From 712dc95e200f13777900f48fb21705e0d1c22713 Mon Sep 17 00:00:00 2001 From: mark8-1 Date: Wed, 20 Nov 2024 09:44:37 +0200 Subject: [PATCH 1/8] laravel pint --- .github/workflows/lint.yml | 33 +++++++++ src/backend/composer.json | 5 +- src/backend/composer.lock | 72 ++++++++++++++++++- ...22_03_10_120408_create_companies_table.php | 2 +- ..._134450_create_company_databases_table.php | 2 +- ...8_204649_create_database_proxies_table.php | 2 +- ..._06_21_102121_create_mpm_plugins_table.php | 2 +- ...21_122032_add_email_to_companies_table.php | 2 +- ...3903_add_tail_tag_to_mpm_plugins_table.php | 2 +- ...tallation_command_to_mpm_plugins_table.php | 2 +- ..._bulk_registration_to_mpm_plugin_table.php | 2 +- ...dd_viber_messaging_to_mpm_plugin_table.php | 2 +- ...email_field_for_database_proxies_table.php | 2 +- ...wave_money_payment_to_mpm_plugin_table.php | 2 +- .../2022_11_25_091725_create_company_jobs.php | 2 +- ...000_add_micro_star_to_mpm_plugin_table.php | 2 +- ...00_add_root_class_to_mpm_plugins_table.php | 2 +- ...00000_add_sun_king_to_mpm_plugin_table.php | 2 +- ...24_110414_create_protected_pages_table.php | 2 +- ...ected_page_password_to_companies_table.php | 2 +- ...0000_add_gome_long_to_mpm_plugin_table.php | 2 +- ...121811_add_wavecom_to_mpm_plugin_table.php | 2 +- ...escription_column_in_mpm_plugins_table.php | 2 +- ...00000_add_daly_bms_to_mpm_plugin_table.php | 2 +- ..._000000_add_angaza_to_mpm_plugin_table.php | 2 +- ..._02_07_100345_create_usage_types_table.php | 2 +- ...usage_type_column_to_mpm_plugins_table.php | 2 +- ...nd_trace_columns_to_company_jobs_table.php | 2 +- .../2014_10_12_000000_create_users_table.php | 2 +- ...12_100000_create_password_resets_table.php | 2 +- ...5615_create_vodacom_transactions_table.php | 2 +- ...05_24_201051_create_transactions_table.php | 2 +- ...13335_create_airtel_transactions_table.php | 2 +- ..._131106_create_payment_histories_table.php | 2 +- ...5_25_131119_create_meter_tariffs_table.php | 2 +- ...18_05_29_071453_create_addresses_table.php | 2 +- ...create_geographical_informations_table.php | 2 +- ..._05_29_140926_create_meter_types_table.php | 2 +- .../2018_05_30_124521_create_meters_table.php | 2 +- ...5_31_071601_create_manufacturers_table.php | 2 +- .../2018_05_31_075346_create_cities_table.php | 2 +- ...18_05_31_075353_create_countries_table.php | 2 +- .../2018_06_01_141845_create_people_table.php | 2 +- .../2018_06_04_124637_create__roles_table.php | 2 +- ...06_07_155444_create_meter_tokens_table.php | 2 +- ...8_102610_create_meter_parameters_table.php | 2 +- .../2018_06_11_131951_create_sms_table.php | 2 +- ...352_create_transaction_conflicts_table.php | 2 +- ...06_28_080905_create_access_rates_table.php | 2 +- ...0914_create_access_rate_payments_table.php | 2 +- ..._07_11_075002_create_permission_tables.php | 2 +- .../2018_07_12_133700_create_loans_table.php | 2 +- ...18_07_12_134253_create_customers_table.php | 2 +- ...18_10_04_195503_create_histories_table.php | 2 +- ...110924_create_meter_consumptions_table.php | 2 +- ...2_123911_create_payment_profiles_table.php | 2 +- ...018_11_29_090603_create_clusters_table.php | 2 +- ...018_12_05_144906_create_revenues_table.php | 2 +- ...1_083717_create_connection_types_table.php | 2 +- ...2018_12_13_083722_create_targets_table.php | 2 +- ..._12_13_100738_create_sub_targets_table.php | 2 +- .../2019_04_19_083645_customer_group.php | 2 +- ...2438_create_sub_connection_types_table.php | 2 +- ..._103123_create_connection_groups_table.php | 2 +- .../2019_05_15_122118_reports.php | 2 +- ...9_06_24_160040_create_mini_grids_table.php | 2 +- ..._133655_create_maintenance_users_table.php | 2 +- ...019_11_06_121116_create_energies_table.php | 2 +- .../2019_11_15_102431_create_solars_table.php | 2 +- ...19_11_26_063009_create_batteries_table.php | 2 +- .../2019_12_16_090907_create_assets_table.php | 2 +- ..._12_16_091934_create_asset_types_table.php | 5 +- ...12_16_092044_create_asset_people_table.php | 2 +- ..._12_16_093223_create_asset_rates_table.php | 2 +- .../2020_01_27_135206_create_logs_table.php | 2 +- .../2020_04_05_233604_create_p_v_s_table.php | 2 +- ...04_19_234527_create_restrictions_table.php | 2 +- ...020_04_19_235421_create_upgrades_table.php | 2 +- ...4_20_001454_create_subscriptions_table.php | 2 +- .../2020_06_20_085555_weather_data.php | 2 +- ...create_tariff_pricing_components_table.php | 2 +- ..._21_194542_create_social_tariffs_table.php | 2 +- ...create_social_tariff_piggy_banks_table.php | 2 +- ...15405_add_total_price_to_meter_tariffs.php | 2 +- .../2020_07_12_192802_create_agents_table.php | 2 +- ...130601_create_agent_transactions_table.php | 2 +- ...6_create_agent_balance_histories_table.php | 2 +- ...create_agent_assigned_appliances_table.php | 2 +- ...811_create_agent_sold_appliances_table.php | 2 +- ..._083600_create_agent_commissions_table.php | 2 +- ..._25_155837_create_agent_receipts_table.php | 2 +- ...8_03_081836_create_agent_charges_table.php | 2 +- ...748_create_agent_receipt_details_table.php | 2 +- ..._02_072509_create_time_of_usages_table.php | 2 +- ..._19_122517_create_sub_menu_items_table.php | 2 +- ...0_10_19_122649_create_menu_items_table.php | 2 +- ...2020_10_29_170007_create_plugins_table.php | 2 +- ...2_17_144527_create_main_settings_table.php | 2 +- ...12_23_165814_create_map_settings_table.php | 2 +- ...ransaction_to_agent_transactions_table.php | 2 +- ...130412_create_third_party_transactions.php | 2 +- ...nsaction_to_vodacom_transactions_table.php | 2 +- ...ansaction_to_airtel_transactions_table.php | 2 +- ...05_234039_create_ticket_settings_table.php | 2 +- ..._122556_add_columns_to_batteries_table.php | 2 +- ...1_18_123245_add_columns_to_p_v_s_table.php | 2 +- .../2021_02_18_153556_create_sms_bodies.php | 5 +- ...556_create_sms_resend_information_keys.php | 2 +- ...6421_create_sms_appliance_remind_rates.php | 2 +- ..._03_140758_create_sms_android_settings.php | 2 +- ...706_create_sms_variable_default_values.php | 2 +- .../2021_03_2_1561251_update_sms_table.php | 2 +- ...8_add_additional_json_column_to_people.php | 2 +- ...8_104840_create_person_documents_table.php | 2 +- ...085817_update_meter_consumptions_table.php | 2 +- ...add_down_payment_to_asset_people_table.php | 2 +- ...rst_payment_date_to_asset_people_table.php | 2 +- ..._092522_create_cash_transactions_table.php | 2 +- ...2021_10_18_220817_create_mail_settings.php | 2 +- ...5_10_093215_update_meter_tariffs_table.php | 2 +- ..._10_101348_update_social_tariffs_table.php | 2 +- ...update_tariff_pricing_components_table.php | 2 +- ...update_social_tariff_piggy_banks_table.php | 2 +- ...05_10_102047_update_access_rates_table.php | 2 +- ...2214_update_access_rate_payments_table.php | 2 +- ...05_10_102507_update_asset_people_table.php | 2 +- ...05_10_102649_update_transactions_table.php | 2 +- ..._102805_update_payment_histories_table.php | 2 +- ..._05_19_102938_update_asset_types_table.php | 2 +- ..._add_connection_column_to_agents_table.php | 2 +- .../2022_06_21_090125_create_calin_tables.php | 2 +- ...06_21_090327_create_calin_smart_tables.php | 2 +- .../2022_06_21_090338_create_kelin_tables.php | 2 +- ..._create_mesomb_payment_provider_tables.php | 2 +- .../2022_06_21_090351_create_spark_tables.php | 2 +- ...2022_06_21_090402_create_steama_tables.php | 2 +- .../2022_06_21_090412_create_stron_tables.php | 2 +- ..._create_swifta_payment_provider_tables.php | 2 +- ..._092948_create_registration_tail_table.php | 2 +- ...000000_create_bulk_registration_tables.php | 2 +- ...0327_add_direction_column_to_sms_table.php | 2 +- ...945_add_gateway_id_column_to_sms_table.php | 2 +- ...123_add_dispatched_column_to_sms_table.php | 2 +- ...42319_add_attempts_column_to_sms_table.php | 2 +- ..._0000000_create_viber_messaging_tables.php | 2 +- ...purchase_amount_to_meter_tariffs_table.php | 2 +- ...ate_wave_money_payment_provider_tables.php | 2 +- ..._11_29_000000_create_micro_star_tables.php | 2 +- ...000_update_swifta_authentication_table.php | 2 +- .../2022_14_12_create_sun_king_tables.php | 2 +- ...3_15_092048_add_colums_to_solars_table.php | 2 +- .../2023_03_16_105024_update_solars_table.php | 2 +- ...update_data_type_values_energies_table.php | 2 +- ...update_data_type_values_energies_table.php | 2 +- ...023_04_02_121811_create_wavecom_tables.php | 2 +- ...421_add_api_type_to_table_transactions.php | 2 +- .../2023_04_26_223352_update_sms_table.php | 2 +- .../2023_06_02_create_gome_long_tables.php | 2 +- ...assets_asset_people_asset_types_tables.php | 2 +- ...pdate_sms_appliance_remind_rates_table.php | 2 +- ...074114_update_wavecom_wavemoney_tables.php | 2 +- ...2023_11_03_112202_create_devices_table.php | 2 +- ...120614_create_solar_home_systems_table.php | 2 +- ..._configuration_columns_to_meters_table.php | 2 +- ...07_update_action_field_type_logs_table.php | 2 +- ..._drop_geo_id_column_from_address_table.php | 2 +- ...add_type_column_to_manufacturers_table.php | 2 +- ..._id_column_to_solar_home_systems_table.php | 2 +- ...date_person_id_column_in_devices_table.php | 2 +- ..._device_serial_column_in_devices_table.php | 2 +- ...ber_column_in_solar_home_systems_table.php | 2 +- .../2023_11_17_095204_create_tokens_table.php | 2 +- ...ce_serial_column_to_asset_people_table.php | 2 +- ...ce_serial_column_in_asset_people_table.php | 2 +- .../2024_01_01_create_daly_bms_tables.php | 2 +- ...2024_01_02_124146_create_e_bikes_table.php | 2 +- .../2024_01_12_create_angaza_tables.php | 2 +- ...age_type_column_to_main_settings_table.php | 2 +- ..._usage_type_column_to_menu_items_table.php | 2 +- ...24_09_30_113302_remove_siderbar_tables.php | 2 +- ...0_23_153042_add_amount_to_agent_charge.php | 2 +- ...0_30_154625_create_notifications_table.php | 2 +- ...24_10_31_180458_remove_batteries_table.php | 2 +- ...024_10_31_180510_remove_energies_table.php | 2 +- ...524_remove_mini_grid_frequencies_table.php | 2 +- .../2024_10_31_180539_remove_pvs_table.php | 2 +- .../2024_10_31_180546_remove_solars_table.php | 2 +- ...10_31_180605_remove_weather_data_table.php | 2 +- ...2024_10_31_180852_remove_agent_tickets.php | 2 +- ...2024_10_31_181016_remove_city_clusters.php | 2 +- ...drop_data_stream_column_from_mini_grid.php | 2 +- .../src/Modules/Api/ApiRequests.php | 9 ++- .../Providers/AngazaSHSServiceProvider.php | 6 +- .../create_bulk_registration_tables.php | 2 +- .../BulkRegistrationServiceProvider.php | 15 ++-- .../GeographicalInformationService.php | 7 +- .../Providers/CalinMeterServiceProvider.php | 3 +- .../CalinSmartMeterServiceProvider.php | 3 +- .../src/Console/Commands/CheckPayments.php | 3 +- .../src/Console/Commands/SyncBikes.php | 3 +- .../daly-bms/src/Modules/Api/ApiRequests.php | 6 +- .../daly-bms/src/Modules/Api/DalyBmsApi.php | 15 ++-- .../src/Providers/DalyBmsServiceProvider.php | 6 +- .../src/Modules/Api/ApiRequests.php | 6 +- .../GomeLongMeterServiceProvider.php | 6 +- .../src/Http/Clients/KelinMeterApiClient.php | 3 +- .../KelinMinutelyConsumptionController.php | 6 +- .../inensus/kelin-meter/src/KelinMeterApi.php | 13 ++-- .../Providers/KelinMeterServiceProvider.php | 9 ++- .../src/Services/KelinCustomerService.php | 6 +- .../src/Services/KelinMeterService.php | 7 +- .../Middleware/MesombTransactionRequest.php | 3 +- .../src/Listeners/TransactionListener.php | 6 +- .../src/Providers/MesombServiceProvider.php | 6 +- .../Providers/MesombTransactionProvider.php | 10 ++- .../src/Services/MesomTransactionService.php | 4 +- .../src/Tests/Unit/PaymentProcessTests.php | 6 +- .../src/Modules/Api/ApiRequests.php | 12 ++-- .../MicroStarMeterServiceProvider.php | 6 +- .../Commands/SparkMeterDataSynchronizer.php | 7 +- .../Commands/SparkMeterSmsNotifier.php | 12 ++-- .../spark-meter/src/Listeners/SmsListener.php | 18 +++-- .../src/Services/CustomerService.php | 14 ++-- .../src/Services/SmSmsBodyService.php | 3 +- .../SmSmsVariableDefaultValueService.php | 3 +- .../Commands/SteamaMeterDataSynchronizer.php | 7 +- .../Console/Commands/SteamaSmsNotifier.php | 12 ++-- .../src/Listeners/SmsListener.php | 6 +- .../Providers/SteamaMeterServiceProvider.php | 6 +- .../src/Services/SteamaCustomerService.php | 8 ++- .../Services/SteamaMeterReadingService.php | 4 +- .../SteamaSmsVariableDefaultValueService.php | 6 +- .../src/Modules/Api/ApiRequests.php | 9 ++- .../src/Modules/Api/SunKingSHSApi.php | 6 +- .../Providers/SunKingSHSServiceProvider.php | 6 +- .../src/Listeners/TransactionListener.php | 6 +- .../src/Providers/SwiftaServiceProvider.php | 6 +- .../src/Tests/Unit/PaymentProcessTests.php | 6 +- .../src/Http/Controllers/TicketController.php | 10 ++- .../src/Services/TicketCommentService.php | 7 +- .../Services/TicketOutsourceReportService.php | 4 +- .../Http/Controllers/WebhookController.php | 8 ++- .../ViberMessagingServiceProvider.php | 3 +- .../src/Services/ViberContactService.php | 3 +- .../src/Console/Commands/InstallPackage.php | 4 +- ...aveMoneyPaymentProviderServiceProvider.php | 9 ++- .../WaveMoneyTransactionProvider.php | 6 +- .../src/routes/api.php | 6 +- src/backend/pint.json | 11 +++ src/backend/routes/api.php | 18 +++-- src/backend/routes/resources/AgentApp.php | 12 ++-- src/backend/routes/web.php | 14 ++-- .../tests/Feature/AgentAppTicketsTest.php | 6 +- .../tests/Feature/AgentCommissionTest.php | 6 +- .../tests/Feature/ClusterRevenueTest.php | 18 +++-- .../tests/Feature/ConnectionGroupTest.php | 6 +- .../tests/Feature/ConnectionTypeTest.php | 6 +- src/backend/tests/Feature/MeterTariffTest.php | 12 ++-- src/backend/tests/Feature/MeterTest.php | 38 ++++++---- src/backend/tests/Feature/MeterTypeTest.php | 12 ++-- .../tests/Feature/SubConnectionTypeTest.php | 12 ++-- .../tests/Feature/UserResourceTest.php | 6 +- .../tests/RefreshMultipleDatabases.php | 26 ++++--- .../Transaction/VodacomTransactionTest.php | 20 ++++-- 264 files changed, 713 insertions(+), 394 deletions(-) create mode 100644 .github/workflows/lint.yml create mode 100644 src/backend/pint.json diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..d966c4d89 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,33 @@ +name: Fix Code Style + +on: [push] + +jobs: + lint: + runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + php: [8.3] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: json, dom, curl, libxml, mbstring + coverage: none + + - name: Install Pint + run: composer global require laravel/pint + + - name: Run Pint + run: pint + + - name: Commit linted files + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "Fixes coding style" \ No newline at end of file diff --git a/src/backend/composer.json b/src/backend/composer.json index 57f1d2799..3bb59e983 100644 --- a/src/backend/composer.json +++ b/src/backend/composer.json @@ -36,6 +36,7 @@ "friendsofphp/php-cs-fixer": "^3.64", "knuckleswtf/scribe": "^4.38", "larastan/larastan": "^2.0", + "laravel/pint": "^1.18", "mockery/mockery": "^1.0", "nunomaduro/collision": "^6.1", "phpstan/phpstan": "^1.1", @@ -103,6 +104,8 @@ "php-cs-fixer-fix": "php-cs-fixer fix --diff", "php-cs-fixer-check": "php-cs-fixer check --diff", "php-cs-fixer-version": "php-cs-fixer --version", - "phpstan-analyse": "phpstan analyse --memory-limit=2G --no-progress" + "phpstan-analyse": "phpstan analyse --memory-limit=2G --no-progress", + "lint-test":"pint --test", + "lint-repair":"pint --repair" } } diff --git a/src/backend/composer.lock b/src/backend/composer.lock index 685cfc326..d08260119 100644 --- a/src/backend/composer.lock +++ b/src/backend/composer.lock @@ -9391,6 +9391,72 @@ ], "time": "2024-10-15T19:41:22+00:00" }, + { + "name": "laravel/pint", + "version": "v1.18.1", + "source": { + "type": "git", + "url": "https://github.com/laravel/pint.git", + "reference": "35c00c05ec43e6b46d295efc0f4386ceb30d50d9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/pint/zipball/35c00c05ec43e6b46d295efc0f4386ceb30d50d9", + "reference": "35c00c05ec43e6b46d295efc0f4386ceb30d50d9", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-mbstring": "*", + "ext-tokenizer": "*", + "ext-xml": "*", + "php": "^8.1.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.64.0", + "illuminate/view": "^10.48.20", + "larastan/larastan": "^2.9.8", + "laravel-zero/framework": "^10.4.0", + "mockery/mockery": "^1.6.12", + "nunomaduro/termwind": "^1.15.1", + "pestphp/pest": "^2.35.1" + }, + "bin": [ + "builds/pint" + ], + "type": "project", + "autoload": { + "psr-4": { + "App\\": "app/", + "Database\\Seeders\\": "database/seeders/", + "Database\\Factories\\": "database/factories/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "An opinionated code formatter for PHP.", + "homepage": "https://laravel.com", + "keywords": [ + "format", + "formatter", + "lint", + "linter", + "php" + ], + "support": { + "issues": "https://github.com/laravel/pint/issues", + "source": "https://github.com/laravel/pint" + }, + "time": "2024-09-24T17:22:50+00:00" + }, { "name": "league/glide", "version": "2.3.0", @@ -14827,14 +14893,14 @@ "aliases": [], "minimum-stability": "dev", "stability-flags": { - "roave/security-advisories": 20, - "tymon/jwt-auth": 20 + "tymon/jwt-auth": 20, + "roave/security-advisories": 20 }, "prefer-stable": true, "prefer-lowest": false, "platform": { "php": "^8.0" }, - "platform-dev": {}, + "platform-dev": [], "plugin-api-version": "2.6.0" } diff --git a/src/backend/database/migrations/2022_03_10_120408_create_companies_table.php b/src/backend/database/migrations/2022_03_10_120408_create_companies_table.php index 86d746c4e..f24dcc24e 100644 --- a/src/backend/database/migrations/2022_03_10_120408_create_companies_table.php +++ b/src/backend/database/migrations/2022_03_10_120408_create_companies_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_03_10_134450_create_company_databases_table.php b/src/backend/database/migrations/2022_03_10_134450_create_company_databases_table.php index d2b568602..b2a1403cc 100644 --- a/src/backend/database/migrations/2022_03_10_134450_create_company_databases_table.php +++ b/src/backend/database/migrations/2022_03_10_134450_create_company_databases_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_06_18_204649_create_database_proxies_table.php b/src/backend/database/migrations/2022_06_18_204649_create_database_proxies_table.php index 6f51e02b3..bacc9187c 100644 --- a/src/backend/database/migrations/2022_06_18_204649_create_database_proxies_table.php +++ b/src/backend/database/migrations/2022_06_18_204649_create_database_proxies_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { public function up(): void { Schema::create('database_proxies', function (Blueprint $table) { diff --git a/src/backend/database/migrations/2022_06_21_102121_create_mpm_plugins_table.php b/src/backend/database/migrations/2022_06_21_102121_create_mpm_plugins_table.php index 252e717ed..ec38f54ba 100644 --- a/src/backend/database/migrations/2022_06_21_102121_create_mpm_plugins_table.php +++ b/src/backend/database/migrations/2022_06_21_102121_create_mpm_plugins_table.php @@ -7,7 +7,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_06_21_122032_add_email_to_companies_table.php b/src/backend/database/migrations/2022_06_21_122032_add_email_to_companies_table.php index 683ee1f16..3c068cf02 100644 --- a/src/backend/database/migrations/2022_06_21_122032_add_email_to_companies_table.php +++ b/src/backend/database/migrations/2022_06_21_122032_add_email_to_companies_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_07_05_093903_add_tail_tag_to_mpm_plugins_table.php b/src/backend/database/migrations/2022_07_05_093903_add_tail_tag_to_mpm_plugins_table.php index 2f2079520..7ab9a9325 100644 --- a/src/backend/database/migrations/2022_07_05_093903_add_tail_tag_to_mpm_plugins_table.php +++ b/src/backend/database/migrations/2022_07_05_093903_add_tail_tag_to_mpm_plugins_table.php @@ -7,7 +7,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_07_07_140545_add_installation_command_to_mpm_plugins_table.php b/src/backend/database/migrations/2022_07_07_140545_add_installation_command_to_mpm_plugins_table.php index 693d3017d..dd8b35d22 100644 --- a/src/backend/database/migrations/2022_07_07_140545_add_installation_command_to_mpm_plugins_table.php +++ b/src/backend/database/migrations/2022_07_07_140545_add_installation_command_to_mpm_plugins_table.php @@ -7,7 +7,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_09_20_0000000_add_bulk_registration_to_mpm_plugin_table.php b/src/backend/database/migrations/2022_09_20_0000000_add_bulk_registration_to_mpm_plugin_table.php index 98a51abd1..c579020a0 100644 --- a/src/backend/database/migrations/2022_09_20_0000000_add_bulk_registration_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2022_09_20_0000000_add_bulk_registration_to_mpm_plugin_table.php @@ -5,7 +5,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class extends Migration { +return new class () extends Migration { public function up() { DB::table('mpm_plugins')->insert([ diff --git a/src/backend/database/migrations/2022_11_08_0000000_add_viber_messaging_to_mpm_plugin_table.php b/src/backend/database/migrations/2022_11_08_0000000_add_viber_messaging_to_mpm_plugin_table.php index d40b82c81..b53ad3bc0 100644 --- a/src/backend/database/migrations/2022_11_08_0000000_add_viber_messaging_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2022_11_08_0000000_add_viber_messaging_to_mpm_plugin_table.php @@ -5,7 +5,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class extends Migration { +return new class () extends Migration { public function up() { DB::table('mpm_plugins')->insert([ diff --git a/src/backend/database/migrations/2022_11_08_154321_update_email_field_for_database_proxies_table.php b/src/backend/database/migrations/2022_11_08_154321_update_email_field_for_database_proxies_table.php index 8b5267dfa..e0ef9444c 100644 --- a/src/backend/database/migrations/2022_11_08_154321_update_email_field_for_database_proxies_table.php +++ b/src/backend/database/migrations/2022_11_08_154321_update_email_field_for_database_proxies_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_11_21_000000_add_wave_money_payment_to_mpm_plugin_table.php b/src/backend/database/migrations/2022_11_21_000000_add_wave_money_payment_to_mpm_plugin_table.php index bcff0e49f..4a8921bcd 100644 --- a/src/backend/database/migrations/2022_11_21_000000_add_wave_money_payment_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2022_11_21_000000_add_wave_money_payment_to_mpm_plugin_table.php @@ -5,7 +5,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class extends Migration { +return new class () extends Migration { public function up() { DB::table('mpm_plugins')->insert([ diff --git a/src/backend/database/migrations/2022_11_25_091725_create_company_jobs.php b/src/backend/database/migrations/2022_11_25_091725_create_company_jobs.php index f5cb6bfaf..8fe3d2cb1 100644 --- a/src/backend/database/migrations/2022_11_25_091725_create_company_jobs.php +++ b/src/backend/database/migrations/2022_11_25_091725_create_company_jobs.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_11_29_000000_add_micro_star_to_mpm_plugin_table.php b/src/backend/database/migrations/2022_11_29_000000_add_micro_star_to_mpm_plugin_table.php index 3d1646056..655cb14fd 100644 --- a/src/backend/database/migrations/2022_11_29_000000_add_micro_star_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2022_11_29_000000_add_micro_star_to_mpm_plugin_table.php @@ -5,7 +5,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class extends Migration { +return new class () extends Migration { public function up() { DB::table('mpm_plugins')->insert([ diff --git a/src/backend/database/migrations/2022_12_12_000000_add_root_class_to_mpm_plugins_table.php b/src/backend/database/migrations/2022_12_12_000000_add_root_class_to_mpm_plugins_table.php index 052cf053a..8ecebf7bd 100644 --- a/src/backend/database/migrations/2022_12_12_000000_add_root_class_to_mpm_plugins_table.php +++ b/src/backend/database/migrations/2022_12_12_000000_add_root_class_to_mpm_plugins_table.php @@ -7,7 +7,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_14_12_000000_add_sun_king_to_mpm_plugin_table.php b/src/backend/database/migrations/2022_14_12_000000_add_sun_king_to_mpm_plugin_table.php index 8d67a6420..fa533e156 100644 --- a/src/backend/database/migrations/2022_14_12_000000_add_sun_king_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2022_14_12_000000_add_sun_king_to_mpm_plugin_table.php @@ -5,7 +5,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class extends Migration { +return new class () extends Migration { public function up() { DB::table('mpm_plugins')->insert([ diff --git a/src/backend/database/migrations/2023_01_24_110414_create_protected_pages_table.php b/src/backend/database/migrations/2023_01_24_110414_create_protected_pages_table.php index 37e51a3b8..f631c9b35 100644 --- a/src/backend/database/migrations/2023_01_24_110414_create_protected_pages_table.php +++ b/src/backend/database/migrations/2023_01_24_110414_create_protected_pages_table.php @@ -6,7 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2023_01_24_112359_add_protected_page_password_to_companies_table.php b/src/backend/database/migrations/2023_01_24_112359_add_protected_page_password_to_companies_table.php index 0ed96210f..654468da4 100644 --- a/src/backend/database/migrations/2023_01_24_112359_add_protected_page_password_to_companies_table.php +++ b/src/backend/database/migrations/2023_01_24_112359_add_protected_page_password_to_companies_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2023_02_06_000000_add_gome_long_to_mpm_plugin_table.php b/src/backend/database/migrations/2023_02_06_000000_add_gome_long_to_mpm_plugin_table.php index cd47cf4eb..a102559e0 100644 --- a/src/backend/database/migrations/2023_02_06_000000_add_gome_long_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2023_02_06_000000_add_gome_long_to_mpm_plugin_table.php @@ -5,7 +5,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class extends Migration { +return new class () extends Migration { public function up() { DB::table('mpm_plugins')->insert([ diff --git a/src/backend/database/migrations/2023_04_02_121811_add_wavecom_to_mpm_plugin_table.php b/src/backend/database/migrations/2023_04_02_121811_add_wavecom_to_mpm_plugin_table.php index 837a9135e..bc5ccc6dd 100644 --- a/src/backend/database/migrations/2023_04_02_121811_add_wavecom_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2023_04_02_121811_add_wavecom_to_mpm_plugin_table.php @@ -5,7 +5,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class extends Migration { +return new class () extends Migration { public function up() { DB::table('mpm_plugins')->insert([ diff --git a/src/backend/database/migrations/2023_11_23_134944_update_description_column_in_mpm_plugins_table.php b/src/backend/database/migrations/2023_11_23_134944_update_description_column_in_mpm_plugins_table.php index 4157e3ac7..a9b567b2f 100644 --- a/src/backend/database/migrations/2023_11_23_134944_update_description_column_in_mpm_plugins_table.php +++ b/src/backend/database/migrations/2023_11_23_134944_update_description_column_in_mpm_plugins_table.php @@ -7,7 +7,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2024_01_01_000000_add_daly_bms_to_mpm_plugin_table.php b/src/backend/database/migrations/2024_01_01_000000_add_daly_bms_to_mpm_plugin_table.php index bf28ebc30..9a90e9d8c 100644 --- a/src/backend/database/migrations/2024_01_01_000000_add_daly_bms_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2024_01_01_000000_add_daly_bms_to_mpm_plugin_table.php @@ -5,7 +5,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class extends Migration { +return new class () extends Migration { public function up() { DB::table('mpm_plugins')->insert([ diff --git a/src/backend/database/migrations/2024_01_12_000000_add_angaza_to_mpm_plugin_table.php b/src/backend/database/migrations/2024_01_12_000000_add_angaza_to_mpm_plugin_table.php index b11cd9575..1303b87fa 100644 --- a/src/backend/database/migrations/2024_01_12_000000_add_angaza_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2024_01_12_000000_add_angaza_to_mpm_plugin_table.php @@ -5,7 +5,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class extends Migration { +return new class () extends Migration { public function up() { DB::table('mpm_plugins')->insert([ diff --git a/src/backend/database/migrations/2024_02_07_100345_create_usage_types_table.php b/src/backend/database/migrations/2024_02_07_100345_create_usage_types_table.php index d97075caf..88e95fd43 100644 --- a/src/backend/database/migrations/2024_02_07_100345_create_usage_types_table.php +++ b/src/backend/database/migrations/2024_02_07_100345_create_usage_types_table.php @@ -6,7 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2024_02_07_113319_add_usage_type_column_to_mpm_plugins_table.php b/src/backend/database/migrations/2024_02_07_113319_add_usage_type_column_to_mpm_plugins_table.php index f8f2db0b7..a347ab7cb 100644 --- a/src/backend/database/migrations/2024_02_07_113319_add_usage_type_column_to_mpm_plugins_table.php +++ b/src/backend/database/migrations/2024_02_07_113319_add_usage_type_column_to_mpm_plugins_table.php @@ -7,7 +7,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2024_03_21_121825_add_message_and_trace_columns_to_company_jobs_table.php b/src/backend/database/migrations/2024_03_21_121825_add_message_and_trace_columns_to_company_jobs_table.php index f2b07ddaa..86819c41f 100644 --- a/src/backend/database/migrations/2024_03_21_121825_add_message_and_trace_columns_to_company_jobs_table.php +++ b/src/backend/database/migrations/2024_03_21_121825_add_message_and_trace_columns_to_company_jobs_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2014_10_12_000000_create_users_table.php b/src/backend/database/migrations/micropowermanager/2014_10_12_000000_create_users_table.php index 5a9665ae8..fb91c6e07 100644 --- a/src/backend/database/migrations/micropowermanager/2014_10_12_000000_create_users_table.php +++ b/src/backend/database/migrations/micropowermanager/2014_10_12_000000_create_users_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2014_10_12_100000_create_password_resets_table.php b/src/backend/database/migrations/micropowermanager/2014_10_12_100000_create_password_resets_table.php index f1d5cd1e2..0ba694725 100644 --- a/src/backend/database/migrations/micropowermanager/2014_10_12_100000_create_password_resets_table.php +++ b/src/backend/database/migrations/micropowermanager/2014_10_12_100000_create_password_resets_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_24_195615_create_vodacom_transactions_table.php b/src/backend/database/migrations/micropowermanager/2018_05_24_195615_create_vodacom_transactions_table.php index c7b377d77..18a985c46 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_24_195615_create_vodacom_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_24_195615_create_vodacom_transactions_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_24_201051_create_transactions_table.php b/src/backend/database/migrations/micropowermanager/2018_05_24_201051_create_transactions_table.php index 6a2bbb5ae..648c7237f 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_24_201051_create_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_24_201051_create_transactions_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_24_213335_create_airtel_transactions_table.php b/src/backend/database/migrations/micropowermanager/2018_05_24_213335_create_airtel_transactions_table.php index 0ac0b8858..1df046d52 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_24_213335_create_airtel_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_24_213335_create_airtel_transactions_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_25_131106_create_payment_histories_table.php b/src/backend/database/migrations/micropowermanager/2018_05_25_131106_create_payment_histories_table.php index 0e5f8a612..a77d900e5 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_25_131106_create_payment_histories_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_25_131106_create_payment_histories_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_25_131119_create_meter_tariffs_table.php b/src/backend/database/migrations/micropowermanager/2018_05_25_131119_create_meter_tariffs_table.php index b0744f4d0..e13d89193 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_25_131119_create_meter_tariffs_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_25_131119_create_meter_tariffs_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_29_071453_create_addresses_table.php b/src/backend/database/migrations/micropowermanager/2018_05_29_071453_create_addresses_table.php index 5428f4d4d..9717baef7 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_29_071453_create_addresses_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_29_071453_create_addresses_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_29_080926_create_geographical_informations_table.php b/src/backend/database/migrations/micropowermanager/2018_05_29_080926_create_geographical_informations_table.php index a52a9b450..597f17d55 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_29_080926_create_geographical_informations_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_29_080926_create_geographical_informations_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_29_140926_create_meter_types_table.php b/src/backend/database/migrations/micropowermanager/2018_05_29_140926_create_meter_types_table.php index 0b9b325a4..b478b7158 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_29_140926_create_meter_types_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_29_140926_create_meter_types_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Reverse the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_30_124521_create_meters_table.php b/src/backend/database/migrations/micropowermanager/2018_05_30_124521_create_meters_table.php index e32b18a61..0389ee683 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_30_124521_create_meters_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_30_124521_create_meters_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_31_071601_create_manufacturers_table.php b/src/backend/database/migrations/micropowermanager/2018_05_31_071601_create_manufacturers_table.php index 0e15fcd86..12342d0ce 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_31_071601_create_manufacturers_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_31_071601_create_manufacturers_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_31_075346_create_cities_table.php b/src/backend/database/migrations/micropowermanager/2018_05_31_075346_create_cities_table.php index 9529c29fc..aff7f86b7 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_31_075346_create_cities_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_31_075346_create_cities_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_31_075353_create_countries_table.php b/src/backend/database/migrations/micropowermanager/2018_05_31_075353_create_countries_table.php index a62992da9..335d12b77 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_31_075353_create_countries_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_31_075353_create_countries_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_06_01_141845_create_people_table.php b/src/backend/database/migrations/micropowermanager/2018_06_01_141845_create_people_table.php index 0139098bc..8dc05a7af 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_01_141845_create_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_01_141845_create_people_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_06_04_124637_create__roles_table.php b/src/backend/database/migrations/micropowermanager/2018_06_04_124637_create__roles_table.php index d0450ff81..23a5983ca 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_04_124637_create__roles_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_04_124637_create__roles_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_06_07_155444_create_meter_tokens_table.php b/src/backend/database/migrations/micropowermanager/2018_06_07_155444_create_meter_tokens_table.php index 23877aee2..aa18106dd 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_07_155444_create_meter_tokens_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_07_155444_create_meter_tokens_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_06_08_102610_create_meter_parameters_table.php b/src/backend/database/migrations/micropowermanager/2018_06_08_102610_create_meter_parameters_table.php index a1b6fb9b4..0123e3aad 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_08_102610_create_meter_parameters_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_08_102610_create_meter_parameters_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_06_11_131951_create_sms_table.php b/src/backend/database/migrations/micropowermanager/2018_06_11_131951_create_sms_table.php index 61220d925..b1d9d8123 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_11_131951_create_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_11_131951_create_sms_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_06_15_082352_create_transaction_conflicts_table.php b/src/backend/database/migrations/micropowermanager/2018_06_15_082352_create_transaction_conflicts_table.php index 6252b570d..c9ca7c8cc 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_15_082352_create_transaction_conflicts_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_15_082352_create_transaction_conflicts_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_06_28_080905_create_access_rates_table.php b/src/backend/database/migrations/micropowermanager/2018_06_28_080905_create_access_rates_table.php index 4c36881bc..9c811792b 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_28_080905_create_access_rates_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_28_080905_create_access_rates_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_06_28_080914_create_access_rate_payments_table.php b/src/backend/database/migrations/micropowermanager/2018_06_28_080914_create_access_rate_payments_table.php index 1d4ac732e..293f96abf 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_28_080914_create_access_rate_payments_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_28_080914_create_access_rate_payments_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_07_11_075002_create_permission_tables.php b/src/backend/database/migrations/micropowermanager/2018_07_11_075002_create_permission_tables.php index 52a64a061..647732e73 100644 --- a/src/backend/database/migrations/micropowermanager/2018_07_11_075002_create_permission_tables.php +++ b/src/backend/database/migrations/micropowermanager/2018_07_11_075002_create_permission_tables.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_07_12_133700_create_loans_table.php b/src/backend/database/migrations/micropowermanager/2018_07_12_133700_create_loans_table.php index 6202eb9a0..130cfde42 100644 --- a/src/backend/database/migrations/micropowermanager/2018_07_12_133700_create_loans_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_07_12_133700_create_loans_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_07_12_134253_create_customers_table.php b/src/backend/database/migrations/micropowermanager/2018_07_12_134253_create_customers_table.php index a74747af6..04e0b0554 100644 --- a/src/backend/database/migrations/micropowermanager/2018_07_12_134253_create_customers_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_07_12_134253_create_customers_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_10_04_195503_create_histories_table.php b/src/backend/database/migrations/micropowermanager/2018_10_04_195503_create_histories_table.php index 059b726ac..6f49a9ea5 100644 --- a/src/backend/database/migrations/micropowermanager/2018_10_04_195503_create_histories_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_10_04_195503_create_histories_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_10_12_110924_create_meter_consumptions_table.php b/src/backend/database/migrations/micropowermanager/2018_10_12_110924_create_meter_consumptions_table.php index 3780d7efd..d7d85ee9b 100644 --- a/src/backend/database/migrations/micropowermanager/2018_10_12_110924_create_meter_consumptions_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_10_12_110924_create_meter_consumptions_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_10_12_123911_create_payment_profiles_table.php b/src/backend/database/migrations/micropowermanager/2018_10_12_123911_create_payment_profiles_table.php index 9594e3c81..dd741492b 100644 --- a/src/backend/database/migrations/micropowermanager/2018_10_12_123911_create_payment_profiles_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_10_12_123911_create_payment_profiles_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_11_29_090603_create_clusters_table.php b/src/backend/database/migrations/micropowermanager/2018_11_29_090603_create_clusters_table.php index 1c4048b7b..c3b491cd9 100644 --- a/src/backend/database/migrations/micropowermanager/2018_11_29_090603_create_clusters_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_11_29_090603_create_clusters_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_12_05_144906_create_revenues_table.php b/src/backend/database/migrations/micropowermanager/2018_12_05_144906_create_revenues_table.php index 729380b0e..0560c08da 100644 --- a/src/backend/database/migrations/micropowermanager/2018_12_05_144906_create_revenues_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_12_05_144906_create_revenues_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_12_11_083717_create_connection_types_table.php b/src/backend/database/migrations/micropowermanager/2018_12_11_083717_create_connection_types_table.php index e35198c21..e45b79bd9 100644 --- a/src/backend/database/migrations/micropowermanager/2018_12_11_083717_create_connection_types_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_12_11_083717_create_connection_types_table.php @@ -6,7 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_12_13_083722_create_targets_table.php b/src/backend/database/migrations/micropowermanager/2018_12_13_083722_create_targets_table.php index 5f68c0492..fdfe166e4 100644 --- a/src/backend/database/migrations/micropowermanager/2018_12_13_083722_create_targets_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_12_13_083722_create_targets_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_12_13_100738_create_sub_targets_table.php b/src/backend/database/migrations/micropowermanager/2018_12_13_100738_create_sub_targets_table.php index a9d3433fa..79190f40f 100644 --- a/src/backend/database/migrations/micropowermanager/2018_12_13_100738_create_sub_targets_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_12_13_100738_create_sub_targets_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_04_19_083645_customer_group.php b/src/backend/database/migrations/micropowermanager/2019_04_19_083645_customer_group.php index dc1b08a2d..cab29f323 100644 --- a/src/backend/database/migrations/micropowermanager/2019_04_19_083645_customer_group.php +++ b/src/backend/database/migrations/micropowermanager/2019_04_19_083645_customer_group.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_04_25_092438_create_sub_connection_types_table.php b/src/backend/database/migrations/micropowermanager/2019_04_25_092438_create_sub_connection_types_table.php index 0392b37c7..b0c014c36 100644 --- a/src/backend/database/migrations/micropowermanager/2019_04_25_092438_create_sub_connection_types_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_04_25_092438_create_sub_connection_types_table.php @@ -6,7 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_05_01_103123_create_connection_groups_table.php b/src/backend/database/migrations/micropowermanager/2019_05_01_103123_create_connection_groups_table.php index c19716b7a..b97dd78d9 100644 --- a/src/backend/database/migrations/micropowermanager/2019_05_01_103123_create_connection_groups_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_05_01_103123_create_connection_groups_table.php @@ -6,7 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_05_15_122118_reports.php b/src/backend/database/migrations/micropowermanager/2019_05_15_122118_reports.php index de15e08a0..076adfe74 100644 --- a/src/backend/database/migrations/micropowermanager/2019_05_15_122118_reports.php +++ b/src/backend/database/migrations/micropowermanager/2019_05_15_122118_reports.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_06_24_160040_create_mini_grids_table.php b/src/backend/database/migrations/micropowermanager/2019_06_24_160040_create_mini_grids_table.php index 58ae32ad7..bae31d4ee 100644 --- a/src/backend/database/migrations/micropowermanager/2019_06_24_160040_create_mini_grids_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_06_24_160040_create_mini_grids_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_07_01_133655_create_maintenance_users_table.php b/src/backend/database/migrations/micropowermanager/2019_07_01_133655_create_maintenance_users_table.php index 7ed712525..2ecd0e202 100644 --- a/src/backend/database/migrations/micropowermanager/2019_07_01_133655_create_maintenance_users_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_07_01_133655_create_maintenance_users_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_11_06_121116_create_energies_table.php b/src/backend/database/migrations/micropowermanager/2019_11_06_121116_create_energies_table.php index ceb964f95..0028c9e56 100644 --- a/src/backend/database/migrations/micropowermanager/2019_11_06_121116_create_energies_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_11_06_121116_create_energies_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_11_15_102431_create_solars_table.php b/src/backend/database/migrations/micropowermanager/2019_11_15_102431_create_solars_table.php index 092056f67..d9bdc6141 100644 --- a/src/backend/database/migrations/micropowermanager/2019_11_15_102431_create_solars_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_11_15_102431_create_solars_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_11_26_063009_create_batteries_table.php b/src/backend/database/migrations/micropowermanager/2019_11_26_063009_create_batteries_table.php index e84d8693c..74e4824ad 100644 --- a/src/backend/database/migrations/micropowermanager/2019_11_26_063009_create_batteries_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_11_26_063009_create_batteries_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_12_16_090907_create_assets_table.php b/src/backend/database/migrations/micropowermanager/2019_12_16_090907_create_assets_table.php index 864a51c53..c781d65ee 100644 --- a/src/backend/database/migrations/micropowermanager/2019_12_16_090907_create_assets_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_12_16_090907_create_assets_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_12_16_091934_create_asset_types_table.php b/src/backend/database/migrations/micropowermanager/2019_12_16_091934_create_asset_types_table.php index 14e065fcd..afa6517bd 100644 --- a/src/backend/database/migrations/micropowermanager/2019_12_16_091934_create_asset_types_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_12_16_091934_create_asset_types_table.php @@ -6,7 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * @@ -22,7 +22,8 @@ public function up(): void }); // Insert initial data - DB::connection('shard')->table('asset_types')->insert([ + DB::connection('shard')->table('asset_types')->insert( + [ [ 'name' => 'Solar Home System', 'created_at' => Carbon::now(), diff --git a/src/backend/database/migrations/micropowermanager/2019_12_16_092044_create_asset_people_table.php b/src/backend/database/migrations/micropowermanager/2019_12_16_092044_create_asset_people_table.php index bf5851245..0117a7115 100644 --- a/src/backend/database/migrations/micropowermanager/2019_12_16_092044_create_asset_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_12_16_092044_create_asset_people_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_12_16_093223_create_asset_rates_table.php b/src/backend/database/migrations/micropowermanager/2019_12_16_093223_create_asset_rates_table.php index bf5ff42ba..ce01316e8 100644 --- a/src/backend/database/migrations/micropowermanager/2019_12_16_093223_create_asset_rates_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_12_16_093223_create_asset_rates_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_01_27_135206_create_logs_table.php b/src/backend/database/migrations/micropowermanager/2020_01_27_135206_create_logs_table.php index 8b6eb8dc4..555d4846a 100644 --- a/src/backend/database/migrations/micropowermanager/2020_01_27_135206_create_logs_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_01_27_135206_create_logs_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_04_05_233604_create_p_v_s_table.php b/src/backend/database/migrations/micropowermanager/2020_04_05_233604_create_p_v_s_table.php index 4248e8a37..b47d121eb 100644 --- a/src/backend/database/migrations/micropowermanager/2020_04_05_233604_create_p_v_s_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_04_05_233604_create_p_v_s_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_04_19_234527_create_restrictions_table.php b/src/backend/database/migrations/micropowermanager/2020_04_19_234527_create_restrictions_table.php index 343eb5b1e..ba22b236b 100644 --- a/src/backend/database/migrations/micropowermanager/2020_04_19_234527_create_restrictions_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_04_19_234527_create_restrictions_table.php @@ -5,7 +5,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_04_19_235421_create_upgrades_table.php b/src/backend/database/migrations/micropowermanager/2020_04_19_235421_create_upgrades_table.php index 758fd9dc6..43453dd9e 100644 --- a/src/backend/database/migrations/micropowermanager/2020_04_19_235421_create_upgrades_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_04_19_235421_create_upgrades_table.php @@ -5,7 +5,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_04_20_001454_create_subscriptions_table.php b/src/backend/database/migrations/micropowermanager/2020_04_20_001454_create_subscriptions_table.php index 03f59e136..b35909c56 100644 --- a/src/backend/database/migrations/micropowermanager/2020_04_20_001454_create_subscriptions_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_04_20_001454_create_subscriptions_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_06_20_085555_weather_data.php b/src/backend/database/migrations/micropowermanager/2020_06_20_085555_weather_data.php index 40ce2c983..e89593640 100644 --- a/src/backend/database/migrations/micropowermanager/2020_06_20_085555_weather_data.php +++ b/src/backend/database/migrations/micropowermanager/2020_06_20_085555_weather_data.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_06_21_131740_create_tariff_pricing_components_table.php b/src/backend/database/migrations/micropowermanager/2020_06_21_131740_create_tariff_pricing_components_table.php index 748b295cb..d6a3d6842 100644 --- a/src/backend/database/migrations/micropowermanager/2020_06_21_131740_create_tariff_pricing_components_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_06_21_131740_create_tariff_pricing_components_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_06_21_194542_create_social_tariffs_table.php b/src/backend/database/migrations/micropowermanager/2020_06_21_194542_create_social_tariffs_table.php index 26d61b55b..81f08e18c 100644 --- a/src/backend/database/migrations/micropowermanager/2020_06_21_194542_create_social_tariffs_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_06_21_194542_create_social_tariffs_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_06_22_085345_create_social_tariff_piggy_banks_table.php b/src/backend/database/migrations/micropowermanager/2020_06_22_085345_create_social_tariff_piggy_banks_table.php index 61697c8b9..f1bb29501 100644 --- a/src/backend/database/migrations/micropowermanager/2020_06_22_085345_create_social_tariff_piggy_banks_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_06_22_085345_create_social_tariff_piggy_banks_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_06_22_115405_add_total_price_to_meter_tariffs.php b/src/backend/database/migrations/micropowermanager/2020_06_22_115405_add_total_price_to_meter_tariffs.php index 6d311f3d0..efb03e96f 100644 --- a/src/backend/database/migrations/micropowermanager/2020_06_22_115405_add_total_price_to_meter_tariffs.php +++ b/src/backend/database/migrations/micropowermanager/2020_06_22_115405_add_total_price_to_meter_tariffs.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_07_12_192802_create_agents_table.php b/src/backend/database/migrations/micropowermanager/2020_07_12_192802_create_agents_table.php index 84b02871f..124e9c43c 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_12_192802_create_agents_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_12_192802_create_agents_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_07_13_130601_create_agent_transactions_table.php b/src/backend/database/migrations/micropowermanager/2020_07_13_130601_create_agent_transactions_table.php index 86730eb84..9309c5d51 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_13_130601_create_agent_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_13_130601_create_agent_transactions_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_07_13_132006_create_agent_balance_histories_table.php b/src/backend/database/migrations/micropowermanager/2020_07_13_132006_create_agent_balance_histories_table.php index e73d0b7c3..56cfce334 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_13_132006_create_agent_balance_histories_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_13_132006_create_agent_balance_histories_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_07_13_132423_create_agent_assigned_appliances_table.php b/src/backend/database/migrations/micropowermanager/2020_07_13_132423_create_agent_assigned_appliances_table.php index 6f0e7e097..c841a39b1 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_13_132423_create_agent_assigned_appliances_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_13_132423_create_agent_assigned_appliances_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_07_13_132811_create_agent_sold_appliances_table.php b/src/backend/database/migrations/micropowermanager/2020_07_13_132811_create_agent_sold_appliances_table.php index 1cc6849f5..a9fd8c036 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_13_132811_create_agent_sold_appliances_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_13_132811_create_agent_sold_appliances_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_07_25_083600_create_agent_commissions_table.php b/src/backend/database/migrations/micropowermanager/2020_07_25_083600_create_agent_commissions_table.php index 9002d5b8a..fdf44f20b 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_25_083600_create_agent_commissions_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_25_083600_create_agent_commissions_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_07_25_155837_create_agent_receipts_table.php b/src/backend/database/migrations/micropowermanager/2020_07_25_155837_create_agent_receipts_table.php index ac1b4a33f..a648c6f3f 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_25_155837_create_agent_receipts_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_25_155837_create_agent_receipts_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_08_03_081836_create_agent_charges_table.php b/src/backend/database/migrations/micropowermanager/2020_08_03_081836_create_agent_charges_table.php index 45f6599bc..495526c62 100644 --- a/src/backend/database/migrations/micropowermanager/2020_08_03_081836_create_agent_charges_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_08_03_081836_create_agent_charges_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_08_05_133748_create_agent_receipt_details_table.php b/src/backend/database/migrations/micropowermanager/2020_08_05_133748_create_agent_receipt_details_table.php index 52dd76cea..78f9e28fb 100644 --- a/src/backend/database/migrations/micropowermanager/2020_08_05_133748_create_agent_receipt_details_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_08_05_133748_create_agent_receipt_details_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_10_02_072509_create_time_of_usages_table.php b/src/backend/database/migrations/micropowermanager/2020_10_02_072509_create_time_of_usages_table.php index c41292352..b76f584b1 100644 --- a/src/backend/database/migrations/micropowermanager/2020_10_02_072509_create_time_of_usages_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_10_02_072509_create_time_of_usages_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_10_19_122517_create_sub_menu_items_table.php b/src/backend/database/migrations/micropowermanager/2020_10_19_122517_create_sub_menu_items_table.php index 7924e56bb..9e6680513 100644 --- a/src/backend/database/migrations/micropowermanager/2020_10_19_122517_create_sub_menu_items_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_10_19_122517_create_sub_menu_items_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_10_19_122649_create_menu_items_table.php b/src/backend/database/migrations/micropowermanager/2020_10_19_122649_create_menu_items_table.php index 2d2512d7b..ab6e76457 100644 --- a/src/backend/database/migrations/micropowermanager/2020_10_19_122649_create_menu_items_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_10_19_122649_create_menu_items_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_10_29_170007_create_plugins_table.php b/src/backend/database/migrations/micropowermanager/2020_10_29_170007_create_plugins_table.php index b57721df7..0242050b4 100644 --- a/src/backend/database/migrations/micropowermanager/2020_10_29_170007_create_plugins_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_10_29_170007_create_plugins_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_12_17_144527_create_main_settings_table.php b/src/backend/database/migrations/micropowermanager/2020_12_17_144527_create_main_settings_table.php index a9bfe2c7f..e98b9ee25 100644 --- a/src/backend/database/migrations/micropowermanager/2020_12_17_144527_create_main_settings_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_12_17_144527_create_main_settings_table.php @@ -6,7 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_12_23_165814_create_map_settings_table.php b/src/backend/database/migrations/micropowermanager/2020_12_23_165814_create_map_settings_table.php index 3e51dd8c6..0b096710c 100644 --- a/src/backend/database/migrations/micropowermanager/2020_12_23_165814_create_map_settings_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_12_23_165814_create_map_settings_table.php @@ -6,7 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_01_02_130016_add_manufacturer_transaction_to_agent_transactions_table.php b/src/backend/database/migrations/micropowermanager/2021_01_02_130016_add_manufacturer_transaction_to_agent_transactions_table.php index b80888dad..9b96aa556 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_02_130016_add_manufacturer_transaction_to_agent_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_02_130016_add_manufacturer_transaction_to_agent_transactions_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_01_02_130412_create_third_party_transactions.php b/src/backend/database/migrations/micropowermanager/2021_01_02_130412_create_third_party_transactions.php index 0ea1fb8d4..eb7b82826 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_02_130412_create_third_party_transactions.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_02_130412_create_third_party_transactions.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_01_02_134152_add_manufacturer_transaction_to_vodacom_transactions_table.php b/src/backend/database/migrations/micropowermanager/2021_01_02_134152_add_manufacturer_transaction_to_vodacom_transactions_table.php index a8e381339..11950fc05 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_02_134152_add_manufacturer_transaction_to_vodacom_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_02_134152_add_manufacturer_transaction_to_vodacom_transactions_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_01_02_134212_add_manufacturer_transaction_to_airtel_transactions_table.php b/src/backend/database/migrations/micropowermanager/2021_01_02_134212_add_manufacturer_transaction_to_airtel_transactions_table.php index 73fba50b3..f3c424f4b 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_02_134212_add_manufacturer_transaction_to_airtel_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_02_134212_add_manufacturer_transaction_to_airtel_transactions_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_01_05_234039_create_ticket_settings_table.php b/src/backend/database/migrations/micropowermanager/2021_01_05_234039_create_ticket_settings_table.php index 9cdbe3bda..4f1f7fb36 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_05_234039_create_ticket_settings_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_05_234039_create_ticket_settings_table.php @@ -6,7 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_01_18_122556_add_columns_to_batteries_table.php b/src/backend/database/migrations/micropowermanager/2021_01_18_122556_add_columns_to_batteries_table.php index c7510e886..3c2c4c615 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_18_122556_add_columns_to_batteries_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_18_122556_add_columns_to_batteries_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_01_18_123245_add_columns_to_p_v_s_table.php b/src/backend/database/migrations/micropowermanager/2021_01_18_123245_add_columns_to_p_v_s_table.php index 3a961fc9c..1fc3328a8 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_18_123245_add_columns_to_p_v_s_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_18_123245_add_columns_to_p_v_s_table.php @@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_bodies.php b/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_bodies.php index 2a10b2488..672cbd23d 100644 --- a/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_bodies.php +++ b/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_bodies.php @@ -6,7 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * @@ -24,7 +24,8 @@ public function up() $table->timestamps(); }); - DB::connection('shard')->table('sms_bodies')->insert([ + DB::connection('shard')->table('sms_bodies')->insert( + [ [ 'reference' => 'SmsTransactionHeader', 'place_holder' => 'Dear [name] [surname], we received your transaction [transaction_amount].', diff --git a/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_resend_information_keys.php b/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_resend_information_keys.php index 9a80c7383..47c0a507d 100644 --- a/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_resend_information_keys.php +++ b/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_resend_information_keys.php @@ -6,7 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_02_18_156421_create_sms_appliance_remind_rates.php b/src/backend/database/migrations/micropowermanager/2021_02_18_156421_create_sms_appliance_remind_rates.php index 8ebddbbd0..c7a84e8a1 100644 --- a/src/backend/database/migrations/micropowermanager/2021_02_18_156421_create_sms_appliance_remind_rates.php +++ b/src/backend/database/migrations/micropowermanager/2021_02_18_156421_create_sms_appliance_remind_rates.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_03_03_140758_create_sms_android_settings.php b/src/backend/database/migrations/micropowermanager/2021_03_03_140758_create_sms_android_settings.php index fb89c99c4..9cc789ad7 100644 --- a/src/backend/database/migrations/micropowermanager/2021_03_03_140758_create_sms_android_settings.php +++ b/src/backend/database/migrations/micropowermanager/2021_03_03_140758_create_sms_android_settings.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_03_03_141706_create_sms_variable_default_values.php b/src/backend/database/migrations/micropowermanager/2021_03_03_141706_create_sms_variable_default_values.php index c4a52ea02..34ed727b7 100644 --- a/src/backend/database/migrations/micropowermanager/2021_03_03_141706_create_sms_variable_default_values.php +++ b/src/backend/database/migrations/micropowermanager/2021_03_03_141706_create_sms_variable_default_values.php @@ -6,7 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_03_2_1561251_update_sms_table.php b/src/backend/database/migrations/micropowermanager/2021_03_2_1561251_update_sms_table.php index e86d97b26..0bdf6e842 100644 --- a/src/backend/database/migrations/micropowermanager/2021_03_2_1561251_update_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_03_2_1561251_update_sms_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_04_28_103758_add_additional_json_column_to_people.php b/src/backend/database/migrations/micropowermanager/2021_04_28_103758_add_additional_json_column_to_people.php index 1aa2de05f..c98c3f628 100644 --- a/src/backend/database/migrations/micropowermanager/2021_04_28_103758_add_additional_json_column_to_people.php +++ b/src/backend/database/migrations/micropowermanager/2021_04_28_103758_add_additional_json_column_to_people.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_04_28_104840_create_person_documents_table.php b/src/backend/database/migrations/micropowermanager/2021_04_28_104840_create_person_documents_table.php index 665872e34..25e5f6b45 100644 --- a/src/backend/database/migrations/micropowermanager/2021_04_28_104840_create_person_documents_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_04_28_104840_create_person_documents_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_06_04_085817_update_meter_consumptions_table.php b/src/backend/database/migrations/micropowermanager/2021_06_04_085817_update_meter_consumptions_table.php index 82894766f..ed0b7e714 100644 --- a/src/backend/database/migrations/micropowermanager/2021_06_04_085817_update_meter_consumptions_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_06_04_085817_update_meter_consumptions_table.php @@ -6,7 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_08_17_090801_add_down_payment_to_asset_people_table.php b/src/backend/database/migrations/micropowermanager/2021_08_17_090801_add_down_payment_to_asset_people_table.php index 24351a0b9..57a38caf6 100644 --- a/src/backend/database/migrations/micropowermanager/2021_08_17_090801_add_down_payment_to_asset_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_08_17_090801_add_down_payment_to_asset_people_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_08_17_090913_add_first_payment_date_to_asset_people_table.php b/src/backend/database/migrations/micropowermanager/2021_08_17_090913_add_first_payment_date_to_asset_people_table.php index 6c7f61835..747895479 100644 --- a/src/backend/database/migrations/micropowermanager/2021_08_17_090913_add_first_payment_date_to_asset_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_08_17_090913_add_first_payment_date_to_asset_people_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_09_07_092522_create_cash_transactions_table.php b/src/backend/database/migrations/micropowermanager/2021_09_07_092522_create_cash_transactions_table.php index 0256a7245..849193095 100644 --- a/src/backend/database/migrations/micropowermanager/2021_09_07_092522_create_cash_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_09_07_092522_create_cash_transactions_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_10_18_220817_create_mail_settings.php b/src/backend/database/migrations/micropowermanager/2021_10_18_220817_create_mail_settings.php index 6373909e0..ceab71922 100644 --- a/src/backend/database/migrations/micropowermanager/2021_10_18_220817_create_mail_settings.php +++ b/src/backend/database/migrations/micropowermanager/2021_10_18_220817_create_mail_settings.php @@ -6,7 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_093215_update_meter_tariffs_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_093215_update_meter_tariffs_table.php index 090871dfe..ceea23dfe 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_093215_update_meter_tariffs_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_093215_update_meter_tariffs_table.php @@ -6,7 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_101348_update_social_tariffs_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_101348_update_social_tariffs_table.php index 13d36c8b2..5045706f7 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_101348_update_social_tariffs_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_101348_update_social_tariffs_table.php @@ -6,7 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_101616_update_tariff_pricing_components_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_101616_update_tariff_pricing_components_table.php index 4914cdc55..93a9a8e63 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_101616_update_tariff_pricing_components_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_101616_update_tariff_pricing_components_table.php @@ -6,7 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_101855_update_social_tariff_piggy_banks_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_101855_update_social_tariff_piggy_banks_table.php index f60fdb177..f63c65c9f 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_101855_update_social_tariff_piggy_banks_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_101855_update_social_tariff_piggy_banks_table.php @@ -6,7 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_102047_update_access_rates_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_102047_update_access_rates_table.php index 126e93461..26258e963 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_102047_update_access_rates_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_102047_update_access_rates_table.php @@ -6,7 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_102214_update_access_rate_payments_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_102214_update_access_rate_payments_table.php index 41259c14f..9322b857f 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_102214_update_access_rate_payments_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_102214_update_access_rate_payments_table.php @@ -6,7 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_102507_update_asset_people_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_102507_update_asset_people_table.php index 3a25f7e40..ab354684a 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_102507_update_asset_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_102507_update_asset_people_table.php @@ -6,7 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_102649_update_transactions_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_102649_update_transactions_table.php index 4157a34b6..4a9f36e6d 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_102649_update_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_102649_update_transactions_table.php @@ -6,7 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_102805_update_payment_histories_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_102805_update_payment_histories_table.php index 9e55c4370..42cbe729b 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_102805_update_payment_histories_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_102805_update_payment_histories_table.php @@ -6,7 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_05_19_102938_update_asset_types_table.php b/src/backend/database/migrations/micropowermanager/2022_05_19_102938_update_asset_types_table.php index 685ac3089..4aaa9b462 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_19_102938_update_asset_types_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_19_102938_update_asset_types_table.php @@ -6,7 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_05_23_104138_add_connection_column_to_agents_table.php b/src/backend/database/migrations/micropowermanager/2022_05_23_104138_add_connection_column_to_agents_table.php index a9374728b..a818cd1cb 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_23_104138_add_connection_column_to_agents_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_23_104138_add_connection_column_to_agents_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090125_create_calin_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090125_create_calin_tables.php index 650ee27f5..c8f8437e7 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090125_create_calin_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090125_create_calin_tables.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { public function up() { if (!Schema::hasTable('calin_api_credentials')) { diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090327_create_calin_smart_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090327_create_calin_smart_tables.php index 0cbffde97..4cef9a0cd 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090327_create_calin_smart_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090327_create_calin_smart_tables.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { public function up() { if (!Schema::hasTable('calin_smart_api_credentials')) { diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090338_create_kelin_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090338_create_kelin_tables.php index b0c7decd2..049d6e16b 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090338_create_kelin_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090338_create_kelin_tables.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { public function up() { if (!Schema::hasTable('kelin_api_credentials')) { diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090345_create_mesomb_payment_provider_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090345_create_mesomb_payment_provider_tables.php index df8f72421..79791a008 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090345_create_mesomb_payment_provider_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090345_create_mesomb_payment_provider_tables.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { public function up() { if (!Schema::hasTable('mesomb_transactions')) { diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090351_create_spark_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090351_create_spark_tables.php index c5fae50c0..f05231b84 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090351_create_spark_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090351_create_spark_tables.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { public function up() { if (!Schema::hasTable('sm_api_credentials')) { diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090402_create_steama_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090402_create_steama_tables.php index b6264ceac..d1d5c1bf2 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090402_create_steama_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090402_create_steama_tables.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { public function up() { if (!Schema::hasTable('steama_agents')) { diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090412_create_stron_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090412_create_stron_tables.php index 8c1e7343f..79e8c5272 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090412_create_stron_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090412_create_stron_tables.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { public function up() { if (!Schema::hasTable('stron_api_credentials')) { diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090425_create_swifta_payment_provider_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090425_create_swifta_payment_provider_tables.php index 39905bf5c..29f4e75a6 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090425_create_swifta_payment_provider_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090425_create_swifta_payment_provider_tables.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { public function up() { if (!Schema::hasTable('swifta_transactions')) { diff --git a/src/backend/database/migrations/micropowermanager/2022_07_05_092948_create_registration_tail_table.php b/src/backend/database/migrations/micropowermanager/2022_07_05_092948_create_registration_tail_table.php index c0f14af3e..23ed77cb3 100644 --- a/src/backend/database/migrations/micropowermanager/2022_07_05_092948_create_registration_tail_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_07_05_092948_create_registration_tail_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_09_20_0000000_create_bulk_registration_tables.php b/src/backend/database/migrations/micropowermanager/2022_09_20_0000000_create_bulk_registration_tables.php index 5d4adeaeb..64343bacf 100644 --- a/src/backend/database/migrations/micropowermanager/2022_09_20_0000000_create_bulk_registration_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_09_20_0000000_create_bulk_registration_tables.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { public function up() { if (!Schema::connection('shard')->hasTable('bulk_registration_csv_datas')) { diff --git a/src/backend/database/migrations/micropowermanager/2022_10_27_130327_add_direction_column_to_sms_table.php b/src/backend/database/migrations/micropowermanager/2022_10_27_130327_add_direction_column_to_sms_table.php index 34ad352e9..889e28ca2 100644 --- a/src/backend/database/migrations/micropowermanager/2022_10_27_130327_add_direction_column_to_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_10_27_130327_add_direction_column_to_sms_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_10_27_140945_add_gateway_id_column_to_sms_table.php b/src/backend/database/migrations/micropowermanager/2022_10_27_140945_add_gateway_id_column_to_sms_table.php index ce2821e1d..52967fea1 100644 --- a/src/backend/database/migrations/micropowermanager/2022_10_27_140945_add_gateway_id_column_to_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_10_27_140945_add_gateway_id_column_to_sms_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_10_27_142123_add_dispatched_column_to_sms_table.php b/src/backend/database/migrations/micropowermanager/2022_10_27_142123_add_dispatched_column_to_sms_table.php index 02e97429d..fd0890489 100644 --- a/src/backend/database/migrations/micropowermanager/2022_10_27_142123_add_dispatched_column_to_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_10_27_142123_add_dispatched_column_to_sms_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_10_27_142319_add_attempts_column_to_sms_table.php b/src/backend/database/migrations/micropowermanager/2022_10_27_142319_add_attempts_column_to_sms_table.php index d8da6df80..3ddc6c9fd 100644 --- a/src/backend/database/migrations/micropowermanager/2022_10_27_142319_add_attempts_column_to_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_10_27_142319_add_attempts_column_to_sms_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_11_08_0000000_create_viber_messaging_tables.php b/src/backend/database/migrations/micropowermanager/2022_11_08_0000000_create_viber_messaging_tables.php index 48c5c383c..02bf8c402 100644 --- a/src/backend/database/migrations/micropowermanager/2022_11_08_0000000_create_viber_messaging_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_11_08_0000000_create_viber_messaging_tables.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { public function up() { if (!Schema::hasTable('viber_credentials')) { diff --git a/src/backend/database/migrations/micropowermanager/2022_11_14_101338_add_minimum_purchase_amount_to_meter_tariffs_table.php b/src/backend/database/migrations/micropowermanager/2022_11_14_101338_add_minimum_purchase_amount_to_meter_tariffs_table.php index 1bb868b51..29f89dbb0 100644 --- a/src/backend/database/migrations/micropowermanager/2022_11_14_101338_add_minimum_purchase_amount_to_meter_tariffs_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_11_14_101338_add_minimum_purchase_amount_to_meter_tariffs_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_11_21_000000_create_wave_money_payment_provider_tables.php b/src/backend/database/migrations/micropowermanager/2022_11_21_000000_create_wave_money_payment_provider_tables.php index c2fd8756c..25b74cbc7 100644 --- a/src/backend/database/migrations/micropowermanager/2022_11_21_000000_create_wave_money_payment_provider_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_11_21_000000_create_wave_money_payment_provider_tables.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { public function up() { if (!Schema::hasTable('wave_money_transactions')) { diff --git a/src/backend/database/migrations/micropowermanager/2022_11_29_000000_create_micro_star_tables.php b/src/backend/database/migrations/micropowermanager/2022_11_29_000000_create_micro_star_tables.php index f8d27f2e2..ea148540d 100644 --- a/src/backend/database/migrations/micropowermanager/2022_11_29_000000_create_micro_star_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_11_29_000000_create_micro_star_tables.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { public function up() { if (!Schema::hasTable('micro_star_api_credentials')) { diff --git a/src/backend/database/migrations/micropowermanager/2022_12_11_000000_update_swifta_authentication_table.php b/src/backend/database/migrations/micropowermanager/2022_12_11_000000_update_swifta_authentication_table.php index dc6cb7525..f3bfff520 100644 --- a/src/backend/database/migrations/micropowermanager/2022_12_11_000000_update_swifta_authentication_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_12_11_000000_update_swifta_authentication_table.php @@ -6,7 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_14_12_create_sun_king_tables.php b/src/backend/database/migrations/micropowermanager/2022_14_12_create_sun_king_tables.php index 2836b3223..498fc3d19 100644 --- a/src/backend/database/migrations/micropowermanager/2022_14_12_create_sun_king_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_14_12_create_sun_king_tables.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { public function up() { if (!Schema::connection('shard')->hasTable('sun_king_api_credentials')) { diff --git a/src/backend/database/migrations/micropowermanager/2023_03_15_092048_add_colums_to_solars_table.php b/src/backend/database/migrations/micropowermanager/2023_03_15_092048_add_colums_to_solars_table.php index 011ac4f62..6190e2f5b 100644 --- a/src/backend/database/migrations/micropowermanager/2023_03_15_092048_add_colums_to_solars_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_03_15_092048_add_colums_to_solars_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_03_16_105024_update_solars_table.php b/src/backend/database/migrations/micropowermanager/2023_03_16_105024_update_solars_table.php index 8e54b500f..bdfbdf2ff 100644 --- a/src/backend/database/migrations/micropowermanager/2023_03_16_105024_update_solars_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_03_16_105024_update_solars_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_03_17_234630_update_data_type_values_energies_table.php b/src/backend/database/migrations/micropowermanager/2023_03_17_234630_update_data_type_values_energies_table.php index 5e05ddd44..9a4c7c1fd 100644 --- a/src/backend/database/migrations/micropowermanager/2023_03_17_234630_update_data_type_values_energies_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_03_17_234630_update_data_type_values_energies_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_03_18_014305_update_data_type_values_energies_table.php b/src/backend/database/migrations/micropowermanager/2023_03_18_014305_update_data_type_values_energies_table.php index cc2b7a167..98c3e5568 100644 --- a/src/backend/database/migrations/micropowermanager/2023_03_18_014305_update_data_type_values_energies_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_03_18_014305_update_data_type_values_energies_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_04_02_121811_create_wavecom_tables.php b/src/backend/database/migrations/micropowermanager/2023_04_02_121811_create_wavecom_tables.php index 245fa7a8b..023e3d172 100644 --- a/src/backend/database/migrations/micropowermanager/2023_04_02_121811_create_wavecom_tables.php +++ b/src/backend/database/migrations/micropowermanager/2023_04_02_121811_create_wavecom_tables.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { private const TABLE_NAME = 'wavecom_transactions'; public function up() diff --git a/src/backend/database/migrations/micropowermanager/2023_04_04_211421_add_api_type_to_table_transactions.php b/src/backend/database/migrations/micropowermanager/2023_04_04_211421_add_api_type_to_table_transactions.php index 2358fd0b9..292b015af 100644 --- a/src/backend/database/migrations/micropowermanager/2023_04_04_211421_add_api_type_to_table_transactions.php +++ b/src/backend/database/migrations/micropowermanager/2023_04_04_211421_add_api_type_to_table_transactions.php @@ -3,7 +3,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_04_26_223352_update_sms_table.php b/src/backend/database/migrations/micropowermanager/2023_04_26_223352_update_sms_table.php index 4c46c099e..5abf3c936 100644 --- a/src/backend/database/migrations/micropowermanager/2023_04_26_223352_update_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_04_26_223352_update_sms_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_06_02_create_gome_long_tables.php b/src/backend/database/migrations/micropowermanager/2023_06_02_create_gome_long_tables.php index 71d96f441..14e6718ad 100644 --- a/src/backend/database/migrations/micropowermanager/2023_06_02_create_gome_long_tables.php +++ b/src/backend/database/migrations/micropowermanager/2023_06_02_create_gome_long_tables.php @@ -6,7 +6,7 @@ // Despite the migration's name, this migration was actually created on Feb 6h // Name should be 2023-02-06 not 2023-06-02... -return new class extends Migration { +return new class () extends Migration { public function up() { if (!Schema::hasTable('gome_long_api_credentials')) { diff --git a/src/backend/database/migrations/micropowermanager/2023_09_25_232731_update_assets_asset_people_asset_types_tables.php b/src/backend/database/migrations/micropowermanager/2023_09_25_232731_update_assets_asset_people_asset_types_tables.php index c729cdd8b..7933fd353 100644 --- a/src/backend/database/migrations/micropowermanager/2023_09_25_232731_update_assets_asset_people_asset_types_tables.php +++ b/src/backend/database/migrations/micropowermanager/2023_09_25_232731_update_assets_asset_people_asset_types_tables.php @@ -6,7 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_09_28_130619_update_sms_appliance_remind_rates_table.php b/src/backend/database/migrations/micropowermanager/2023_09_28_130619_update_sms_appliance_remind_rates_table.php index 6182a8d76..41c4217a1 100644 --- a/src/backend/database/migrations/micropowermanager/2023_09_28_130619_update_sms_appliance_remind_rates_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_09_28_130619_update_sms_appliance_remind_rates_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_10_25_074114_update_wavecom_wavemoney_tables.php b/src/backend/database/migrations/micropowermanager/2023_10_25_074114_update_wavecom_wavemoney_tables.php index 78b331283..07ef68f96 100644 --- a/src/backend/database/migrations/micropowermanager/2023_10_25_074114_update_wavecom_wavemoney_tables.php +++ b/src/backend/database/migrations/micropowermanager/2023_10_25_074114_update_wavecom_wavemoney_tables.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_03_112202_create_devices_table.php b/src/backend/database/migrations/micropowermanager/2023_11_03_112202_create_devices_table.php index 45ac7b542..8b0b749cb 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_03_112202_create_devices_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_03_112202_create_devices_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_03_120614_create_solar_home_systems_table.php b/src/backend/database/migrations/micropowermanager/2023_11_03_120614_create_solar_home_systems_table.php index bfa0ee70a..f85c3ac57 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_03_120614_create_solar_home_systems_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_03_120614_create_solar_home_systems_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_03_121740_add_configuration_columns_to_meters_table.php b/src/backend/database/migrations/micropowermanager/2023_11_03_121740_add_configuration_columns_to_meters_table.php index 4bfc16837..60f31da52 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_03_121740_add_configuration_columns_to_meters_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_03_121740_add_configuration_columns_to_meters_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_11_142307_update_action_field_type_logs_table.php b/src/backend/database/migrations/micropowermanager/2023_11_11_142307_update_action_field_type_logs_table.php index 2fe634fb0..f3598f212 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_11_142307_update_action_field_type_logs_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_11_142307_update_action_field_type_logs_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_14_160711_drop_geo_id_column_from_address_table.php b/src/backend/database/migrations/micropowermanager/2023_11_14_160711_drop_geo_id_column_from_address_table.php index c0df218ad..6ac069628 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_14_160711_drop_geo_id_column_from_address_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_14_160711_drop_geo_id_column_from_address_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_16_175649_add_type_column_to_manufacturers_table.php b/src/backend/database/migrations/micropowermanager/2023_11_16_175649_add_type_column_to_manufacturers_table.php index ac84bc87c..c5ca997ee 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_16_175649_add_type_column_to_manufacturers_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_16_175649_add_type_column_to_manufacturers_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_16_175940_add_asset_id_column_to_solar_home_systems_table.php b/src/backend/database/migrations/micropowermanager/2023_11_16_175940_add_asset_id_column_to_solar_home_systems_table.php index 88cc96d66..b8adf1020 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_16_175940_add_asset_id_column_to_solar_home_systems_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_16_175940_add_asset_id_column_to_solar_home_systems_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_16_220432_update_person_id_column_in_devices_table.php b/src/backend/database/migrations/micropowermanager/2023_11_16_220432_update_person_id_column_in_devices_table.php index 6d6301440..3493031bb 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_16_220432_update_person_id_column_in_devices_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_16_220432_update_person_id_column_in_devices_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_16_220931_update_device_serial_column_in_devices_table.php b/src/backend/database/migrations/micropowermanager/2023_11_16_220931_update_device_serial_column_in_devices_table.php index bbbd60767..8257d4cb9 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_16_220931_update_device_serial_column_in_devices_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_16_220931_update_device_serial_column_in_devices_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_16_221111_update_serial_number_column_in_solar_home_systems_table.php b/src/backend/database/migrations/micropowermanager/2023_11_16_221111_update_serial_number_column_in_solar_home_systems_table.php index 2ee59cbb8..d6c41ca57 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_16_221111_update_serial_number_column_in_solar_home_systems_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_16_221111_update_serial_number_column_in_solar_home_systems_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_17_095204_create_tokens_table.php b/src/backend/database/migrations/micropowermanager/2023_11_17_095204_create_tokens_table.php index a96a4b81a..ce82cfa03 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_17_095204_create_tokens_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_17_095204_create_tokens_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_18_190332_add_device_serial_column_to_asset_people_table.php b/src/backend/database/migrations/micropowermanager/2023_11_18_190332_add_device_serial_column_to_asset_people_table.php index f082d21e1..3b2d1f914 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_18_190332_add_device_serial_column_to_asset_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_18_190332_add_device_serial_column_to_asset_people_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_21_090129_update_derice_serial_column_in_asset_people_table.php b/src/backend/database/migrations/micropowermanager/2023_11_21_090129_update_derice_serial_column_in_asset_people_table.php index 2b6e6169d..efbc51fed 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_21_090129_update_derice_serial_column_in_asset_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_21_090129_update_derice_serial_column_in_asset_people_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_01_01_create_daly_bms_tables.php b/src/backend/database/migrations/micropowermanager/2024_01_01_create_daly_bms_tables.php index af89ef270..c3f4aedc8 100644 --- a/src/backend/database/migrations/micropowermanager/2024_01_01_create_daly_bms_tables.php +++ b/src/backend/database/migrations/micropowermanager/2024_01_01_create_daly_bms_tables.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { public function up() { if (!Schema::hasTable('daly_bms_api_credentials')) { diff --git a/src/backend/database/migrations/micropowermanager/2024_01_02_124146_create_e_bikes_table.php b/src/backend/database/migrations/micropowermanager/2024_01_02_124146_create_e_bikes_table.php index c600d582c..6f8820d3e 100644 --- a/src/backend/database/migrations/micropowermanager/2024_01_02_124146_create_e_bikes_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_01_02_124146_create_e_bikes_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_01_12_create_angaza_tables.php b/src/backend/database/migrations/micropowermanager/2024_01_12_create_angaza_tables.php index 78200f4b5..1eaf1b33c 100644 --- a/src/backend/database/migrations/micropowermanager/2024_01_12_create_angaza_tables.php +++ b/src/backend/database/migrations/micropowermanager/2024_01_12_create_angaza_tables.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { public function up() { if (!Schema::connection('shard')->hasTable('angaza_api_credentials')) { diff --git a/src/backend/database/migrations/micropowermanager/2024_02_07_102305_add_usage_type_column_to_main_settings_table.php b/src/backend/database/migrations/micropowermanager/2024_02_07_102305_add_usage_type_column_to_main_settings_table.php index 10aa435b6..48469140d 100644 --- a/src/backend/database/migrations/micropowermanager/2024_02_07_102305_add_usage_type_column_to_main_settings_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_02_07_102305_add_usage_type_column_to_main_settings_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_02_07_113710_add_usage_type_column_to_menu_items_table.php b/src/backend/database/migrations/micropowermanager/2024_02_07_113710_add_usage_type_column_to_menu_items_table.php index d16cd7fb9..23d3993f9 100644 --- a/src/backend/database/migrations/micropowermanager/2024_02_07_113710_add_usage_type_column_to_menu_items_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_02_07_113710_add_usage_type_column_to_menu_items_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_09_30_113302_remove_siderbar_tables.php b/src/backend/database/migrations/micropowermanager/2024_09_30_113302_remove_siderbar_tables.php index 3d7fe14f9..c02aecded 100644 --- a/src/backend/database/migrations/micropowermanager/2024_09_30_113302_remove_siderbar_tables.php +++ b/src/backend/database/migrations/micropowermanager/2024_09_30_113302_remove_siderbar_tables.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_23_153042_add_amount_to_agent_charge.php b/src/backend/database/migrations/micropowermanager/2024_10_23_153042_add_amount_to_agent_charge.php index a0f9ed99e..d3b7a9eb6 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_23_153042_add_amount_to_agent_charge.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_23_153042_add_amount_to_agent_charge.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_30_154625_create_notifications_table.php b/src/backend/database/migrations/micropowermanager/2024_10_30_154625_create_notifications_table.php index 3d6cbf7f8..448655043 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_30_154625_create_notifications_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_30_154625_create_notifications_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180458_remove_batteries_table.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180458_remove_batteries_table.php index 4da0bd72e..81555990f 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180458_remove_batteries_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180458_remove_batteries_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180510_remove_energies_table.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180510_remove_energies_table.php index 55994d8e8..a1bd1f04f 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180510_remove_energies_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180510_remove_energies_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180524_remove_mini_grid_frequencies_table.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180524_remove_mini_grid_frequencies_table.php index 4a350e0eb..a9a158daf 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180524_remove_mini_grid_frequencies_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180524_remove_mini_grid_frequencies_table.php @@ -3,7 +3,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180539_remove_pvs_table.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180539_remove_pvs_table.php index 3b6fb8e94..0957f165e 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180539_remove_pvs_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180539_remove_pvs_table.php @@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180546_remove_solars_table.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180546_remove_solars_table.php index 87b6114b5..8c2f0b897 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180546_remove_solars_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180546_remove_solars_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180605_remove_weather_data_table.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180605_remove_weather_data_table.php index 35d582874..8e91b068d 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180605_remove_weather_data_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180605_remove_weather_data_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180852_remove_agent_tickets.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180852_remove_agent_tickets.php index d81b62db0..1aec28c01 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180852_remove_agent_tickets.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180852_remove_agent_tickets.php @@ -3,7 +3,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_181016_remove_city_clusters.php b/src/backend/database/migrations/micropowermanager/2024_10_31_181016_remove_city_clusters.php index afc95f4a0..86d7d95d8 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_181016_remove_city_clusters.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_181016_remove_city_clusters.php @@ -3,7 +3,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_11_11_130340_drop_data_stream_column_from_mini_grid.php b/src/backend/database/migrations/micropowermanager/2024_11_11_130340_drop_data_stream_column_from_mini_grid.php index 2f89d59cb..82d0ae3e9 100644 --- a/src/backend/database/migrations/micropowermanager/2024_11_11_130340_drop_data_stream_column_from_mini_grid.php +++ b/src/backend/database/migrations/micropowermanager/2024_11_11_130340_drop_data_stream_column_from_mini_grid.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/packages/inensus/angaza-shs/src/Modules/Api/ApiRequests.php b/src/backend/packages/inensus/angaza-shs/src/Modules/Api/ApiRequests.php index 0089c9c77..438668e60 100644 --- a/src/backend/packages/inensus/angaza-shs/src/Modules/Api/ApiRequests.php +++ b/src/backend/packages/inensus/angaza-shs/src/Modules/Api/ApiRequests.php @@ -22,13 +22,15 @@ public function get(AngazaCredential $credentials, array $params, string $slug) } try { - $request = $this->httpClient->get($url, + $request = $this->httpClient->get( + $url, [ 'headers' => [ 'Accept' => 'application/json', 'Authorization' => $this->getBasicAuthHeader($credentials), ], - ]); + ] + ); return json_decode((string) $request->getBody(), true); } catch (\Exception $e) { @@ -62,7 +64,8 @@ public function put(AngazaCredential $credentials, array $params, string $slug) 'URL :' => $url, 'Body :' => json_encode($params), 'message :' => $e->getMessage(), - ]); + ] + ); throw new AngazaApiResponseException($e->getMessage()); } } diff --git a/src/backend/packages/inensus/angaza-shs/src/Providers/AngazaSHSServiceProvider.php b/src/backend/packages/inensus/angaza-shs/src/Providers/AngazaSHSServiceProvider.php index b0b3de0aa..6fb005cc4 100644 --- a/src/backend/packages/inensus/angaza-shs/src/Providers/AngazaSHSServiceProvider.php +++ b/src/backend/packages/inensus/angaza-shs/src/Providers/AngazaSHSServiceProvider.php @@ -58,8 +58,10 @@ protected function getMigrationFileName(Filesystem $filesystem): string ->flatMap(function ($path) use ($filesystem) { if (count($filesystem->glob($path.'*_create_angaza_tables.php'))) { $file = $filesystem->glob($path.'*_create_angaza_tables.php')[0]; - file_put_contents($file, - file_get_contents(__DIR__.'/../../database/migrations/create_angaza_tables.php.stub')); + file_put_contents( + $file, + file_get_contents(__DIR__.'/../../database/migrations/create_angaza_tables.php.stub') + ); } return $filesystem->glob($path.'*_create_angaza_tables.php'); diff --git a/src/backend/packages/inensus/bulk-registration/database/migrations/create_bulk_registration_tables.php b/src/backend/packages/inensus/bulk-registration/database/migrations/create_bulk_registration_tables.php index 987381d2d..d90e4dbb1 100644 --- a/src/backend/packages/inensus/bulk-registration/database/migrations/create_bulk_registration_tables.php +++ b/src/backend/packages/inensus/bulk-registration/database/migrations/create_bulk_registration_tables.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration { +return new class () extends Migration { public function up() { if (!Schema::hasTable('bulk_registration_csv_datas')) { diff --git a/src/backend/packages/inensus/bulk-registration/src/Providers/BulkRegistrationServiceProvider.php b/src/backend/packages/inensus/bulk-registration/src/Providers/BulkRegistrationServiceProvider.php index 9012af2ed..1b340af76 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Providers/BulkRegistrationServiceProvider.php +++ b/src/backend/packages/inensus/bulk-registration/src/Providers/BulkRegistrationServiceProvider.php @@ -23,8 +23,10 @@ public function boot(Filesystem $filesystem) public function register() { - $this->mergeConfigFrom(__DIR__.'/../../config/bulk-registration.php', - 'bulk-registration'); + $this->mergeConfigFrom( + __DIR__.'/../../config/bulk-registration.php', + 'bulk-registration' + ); $this->app->register(EventServiceProvider::class); $this->app->register(ObserverServiceProvider::class); /* $this->app->bind(GeographicalLocationFinder::class,function($app){ @@ -42,7 +44,8 @@ public function publishConfigFiles() public function publishVueFiles() { $this->publishes([ - __DIR__.'/../resources/assets' => resource_path('assets/js/plugins/bulk-registration' + __DIR__.'/../resources/assets' => resource_path( + 'assets/js/plugins/bulk-registration' ), ], 'vue-components'); } @@ -62,8 +65,10 @@ protected function getMigrationFileName(Filesystem $filesystem): string ->flatMap(function ($path) use ($filesystem) { if (count($filesystem->glob($path.'*_create_bulk-registration_tables.php'))) { $file = $filesystem->glob($path.'*_create_bulk-registration_tables.php')[0]; - file_put_contents($file, - file_get_contents(__DIR__.'/../../database/migrations/create_bulk_registration_tables.php')); + file_put_contents( + $file, + file_get_contents(__DIR__.'/../../database/migrations/create_bulk_registration_tables.php') + ); } return $filesystem->glob($path.'*_create_bulk-registration_tables.php'); diff --git a/src/backend/packages/inensus/bulk-registration/src/Services/GeographicalInformationService.php b/src/backend/packages/inensus/bulk-registration/src/Services/GeographicalInformationService.php index 8aaf6176f..07bcea68e 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Services/GeographicalInformationService.php +++ b/src/backend/packages/inensus/bulk-registration/src/Services/GeographicalInformationService.php @@ -27,8 +27,11 @@ public function resolveCsvDataFromComingRow($csvData, $ownerModel) if ($ownerModel instanceof MiniGrid) { $this->createMiniGridRelatedGeographicalInformation($ownerModel); } else { - $geographicalInformationData = $this->createMeterParameterRelatedGeographicalInformation($geographicalInformationData, - $csvData, $ownerModel); + $geographicalInformationData = $this->createMeterParameterRelatedGeographicalInformation( + $geographicalInformationData, + $csvData, + $ownerModel + ); $this->createRelatedDataIfDoesNotExists($geographicalInformationData, $ownerModel); } } diff --git a/src/backend/packages/inensus/calin-meter/src/Providers/CalinMeterServiceProvider.php b/src/backend/packages/inensus/calin-meter/src/Providers/CalinMeterServiceProvider.php index f9de8cea1..b26087944 100644 --- a/src/backend/packages/inensus/calin-meter/src/Providers/CalinMeterServiceProvider.php +++ b/src/backend/packages/inensus/calin-meter/src/Providers/CalinMeterServiceProvider.php @@ -25,7 +25,8 @@ public function boot(Filesystem $filesystem) Relation::morphMap( [ 'calin_transaction' => CalinTransaction::class, - ]); + ] + ); } public function register() diff --git a/src/backend/packages/inensus/calin-smart-meter/src/Providers/CalinSmartMeterServiceProvider.php b/src/backend/packages/inensus/calin-smart-meter/src/Providers/CalinSmartMeterServiceProvider.php index b1cd4787a..55d59900f 100644 --- a/src/backend/packages/inensus/calin-smart-meter/src/Providers/CalinSmartMeterServiceProvider.php +++ b/src/backend/packages/inensus/calin-smart-meter/src/Providers/CalinSmartMeterServiceProvider.php @@ -25,7 +25,8 @@ public function boot(Filesystem $filesystem) Relation::morphMap( [ 'calin_smart_transaction' => CalinSmartTransaction::class, - ]); + ] + ); } public function register() diff --git a/src/backend/packages/inensus/daly-bms/src/Console/Commands/CheckPayments.php b/src/backend/packages/inensus/daly-bms/src/Console/Commands/CheckPayments.php index ac789ad46..c46363356 100644 --- a/src/backend/packages/inensus/daly-bms/src/Console/Commands/CheckPayments.php +++ b/src/backend/packages/inensus/daly-bms/src/Console/Commands/CheckPayments.php @@ -83,7 +83,8 @@ private function lockTheBike($installment): bool ]; $this->eBikeService->update( $eBike, - $updatingData); + $updatingData + ); $creator = $this->user->newQuery()->firstOrCreate([ 'name' => 'System', diff --git a/src/backend/packages/inensus/daly-bms/src/Console/Commands/SyncBikes.php b/src/backend/packages/inensus/daly-bms/src/Console/Commands/SyncBikes.php index f38a968c6..3e09a9561 100644 --- a/src/backend/packages/inensus/daly-bms/src/Console/Commands/SyncBikes.php +++ b/src/backend/packages/inensus/daly-bms/src/Console/Commands/SyncBikes.php @@ -72,7 +72,8 @@ private function updateBike($deviceData) $eBike = $this->eBikeService->getBySerialNumber($deviceData['Code']); $this->eBikeService->update( $eBike, - $updatingData); + $updatingData + ); $address = $this->deviceAddressService->getAddressByDevice($eBike->device); $geoData = [ diff --git a/src/backend/packages/inensus/daly-bms/src/Modules/Api/ApiRequests.php b/src/backend/packages/inensus/daly-bms/src/Modules/Api/ApiRequests.php index 715cb475f..6b9b21775 100644 --- a/src/backend/packages/inensus/daly-bms/src/Modules/Api/ApiRequests.php +++ b/src/backend/packages/inensus/daly-bms/src/Modules/Api/ApiRequests.php @@ -76,7 +76,8 @@ public function postWithBodyParams(DalyBmsCredential $credentials, array $params 'URL :' => $url, 'Body :' => json_encode($params), 'message :' => $e->getMessage(), - ]); + ] + ); throw $e; } } @@ -115,7 +116,8 @@ public function postWithQueryParams(DalyBmsCredential $credentials, array $param 'URL :' => $url, 'Body :' => json_encode($params), 'message :' => $e->getMessage(), - ]); + ] + ); throw $e; } } diff --git a/src/backend/packages/inensus/daly-bms/src/Modules/Api/DalyBmsApi.php b/src/backend/packages/inensus/daly-bms/src/Modules/Api/DalyBmsApi.php index 60e6a70f7..f7cc49c13 100644 --- a/src/backend/packages/inensus/daly-bms/src/Modules/Api/DalyBmsApi.php +++ b/src/backend/packages/inensus/daly-bms/src/Modules/Api/DalyBmsApi.php @@ -46,8 +46,10 @@ public function getDevices(array $deviceSerials) return $this->apiRequests->postWithBodyParams($credentials, $params, self::COMMAND_DEVICES_LIST); } catch (DalyBmsApiResponseException $e) { - $this->credentialService->updateCredentials($credentials, - ['access_token' => null, 'token_expires_in' => null]); + $this->credentialService->updateCredentials( + $credentials, + ['access_token' => null, 'token_expires_in' => null] + ); throw $e; } } @@ -67,8 +69,10 @@ public function getDevice(string $code) return $this->apiRequests->postWithQueryParams($credentials, $params, self::COMMAND_DEVICE_DETAIL); } catch (DalyBmsApiResponseException $e) { - $this->credentialService->updateCredentials($credentials, - ['access_token' => null, 'token_expires_in' => null]); + $this->credentialService->updateCredentials( + $credentials, + ['access_token' => null, 'token_expires_in' => null] + ); throw $e; } } @@ -125,7 +129,8 @@ public function chargeDevice(TransactionDataContainer $transactionContainer): ar ]; $this->eBikeService->update( $eBike, - $updatingData); + $updatingData + ); $creator = User::query()->firstOrCreate([ 'name' => 'System', ]); diff --git a/src/backend/packages/inensus/daly-bms/src/Providers/DalyBmsServiceProvider.php b/src/backend/packages/inensus/daly-bms/src/Providers/DalyBmsServiceProvider.php index 6cefbbcdf..3b2479b77 100644 --- a/src/backend/packages/inensus/daly-bms/src/Providers/DalyBmsServiceProvider.php +++ b/src/backend/packages/inensus/daly-bms/src/Providers/DalyBmsServiceProvider.php @@ -63,8 +63,10 @@ protected function getMigrationFileName(Filesystem $filesystem): string if (count($filesystem->glob($path.'*_create_daly_bms_tables.php'))) { $file = $filesystem->glob($path.'*_create_daly_bms_tables.php')[0]; - file_put_contents($file, - file_get_contents(__DIR__.'/../../database/migrations/create_daly_bms_tables.php.stub')); + file_put_contents( + $file, + file_get_contents(__DIR__.'/../../database/migrations/create_daly_bms_tables.php.stub') + ); } return $filesystem->glob($path.'*_create_daly_bms_tables.php'); diff --git a/src/backend/packages/inensus/gome-long-meter/src/Modules/Api/ApiRequests.php b/src/backend/packages/inensus/gome-long-meter/src/Modules/Api/ApiRequests.php index 72ee96a8a..545825988 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Modules/Api/ApiRequests.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Modules/Api/ApiRequests.php @@ -22,12 +22,14 @@ public function get(GomeLongCredential $credentials, array $params, string $slug $url .= $key.'='.$value.'&'; } try { - $request = $this->httpClient->get($url, + $request = $this->httpClient->get( + $url, [ 'headers' => [ 'Accept' => 'application/json', ], - ]); + ] + ); $result = json_decode((string) $request->getBody(), true); if ($result['ReturnCode'] !== 0) { diff --git a/src/backend/packages/inensus/gome-long-meter/src/Providers/GomeLongMeterServiceProvider.php b/src/backend/packages/inensus/gome-long-meter/src/Providers/GomeLongMeterServiceProvider.php index d1583bd55..0704f5c95 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Providers/GomeLongMeterServiceProvider.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Providers/GomeLongMeterServiceProvider.php @@ -66,8 +66,10 @@ protected function getMigrationFileName(Filesystem $filesystem): string ->flatMap(function ($path) use ($filesystem) { if (count($filesystem->glob($path.'*_create_gome_long_tables.php'))) { $file = $filesystem->glob($path.'*_create_gome_long_tables.php')[0]; - file_put_contents($file, - file_get_contents(__DIR__.'/../../database/migrations/create_gome_long_tables.php.stub')); + file_put_contents( + $file, + file_get_contents(__DIR__.'/../../database/migrations/create_gome_long_tables.php.stub') + ); } return $filesystem->glob($path.'*_create_gome_long_tables.php'); diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Clients/KelinMeterApiClient.php b/src/backend/packages/inensus/kelin-meter/src/Http/Clients/KelinMeterApiClient.php index b38ecebc7..7170a4dea 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Clients/KelinMeterApiClient.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Clients/KelinMeterApiClient.php @@ -34,7 +34,8 @@ public function token($url, $queryParams) throw new KelinApiCredentialsNotFoundException($e->getMessage()); } try { - $response = $this->client->request('GET', + $response = $this->client->request( + 'GET', $credential->api_url.$url.'?param='.urlencode(json_encode($queryParams)) ); } catch (GuzzleException $exception) { diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinMinutelyConsumptionController.php b/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinMinutelyConsumptionController.php index e37a2b214..b0f08fe6e 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinMinutelyConsumptionController.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinMinutelyConsumptionController.php @@ -20,7 +20,9 @@ public function index(KelinMeter $meter) { $perPage = \request()->get('per_page') ?? 15; - return MinutelyConsumptionResource::collection($this->minutelyConsumptionService->getDailyData($meter->meter_address, - $perPage)); + return MinutelyConsumptionResource::collection($this->minutelyConsumptionService->getDailyData( + $meter->meter_address, + $perPage + )); } } diff --git a/src/backend/packages/inensus/kelin-meter/src/KelinMeterApi.php b/src/backend/packages/inensus/kelin-meter/src/KelinMeterApi.php index c70dce41a..3d7da8919 100644 --- a/src/backend/packages/inensus/kelin-meter/src/KelinMeterApi.php +++ b/src/backend/packages/inensus/kelin-meter/src/KelinMeterApi.php @@ -97,10 +97,15 @@ public function chargeDevice($transactionContainer): array 'manufacturer_transaction_type' => 'kelin_transaction', ]); - $token = $transactionResult['opType'] === 2 ? sprintf('EnergyToken : %s', - $transactionResult['payToken']) : - sprintf('OpenToken1 : %s OpenToken2 : %s', $transactionResult['openToken1'], - $transactionResult['openToken2']); + $token = $transactionResult['opType'] === 2 ? sprintf( + 'EnergyToken : %s', + $transactionResult['payToken'] + ) : + sprintf( + 'OpenToken1 : %s OpenToken2 : %s', + $transactionResult['openToken1'], + $transactionResult['openToken2'] + ); return [ 'token' => $token, diff --git a/src/backend/packages/inensus/kelin-meter/src/Providers/KelinMeterServiceProvider.php b/src/backend/packages/inensus/kelin-meter/src/Providers/KelinMeterServiceProvider.php index ff7ca6c47..1e7ae738a 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Providers/KelinMeterServiceProvider.php +++ b/src/backend/packages/inensus/kelin-meter/src/Providers/KelinMeterServiceProvider.php @@ -91,7 +91,8 @@ public function publishConfigFiles() public function publishVueFiles() { $this->publishes([ - __DIR__.'/../resources/assets' => resource_path('assets/js/plugins/kelin-meter' + __DIR__.'/../resources/assets' => resource_path( + 'assets/js/plugins/kelin-meter' ), ], 'vue-components'); } @@ -112,8 +113,10 @@ protected function getMigrationFileName(Filesystem $filesystem): string if (count($filesystem->glob($path.'*_create_kelin_tables.php'))) { $file = $filesystem->glob($path.'*_create_kelin_tables.php')[0]; - file_put_contents($file, - file_get_contents(__DIR__.'/../../database/migrations/create_kelin_tables.php.stub')); + file_put_contents( + $file, + file_get_contents(__DIR__.'/../../database/migrations/create_kelin_tables.php.stub') + ); } return $filesystem->glob($path.'*_create_kelin_tables.php'); diff --git a/src/backend/packages/inensus/kelin-meter/src/Services/KelinCustomerService.php b/src/backend/packages/inensus/kelin-meter/src/Services/KelinCustomerService.php index aa71f5dca..b0a6480ee 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Services/KelinCustomerService.php +++ b/src/backend/packages/inensus/kelin-meter/src/Services/KelinCustomerService.php @@ -50,8 +50,10 @@ public function sync() $syncCheck['data']->filter(function ($value) { return $value['syncStatus'] === SyncStatus::EARLY_REGISTERED; })->each(function ($customer) { - $person = $this->updateRelatedPerson($customer, - $customer['relatedPerson']); + $person = $this->updateRelatedPerson( + $customer, + $customer['relatedPerson'] + ); try { $this->kelinCustomer->newQuery()->create([ 'customer_no' => $customer['consNo'], diff --git a/src/backend/packages/inensus/kelin-meter/src/Services/KelinMeterService.php b/src/backend/packages/inensus/kelin-meter/src/Services/KelinMeterService.php index 61308863b..ac01b6de1 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Services/KelinMeterService.php +++ b/src/backend/packages/inensus/kelin-meter/src/Services/KelinMeterService.php @@ -51,7 +51,6 @@ public function __construct( KelinCustomer $kelinCustomer, MeterParameter $meterParameter, Manufacturer $manufacturer, - ConnectionGroup $connectionGroup, ConnectionType $connectionType, MeterTariff $meterTariff, @@ -105,8 +104,10 @@ public function sync() $syncCheck['data']->filter(function ($value) { return $value['syncStatus'] === SyncStatus::EARLY_REGISTERED; })->each(function ($meter) { - $updatedMeter = $this->updateRelatedMeter($meter, - $meter['relatedMeter']); + $updatedMeter = $this->updateRelatedMeter( + $meter, + $meter['relatedMeter'] + ); $this->kelinMeter->newQuery()->create([ 'meter_name' => $meter['meterName'], 'meter_address' => $meter['meterAddr'], diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Http/Middleware/MesombTransactionRequest.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Http/Middleware/MesombTransactionRequest.php index f3fb52c0d..d79995cff 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Http/Middleware/MesombTransactionRequest.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Http/Middleware/MesombTransactionRequest.php @@ -21,7 +21,8 @@ public function handle(Request $request, \Closure $next) [ 'message' => $request->input('message'), 'pk' => $request->input('pk'), - ]); + ] + ); return response()->json([ 'errors' => [ diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Listeners/TransactionListener.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Listeners/TransactionListener.php index 3042096f8..d99aba693 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Listeners/TransactionListener.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Listeners/TransactionListener.php @@ -26,10 +26,12 @@ public function onTransactionSuccess(Transaction $transaction) public function subscribe(Dispatcher $events) { - $events->listen('transaction.successful', + $events->listen( + 'transaction.successful', 'Inensus\MesombPaymentProvider\Listeners\TransactionListener@onTransactionSuccess' ); - $events->listen('transaction.failed', + $events->listen( + 'transaction.failed', 'Inensus\MesombPaymentProvider\Listeners\TransactionListener@onTransactionFailed' ); } diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Providers/MesombServiceProvider.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Providers/MesombServiceProvider.php index 07c7b3d69..5b485cbd9 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Providers/MesombServiceProvider.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Providers/MesombServiceProvider.php @@ -58,8 +58,10 @@ protected function getMigrationFileName(Filesystem $filesystem): string if (count($filesystem->glob($path.'*_create_mesomb_payment_provider_tables.php'))) { $file = $filesystem->glob($path.'*_create_mesomb_payment_provider_tables.php')[0]; - file_put_contents($file, - file_get_contents(__DIR__.'/../../database/migrations/create_mesomb_payment_provider_tables.php.stub')); + file_put_contents( + $file, + file_get_contents(__DIR__.'/../../database/migrations/create_mesomb_payment_provider_tables.php.stub') + ); } return $filesystem->glob($path.'*_create_mesomb_payment_provider_tables.php'); diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Providers/MesombTransactionProvider.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Providers/MesombTransactionProvider.php index db964ef9d..1ddb48cdc 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Providers/MesombTransactionProvider.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Providers/MesombTransactionProvider.php @@ -57,8 +57,10 @@ public function saveTransaction() public function saveCommonData(): Model { - return $this->mesombTransactionService->associateMesombTransactionWithTransaction($this->mesombTransaction, - $this->transaction); + return $this->mesombTransactionService->associateMesombTransactionWithTransaction( + $this->mesombTransaction, + $this->transaction + ); } public function sendResult(bool $requestType, Transaction $transaction) @@ -107,7 +109,9 @@ private function checkPhoneIsExists($requestData): Model private function checkSenderHasOnlyOneMeterRegistered($senderAddress): void { $senderMeters = $senderAddress->newQuery()->whereHasMorph( - 'owner', [Person::class]) + 'owner', + [Person::class] + ) ->first()->owner()->first()->meters(); $senderMetersCount = $senderMeters->count(); if ($senderMetersCount > 1 || $senderMetersCount == 0) { diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Services/MesomTransactionService.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Services/MesomTransactionService.php index 418ffbcf8..857deb943 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Services/MesomTransactionService.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Services/MesomTransactionService.php @@ -12,8 +12,8 @@ class MesomTransactionService public function __construct( MesombTransaction $mesombTransaction, - Transaction $transaction) - { + Transaction $transaction + ) { $this->mesombTransaction = $mesombTransaction; $this->transaction = $transaction; } diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Tests/Unit/PaymentProcessTests.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Tests/Unit/PaymentProcessTests.php index 3ee0f5f0b..7ffd442f2 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Tests/Unit/PaymentProcessTests.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Tests/Unit/PaymentProcessTests.php @@ -76,8 +76,10 @@ private function initializeTransaction() $mesombTransaction = $mesombTransactionService->assignIncomingDataToMesombTransaction($validData); $transaction = $mesombTransactionService->assignIncomingDataToTransaction($validData); - return $mesombTransactionService->associateMesombTransactionWithTransaction($mesombTransaction, - $transaction); + return $mesombTransactionService->associateMesombTransactionWithTransaction( + $mesombTransaction, + $transaction + ); } private function initializeData() diff --git a/src/backend/packages/inensus/micro-star-meter/src/Modules/Api/ApiRequests.php b/src/backend/packages/inensus/micro-star-meter/src/Modules/Api/ApiRequests.php index 863d1eda2..9e87dfbeb 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Modules/Api/ApiRequests.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Modules/Api/ApiRequests.php @@ -26,13 +26,15 @@ public function get(MicroStarCredential $credentials, array $params, string $slu $certificatePath = storage_path('app'.$credentials->certificate_path.'/'. $credentials->certificate_file_name); try { - $request = $this->httpClient->get($url, + $request = $this->httpClient->get( + $url, [ 'headers' => [ 'Accept' => 'application/json', ], 'cert' => [$certificatePath, $credentials->certificate_password], - ]); + ] + ); return $this->responseResolver->checkResponse(json_decode((string) $request->getBody(), true)); } catch (GuzzleException|MicroStarApiResponseException $exception) { @@ -59,13 +61,15 @@ public function testGet() $t = '/TMRDataService/getStsVendingToken?deviceNo=0101189000116&sgc=600415&ti=2&rechargeAmount=1'; try { - $request = $this->httpClient->get($url.$t, + $request = $this->httpClient->get( + $url.$t, [ 'headers' => [ 'Accept' => 'application/json', ], 'cert' => [__DIR__.'/Certs/client.ympt.p12', 'U7i8o9p0'], - ]); + ] + ); return $this->responseResolver->checkResponse(json_decode((string) $request->getBody(), true)); } catch (GuzzleException|MicroStarApiResponseException $exception) { diff --git a/src/backend/packages/inensus/micro-star-meter/src/Providers/MicroStarMeterServiceProvider.php b/src/backend/packages/inensus/micro-star-meter/src/Providers/MicroStarMeterServiceProvider.php index 07e217276..b1a9f605a 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Providers/MicroStarMeterServiceProvider.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Providers/MicroStarMeterServiceProvider.php @@ -59,8 +59,10 @@ protected function getMigrationFileName(Filesystem $filesystem): string ->flatMap(function ($path) use ($filesystem) { if (count($filesystem->glob($path.'*_create_micro_star_tables.php'))) { $file = $filesystem->glob($path.'*_create_micro_star_tables.php')[0]; - file_put_contents($file, - file_get_contents(__DIR__.'/../../database/migrations/create_micro_star_tables.php.stub')); + file_put_contents( + $file, + file_get_contents(__DIR__.'/../../database/migrations/create_micro_star_tables.php.stub') + ); } return $filesystem->glob($path.'*_create_micro_star_tables.php'); diff --git a/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterDataSynchronizer.php b/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterDataSynchronizer.php index 1427d2212..860312fa4 100644 --- a/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterDataSynchronizer.php +++ b/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterDataSynchronizer.php @@ -70,10 +70,13 @@ public function handle(): void return true; } $adminId = $cluster->manager->id; - $adminAddress = $this->address->whereHasMorph('owner', [Person::class], + $adminAddress = $this->address->whereHasMorph( + 'owner', + [Person::class], function ($q) use ($adminId) { $q->where('id', $adminId); - })->first(); + } + )->first(); if (!$adminAddress) { return true; diff --git a/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterSmsNotifier.php b/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterSmsNotifier.php index 5d8c015a8..00c601e36 100644 --- a/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterSmsNotifier.php +++ b/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterSmsNotifier.php @@ -77,9 +77,11 @@ private function sendTransactionNotifySms($transactionMin, $smsNotifiedCustomers ) { return true; } - $this->smsService->sendSms($smTransaction->thirdPartyTransaction->transaction, + $this->smsService->sendSms( + $smTransaction->thirdPartyTransaction->transaction, SmsTypes::TRANSACTION_CONFIRMATION, - SmsConfigs::class); + SmsConfigs::class + ); $this->smSmsNotifiedCustomerService->createTransactionSmsNotify( $notifyCustomer->customer_id, $smTransaction->id @@ -110,9 +112,11 @@ private function sendLowBalanceWarningNotifySms($customers, $smsNotifiedCustomer ) { return true; } - $this->smsService->sendSms($customer, + $this->smsService->sendSms( + $customer, SparkSmsTypes::LOW_BALANCE_LIMIT_NOTIFIER, - SparkSmsConfig::class); + SparkSmsConfig::class + ); $this->smSmsNotifiedCustomerService->createLowBalanceSmsNotify($customer->customer_id); return true; diff --git a/src/backend/packages/inensus/spark-meter/src/Listeners/SmsListener.php b/src/backend/packages/inensus/spark-meter/src/Listeners/SmsListener.php index 55c71a642..4d1ab4848 100644 --- a/src/backend/packages/inensus/spark-meter/src/Listeners/SmsListener.php +++ b/src/backend/packages/inensus/spark-meter/src/Listeners/SmsListener.php @@ -42,22 +42,28 @@ public function onSmsStored($sender, $message) if ($meterReset !== false) { try { $this->customerService->resetMeter($sparkCustomer); - $this->smsService->sendSms($meter, + $this->smsService->sendSms( + $meter, SparkSmsTypes::METER_RESET_FEEDBACK, - SparkSmsConfig::class); + SparkSmsConfig::class + ); return; } catch (SparkAPIResponseException $exception) { - $this->smsService->sendSms(['meter' => $meter['serial_number'], 'phone' => $sender], + $this->smsService->sendSms( + ['meter' => $meter['serial_number'], 'phone' => $sender], SparkSmsTypes::METER_RESET_FEEDBACK, - SparkSmsConfig::class); + SparkSmsConfig::class + ); } } $meterBalance = strpos(strtolower($message), strtolower($smsFeedbackWords[0]->meter_balance)); if ($meterBalance !== false) { - $this->smsService->sendSms($sparkCustomer, + $this->smsService->sendSms( + $sparkCustomer, SparkSmsTypes::BALANCE_FEEDBACK, - SparkSmsConfig::class); + SparkSmsConfig::class + ); return; } diff --git a/src/backend/packages/inensus/spark-meter/src/Services/CustomerService.php b/src/backend/packages/inensus/spark-meter/src/Services/CustomerService.php index 98f8273b2..ee588a77c 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/CustomerService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/CustomerService.php @@ -595,12 +595,16 @@ public function resetMeter($customer) public function getSparkCustomerWithPhone($phoneNumber) { $person = $this->person::with(['addresses']) - ->whereHas('addresses', static function ($q) use ($phoneNumber) { - $q->where('phone', $phoneNumber); - } + ->whereHas( + 'addresses', + static function ($q) use ($phoneNumber) { + $q->where('phone', $phoneNumber); + } )->first(); - return $this->smCustomer->newQuery()->with(['site', 'mpmPerson.meters.meter'])->where('mpm_customer_id', - $person->id)->first(); + return $this->smCustomer->newQuery()->with(['site', 'mpmPerson.meters.meter'])->where( + 'mpm_customer_id', + $person->id + )->first(); } } diff --git a/src/backend/packages/inensus/spark-meter/src/Services/SmSmsBodyService.php b/src/backend/packages/inensus/spark-meter/src/Services/SmSmsBodyService.php index d2627e98d..7e969571b 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/SmSmsBodyService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/SmSmsBodyService.php @@ -108,7 +108,8 @@ public function createSmsBodies() ], ]; collect($smsBodies)->each(function ($smsBody) { - $this->smsBody->newQuery()->firstOrCreate(['reference' => $smsBody['reference']], + $this->smsBody->newQuery()->firstOrCreate( + ['reference' => $smsBody['reference']], $smsBody ); }); diff --git a/src/backend/packages/inensus/spark-meter/src/Services/SmSmsVariableDefaultValueService.php b/src/backend/packages/inensus/spark-meter/src/Services/SmSmsVariableDefaultValueService.php index 581f77729..7d5d8b41d 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/SmSmsVariableDefaultValueService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/SmSmsVariableDefaultValueService.php @@ -43,7 +43,8 @@ public function createSmsVariableDefaultValues() ], ]; collect($smsVariableDefaultValues)->each(function ($variable) { - $this->smsVariableDefaultValue->newQuery()->firstOrCreate(['variable' => $variable['variable']], + $this->smsVariableDefaultValue->newQuery()->firstOrCreate( + ['variable' => $variable['variable']], $variable ); }); diff --git a/src/backend/packages/inensus/steama-meter/src/Console/Commands/SteamaMeterDataSynchronizer.php b/src/backend/packages/inensus/steama-meter/src/Console/Commands/SteamaMeterDataSynchronizer.php index b4f0a0721..9577305fa 100644 --- a/src/backend/packages/inensus/steama-meter/src/Console/Commands/SteamaMeterDataSynchronizer.php +++ b/src/backend/packages/inensus/steama-meter/src/Console/Commands/SteamaMeterDataSynchronizer.php @@ -89,10 +89,13 @@ public function handle(): void return true; } $adminId = $cluster->manager->id; - $adminAddress = $this->address->whereHasMorph('owner', [Person::class], + $adminAddress = $this->address->whereHasMorph( + 'owner', + [Person::class], function ($q) use ($adminId) { $q->where('id', $adminId); - })->first(); + } + )->first(); if (!$adminAddress) { return true; } diff --git a/src/backend/packages/inensus/steama-meter/src/Console/Commands/SteamaSmsNotifier.php b/src/backend/packages/inensus/steama-meter/src/Console/Commands/SteamaSmsNotifier.php index 90427bfc2..2dfdef747 100644 --- a/src/backend/packages/inensus/steama-meter/src/Console/Commands/SteamaSmsNotifier.php +++ b/src/backend/packages/inensus/steama-meter/src/Console/Commands/SteamaSmsNotifier.php @@ -75,9 +75,11 @@ private function sendTransactionNotifySms($transactionMin, $smsNotifiedCustomers ) { return true; } - $this->smsService->sendSms($steamaTransaction->thirdPartyTransaction->transaction, + $this->smsService->sendSms( + $steamaTransaction->thirdPartyTransaction->transaction, SmsTypes::TRANSACTION_CONFIRMATION, - SmsConfigs::class); + SmsConfigs::class + ); $this->steamaSmsNotifiedCustomerService->createTransactionSmsNotify( $notifyCustomer->customer_id, @@ -109,9 +111,11 @@ private function sendLowBalanceWarningNotifySms($customers, $smsNotifiedCustomer ) { return true; } - $this->smsService->sendSms($customer, + $this->smsService->sendSms( + $customer, SteamaSmsTypes::LOW_BALANCE_LIMIT_NOTIFIER, - SteamaSmsConfig::class); + SteamaSmsConfig::class + ); $this->steamaSmsNotifiedCustomerService->createLowBalanceSmsNotify($customer->customer_id); diff --git a/src/backend/packages/inensus/steama-meter/src/Listeners/SmsListener.php b/src/backend/packages/inensus/steama-meter/src/Listeners/SmsListener.php index 3e6aaccd4..dd591c611 100644 --- a/src/backend/packages/inensus/steama-meter/src/Listeners/SmsListener.php +++ b/src/backend/packages/inensus/steama-meter/src/Listeners/SmsListener.php @@ -39,9 +39,11 @@ public function onSmsStored($sender, $message) $meterBalance = strpos(strtolower($message), strtolower($smsFeedbackWords[0]->meter_balance)); if ($meterBalance !== false) { - $this->smsService->sendSms($steamaCustomer, + $this->smsService->sendSms( + $steamaCustomer, SteamaSmsTypes::BALANCE_FEEDBACK, - SteamaSmsConfig::class); + SteamaSmsConfig::class + ); return; } diff --git a/src/backend/packages/inensus/steama-meter/src/Providers/SteamaMeterServiceProvider.php b/src/backend/packages/inensus/steama-meter/src/Providers/SteamaMeterServiceProvider.php index 09a19e5b0..0112a0e5d 100644 --- a/src/backend/packages/inensus/steama-meter/src/Providers/SteamaMeterServiceProvider.php +++ b/src/backend/packages/inensus/steama-meter/src/Providers/SteamaMeterServiceProvider.php @@ -103,8 +103,10 @@ protected function getMigrationFileName(Filesystem $filesystem): string if (count($filesystem->glob($path.'*_create_steama_tables.php'))) { $file = $filesystem->glob($path.'*_create_steama_tables.php')[0]; - file_put_contents($file, - file_get_contents(__DIR__.'/../../database/migrations/create_steama_tables.php.stub')); + file_put_contents( + $file, + file_get_contents(__DIR__.'/../../database/migrations/create_steama_tables.php.stub') + ); } return $filesystem->glob($path.'*_create_steama_tables.php'); diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaCustomerService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaCustomerService.php index e50587ff9..842154b38 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaCustomerService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaCustomerService.php @@ -544,9 +544,11 @@ private function steamaCustomerHasher($steamaCustomer) public function getSteamaCustomerWithPhone($phoneNumber) { $person = $this->person::with(['addresses']) - ->whereHas('addresses', static function ($q) use ($phoneNumber) { - $q->where('phone', $phoneNumber); - } + ->whereHas( + 'addresses', + static function ($q) use ($phoneNumber) { + $q->where('phone', $phoneNumber); + } )->first(); return $this->customer->newQuery()->with(['site', 'mpmPerson.meters.meter'])->where('mpm_customer_id', $person->id)->first(); diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaMeterReadingService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaMeterReadingService.php index 788f7e6dc..effeb9d4a 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaMeterReadingService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaMeterReadingService.php @@ -18,7 +18,6 @@ class SteamaMeterReadingService public function __construct( SteamaMeter $steamaMeter, SteamaMeterApiClient $steamaApi, - MeterConsumption $meterConsumption, ) { $this->steamaMeter = $steamaMeter; @@ -42,7 +41,8 @@ public function getMeterReadingsThroughHourlyWorkingJob() [ 'meter_id' => $meter->mpm_meter_id, 'reading_date' => Carbon::parse($reading['timestamp'])->format('Y-m-d H:i:s'), - ], [ + ], + [ 'meter_id' => $meter->mpm_meter_id, 'total_consumption' => $reading['reading'], 'consumption' => $reading['usage_amount'], diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSmsVariableDefaultValueService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSmsVariableDefaultValueService.php index b770b2f0b..61eb54c76 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSmsVariableDefaultValueService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSmsVariableDefaultValueService.php @@ -40,8 +40,10 @@ public function createSmsVariableDefaultValues() ]; collect($smsVariableDefaultValues)->each(function ($variable) { $this->smsVariableDefaultValue->newQuery() - ->firstOrCreate(['variable' => $variable['variable']], - $variable); + ->firstOrCreate( + ['variable' => $variable['variable']], + $variable + ); }); } } diff --git a/src/backend/packages/inensus/sun-king-shs/src/Modules/Api/ApiRequests.php b/src/backend/packages/inensus/sun-king-shs/src/Modules/Api/ApiRequests.php index 54f502401..905cb022c 100644 --- a/src/backend/packages/inensus/sun-king-shs/src/Modules/Api/ApiRequests.php +++ b/src/backend/packages/inensus/sun-king-shs/src/Modules/Api/ApiRequests.php @@ -51,13 +51,15 @@ public function get(SunKingCredential $credentials, array $params, string $slug) $url .= $key.'='.$value.'&'; } try { - $request = $this->httpClient->get($url, + $request = $this->httpClient->get( + $url, [ 'headers' => [ 'Accept' => 'application/json', 'Authorization' => 'Bearer '.$credentials->getApiKey(), ], - ]); + ] + ); return json_decode((string) $request->getBody(), true); } catch (GuzzleException $e) { @@ -91,7 +93,8 @@ public function post(SunKingCredential $credentials, array $params, string $slug 'URL :' => $url, 'Body :' => json_encode($params), 'message :' => $e->getMessage(), - ]); + ] + ); throw new SunKingApiResponseException($e->getMessage()); } } diff --git a/src/backend/packages/inensus/sun-king-shs/src/Modules/Api/SunKingSHSApi.php b/src/backend/packages/inensus/sun-king-shs/src/Modules/Api/SunKingSHSApi.php index b16959461..1d4e63e6c 100644 --- a/src/backend/packages/inensus/sun-king-shs/src/Modules/Api/SunKingSHSApi.php +++ b/src/backend/packages/inensus/sun-king-shs/src/Modules/Api/SunKingSHSApi.php @@ -50,8 +50,10 @@ public function chargeDevice(TransactionDataContainer $transactionContainer): ar $this->credentialService->updateCredentials($credentials, $authResponse); $response = $this->apiRequests->post($credentials, $params, self::API_CALL_TOKEN_GENERATION); } catch (SunKingApiResponseException $e) { - $this->credentialService->updateCredentials($credentials, - ['access_token' => null, 'token_expires_in' => null]); + $this->credentialService->updateCredentials( + $credentials, + ['access_token' => null, 'token_expires_in' => null] + ); throw new SunKingApiResponseException($e->getMessage()); } diff --git a/src/backend/packages/inensus/sun-king-shs/src/Providers/SunKingSHSServiceProvider.php b/src/backend/packages/inensus/sun-king-shs/src/Providers/SunKingSHSServiceProvider.php index 5d80f4609..ac5313e48 100644 --- a/src/backend/packages/inensus/sun-king-shs/src/Providers/SunKingSHSServiceProvider.php +++ b/src/backend/packages/inensus/sun-king-shs/src/Providers/SunKingSHSServiceProvider.php @@ -58,8 +58,10 @@ protected function getMigrationFileName(Filesystem $filesystem): string ->flatMap(function ($path) use ($filesystem) { if (count($filesystem->glob($path.'*_create_sun_king_tables.php'))) { $file = $filesystem->glob($path.'*_create_sun_king_tables.php')[0]; - file_put_contents($file, - file_get_contents(__DIR__.'/../../database/migrations/create_sun_king_tables.php.stub')); + file_put_contents( + $file, + file_get_contents(__DIR__.'/../../database/migrations/create_sun_king_tables.php.stub') + ); } return $filesystem->glob($path.'*_create_sun_king_tables.php'); diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Listeners/TransactionListener.php b/src/backend/packages/inensus/swifta-payment-provider/src/Listeners/TransactionListener.php index 35011823b..ca1fa1790 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Listeners/TransactionListener.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Listeners/TransactionListener.php @@ -26,10 +26,12 @@ public function onTransactionSuccess(Transaction $transaction) public function subscribe(Dispatcher $events) { - $events->listen('transaction.successful', + $events->listen( + 'transaction.successful', 'Inensus\SwiftaPaymentProvider\Listeners\TransactionListener@onTransactionSuccess' ); - $events->listen('transaction.failed', + $events->listen( + 'transaction.failed', 'Inensus\SwiftaPaymentProvider\Listeners\TransactionListener@onTransactionFailed' ); } diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Providers/SwiftaServiceProvider.php b/src/backend/packages/inensus/swifta-payment-provider/src/Providers/SwiftaServiceProvider.php index f4ad9e680..b547cc5ac 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Providers/SwiftaServiceProvider.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Providers/SwiftaServiceProvider.php @@ -62,8 +62,10 @@ protected function getMigrationFileName(Filesystem $filesystem): string if (count($filesystem->glob($path.'*_create_swifta_payment_provider_tables.php'))) { $file = $filesystem->glob($path.'*_create_swifta_payment_provider_tables.php')[0]; - file_put_contents($file, - file_get_contents(__DIR__.'/../../database/migrations/create_swifta_payment_provider_tables.php.stub')); + file_put_contents( + $file, + file_get_contents(__DIR__.'/../../database/migrations/create_swifta_payment_provider_tables.php.stub') + ); } return $filesystem->glob($path.'*_create_swifta_payment_provider_tables.php'); diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Tests/Unit/PaymentProcessTests.php b/src/backend/packages/inensus/swifta-payment-provider/src/Tests/Unit/PaymentProcessTests.php index a5af291bd..944ad1744 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Tests/Unit/PaymentProcessTests.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Tests/Unit/PaymentProcessTests.php @@ -75,8 +75,10 @@ private function initializeTransaction() $mesombTransaction = $mesombTransactionService->assignIncomingDataToMesombTransaction($validData); $transaction = $mesombTransactionService->assignIncomingDataToTransaction($validData); - return $mesombTransactionService->associateMesombTransactionWithTransaction($mesombTransaction, - $transaction); + return $mesombTransactionService->associateMesombTransactionWithTransaction( + $mesombTransaction, + $transaction + ); } private function initializeData() diff --git a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketController.php b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketController.php index 53962d162..de5d0e833 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketController.php +++ b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketController.php @@ -23,8 +23,14 @@ public function index(Request $request): TicketResource $agentId = $request->input('agent') ?? null; $customerId = $request->input('customer') ?? null; - return TicketResource::make($this->ticketService->getAll($limit, $status, $agentId, $customerId, $assignedId, - $categoryId)); + return TicketResource::make($this->ticketService->getAll( + $limit, + $status, + $agentId, + $customerId, + $assignedId, + $categoryId + )); } public function show(int $id): TicketResource diff --git a/src/backend/packages/inensus/ticket/src/Services/TicketCommentService.php b/src/backend/packages/inensus/ticket/src/Services/TicketCommentService.php index 20fae6e86..afce1ca6b 100644 --- a/src/backend/packages/inensus/ticket/src/Services/TicketCommentService.php +++ b/src/backend/packages/inensus/ticket/src/Services/TicketCommentService.php @@ -7,10 +7,11 @@ class TicketCommentService { - public function __construct(private Person $person, + public function __construct( + private Person $person, private TicketComment $ticketComment, - private TicketUserService $ticketUserService) - { + private TicketUserService $ticketUserService + ) { } public function createComment(int $ticketId, string $comment, int $ticketUserId): TicketComment diff --git a/src/backend/packages/inensus/ticket/src/Services/TicketOutsourceReportService.php b/src/backend/packages/inensus/ticket/src/Services/TicketOutsourceReportService.php index daa71de3a..35e575208 100644 --- a/src/backend/packages/inensus/ticket/src/Services/TicketOutsourceReportService.php +++ b/src/backend/packages/inensus/ticket/src/Services/TicketOutsourceReportService.php @@ -17,8 +17,8 @@ class TicketOutsourceReportService implements IBaseService { public function __construct( private TicketOutsourceReport $ticketOutsourceReport, - private Spreadsheet $spreadsheet) - { + private Spreadsheet $spreadsheet + ) { } public function getAll(?int $limit = null): Collection|LengthAwarePaginator diff --git a/src/backend/packages/inensus/viber-messaging/src/Http/Controllers/WebhookController.php b/src/backend/packages/inensus/viber-messaging/src/Http/Controllers/WebhookController.php index 43e1cdf32..17f54170c 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Http/Controllers/WebhookController.php +++ b/src/backend/packages/inensus/viber-messaging/src/Http/Controllers/WebhookController.php @@ -69,8 +69,12 @@ public function index(string $slug) $viberContact = $this->viberContactService->getByRegisteredMeterSerialNumber($meterSerialNumber); if ($viberContact) { - $this->answerToCustomer($bot, $botSender, $event, - $this->setAlreadyRegisteredMessage($meterSerialNumber)); + $this->answerToCustomer( + $bot, + $botSender, + $event, + $this->setAlreadyRegisteredMessage($meterSerialNumber) + ); return; } diff --git a/src/backend/packages/inensus/viber-messaging/src/Providers/ViberMessagingServiceProvider.php b/src/backend/packages/inensus/viber-messaging/src/Providers/ViberMessagingServiceProvider.php index bb4a121e9..592815c49 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Providers/ViberMessagingServiceProvider.php +++ b/src/backend/packages/inensus/viber-messaging/src/Providers/ViberMessagingServiceProvider.php @@ -40,7 +40,8 @@ public function publishConfigFiles() public function publishVueFiles() { $this->publishes([ - __DIR__.'/../resources/assets' => resource_path('assets/js/plugins/viber-messaging' + __DIR__.'/../resources/assets' => resource_path( + 'assets/js/plugins/viber-messaging' ), ], 'vue-components'); } diff --git a/src/backend/packages/inensus/viber-messaging/src/Services/ViberContactService.php b/src/backend/packages/inensus/viber-messaging/src/Services/ViberContactService.php index 109883cb8..bbeb6998c 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Services/ViberContactService.php +++ b/src/backend/packages/inensus/viber-messaging/src/Services/ViberContactService.php @@ -13,7 +13,8 @@ class ViberContactService implements IBaseService { public function __construct( - private ViberContact $viberContact, private Person $person, + private ViberContact $viberContact, + private Person $person, ) { } diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Console/Commands/InstallPackage.php index 69345d2f2..6b209a65e 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Console/Commands/InstallPackage.php @@ -11,8 +11,8 @@ class InstallPackage extends Command protected $description = 'Install WaveMoneyPaymentProvider Package'; public function __construct( - private WaveMoneyCredentialService $credentialService) - { + private WaveMoneyCredentialService $credentialService + ) { parent::__construct(); } diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/WaveMoneyPaymentProviderServiceProvider.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/WaveMoneyPaymentProviderServiceProvider.php index 5510558a6..a55c88605 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/WaveMoneyPaymentProviderServiceProvider.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/WaveMoneyPaymentProviderServiceProvider.php @@ -30,8 +30,10 @@ public function boot(Filesystem $filesystem) public function register() { - $this->mergeConfigFrom(__DIR__.'/../../config/wave-money-payment-provider.php', - 'wave-money-payment-provider'); + $this->mergeConfigFrom( + __DIR__.'/../../config/wave-money-payment-provider.php', + 'wave-money-payment-provider' + ); $this->app->register(EventServiceProvider::class); $this->app->register(ObserverServiceProvider::class); $this->app->singleton('WaveMoneyPaymentProvider', WaveMoneyTransactionProvider::class); @@ -48,7 +50,8 @@ public function publishConfigFiles() public function publishVueFiles() { $this->publishes([ - __DIR__.'/../resources/assets' => resource_path('assets/js/plugins/wave-money-payment-provider' + __DIR__.'/../resources/assets' => resource_path( + 'assets/js/plugins/wave-money-payment-provider' ), ], 'vue-components'); } diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/WaveMoneyTransactionProvider.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/WaveMoneyTransactionProvider.php index 8da7aada7..cccac46c3 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/WaveMoneyTransactionProvider.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/WaveMoneyTransactionProvider.php @@ -59,11 +59,13 @@ public function sendResult(bool $requestType, Transaction $transaction) $smsService = app()->make(SmsService::class); $smsService->sendSms($transaction, SmsTypes::TRANSACTION_CONFIRMATION, SmsConfigs::class); } else { - Log::critical('WaveMoney transaction is been cancelled from MicroPowerManager.', + Log::critical( + 'WaveMoney transaction is been cancelled from MicroPowerManager.', [ 'transaction_id' => $transaction->id, 'original_transaction_id' => $transaction->originalTransaction()->first()->id, - ]); + ] + ); } } diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/routes/api.php b/src/backend/packages/inensus/wave-money-payment-provider/src/routes/api.php index 35d48c22f..68f6e4973 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/routes/api.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/routes/api.php @@ -10,8 +10,10 @@ Route::put('/', 'WaveMoneyCredentialController@update'); }); Route::group(['prefix' => 'wave-money-transaction'], function () { - Route::post('/start/{slug}', - ['middleware' => WaveMoneyTransactionMiddleware::class, 'uses' => 'WaveMoneyController@startTransaction']); + Route::post( + '/start/{slug}', + ['middleware' => WaveMoneyTransactionMiddleware::class, 'uses' => 'WaveMoneyController@startTransaction'] + ); Route::post('/callback/{slug}', [ 'middleware' => WaveMoneyTransactionCallbackMiddleware::class, 'uses' => 'WaveMoneyController@transactionCallBack', diff --git a/src/backend/pint.json b/src/backend/pint.json new file mode 100644 index 000000000..d5f9599ec --- /dev/null +++ b/src/backend/pint.json @@ -0,0 +1,11 @@ +{ + "preset": "psr12", + "rules": { + "no_superfluous_phpdoc_tags": false, + "yoda_style": false, + "no_unused_imports": false + }, + "exclude": [ + "bootstrap/cache" + ] +} \ No newline at end of file diff --git a/src/backend/routes/api.php b/src/backend/routes/api.php index 46735e2c8..9fcbeaf2b 100644 --- a/src/backend/routes/api.php +++ b/src/backend/routes/api.php @@ -138,8 +138,10 @@ Route::get('/{person}/period', 'PaymentHistoryController@getPaymentPeriod')->where('personId', '[0-9]+'); Route::get('/debt/{personId}', 'PaymentHistoryController@debts')->where('personId', '[0-9]+'); Route::post('/overview', 'PaymentHistoryController@getPaymentRange'); - Route::get('/{personId}/payments/{period}/{limit?}/{order?}', 'PaymentHistoryController@show')->where('personId', - '[0-9]+'); + Route::get('/{personId}/payments/{period}/{limit?}/{order?}', 'PaymentHistoryController@show')->where( + 'personId', + '[0-9]+' + ); }); // People Route::group(['prefix' => 'people', 'middleware' => 'jwt.verify'], static function () { @@ -259,13 +261,17 @@ Route::put('/{meterSerial}/change-meter-tariff/{tariffId}', 'MeterTariffMeterParameterController@updateForMeter'); }); // Transactions -Route::group(['prefix' => 'transactions', 'middleware' => ['transaction.auth', 'transaction.request']], +Route::group( + ['prefix' => 'transactions', 'middleware' => ['transaction.auth', 'transaction.request']], static function () { Route::post('/airtel', 'TransactionController@store'); Route::post('/vodacom', ['as' => 'vodacomTransaction', 'uses' => 'TransactionController@store']); - Route::post('/agent', - ['as' => 'agent-transaction', 'uses' => 'TransactionController@store', 'middleware' => 'agent.balance']); - }); + Route::post( + '/agent', + ['as' => 'agent-transaction', 'uses' => 'TransactionController@store', 'middleware' => 'agent.balance'] + ); + } +); Route::group(['prefix' => 'time-of-usages', 'middleware' => 'jwt.verify'], static function () { Route::delete('/{timeOfUsageId}', 'TimeOfUsageController@destroy'); diff --git a/src/backend/routes/resources/AgentApp.php b/src/backend/routes/resources/AgentApp.php index 9aefd4fee..2ff9d901f 100644 --- a/src/backend/routes/resources/AgentApp.php +++ b/src/backend/routes/resources/AgentApp.php @@ -16,10 +16,14 @@ Route::group(['prefix' => 'customers'], function () { Route::get('/', 'AgentCustomerController@index'); Route::get('/search', 'AgentCustomerController@search'); - Route::get('/{customerId}/graph/{period}/{limit?}/{order?}', - 'AgentCustomersPaymentHistoryController@show')->where('customerId', '[0-9]+'); - Route::get('/graph/{period}/{limit?}/{order?}', - 'AgentCustomersPaymentHistoryController@index'); + Route::get( + '/{customerId}/graph/{period}/{limit?}/{order?}', + 'AgentCustomersPaymentHistoryController@show' + )->where('customerId', '[0-9]+'); + Route::get( + '/graph/{period}/{limit?}/{order?}', + 'AgentCustomersPaymentHistoryController@index' + ); }); Route::group(['prefix' => 'transactions'], function () { Route::get('/', 'AgentTransactionsController@index'); diff --git a/src/backend/routes/web.php b/src/backend/routes/web.php index dc718d7ff..26e6b9cf0 100644 --- a/src/backend/routes/web.php +++ b/src/backend/routes/web.php @@ -21,16 +21,19 @@ Route::get('/', 'HomeController@index')->name('home'); -Route::group(['prefix' => '/jobs', 'middleware' => 'auth'], +Route::group( + ['prefix' => '/jobs', 'middleware' => 'auth'], static function () { Route::get('/token/{id}/{recreate?}', static function () { $id = request('id'); $recreate = (bool) request('recreate'); TokenProcessor::dispatch( TransactionDataContainer::initialize(Transaction::find($id)), - $recreate, 1)->allOnConnection('redis')->onQueue( - config('services.queues.token') - ); + $recreate, + 1 + )->allOnConnection('redis')->onQueue( + config('services.queues.token') + ); })->where('id', '[0-9]+')->name('jobs.token'); Route::get('energy/{id}', function () { @@ -38,7 +41,8 @@ static function () { $transaction = Transaction::find($id); EnergyTransactionProcessor::dispatch($transaction)->allOnConnection('redis')->onQueue('energy_payment'); }); - }); + } +); /* * the group in which events can be fired manually again. diff --git a/src/backend/tests/Feature/AgentAppTicketsTest.php b/src/backend/tests/Feature/AgentAppTicketsTest.php index 0e817f6a6..3731acf6d 100644 --- a/src/backend/tests/Feature/AgentAppTicketsTest.php +++ b/src/backend/tests/Feature/AgentAppTicketsTest.php @@ -54,8 +54,10 @@ public function testAgentGetsTicketCustomerId() $this->createTicketCard(); $ticketCount = 1; $this->createTicket($ticketCount, 1, $this->person->id, $this->agent->id); - $response = $this->actingAs($this->agent)->get(sprintf('/api/app/agents/ticket/customer/%s', - $this->person->id)); + $response = $this->actingAs($this->agent)->get(sprintf( + '/api/app/agents/ticket/customer/%s', + $this->person->id + )); $response->assertStatus(200); $this->assertEquals($this->ticket->id, $response['data']['data'][0]['id']); $this->assertEquals($this->agent->id, $response['data']['data'][0]['creator_id']); diff --git a/src/backend/tests/Feature/AgentCommissionTest.php b/src/backend/tests/Feature/AgentCommissionTest.php index 305d29917..3a406b84f 100644 --- a/src/backend/tests/Feature/AgentCommissionTest.php +++ b/src/backend/tests/Feature/AgentCommissionTest.php @@ -50,8 +50,10 @@ public function testUserCanUpdateAnAgentCommission() 'risk_balance' => -20000, ]; - $response = $this->actingAs($this->user)->put(sprintf('/api/agents/commissions/%s', - $this->agentCommissions[0]->id), $putData); + $response = $this->actingAs($this->user)->put(sprintf( + '/api/agents/commissions/%s', + $this->agentCommissions[0]->id + ), $putData); $response->assertStatus(200); $this->assertEquals($putData['name'], $response['data']['name']); $this->assertEquals($putData['energy_commission'], $response['data']['energy_commission']); diff --git a/src/backend/tests/Feature/ClusterRevenueTest.php b/src/backend/tests/Feature/ClusterRevenueTest.php index 746b6d3d3..598f06385 100644 --- a/src/backend/tests/Feature/ClusterRevenueTest.php +++ b/src/backend/tests/Feature/ClusterRevenueTest.php @@ -81,8 +81,10 @@ public function testUserGetsRevenueInConnectionTypesAnalysisForCluster() $meterCount = 2; $transactionCount = 1; $this->createTestData($clusterCount, $meterCount, $transactionCount); - $response = $this->actingAs($this->user)->get(sprintf('/api/clusters/%s/revenue/analysis', - $this->clusterIds[0])); + $response = $this->actingAs($this->user)->get(sprintf( + '/api/clusters/%s/revenue/analysis', + $this->clusterIds[0] + )); $response->assertStatus(200); } @@ -92,8 +94,10 @@ public function testUserGetsMiniGridRevenueMonthlyForCluster() $meterCount = 1; $transactionCount = 1; $this->createTestData($clusterCount, $meterCount, $transactionCount); - $response = $this->actingAs($this->user)->get(sprintf('/api/clusters/%s/cities-revenue', - $this->clusterIds[0])); + $response = $this->actingAs($this->user)->get(sprintf( + '/api/clusters/%s/cities-revenue', + $this->clusterIds[0] + )); $response->assertStatus(200); $totalRevenue = array_reduce($response['data'], function ($acc, $curr) { return $acc + $curr['totalRevenue']; @@ -107,8 +111,10 @@ public function testUserGetsMiniGridRevenueWeeklyForCluster() $meterCount = 1; $transactionCount = 1; $this->createTestData($clusterCount, $meterCount, $transactionCount); - $response = $this->actingAs($this->user)->get(sprintf('/api/clusters/%s/cities-revenue?period=weekly', - $this->clusterIds[0])); + $response = $this->actingAs($this->user)->get(sprintf( + '/api/clusters/%s/cities-revenue?period=weekly', + $this->clusterIds[0] + )); $response->assertStatus(200); $totalRevenue = array_reduce($response['data'], function ($acc, $curr) { return $acc + $curr['totalRevenue']; diff --git a/src/backend/tests/Feature/ConnectionGroupTest.php b/src/backend/tests/Feature/ConnectionGroupTest.php index fc0c17d68..a1fbfdd70 100644 --- a/src/backend/tests/Feature/ConnectionGroupTest.php +++ b/src/backend/tests/Feature/ConnectionGroupTest.php @@ -55,8 +55,10 @@ public function testUserUpdatesAConnectionGroup() $connectionGroupCount = 1; $this->createTestData($connectionGroupCount); $connectionGroupData = ['name' => 'Updated Connection Group']; - $response = $this->actingAs($this->user)->put(sprintf('/api/connection-groups/%s', - $this->connectonGroupIds[0]), $connectionGroupData); + $response = $this->actingAs($this->user)->put(sprintf( + '/api/connection-groups/%s', + $this->connectonGroupIds[0] + ), $connectionGroupData); $response->assertStatus(200); $this->assertEquals($response['data']['name'], $connectionGroupData['name']); } diff --git a/src/backend/tests/Feature/ConnectionTypeTest.php b/src/backend/tests/Feature/ConnectionTypeTest.php index 5a2d0c64b..0eddd1829 100644 --- a/src/backend/tests/Feature/ConnectionTypeTest.php +++ b/src/backend/tests/Feature/ConnectionTypeTest.php @@ -55,8 +55,10 @@ public function testUserUpdatesAConnectionType() $connectionTypeCount = 1; $this->createTestData($connectionTypeCount); $connectionTypeData = ['name' => 'Updated Connection Type']; - $response = $this->actingAs($this->user)->put(sprintf('/api/connection-types/%s', - $this->connectonTypeIds[0]), $connectionTypeData); + $response = $this->actingAs($this->user)->put(sprintf( + '/api/connection-types/%s', + $this->connectonTypeIds[0] + ), $connectionTypeData); $response->assertStatus(200); $this->assertEquals($response['data']['name'], $connectionTypeData['name']); } diff --git a/src/backend/tests/Feature/MeterTariffTest.php b/src/backend/tests/Feature/MeterTariffTest.php index 43913f13d..3844fe18b 100644 --- a/src/backend/tests/Feature/MeterTariffTest.php +++ b/src/backend/tests/Feature/MeterTariffTest.php @@ -69,8 +69,10 @@ public function testUserUpdatesAMeterTariff() 'access_rate_amount' => 100, ], ]; - $response = $this->actingAs($this->user)->put(sprintf('/api/tariffs/%s', - $this->meterTariffs[0]->id), $tariffData); + $response = $this->actingAs($this->user)->put(sprintf( + '/api/tariffs/%s', + $this->meterTariffs[0]->id + ), $tariffData); $response->assertStatus(200); $this->assertEquals($response['data']['name'], $tariffData['name']); $this->assertEquals($this->meterTariffs[0]->id, SocialTariff::query()->first()->tariff_id); @@ -193,8 +195,10 @@ public function testUserGetsMeterListForATariff(): void $this->createConnectionType(); $meterCount = 5; $this->createMeter($meterCount); - $response = $this->actingAs($this->user)->get(sprintf('/api/tariffs/%s/usage-count', - $this->meterTariffs[0]->id)); + $response = $this->actingAs($this->user)->get(sprintf( + '/api/tariffs/%s/usage-count', + $this->meterTariffs[0]->id + )); $response->assertStatus(200); diff --git a/src/backend/tests/Feature/MeterTest.php b/src/backend/tests/Feature/MeterTest.php index 8bd4ab7e9..248ef1204 100644 --- a/src/backend/tests/Feature/MeterTest.php +++ b/src/backend/tests/Feature/MeterTest.php @@ -105,8 +105,10 @@ public function testUserSearchesMetersBySerialNumber() public function testUserSearchesMeterByTariffName() { $meter = $this->getMeter(); - $response = $this->actingAs($this->user)->get(sprintf('/api/meters/search?term=%s', - $this->meterTariff->name)); + $response = $this->actingAs($this->user)->get(sprintf( + '/api/meters/search?term=%s', + $this->meterTariff->name + )); $response->assertStatus(200); $this->assertEquals($response['data'][0]['id'], $meter->id); } @@ -125,8 +127,10 @@ public function testUserUpdatesMetersGeolocation() public function testUserGetsPersonMeters() { $meter = $this->getMeter(); - $response = $this->actingAs($this->user)->get(sprintf('/api/people/%s/meters', - $this->person->id)); + $response = $this->actingAs($this->user)->get(sprintf( + '/api/people/%s/meters', + $this->person->id + )); $response->assertStatus(200); $metersCount = Meter::query()->get()->count(); $this->assertEquals(count($response['data']['meters']), $metersCount); @@ -135,16 +139,20 @@ public function testUserGetsPersonMeters() public function testUserGetsPersonMetersGeographicalInformation() { $this->createMeterWithGeo(); - $response = $this->actingAs($this->user)->get(sprintf('/api/people/%s/meters/geo', - $this->person->id)); + $response = $this->actingAs($this->user)->get(sprintf( + '/api/people/%s/meters/geo', + $this->person->id + )); $response->assertStatus(200); } public function testUserGetsMetersTransactions() { $meter = $this->createMeterWithTransaction(); - $response = $this->actingAs($this->user)->get(sprintf('/api/meters/%s/transactions', - $meter->serial_number)); + $response = $this->actingAs($this->user)->get(sprintf( + '/api/meters/%s/transactions', + $meter->serial_number + )); $response->assertStatus(200); $this->assertEquals($response['data'][0]['amount'], $this->transaction->amount); $this->assertEquals($response['data'][0]['id'], $this->transaction->id); @@ -153,8 +161,10 @@ public function testUserGetsMetersTransactions() public function testUserGetsMeterRevenueBySerialNumber() { $meter = $this->createMeterWithTransaction(); - $response = $this->actingAs($this->user)->get(sprintf('/api/meters/%s/revenue', - $meter->serial_number)); + $response = $this->actingAs($this->user)->get(sprintf( + '/api/meters/%s/revenue', + $meter->serial_number + )); $response->assertStatus(200); $this->assertEquals($response['data']['revenue'], $this->transaction->amount); } @@ -163,8 +173,12 @@ public function testUserGetsMeterConsumptions() { $meter = $this->createMeterWithTransaction(); $consumption = MeterConsumptionFactory::new()->create(); - $response = $this->actingAs($this->user)->get(sprintf('/api/meters/%s/consumptions/%s/%s', - $meter->serial_number, Carbon::now()->subDays(3)->format('Y-m-d'), Carbon::now()->format('Y-m-d'))); + $response = $this->actingAs($this->user)->get(sprintf( + '/api/meters/%s/consumptions/%s/%s', + $meter->serial_number, + Carbon::now()->subDays(3)->format('Y-m-d'), + Carbon::now()->format('Y-m-d') + )); $response->assertStatus(200); $this->assertEquals($response['data'][0]['consumption'], $consumption->consumption); $this->assertEquals($response['data'][0]['meter_id'], $meter->id); diff --git a/src/backend/tests/Feature/MeterTypeTest.php b/src/backend/tests/Feature/MeterTypeTest.php index a0dab9c82..6444a5519 100644 --- a/src/backend/tests/Feature/MeterTypeTest.php +++ b/src/backend/tests/Feature/MeterTypeTest.php @@ -72,8 +72,10 @@ public function testUserUpdatesAMeterType() 'phase' => 3, 'max_current' => 15, ]; - $response = $this->actingAs($this->user)->put(sprintf('/api/meter-types/%s', - $this->meterTypes[0]->id), $meterTypeData); + $response = $this->actingAs($this->user)->put(sprintf( + '/api/meter-types/%s', + $this->meterTypes[0]->id + ), $meterTypeData); $response->assertStatus(200); $this->assertEquals($response['data']['max_current'], $meterTypeData['max_current']); $this->assertEquals($response['data']['phase'], $meterTypeData['phase']); @@ -90,8 +92,10 @@ public function testUserGetsMeterTypesWithMeterRelationByMeterTypeId() $this->createMeterManufacturer(); $this->createPerson(); $this->createMetersWithDifferentMeterTypes(); - $response = $this->actingAs($this->user)->get(sprintf('/api/meter-types/%s/list', - $this->meterTypes[0]->id)); + $response = $this->actingAs($this->user)->get(sprintf( + '/api/meter-types/%s/list', + $this->meterTypes[0]->id + )); $response->assertStatus(200); $this->assertEquals(count($response['data']['meters']), 1); } diff --git a/src/backend/tests/Feature/SubConnectionTypeTest.php b/src/backend/tests/Feature/SubConnectionTypeTest.php index b6011130c..5fe69e2f6 100644 --- a/src/backend/tests/Feature/SubConnectionTypeTest.php +++ b/src/backend/tests/Feature/SubConnectionTypeTest.php @@ -30,8 +30,10 @@ public function testUserGetsSubConnectionTypesByConnectionTypeId() $this->createTestData(); $this->createMeterTariff($meterTariffCount); $this->createConnectionType($connectionTypeCount, $subConnectionTypeCount); - $response = $this->actingAs($this->user)->get(sprintf('/api/sub-connection-types/%s', - $this->connectonTypes[0]->id)); + $response = $this->actingAs($this->user)->get(sprintf( + '/api/sub-connection-types/%s', + $this->connectonTypes[0]->id + )); $response->assertStatus(200); $this->assertEquals($response['data'][0]['connection_type_id'], $this->connectonTypes[0]->id); } @@ -63,8 +65,10 @@ public function testUserUpdatesASubConnectionType() $this->createMeterTariff($meterTariffCount); $this->createConnectionType($connectionTypeCount, $subConnectionTypeCount); $subConnectionTypeData = ['name' => 'Updated SubConnection Type']; - $response = $this->actingAs($this->user)->put(sprintf('/api/sub-connection-types/%s', - $this->subConnectionTypes[0]->id), $subConnectionTypeData); + $response = $this->actingAs($this->user)->put(sprintf( + '/api/sub-connection-types/%s', + $this->subConnectionTypes[0]->id + ), $subConnectionTypeData); $response->assertStatus(200); $this->assertEquals($response['data']['name'], $subConnectionTypeData['name']); } diff --git a/src/backend/tests/Feature/UserResourceTest.php b/src/backend/tests/Feature/UserResourceTest.php index f7aefeb5d..d5e313249 100644 --- a/src/backend/tests/Feature/UserResourceTest.php +++ b/src/backend/tests/Feature/UserResourceTest.php @@ -65,12 +65,14 @@ public function updateUserPassword(): void $user = User::query()->get()[1]; - $response = $this->actingAs($user)->put('/api/users/password/'.$user->id, + $response = $this->actingAs($user)->put( + '/api/users/password/'.$user->id, [ 'id' => $user->id, 'password' => '12345', 'confirm_password' => '12345', - ]); + ] + ); $response->assertStatus(200); $user = User::query()->get()[1]; $this->assertTrue(Hash::check('12345', $user->password)); diff --git a/src/backend/tests/RefreshMultipleDatabases.php b/src/backend/tests/RefreshMultipleDatabases.php index b290e76f8..049c2b129 100644 --- a/src/backend/tests/RefreshMultipleDatabases.php +++ b/src/backend/tests/RefreshMultipleDatabases.php @@ -13,10 +13,14 @@ trait RefreshMultipleDatabases protected function refreshInMemoryDatabase() { - Artisan::call('migrate:fresh', - ['--database' => 'micro_power_manager', '--path' => '/database/migrations/base']); - Artisan::call('migrate:fresh', - ['--database' => 'test_company_db', '--path' => '/database/migrations/test_company_db']); + Artisan::call( + 'migrate:fresh', + ['--database' => 'micro_power_manager', '--path' => '/database/migrations/base'] + ); + Artisan::call( + 'migrate:fresh', + ['--database' => 'test_company_db', '--path' => '/database/migrations/test_company_db'] + ); app(Kernel::class)->setArtisan(null); $this->app[Kernel::class]->setArtisan(null); } @@ -24,11 +28,15 @@ protected function refreshInMemoryDatabase() protected function refreshTestDatabase() { if (!RefreshDatabaseState::$migrated) { - Artisan::call('migrate:fresh', - ['--database' => 'micro_power_manager', '--path' => '/database/migrations/base']); - - Artisan::call('migrate:fresh', - ['--database' => 'test_company_db', '--path' => '/database/migrations/test_company_db']); + Artisan::call( + 'migrate:fresh', + ['--database' => 'micro_power_manager', '--path' => '/database/migrations/base'] + ); + + Artisan::call( + 'migrate:fresh', + ['--database' => 'test_company_db', '--path' => '/database/migrations/test_company_db'] + ); app(Kernel::class)->setArtisan(null); diff --git a/src/backend/tests/Unit/Transaction/VodacomTransactionTest.php b/src/backend/tests/Unit/Transaction/VodacomTransactionTest.php index 8989e8338..a8b2fcf36 100644 --- a/src/backend/tests/Unit/Transaction/VodacomTransactionTest.php +++ b/src/backend/tests/Unit/Transaction/VodacomTransactionTest.php @@ -21,8 +21,14 @@ class VodacomTransactionTest extends TestCase */ public function testTransactionSentFromUnknownIpAddress(): void { - $request = Request::create(URL::route('vodacomTransaction'), 'POST', [], [], [], - ['REMOTE_ADDR' => '127.0.0.2']); + $request = Request::create( + URL::route('vodacomTransaction'), + 'POST', + [], + [], + [], + ['REMOTE_ADDR' => '127.0.0.2'] + ); $middleWare = new Transaction(); $response = $middleWare->handle($request, function () { @@ -33,8 +39,14 @@ public function testTransactionSentFromUnknownIpAddress(): void public function testTransactionSentFromWhiteListedIpAddress(): void { - $request = Request::create(URL::route('vodacomTransaction'), 'POST', [], [], [], - ['REMOTE_ADDR' => config('services.vodacom.ips')[0]]); + $request = Request::create( + URL::route('vodacomTransaction'), + 'POST', + [], + [], + [], + ['REMOTE_ADDR' => config('services.vodacom.ips')[0]] + ); $middleWare = new Transaction(); From cea21f5301a1c751ae58a5bc171ef56a309fdeb6 Mon Sep 17 00:00:00 2001 From: munyanezaarmel Date: Wed, 20 Nov 2024 07:45:40 +0000 Subject: [PATCH 2/8] Fixes coding style --- .../Commands/AbstractSharedCommand.php | 1 + .../Console/Commands/AccessRateChecker.php | 3 +- .../app/Console/Commands/AddMeterAddress.php | 1 + .../app/Console/Commands/AddPlugin.php | 1 + .../Commands/AdminPasswordResetter.php | 1 + .../app/Console/Commands/AssetRateChecker.php | 1 + .../app/Console/Commands/BackupFull.php | 1 + .../Console/Commands/BackupTenantDatabase.php | 1 + .../ClustersDashboardCacheDataGenerator.php | 1 + .../Commands/CreateDummyCompanyWithData.php | 4 + .../app/Console/Commands/DummyDataCreator.php | 3 +- .../Commands/EcosysCustomerDatabaseParser.php | 1 + .../Console/Commands/MakeMigrationTenant.php | 1 + .../app/Console/Commands/MigrateTenant.php | 1 + .../Console/Commands/MigrateTenantDrop.php | 1 + .../Console/Commands/MigrateTenantFresh.php | 1 + .../Console/Commands/MigrateTenantInstall.php | 1 + .../Console/Commands/MigrateTenantRefresh.php | 1 + .../Console/Commands/MigrateTenantReset.php | 1 + .../Commands/MigrateTenantRollback.php | 1 + .../Console/Commands/MigrateTenantStatus.php | 1 + .../Commands/OutsourceReportGenerator.php | 1 + .../app/Console/Commands/PackageGenerator.php | 1 + .../app/Console/Commands/ReportGenerator.php | 1 + .../app/Console/Commands/RoutesGenerator.php | 5 +- .../SendNonPayingCustomerMailCommand.php | 2 + .../ShiftEcosysSHSdataForDeviceFeature.php | 1 + src/backend/app/Console/Kernel.php | 1 - src/backend/app/Events/AssetPersonCreated.php | 2 - src/backend/app/Events/ClusterEvent.php | 8 +- src/backend/app/Events/HistoryEvent.php | 8 +- src/backend/app/Events/NewTicket.php | 2 - src/backend/app/Events/PersonDeleting.php | 2 - .../AccessRates/NoAccessRateFound.php | 4 +- .../ActiveSheetNotCreatedException.php | 4 +- .../Exceptions/AgentRiskBalanceExceeded.php | 4 +- .../CustomerGroup/CustomerGroupNotFound.php | 4 +- .../Device/DeviceIsNotAssignedToCustomer.php | 4 +- .../DownPaymentBiggerThanAmountException.php | 4 +- ...ymentBiggerThanAppliancePriceException.php | 4 +- .../DownPaymentNotFoundException.php | 4 +- .../app/Exceptions/GeoFormatException.php | 4 +- src/backend/app/Exceptions/Handler.php | 6 +- .../Exceptions/InvalidBingApiKeyException.php | 4 +- .../app/Exceptions/MailNotSentException.php | 4 +- .../ApiCallDoesNotSupportedException.php | 4 +- .../Manufacturer/MeterIsNotReadable.php | 4 +- .../MeterParameter/MeterParameterNotFound.php | 4 +- .../Meters/MeterIsNotAssignedToCustomer.php | 4 +- .../app/Exceptions/Meters/MeterIsNotInUse.php | 4 +- .../MissingSmsReferencesException.php | 4 +- .../NotificationSendFailedException.php | 4 +- ...ntAmountBiggerThanTotalRemainingAmount.php | 4 +- .../PaymentAmountSmallerThanZero.php | 4 +- .../PaymentProviderNotIdentified.php | 4 +- .../app/Exceptions/PurchaseNotProcessable.php | 4 +- .../SmsAndroidSettingNotExistingException.php | 4 +- .../SmsBodyParserNotExtendedException.php | 4 +- .../Exceptions/SmsTypeNotFoundException.php | 4 +- .../SpreadSheetNotCreatedException.php | 4 +- .../SpreadSheetNotSavedException.php | 4 +- .../app/Exceptions/Tariffs/TariffNotFound.php | 4 +- .../TransactionAmountNotEnoughException.php | 4 +- .../TransactionAmountNotFoundException.php | 4 +- .../TransactionFetchingException.php | 4 +- ...dForProcessingIncomingRequestException.php | 4 +- .../TransactionNotInitializedException.php | 4 +- .../app/Exceptions/TrelloAPIException.php | 4 +- .../UserAddressNorFoundException.php | 4 +- .../app/Exceptions/ValidationException.php | 4 +- .../Exceptions/VodacomHeartBeatException.php | 4 +- .../Exceptions/WeatherParametersMissing.php | 4 +- .../Exceptions/WeatherProviderUnreachable.php | 4 +- src/backend/app/Helpers/MailHelper.php | 9 +- .../app/Helpers/MailHelperInterface.php | 5 +- src/backend/app/Helpers/MailHelperMock.php | 15 +- src/backend/app/Helpers/PowerConverter.php | 2 +- src/backend/app/Helpers/RelationsManager.php | 2 +- .../Http/Controllers/AddressController.php | 3 +- .../AgentAssignedApplianceWebController.php | 9 +- .../AgentAssignedAppliancesController.php | 4 +- .../Http/Controllers/AgentAuthController.php | 7 +- .../Controllers/AgentBalanceController.php | 3 +- .../AgentBalanceHistoryController.php | 21 +- .../AgentBalanceHistoryWebController.php | 4 +- .../Controllers/AgentChargeWebController.php | 3 +- .../AgentCommissionWebController.php | 16 +- .../Controllers/AgentCustomerController.php | 4 +- .../AgentCustomerTicketController.php | 4 +- ...AgentCustomersPaymentHistoryController.php | 3 +- ...AgentDashboardBalanceHistoryController.php | 3 +- .../AgentDashboardBoxesController.php | 3 +- .../AgentDashboardRevenueController.php | 3 +- .../Controllers/AgentFirebaseController.php | 3 +- .../AgentReceiptDetailController.php | 4 +- .../Controllers/AgentReceiptWebController.php | 10 +- .../AgentSoldApplianceController.php | 4 +- .../AgentSoldApplianceWebController.php | 4 +- .../Controllers/AgentTicketController.php | 3 +- .../AgentTransactionWebController.php | 4 +- .../AgentTransactionsController.php | 3 +- .../Http/Controllers/AgentWebController.php | 3 +- .../AppliancePaymentController.php | 4 +- .../app/Http/Controllers/AssetController.php | 6 +- .../Controllers/AssetPersonController.php | 16 +- .../Http/Controllers/AssetRateController.php | 8 +- .../Http/Controllers/AssetTypeController.php | 13 - .../app/Http/Controllers/AuthController.php | 5 +- .../app/Http/Controllers/CityController.php | 3 +- .../Http/Controllers/ClusterController.php | 3 +- .../ClusterMiniGridRevenueController.php | 3 +- .../ClusterRevenueAnalysisController.php | 3 +- .../Controllers/ClusterRevenueController.php | 3 +- .../ClustersDashboardCacheDataController.php | 3 +- .../Http/Controllers/CompanyController.php | 5 +- .../Controllers/ConnectionGroupController.php | 3 +- .../Controllers/ConnectionTypeController.php | 4 +- .../CustomerRegistrationAppController.php | 4 +- .../Controllers/DeviceAddressController.php | 3 +- .../app/Http/Controllers/DeviceController.php | 4 +- .../app/Http/Controllers/EBikeController.php | 3 +- .../app/Http/Controllers/HomeController.php | 4 +- .../Controllers/MailSettingsController.php | 1 + .../Controllers/MainSettingsController.php | 4 +- .../Controllers/MaintenanceUserController.php | 8 +- .../Controllers/ManufacturerController.php | 13 +- .../MeterConsumptionController.php | 9 +- .../app/Http/Controllers/MeterController.php | 18 +- ...MeterGeographicalInformationController.php | 12 +- .../MeterPaymentHistoryController.php | 3 +- .../Controllers/MeterRevenueController.php | 7 +- .../Controllers/MeterTariffController.php | 11 +- .../MeterTariffMeterParameterController.php | 13 +- .../Http/Controllers/MeterTypeController.php | 17 +- .../Controllers/MeterTypeMeterController.php | 7 +- .../Http/Controllers/MiniGridController.php | 17 +- .../MiniGridDashboardCacheController.php | 4 +- .../Controllers/MiniGridDeviceController.php | 3 +- .../Controllers/MiniGridRevenueController.php | 3 +- .../Http/Controllers/MpmPluginController.php | 4 +- .../OutstandingDebtsExportController.php | 3 +- .../Controllers/PaymentHistoryController.php | 20 +- .../Controllers/PersonAddressesController.php | 7 +- .../app/Http/Controllers/PersonController.php | 23 +- .../Controllers/PersonDocumentController.php | 4 +- .../Controllers/PersonMeterController.php | 7 +- .../app/Http/Controllers/PluginController.php | 7 +- .../RegistrationTailController.php | 4 +- .../app/Http/Controllers/ReportController.php | 2 +- src/backend/app/Http/Controllers/Reports.php | 94 ++----- .../Controllers/RestrictionController.php | 9 +- .../Http/Controllers/RevenueController.php | 8 +- .../app/Http/Controllers/SmsController.php | 7 +- .../Controllers/SolarHomeSystemController.php | 3 +- .../SubConnectionTypeController.php | 12 +- .../app/Http/Controllers/TargetController.php | 3 +- .../Controllers/TicketSettingsController.php | 4 +- .../Controllers/TimeOfUsageController.php | 3 +- .../TransactionAdvancedController.php | 3 +- .../Controllers/TransactionController.php | 3 +- .../TransactionExportController.php | 3 +- .../Http/Controllers/UsageTypeController.php | 4 +- .../app/Http/Controllers/UserController.php | 3 +- .../Controllers/UserPasswordController.php | 2 +- .../VodacomTransactionController.php | 4 - .../Middleware/AgentBalanceMiddleware.php | 11 +- .../app/Http/Middleware/JwtMiddleware.php | 6 - .../Middleware/RedirectIfAuthenticated.php | 6 +- .../Http/Middleware/RestrictionMiddleware.php | 11 +- .../Http/Middleware/TransactionRequest.php | 4 +- ...serDefaultDatabaseConnectionMiddleware.php | 7 +- .../Requests/AdminResetPasswordRequest.php | 2 - src/backend/app/Http/Requests/CityRequest.php | 9 +- .../app/Http/Requests/ClusterRequest.php | 4 - .../Requests/CompanyRegistrationRequest.php | 2 - .../app/Http/Requests/StoreEBikeRequest.php | 2 - .../Http/Requests/StoreMiniGridRequest.php | 3 +- .../Requests/StoreSolarHomeSystemRequest.php | 2 - .../SubConnectionTypeCreateRequest.php | 4 - .../app/Http/Resources/ApiResource.php | 3 +- .../app/Http/Resources/MeterResource.php | 3 +- .../app/Http/Resources/MeterTypeResource.php | 3 +- .../Resources/SmsSearchResultResource.php | 10 +- .../app/Http/Resources/UserResource.php | 3 +- src/backend/app/Jobs/AbstractJob.php | 1 + .../Jobs/ApplianceTransactionProcessor.php | 1 + .../app/Jobs/EnergyTransactionProcessor.php | 3 +- src/backend/app/Jobs/HearthBeat.php | 4 +- src/backend/app/Jobs/MeterReader.php | 6 +- src/backend/app/Jobs/ProcessPayment.php | 4 +- src/backend/app/Jobs/SmsLoadBalancer.php | 4 +- src/backend/app/Jobs/SmsProcessor.php | 6 +- src/backend/app/Jobs/TokenProcessor.php | 7 +- src/backend/app/Jobs/UpdatePiggyBankEntry.php | 2 +- src/backend/app/Lib/IManufacturerAPI.php | 5 - src/backend/app/Lib/IMeterReader.php | 10 +- src/backend/app/Lib/ISmsProvider.php | 4 - .../app/Listeners/AccessRateListener.php | 4 +- .../app/Listeners/ClusterGeoListener.php | 14 +- src/backend/app/Listeners/HistoryListener.php | 8 +- src/backend/app/Listeners/MeterListener.php | 4 - src/backend/app/Listeners/PaymentListener.php | 18 +- .../app/Listeners/PaymentPeriodListener.php | 6 +- src/backend/app/Listeners/SmsListener.php | 6 +- .../app/Listeners/SoldApplianceListener.php | 3 +- src/backend/app/Listeners/TokenListener.php | 4 +- .../app/ManufacturerApi/CalinReadMeter.php | 36 +-- src/backend/app/Misc/LoanDataContainer.php | 9 +- .../app/Misc/SoldApplianceDataContainer.php | 3 +- .../app/Misc/TransactionDataContainer.php | 13 + src/backend/app/Models/Address/Address.php | 10 +- src/backend/app/Models/Admin.php | 4 +- src/backend/app/Models/Agent.php | 14 +- .../app/Models/AgentAssignedAppliances.php | 1 + src/backend/app/Models/AgentCommission.php | 2 +- src/backend/app/Models/Asset.php | 1 + src/backend/app/Models/AssetRate.php | 6 +- src/backend/app/Models/Base/BaseModel.php | 1 + src/backend/app/Models/Base/BaseModelCore.php | 1 + src/backend/app/Models/City.php | 8 +- src/backend/app/Models/Cluster.php | 2 +- src/backend/app/Models/Company.php | 2 +- src/backend/app/Models/CompanyDatabase.php | 2 + src/backend/app/Models/CompanyJob.php | 2 + src/backend/app/Models/Country.php | 3 - src/backend/app/Models/DatabaseProxy.php | 2 + src/backend/app/Models/EBike.php | 1 + src/backend/app/Models/History.php | 8 +- src/backend/app/Models/MailSettings.php | 4 +- src/backend/app/Models/MainSettings.php | 10 +- src/backend/app/Models/Manufacturer.php | 1 + src/backend/app/Models/MapSettings.php | 6 +- src/backend/app/Models/Meter/Meter.php | 6 +- .../app/Models/Meter/MeterConsumption.php | 10 +- .../app/Models/Meter/MeterParameter.php | 2 + src/backend/app/Models/Meter/MeterTariff.php | 15 +- src/backend/app/Models/Meter/MeterToken.php | 4 +- src/backend/app/Models/Meter/MeterType.php | 6 +- src/backend/app/Models/MiniGrid.php | 7 +- src/backend/app/Models/MpmPlugin.php | 16 ++ .../app/Models/Payment/PaymentProfile.php | 4 +- src/backend/app/Models/PaymentHistory.php | 4 +- src/backend/app/Models/Person/Person.php | 12 +- src/backend/app/Models/Plugins.php | 1 + src/backend/app/Models/Report.php | 6 +- src/backend/app/Models/Restriction.php | 6 +- .../app/Models/Role/RoleDefinition.php | 1 + src/backend/app/Models/Role/Roles.php | 3 - src/backend/app/Models/Sms.php | 12 +- .../app/Models/SocialTariffPiggyBank.php | 4 +- src/backend/app/Models/SolarHomeSystem.php | 1 + src/backend/app/Models/SubTarget.php | 6 - src/backend/app/Models/Subscription.php | 4 +- src/backend/app/Models/Target.php | 10 +- .../app/Models/TariffPricingComponent.php | 6 +- src/backend/app/Models/TicketSettings.php | 6 +- .../Models/Transaction/AgentTransaction.php | 2 +- .../Models/Transaction/AirtelTransaction.php | 9 +- .../app/Models/Transaction/Transaction.php | 5 +- .../Models/Transaction/VodacomTransaction.php | 2 +- src/backend/app/Models/User.php | 10 +- .../app/Observers/AddressesObserver.php | 4 - .../Observers/AgentBalanceHistoryObserver.php | 4 +- .../app/Observers/AgentChargeObserver.php | 3 +- src/backend/app/Observers/AgentObserver.php | 4 +- .../app/Observers/AgentReceiptObserver.php | 3 +- .../Observers/AgentSoldApplianceObserver.php | 3 +- .../app/Observers/MeterParameterObserver.php | 8 +- src/backend/app/Observers/PersonObserver.php | 8 - src/backend/app/PaymentHandler/AccessRate.php | 23 +- .../app/PaymentHandler/EnergyPayment.php | 4 +- .../app/Providers/AppServiceProvider.php | 2 - .../app/Providers/ServicesProvider.php | 4 - .../app/Providers/VodacomServiceProvider.php | 8 +- src/backend/app/Relations/BelongsToMorph.php | 37 ++- .../app/Services/AbstractExportService.php | 8 +- ...actPaymentAggregatorTransactionService.php | 16 +- .../AccessRatePaymentHistoryService.php | 1 + .../app/Services/AccessRatePaymentService.php | 3 +- .../app/Services/AccessRateService.php | 3 +- .../AddressGeographicalInformationService.php | 1 + src/backend/app/Services/AddressesService.php | 5 +- .../Services/AgentAppliancePersonService.php | 1 + ...AssignedApplianceHistoryBalanceService.php | 1 + .../AgentAssignedApplianceService.php | 3 +- .../Services/AgentBalanceHistoryService.php | 9 +- .../AgentChargeHistoryBalanceService.php | 1 + .../app/Services/AgentChargeService.php | 3 +- .../AgentCommissionHistoryBalanceService.php | 1 + .../app/Services/AgentCommissionService.php | 3 +- .../app/Services/AgentCustomerService.php | 4 +- .../AgentCustomersPaymentHistoryService.php | 3 +- .../Services/AgentReceiptDetailService.php | 3 +- .../AgentReceiptHistoryBalanceService.php | 1 + .../app/Services/AgentReceiptService.php | 3 +- src/backend/app/Services/AgentService.php | 3 +- .../Services/AgentSoldApplianceService.php | 3 +- .../app/Services/AgentTicketService.php | 1 + .../AgentTransactionHistoryBalanceService.php | 1 + .../app/Services/AgentTransactionService.php | 5 +- .../AgentTransactionTransactionService.php | 1 + .../app/Services/AppliancePaymentService.php | 5 +- .../app/Services/AppliancePersonService.php | 5 +- .../ApplianceRatePaymentHistoryService.php | 1 + .../app/Services/ApplianceRateService.php | 3 +- src/backend/app/Services/AssetService.php | 4 +- .../app/Services/CashTransactionService.php | 1 + .../CityGeographicalInformationService.php | 1 + src/backend/app/Services/CityService.php | 3 +- .../app/Services/ClusterMeterService.php | 4 +- .../app/Services/ClusterMiniGridService.php | 4 +- .../app/Services/ClusterPopulationService.php | 4 +- .../app/Services/ClusterRevenueService.php | 15 +- src/backend/app/Services/ClusterService.php | 5 +- .../Services/ClusterTransactionService.php | 4 +- .../ClustersDashboardCacheDataService.php | 2 +- .../app/Services/CompanyDatabaseService.php | 3 +- src/backend/app/Services/CompanyService.php | 3 +- .../app/Services/ConnectionGroupService.php | 3 +- .../app/Services/ConnectionTypeService.php | 3 +- src/backend/app/Services/CountryService.php | 3 +- .../app/Services/DatabaseProxyService.php | 6 +- src/backend/app/Services/FirebaseService.php | 2 +- .../GeographicalInformationService.php | 5 +- .../app/Services/Interfaces/IAssociative.php | 2 +- .../app/Services/Interfaces/IBaseService.php | 3 +- .../Services/Interfaces/ISettingsService.php | 3 +- .../app/Services/MainSettingsService.php | 7 +- .../app/Services/MaintenanceUserService.php | 3 +- .../Services/MaintenanceUserTicketService.php | 1 + .../Services/ManufacturerAddressService.php | 1 + .../app/Services/ManufacturerService.php | 3 +- .../app/Services/MeterConsumptionService.php | 3 +- .../MeterGeographicalInformationService.php | 3 +- .../Services/MeterParameterAddressService.php | 1 + .../app/Services/MeterParameterService.php | 3 +- .../app/Services/MeterRevenueService.php | 3 +- src/backend/app/Services/MeterService.php | 3 +- .../MeterTariffMeterParameterService.php | 3 +- .../app/Services/MeterTariffService.php | 3 +- .../MeterTokenPaymentHistoryService.php | 1 + .../app/Services/MeterTypeMeterService.php | 4 +- src/backend/app/Services/MeterTypeService.php | 4 +- .../MiniGridDashboardCacheDataService.php | 2 +- .../app/Services/MiniGridEnergyService.php | 4 +- ...MiniGridGeographicalInformationService.php | 1 + .../app/Services/MiniGridRevenueService.php | 3 +- src/backend/app/Services/MiniGridService.php | 3 +- src/backend/app/Services/MpmPluginService.php | 3 +- .../app/Services/PaymentHistoryService.php | 3 +- src/backend/app/Services/PeriodService.php | 8 +- .../app/Services/PersonAddressService.php | 1 + .../app/Services/PersonMeterService.php | 3 +- .../Services/PersonPaymentHistoryService.php | 1 + src/backend/app/Services/PersonService.php | 10 +- .../app/Services/PersonTicketService.php | 1 + src/backend/app/Services/PluginsService.php | 3 +- .../app/Services/RegistrationTailService.php | 9 +- .../app/Services/RestrictionService.php | 3 +- src/backend/app/Services/RolesService.php | 1 + src/backend/app/Services/SessionService.php | 2 +- .../app/Services/SmsAndroidSettingService.php | 1 + .../SmsApplianceRemindRateService.php | 3 +- src/backend/app/Services/SmsService.php | 11 +- .../app/Services/SocialTariffService.php | 3 +- .../app/Services/SubConnectionTypeService.php | 5 +- src/backend/app/Services/SubTargetService.php | 7 +- src/backend/app/Services/TargetService.php | 6 +- .../TariffPricingComponentService.php | 3 +- .../app/Services/TicketSettingsService.php | 3 +- .../app/Services/TimeOfUsageService.php | 3 +- src/backend/app/Services/TokenService.php | 5 +- .../TransactionPaymentHistoryService.php | 1 + .../Services/TransactionProviderService.php | 2 - src/backend/app/Services/UsageTypeService.php | 9 +- .../app/Services/UserAddressService.php | 3 +- .../Services/UserAppliancePersonService.php | 1 + src/backend/app/Services/UserService.php | 4 +- .../app/Services/UserTicketService.php | 1 + src/backend/app/Sms/AndroidGateway.php | 7 +- .../BodyParsers/AccessRateConfirmation.php | 1 + .../app/Sms/BodyParsers/AssetRatePayment.php | 1 + .../app/Sms/BodyParsers/AssetRateReminder.php | 1 + .../Sms/BodyParsers/EnergyConfirmation.php | 1 + .../BodyParsers/OverDueAssetRateReminder.php | 1 + .../app/Sms/BodyParsers/PricingDetails.php | 3 + .../app/Sms/BodyParsers/ResendInformation.php | 1 + .../app/Sms/BodyParsers/SmsReminderHeader.php | 1 + .../SmsResendInformationHeader.php | 3 +- .../Sms/BodyParsers/SmsTransactionHeader.php | 1 + src/backend/app/Sms/Senders/ManualSms.php | 2 + .../Senders/ResendInformationNotification.php | 4 +- src/backend/app/Sms/Senders/SmsConfigs.php | 4 +- .../app/Sms/Senders/SmsConfigsCore.php | 2 + src/backend/app/Sms/Senders/SmsSender.php | 13 +- .../Sms/Senders/TransactionConfirmation.php | 5 + src/backend/app/Sms/SmsTypes.php | 4 + .../app/Traits/RestExceptionHandler.php | 31 +-- src/backend/app/Utils/AccessRatePayer.php | 4 + .../app/Utils/ApplianceInstallmentPayer.php | 9 +- src/backend/app/Utils/DummyCompany.php | 1 + .../Utils/MinimumPurchaseAmountValidator.php | 1 + .../app/Utils/TariffPriceCalculator.php | 3 +- .../CustomerRegistrationAppService.php | 3 +- .../Ecosys/CustomerDatabaseParser.php | 7 +- .../Services/AppliancePersonService.php | 12 +- .../Ecosys/Services/ApplianceService.php | 1 + .../Services/ConnectionGroupService.php | 1 + .../DatabaseProxyManagerService.php | 3 +- .../modules/Device/ClusterDeviceService.php | 4 +- .../modules/Device/DeviceAddressService.php | 4 +- .../app/modules/Device/DeviceService.php | 9 +- .../modules/Device/MiniGridDeviceService.php | 4 +- .../app/modules/EBike/EBikeDeviceService.php | 1 + .../app/modules/EBike/EBikeService.php | 5 +- .../app/modules/Meter/MeterDeviceService.php | 1 + .../OutstandingDebtsExportService.php | 3 +- .../Sharding/ApiCompanyResolverService.php | 8 +- .../ApiResolvers/Data/ApiResolverMap.php | 7 + .../ApiResolvers/DataExportResolver.php | 4 +- .../Sharding/ApiResolvers/TestApiResolver.php | 2 +- .../SolarHomeSystemDeviceService.php | 1 + .../SolarHomeSystemService.php | 4 +- .../app/modules/Target/TargetAssignable.php | 4 +- .../ApplianceTransactionService.php | 4 +- .../Transaction/EBikeTransactionService.php | 4 +- .../Export/TransactionExportService.php | 1 + .../Transaction/MeterTransactionService.php | 4 +- .../Provider/AgentTransactionProvider.php | 11 +- .../Provider/AirtelTransactionProvider.php | 18 +- .../Provider/AirtelVoltTerraProvider.php | 24 +- .../Provider/CashTransactionProvider.php | 9 +- .../Provider/TransactionAdapter.php | 4 +- .../Provider/VodacomTransactionProvider.php | 42 +-- .../SolarHomeSystemTransactionService.php | 4 +- .../TransactionPaymentProcessor.php | 1 + .../Transaction/TransactionService.php | 38 +-- .../modules/User/Events/UserCreatedEvent.php | 4 +- src/backend/app/modules/User/UserListener.php | 3 +- .../GeographicalInformationFactory.php | 2 +- .../factories/Person/PersonFactory.php | 2 - .../factories/VodacomTransactionFactory.php | 2 - ...22_03_10_120408_create_companies_table.php | 3 +- ..._134450_create_company_databases_table.php | 3 +- ...8_204649_create_database_proxies_table.php | 3 +- ..._06_21_102121_create_mpm_plugins_table.php | 3 +- ...21_122032_add_email_to_companies_table.php | 3 +- ...3903_add_tail_tag_to_mpm_plugins_table.php | 3 +- ...tallation_command_to_mpm_plugins_table.php | 3 +- ..._bulk_registration_to_mpm_plugin_table.php | 7 +- ...dd_viber_messaging_to_mpm_plugin_table.php | 7 +- ...email_field_for_database_proxies_table.php | 6 +- ...wave_money_payment_to_mpm_plugin_table.php | 7 +- .../2022_11_25_091725_create_company_jobs.php | 3 +- ...000_add_micro_star_to_mpm_plugin_table.php | 7 +- ...00_add_root_class_to_mpm_plugins_table.php | 3 +- ...00000_add_sun_king_to_mpm_plugin_table.php | 7 +- ...24_110414_create_protected_pages_table.php | 3 +- ...ected_page_password_to_companies_table.php | 3 +- ...0000_add_gome_long_to_mpm_plugin_table.php | 7 +- ...121811_add_wavecom_to_mpm_plugin_table.php | 7 +- ...escription_column_in_mpm_plugins_table.php | 3 +- ...00000_add_daly_bms_to_mpm_plugin_table.php | 7 +- ..._000000_add_angaza_to_mpm_plugin_table.php | 7 +- ..._02_07_100345_create_usage_types_table.php | 3 +- ...usage_type_column_to_mpm_plugins_table.php | 3 +- ...nd_trace_columns_to_company_jobs_table.php | 3 +- .../2014_10_12_000000_create_users_table.php | 3 +- ...12_100000_create_password_resets_table.php | 3 +- ...5615_create_vodacom_transactions_table.php | 3 +- ...05_24_201051_create_transactions_table.php | 3 +- ...13335_create_airtel_transactions_table.php | 3 +- ..._131106_create_payment_histories_table.php | 3 +- ...5_25_131119_create_meter_tariffs_table.php | 3 +- ...18_05_29_071453_create_addresses_table.php | 3 +- ...create_geographical_informations_table.php | 3 +- ..._05_29_140926_create_meter_types_table.php | 3 +- .../2018_05_30_124521_create_meters_table.php | 3 +- ...5_31_071601_create_manufacturers_table.php | 3 +- .../2018_05_31_075346_create_cities_table.php | 3 +- ...18_05_31_075353_create_countries_table.php | 3 +- .../2018_06_01_141845_create_people_table.php | 3 +- .../2018_06_04_124637_create__roles_table.php | 3 +- ...06_07_155444_create_meter_tokens_table.php | 3 +- ...8_102610_create_meter_parameters_table.php | 3 +- .../2018_06_11_131951_create_sms_table.php | 3 +- ...352_create_transaction_conflicts_table.php | 3 +- ...06_28_080905_create_access_rates_table.php | 3 +- ...0914_create_access_rate_payments_table.php | 3 +- ..._07_11_075002_create_permission_tables.php | 3 +- .../2018_07_12_133700_create_loans_table.php | 3 +- ...18_07_12_134253_create_customers_table.php | 3 +- ...18_10_04_195503_create_histories_table.php | 7 +- ...110924_create_meter_consumptions_table.php | 3 +- ...2_123911_create_payment_profiles_table.php | 3 +- ...018_11_29_090603_create_clusters_table.php | 3 +- ...018_12_05_144906_create_revenues_table.php | 3 +- ...1_083717_create_connection_types_table.php | 3 +- ...2018_12_13_083722_create_targets_table.php | 3 +- ..._12_13_100738_create_sub_targets_table.php | 3 +- .../2019_04_19_083645_customer_group.php | 3 +- ...2438_create_sub_connection_types_table.php | 7 +- ..._103123_create_connection_groups_table.php | 3 +- .../2019_05_15_122118_reports.php | 3 +- ...9_06_24_160040_create_mini_grids_table.php | 3 +- ..._133655_create_maintenance_users_table.php | 3 +- ...019_11_06_121116_create_energies_table.php | 3 +- .../2019_11_15_102431_create_solars_table.php | 3 +- ...19_11_26_063009_create_batteries_table.php | 3 +- .../2019_12_16_090907_create_assets_table.php | 3 +- ..._12_16_091934_create_asset_types_table.php | 39 ++- ...12_16_092044_create_asset_people_table.php | 3 +- ..._12_16_093223_create_asset_rates_table.php | 3 +- .../2020_01_27_135206_create_logs_table.php | 3 +- .../2020_04_05_233604_create_p_v_s_table.php | 3 +- ...04_19_234527_create_restrictions_table.php | 3 +- ...020_04_19_235421_create_upgrades_table.php | 3 +- ...4_20_001454_create_subscriptions_table.php | 3 +- .../2020_06_20_085555_weather_data.php | 3 +- ...create_tariff_pricing_components_table.php | 3 +- ..._21_194542_create_social_tariffs_table.php | 3 +- ...create_social_tariff_piggy_banks_table.php | 3 +- ...15405_add_total_price_to_meter_tariffs.php | 3 +- .../2020_07_12_192802_create_agents_table.php | 3 +- ...130601_create_agent_transactions_table.php | 3 +- ...6_create_agent_balance_histories_table.php | 3 +- ...create_agent_assigned_appliances_table.php | 3 +- ...811_create_agent_sold_appliances_table.php | 3 +- ..._083600_create_agent_commissions_table.php | 3 +- ..._25_155837_create_agent_receipts_table.php | 3 +- ...8_03_081836_create_agent_charges_table.php | 3 +- ...748_create_agent_receipt_details_table.php | 3 +- ..._02_072509_create_time_of_usages_table.php | 3 +- ..._19_122517_create_sub_menu_items_table.php | 3 +- ...0_10_19_122649_create_menu_items_table.php | 3 +- ...2020_10_29_170007_create_plugins_table.php | 3 +- ...2_17_144527_create_main_settings_table.php | 3 +- ...12_23_165814_create_map_settings_table.php | 3 +- ...ransaction_to_agent_transactions_table.php | 6 +- ...130412_create_third_party_transactions.php | 3 +- ...nsaction_to_vodacom_transactions_table.php | 6 +- ...ansaction_to_airtel_transactions_table.php | 6 +- ...05_234039_create_ticket_settings_table.php | 3 +- ..._122556_add_columns_to_batteries_table.php | 6 +- ...1_18_123245_add_columns_to_p_v_s_table.php | 6 +- .../2021_02_18_153556_create_sms_bodies.php | 257 +++++++++--------- ...556_create_sms_resend_information_keys.php | 3 +- ...6421_create_sms_appliance_remind_rates.php | 3 +- ..._03_140758_create_sms_android_settings.php | 3 +- ...706_create_sms_variable_default_values.php | 3 +- .../2021_03_2_1561251_update_sms_table.php | 6 +- ...8_add_additional_json_column_to_people.php | 6 +- ...8_104840_create_person_documents_table.php | 3 +- ...085817_update_meter_consumptions_table.php | 8 +- ...add_down_payment_to_asset_people_table.php | 3 +- ...rst_payment_date_to_asset_people_table.php | 3 +- ..._092522_create_cash_transactions_table.php | 3 +- ...2021_10_18_220817_create_mail_settings.php | 3 +- ...5_10_093215_update_meter_tariffs_table.php | 8 +- ..._10_101348_update_social_tariffs_table.php | 8 +- ...update_tariff_pricing_components_table.php | 8 +- ...update_social_tariff_piggy_banks_table.php | 8 +- ...05_10_102047_update_access_rates_table.php | 8 +- ...2214_update_access_rate_payments_table.php | 8 +- ...05_10_102507_update_asset_people_table.php | 8 +- ...05_10_102649_update_transactions_table.php | 8 +- ..._102805_update_payment_histories_table.php | 8 +- ..._05_19_102938_update_asset_types_table.php | 5 +- ..._add_connection_column_to_agents_table.php | 3 +- .../2022_06_21_090125_create_calin_tables.php | 7 +- ...06_21_090327_create_calin_smart_tables.php | 7 +- .../2022_06_21_090338_create_kelin_tables.php | 21 +- ..._create_mesomb_payment_provider_tables.php | 5 +- .../2022_06_21_090351_create_spark_tables.php | 35 +-- ...2022_06_21_090402_create_steama_tables.php | 59 ++-- .../2022_06_21_090412_create_stron_tables.php | 7 +- ..._create_swifta_payment_provider_tables.php | 7 +- ..._092948_create_registration_tail_table.php | 3 +- ...000000_create_bulk_registration_tables.php | 5 +- ...0327_add_direction_column_to_sms_table.php | 3 +- ...945_add_gateway_id_column_to_sms_table.php | 3 +- ...123_add_dispatched_column_to_sms_table.php | 3 +- ...42319_add_attempts_column_to_sms_table.php | 3 +- ..._0000000_create_viber_messaging_tables.php | 9 +- ...purchase_amount_to_meter_tariffs_table.php | 3 +- ...ate_wave_money_payment_provider_tables.php | 7 +- ..._11_29_000000_create_micro_star_tables.php | 7 +- ...000_update_swifta_authentication_table.php | 8 +- .../2022_14_12_create_sun_king_tables.php | 7 +- ...3_15_092048_add_colums_to_solars_table.php | 3 +- .../2023_03_16_105024_update_solars_table.php | 3 +- ...update_data_type_values_energies_table.php | 6 +- ...update_data_type_values_energies_table.php | 6 +- ...023_04_02_121811_create_wavecom_tables.php | 5 +- ...421_add_api_type_to_table_transactions.php | 3 +- .../2023_04_26_223352_update_sms_table.php | 3 +- .../2023_06_02_create_gome_long_tables.php | 9 +- ...assets_asset_people_asset_types_tables.php | 5 +- ...pdate_sms_appliance_remind_rates_table.php | 7 +- ...074114_update_wavecom_wavemoney_tables.php | 7 +- ...2023_11_03_112202_create_devices_table.php | 3 +- ...120614_create_solar_home_systems_table.php | 3 +- ..._configuration_columns_to_meters_table.php | 3 +- ...07_update_action_field_type_logs_table.php | 7 +- ..._drop_geo_id_column_from_address_table.php | 3 +- ...add_type_column_to_manufacturers_table.php | 6 +- ..._id_column_to_solar_home_systems_table.php | 3 +- ...date_person_id_column_in_devices_table.php | 6 +- ..._device_serial_column_in_devices_table.php | 6 +- ...ber_column_in_solar_home_systems_table.php | 6 +- .../2023_11_17_095204_create_tokens_table.php | 3 +- ...ce_serial_column_to_asset_people_table.php | 3 +- ...ce_serial_column_in_asset_people_table.php | 6 +- .../2024_01_01_create_daly_bms_tables.php | 7 +- ...2024_01_02_124146_create_e_bikes_table.php | 3 +- .../2024_01_12_create_angaza_tables.php | 7 +- ...age_type_column_to_main_settings_table.php | 6 +- ..._usage_type_column_to_menu_items_table.php | 3 +- ...24_09_30_113302_remove_siderbar_tables.php | 3 +- ...0_23_153042_add_amount_to_agent_charge.php | 3 +- ...0_30_154625_create_notifications_table.php | 3 +- ...24_10_31_180458_remove_batteries_table.php | 3 +- ...024_10_31_180510_remove_energies_table.php | 3 +- ...524_remove_mini_grid_frequencies_table.php | 3 +- .../2024_10_31_180539_remove_pvs_table.php | 3 +- .../2024_10_31_180546_remove_solars_table.php | 3 +- ...10_31_180605_remove_weather_data_table.php | 3 +- ...2024_10_31_180852_remove_agent_tickets.php | 3 +- ...2024_10_31_181016_remove_city_clusters.php | 3 +- ...drop_data_stream_column_from_mini_grid.php | 3 +- .../seeders/SolarHomeSystemSeeder.php | 2 +- src/backend/database/seeders/TenantSeeder.php | 3 +- .../src/Console/Commands/InstallPackage.php | 1 + .../AngazaCredentialController.php | 4 +- .../src/Http/Resources/AngazaResource.php | 3 +- .../src/Modules/Api/AngazaSHSApi.php | 5 +- .../src/Modules/Api/ApiRequests.php | 3 +- .../src/Services/AngazaCredentialService.php | 3 +- .../src/Services/ManufacturerService.php | 6 +- .../create_bulk_registration_tables.php | 5 +- .../src/Console/Commands/InstallPackage.php | 1 + .../src/Console/Commands/UpdatePackage.php | 3 +- .../Exceptions/ClusterNotFoundException.php | 4 +- .../src/Exceptions/CsvDataParserException.php | 4 +- .../src/Exceptions/Handler.php | 5 +- .../ManufacturerNotSupportedException.php | 4 +- .../Exceptions/MiniGridNotFoundException.php | 4 +- .../src/Exceptions/MissingDataException.php | 4 +- .../Exceptions/VillageNotFoundException.php | 4 +- .../src/Helpers/CsvDataProcessor.php | 7 +- .../src/Helpers/CsvFileParser.php | 2 +- .../Helpers/GeographicalLocationFinder.php | 2 +- .../src/Http/Requests/ImportCsvRequest.php | 2 - .../src/Models/BaseModel.php | 1 + .../src/Services/AddressService.php | 2 +- .../src/Services/CityService.php | 4 +- .../src/Services/ClusterService.php | 4 +- .../src/Services/CsvDataService.php | 2 + .../src/Services/ManufacturerService.php | 2 +- .../src/Services/MiniGridService.php | 4 +- .../inensus/calin-meter/src/CalinMeterApi.php | 2 + .../src/Console/Commands/InstallPackage.php | 1 + .../src/Console/Commands/UpdatePackage.php | 3 +- .../Exceptions/CalinApiResponseException.php | 4 +- .../calin-meter/src/Helpers/ApiHelpers.php | 2 +- .../Http/Requests/CalinMeterApiRequests.php | 2 + .../src/Http/Resources/CalinResource.php | 3 +- .../src/CalinSmartMeterApi.php | 3 +- .../src/Console/Commands/InstallPackage.php | 1 + .../src/Console/Commands/UpdatePackage.php | 3 +- .../CalinSmartApiResponseException.php | 4 +- ...alinSmartCreadentialsNotFoundException.php | 4 +- .../src/Helpers/ApiHelpers.php | 2 +- .../Requests/CalinSmartMeterApiRequests.php | 2 + .../src/Http/Resources/CalinSmartResource.php | 3 +- .../src/Console/Commands/CheckPayments.php | 6 +- .../src/Console/Commands/InstallPackage.php | 1 + .../src/Console/Commands/SyncBikes.php | 5 +- .../DalyBmsCredentialController.php | 3 +- .../src/Http/Resources/DalyBmsResource.php | 3 +- .../daly-bms/src/Modules/Api/ApiRequests.php | 5 +- .../daly-bms/src/Modules/Api/DalyBmsApi.php | 11 +- .../src/Services/DalyBmsCredentialService.php | 3 +- .../src/Services/ManufacturerService.php | 6 +- .../GomeLongMeterDataSynchronizer.php | 1 + .../src/Console/Commands/InstallPackage.php | 1 + .../src/Exceptions/CronJobException.php | 4 +- .../GomeLongCredentialController.php | 3 +- .../src/Http/Resources/GomeLongResource.php | 3 +- .../src/Modules/Api/ApiRequests.php | 3 +- .../src/Modules/Api/GomeLongMeterApi.php | 3 +- .../src/Observers/MeterTariffObserver.php | 9 +- .../Services/GomeLongCredentialService.php | 3 +- .../src/Services/GomeLongTariffService.php | 15 +- .../src/Services/ManufacturerService.php | 6 +- .../Console/Commands/AccessTokenRefresher.php | 5 +- .../src/Console/Commands/DataSynchronizer.php | 10 +- .../src/Console/Commands/InstallPackage.php | 1 + .../Commands/ReadDailyMeterConsumptions.php | 4 +- .../ReadMinutelyMeterConsumptions.php | 4 +- .../src/Console/Commands/UpdatePackage.php | 3 +- .../src/Exceptions/CronJobException.php | 4 +- .../KelinApiAuthenticationException.php | 4 +- .../KelinApiCredentialsNotFoundException.php | 4 +- .../Exceptions/KelinApiEmtyDataException.php | 4 +- .../Exceptions/KelinApiResponseException.php | 4 +- .../kelin-meter/src/Helpers/ApiHelpers.php | 2 +- .../src/Http/Clients/KelinMeterApiClient.php | 2 + .../Resources/DailyConsumptionCollection.php | 3 +- .../Resources/KelinCustomerCollection.php | 3 +- .../Http/Resources/KelinMeterCollection.php | 3 +- .../src/Http/Resources/KelinResource.php | 3 +- .../Http/Resources/KelinSettingCollection.php | 3 +- .../MinutelyConsumptionCollection.php | 3 +- .../inensus/kelin-meter/src/KelinMeterApi.php | 7 +- .../kelin-meter/src/Models/SyncStatus.php | 3 + .../src/Observers/PersonObserver.php | 3 + .../src/Services/DailyConsumptionService.php | 4 +- .../src/Services/KelinCredentialService.php | 4 +- .../src/Services/KelinCustomerService.php | 6 + .../src/Services/KelinMeterService.php | 31 ++- .../src/Services/KelinMeterStatusService.php | 1 + .../src/Services/KelinSyncActionService.php | 2 +- .../src/Services/KelinSyncSettingService.php | 6 +- .../Services/MinutelyConsumptionService.php | 4 +- .../Services/PackageInstallationService.php | 3 +- .../src/Tests/Feature/RechargeMeterTest.php | 2 +- .../src/Console/Commands/InstallPackage.php | 1 + .../src/Console/Commands/UpdatePackage.php | 3 +- ...MustHaveOnlyOneConnectedMeterException.php | 4 +- ...ombPaymentPhoneNumberNotFoundException.php | 4 +- .../MesombStatusFailedException.php | 4 +- .../MesombTransactionProcessingResource.php | 3 +- .../src/Models/BaseModel.php | 1 + .../src/Models/MesombTransaction.php | 3 - .../Providers/MesombTransactionProvider.php | 4 + .../src/Services/MesomTransactionService.php | 1 + .../src/Tests/Feature/PaymentTests.php | 2 +- .../src/Console/Commands/InstallPackage.php | 1 + .../src/Console/Commands/UpdatePackage.php | 3 +- .../MicroStarCertificateController.php | 3 +- .../MicroStarCredentialController.php | 4 +- .../Controllers/MicroStarTestController.php | 4 +- .../Requests/ImportCertificateRequest.php | 2 - .../src/Http/Resources/MicroStarResource.php | 3 +- .../src/Modules/Api/ApiRequests.php | 3 +- .../src/Modules/Api/MicroStarMeterApi.php | 3 +- .../src/Services/ManufacturerService.php | 6 +- .../Services/MicroStarCertificateService.php | 4 +- .../Services/MicroStarCredentialService.php | 3 +- .../Commands/InstallSparkMeterPackage.php | 5 +- .../Commands/SparkMeterDataSynchronizer.php | 10 +- .../Commands/SparkMeterSmsNotifier.php | 19 +- .../SparkMeterTransactionStatusCheck.php | 3 +- .../Commands/UpdateSparkMeterPackage.php | 3 +- .../CredentialsNotFoundException.php | 4 +- .../CredentialsNotUpToDateException.php | 4 +- .../src/Exceptions/CronJobException.php | 4 +- .../NoOnlineSiteRecordException.php | 4 +- .../Exceptions/SitesNotUpToDateException.php | 4 +- .../Exceptions/SparkAPIResponseException.php | 4 +- .../Exceptions/WrongCredentialsException.php | 4 +- .../src/Helpers/InsertSparkMeterApi.php | 2 +- .../Http/Requests/SparkMeterApiRequests.php | 4 + .../SparkMeterCredentialResource.php | 3 +- .../src/Http/Resources/SparkResource.php | 3 +- .../src/Listeners/MeterParameterListener.php | 13 +- .../spark-meter/src/Listeners/SmsListener.php | 5 +- .../src/Listeners/TransactionListener.php | 3 +- .../spark-meter/src/Models/BaseModel.php | 1 + .../spark-meter/src/Models/SmSetting.php | 4 - .../spark-meter/src/Models/SyncStatus.php | 2 + .../GeographicalInformationObserver.php | 3 +- .../src/Observers/MeterTariffObserver.php | 5 +- .../src/Observers/PersonObserver.php | 3 + .../src/Services/CredentialService.php | 4 + .../src/Services/CustomerService.php | 29 +- .../src/Services/MeterModelService.php | 7 + .../src/Services/OrganizationService.php | 2 +- .../Services/PackageInstallationService.php | 4 + .../spark-meter/src/Services/SiteService.php | 18 +- .../src/Services/SmSalesAccoutService.php | 6 + .../src/Services/SmSmsSettingService.php | 5 +- .../src/Services/SmSyncActionService.php | 2 +- .../src/Services/SmSyncSettingService.php | 14 +- .../src/Services/TariffService.php | 22 +- .../src/Services/TransactionService.php | 36 ++- .../SparkSmsBalanceFeedbackBody.php | 1 + .../SparkSmsBalanceFeedbackHeader.php | 1 + .../BodyParsers/SparkSmsLowBalanceBody.php | 1 + .../BodyParsers/SparkSmsLowBalanceHeader.php | 1 + .../SparkSmsMeterResetFailedFeedbackBody.php | 1 + .../SparkSmsMeterResetFeedbackBody.php | 1 + .../SparkSmsMeterResetFeedbackHeader.php | 3 +- .../src/Sms/Senders/MeterResetFeedback.php | 4 +- .../src/Sms/Senders/SparkSmsConfig.php | 2 + .../spark-meter/src/Sms/SparkSmsTypes.php | 2 + .../inensus/spark-meter/src/SparkMeterApi.php | 1 + .../src/Tests/Unit/SmsNotifyTest.php | 10 +- .../src/Console/Commands/InstallPackage.php | 3 +- .../Commands/ReadHourlyMeterReadings.php | 4 +- .../Commands/SteamaMeterDataSynchronizer.php | 18 +- .../Console/Commands/SteamaSmsNotifier.php | 15 +- .../src/Console/Commands/UpdatePackage.php | 3 +- .../src/Exceptions/CronJobException.php | 4 +- .../src/Exceptions/ModelNotFoundException.php | 4 +- .../Exceptions/SteamaApiResponseException.php | 4 +- .../Exceptions/WrongCredentialsException.php | 4 +- .../steama-meter/src/Helpers/ApiHelpers.php | 2 +- .../src/Http/Clients/SteamaMeterApiClient.php | 2 + .../Resources/SteamaCredentialResource.php | 3 +- .../src/Http/Resources/SteamaResource.php | 3 +- .../src/Listeners/MeterParameterListener.php | 13 +- .../src/Listeners/SmsListener.php | 5 +- .../steama-meter/src/Models/BaseModel.php | 1 + .../steama-meter/src/Models/SteamaSetting.php | 4 - .../steama-meter/src/Models/SyncStatus.php | 2 + .../GeographicalInformationObserver.php | 4 + .../src/Observers/PersonObserver.php | 5 + .../Providers/SteamaMeterServiceProvider.php | 2 +- .../Services/PackageInstallationService.php | 3 +- .../src/Services/SteamaAgentService.php | 13 +- .../Services/SteamaBitharvesterService.php | 1 + .../src/Services/SteamaCredentialService.php | 2 + .../src/Services/SteamaCustomerService.php | 19 ++ .../Services/SteamaMeterReadingService.php | 2 + .../src/Services/SteamaMeterService.php | 19 +- .../SteamaSiteLevelPaymentPlanTypeService.php | 2 +- .../src/Services/SteamaSiteService.php | 9 + .../src/Services/SteamaSmsSettingService.php | 5 +- .../src/Services/SteamaSyncSettingService.php | 12 +- .../src/Services/SteamaTariffService.php | 6 +- .../Services/SteamaTransactionsService.php | 14 + .../src/Services/SteamaUserTypeService.php | 8 +- .../src/Services/StemaSyncActionService.php | 2 +- .../SteamaSmsBalanceFeedbackBody.php | 1 + .../SteamaSmsBalanceFeedbackHeader.php | 1 + .../BodyParsers/SteamaSmsLowBalanceBody.php | 1 + .../BodyParsers/SteamaSmsLowBalanceHeader.php | 1 + .../src/Sms/Senders/SteamaSmsConfig.php | 2 + .../steama-meter/src/Sms/SteamaSmsTypes.php | 1 + .../steama-meter/src/SteamaMeterApi.php | 4 +- .../src/Tests/Unit/SmsNotifyTest.php | 10 +- .../src/Console/Commands/InstallPackage.php | 1 + .../src/Console/Commands/UpdatePackage.php | 3 +- .../Exceptions/StronApiResponseException.php | 4 +- .../stron-meter/src/Helpers/ApiHelpers.php | 2 +- .../Http/Requests/StronMeterApiRequests.php | 2 + .../Resources/StronCredentialResource.php | 3 +- .../src/Http/Resources/StronResource.php | 3 +- .../src/Services/StronCredentialService.php | 2 + .../inensus/stron-meter/src/StronMeterApi.php | 1 + .../src/Console/Commands/InstallPackage.php | 1 + .../SunKingCredentialController.php | 4 +- .../src/Http/Resources/SunKingResource.php | 3 +- .../src/Modules/Api/ApiRequests.php | 3 +- .../src/Modules/Api/SunKingSHSApi.php | 4 +- .../src/Services/ManufacturerService.php | 6 +- .../src/Services/SunKingCredentialService.php | 3 +- .../src/Console/Commands/InstallPackage.php | 3 +- .../Commands/TransactionStatusChecker.php | 4 +- .../src/Console/Commands/UpdatePackage.php | 5 +- .../Exceptions/CipherNotValidException.php | 4 +- .../CustomerAddressNotFoundException.php | 4 +- .../SwiftaValidationFailedException.php | 4 +- .../TransactionAmountDifferentException.php | 4 +- .../TransactionNotExistsException.php | 4 +- .../SwiftaAuthenticationController.php | 4 +- .../SwiftaPaymentProviderController.php | 4 +- .../SwiftaTransactionCallbackMiddleware.php | 4 +- .../src/Models/SwiftaTransaction.php | 9 +- .../Providers/SwiftaTransactionProvider.php | 3 +- .../Services/SwiftaAuthenticationService.php | 4 +- .../src/Services/SwiftaTransactionService.php | 2 +- .../ticket/src/Exceptions/ApiUserNotFound.php | 4 +- .../TicketOwnerNotFoundException.php | 4 +- .../Controllers/TicketAgentController.php | 4 +- .../Controllers/TicketCategoryController.php | 4 +- .../Controllers/TicketCommentController.php | 4 +- .../src/Http/Controllers/TicketController.php | 4 +- .../Controllers/TicketCustomerController.php | 3 +- .../Controllers/TicketExportController.php | 7 +- .../Http/Controllers/TicketUserController.php | 3 +- .../Http/Controllers/WatcherController.php | 11 +- .../Requests/TicketingUserExternalRequest.php | 2 - .../Http/Requests/TicketingUserRequest.php | 2 - .../src/Http/Resources/TicketResource.php | 3 +- .../inensus/ticket/src/Jobs/OutputJob.php | 1 + .../inensus/ticket/src/Models/BaseModel.php | 4 +- .../src/Models/TicketOutsourceReport.php | 2 +- .../inensus/ticket/src/Models/TicketUser.php | 6 +- .../src/Providers/TicketServiceProvider.php | 2 +- .../src/Services/TicketCategoryService.php | 3 +- .../src/Services/TicketCommentService.php | 5 +- .../src/Services/TicketOutSourceService.php | 3 +- .../Services/TicketOutsourceReportService.php | 5 +- .../ticket/src/Services/TicketService.php | 3 +- .../ticket/src/Services/TicketUserService.php | 3 +- .../src/Console/Commands/InstallPackage.php | 1 + .../src/Console/Commands/UpdatePackage.php | 3 +- .../Exceptions/MessageNotSentException.php | 4 +- .../Exceptions/WebhookNotCreatedException.php | 4 +- .../Controllers/ViberCredentialController.php | 3 +- .../Http/Controllers/WebhookController.php | 13 +- .../src/Http/Resources/ViberResource.php | 3 +- .../src/Services/ViberContactService.php | 3 +- .../src/Services/ViberCredentialService.php | 7 +- .../src/Services/ViberMessageService.php | 3 +- .../viber-messaging/src/ViberGateway.php | 3 +- ...ate_wave_money_payment_provider_tables.php | 4 +- .../src/Console/Commands/InstallPackage.php | 1 + .../src/Console/Commands/UpdatePackage.php | 3 +- .../Http/Controllers/WaveMoneyController.php | 3 +- .../WaveMoneyCredentialController.php | 3 +- ...WaveMoneyTransactionCallbackMiddleware.php | 6 +- .../TransactionCallbackRequestMapper.php | 19 ++ .../Requests/TransactionInitializeRequest.php | 1 + .../src/Http/Resources/WaveMoneyResource.php | 3 +- .../src/Models/WaveMoneyTransaction.php | 6 +- .../src/Modules/Api/AbstractApi.php | 4 +- .../Api/Data/TransactionCallbackData.php | 9 +- .../src/Modules/Api/RequestMethod.php | 3 + .../Api/Resources/AbstractApiResource.php | 1 + .../Resources/StartTransactionResource.php | 5 +- .../src/Modules/Api/WaveMoneyApi.php | 4 +- .../src/Modules/Api/WaveMoneyApiService.php | 3 +- .../WaveMoneyTransactionService.php | 4 + .../WaveMoneyTransactionProvider.php | 3 +- .../Services/WaveMoneyCredentialService.php | 3 +- .../src/Console/Commands/InstallPackage.php | 1 + .../WaveComTransactionController.php | 4 +- .../src/Models/WaveComTransaction.php | 9 +- .../Providers/WaveComTransactionProvider.php | 3 +- .../src/Services/TransactionService.php | 13 +- src/backend/tests/Feature/CityTest.php | 12 +- .../Feature/ClusterDashboardCacheTest.php | 18 +- .../tests/Feature/ClusterRevenueTest.php | 18 +- src/backend/tests/Feature/ClusterTest.php | 18 +- .../tests/Feature/ConnectionGroupTest.php | 6 +- .../tests/Feature/ConnectionTypeTest.php | 6 +- .../tests/Feature/CreateEnvironments.php | 120 ++++++-- src/backend/tests/Feature/MeterTest.php | 15 +- .../tests/Feature/MiniGridRevenueTest.php | 20 +- src/backend/tests/Feature/MiniGridTest.php | 9 +- .../Feature/SocialTariffPiggyBankTest.php | 4 +- .../tests/RefreshMultipleDatabases.php | 2 +- src/backend/tests/TestCase.php | 2 +- .../tests/Unit/Exports/DailyTransactions.php | 4 +- .../tests/Unit/Transaction/AccessRateTest.php | 4 +- .../Transaction/VodacomTransactionTest.php | 7 +- 950 files changed, 2452 insertions(+), 2618 deletions(-) diff --git a/src/backend/app/Console/Commands/AbstractSharedCommand.php b/src/backend/app/Console/Commands/AbstractSharedCommand.php index 43c617c9a..545559193 100644 --- a/src/backend/app/Console/Commands/AbstractSharedCommand.php +++ b/src/backend/app/Console/Commands/AbstractSharedCommand.php @@ -12,6 +12,7 @@ abstract class AbstractSharedCommand extends Command { protected const EXECUTE_FOR_ONE = 1; + protected const EXECUTE_FOR_ALL = 0; protected int $EXECUTION_TYPE = self::EXECUTE_FOR_ALL; diff --git a/src/backend/app/Console/Commands/AccessRateChecker.php b/src/backend/app/Console/Commands/AccessRateChecker.php index b9e56bf22..76558600b 100644 --- a/src/backend/app/Console/Commands/AccessRateChecker.php +++ b/src/backend/app/Console/Commands/AccessRateChecker.php @@ -8,6 +8,7 @@ class AccessRateChecker extends AbstractSharedCommand { protected $signature = 'accessrate:check'; + protected $description = 'Updates the "debt" field, based on "due_date" field'; public function runInCompanyScope(): void @@ -25,7 +26,7 @@ public function runInCompanyScope(): void // access-rate is defined if ($accessRate->amount > 0) { $accessRatePayment->debt += $accessRate->amount; - ++$accessRatePayment->unpaid_in_row; + $accessRatePayment->unpaid_in_row++; } $accessRatePayment->save(); diff --git a/src/backend/app/Console/Commands/AddMeterAddress.php b/src/backend/app/Console/Commands/AddMeterAddress.php index 30425d4ee..a8c983a18 100644 --- a/src/backend/app/Console/Commands/AddMeterAddress.php +++ b/src/backend/app/Console/Commands/AddMeterAddress.php @@ -8,6 +8,7 @@ class AddMeterAddress extends AbstractSharedCommand { protected $signature = 'meters:addAddress'; + protected $description = 'Creates an address entry for all every registered meter. Sets them all to village 1'; public function __construct(private MeterParameter $meterParameter, private Address $address) diff --git a/src/backend/app/Console/Commands/AddPlugin.php b/src/backend/app/Console/Commands/AddPlugin.php index db0b06821..21a55c993 100644 --- a/src/backend/app/Console/Commands/AddPlugin.php +++ b/src/backend/app/Console/Commands/AddPlugin.php @@ -7,6 +7,7 @@ class AddPlugin extends AbstractSharedCommand { protected $signature = 'plugin:add {name} {composer_name} {description}'; + protected $description = 'Plugin Details adding to database'; public function __construct(private PluginsService $pluginsService) diff --git a/src/backend/app/Console/Commands/AdminPasswordResetter.php b/src/backend/app/Console/Commands/AdminPasswordResetter.php index c02f11cc4..30856ffbf 100644 --- a/src/backend/app/Console/Commands/AdminPasswordResetter.php +++ b/src/backend/app/Console/Commands/AdminPasswordResetter.php @@ -7,6 +7,7 @@ class AdminPasswordResetter extends AbstractSharedCommand { protected $signature = 'reset:admin-password'; + protected $description = 'Reset forgotten password'; public function __construct(private UserService $userService) diff --git a/src/backend/app/Console/Commands/AssetRateChecker.php b/src/backend/app/Console/Commands/AssetRateChecker.php index c733109ee..b6b06646f 100644 --- a/src/backend/app/Console/Commands/AssetRateChecker.php +++ b/src/backend/app/Console/Commands/AssetRateChecker.php @@ -16,6 +16,7 @@ class AssetRateChecker extends AbstractSharedCommand { protected $signature = 'asset-rate:check'; + protected $description = 'Checks if any asset rate is due and creates a ticket and reminds the customer'; public function __construct( diff --git a/src/backend/app/Console/Commands/BackupFull.php b/src/backend/app/Console/Commands/BackupFull.php index a8d9ccc50..587a70596 100644 --- a/src/backend/app/Console/Commands/BackupFull.php +++ b/src/backend/app/Console/Commands/BackupFull.php @@ -9,6 +9,7 @@ class BackupFull extends Command { protected $signature = 'backup:full'; + protected $description = 'Run the backup for core base database and all tenant databases'; public function handle(): void diff --git a/src/backend/app/Console/Commands/BackupTenantDatabase.php b/src/backend/app/Console/Commands/BackupTenantDatabase.php index 0d61742f0..c8cf57838 100644 --- a/src/backend/app/Console/Commands/BackupTenantDatabase.php +++ b/src/backend/app/Console/Commands/BackupTenantDatabase.php @@ -7,6 +7,7 @@ class BackupTenantDatabase extends AbstractSharedCommand { protected $signature = 'backup-tenant:run'; + protected $description = 'Run the backup for provided tenant database(s)'; public function handle() diff --git a/src/backend/app/Console/Commands/ClustersDashboardCacheDataGenerator.php b/src/backend/app/Console/Commands/ClustersDashboardCacheDataGenerator.php index b95e086b0..a1202f9d5 100644 --- a/src/backend/app/Console/Commands/ClustersDashboardCacheDataGenerator.php +++ b/src/backend/app/Console/Commands/ClustersDashboardCacheDataGenerator.php @@ -7,6 +7,7 @@ class ClustersDashboardCacheDataGenerator extends AbstractSharedCommand { protected $signature = 'update:cachedClustersDashboardData'; + protected $description = 'Update Clusters Dashboard Data'; public function __construct( diff --git a/src/backend/app/Console/Commands/CreateDummyCompanyWithData.php b/src/backend/app/Console/Commands/CreateDummyCompanyWithData.php index f518f94f2..eb1b5cfb1 100644 --- a/src/backend/app/Console/Commands/CreateDummyCompanyWithData.php +++ b/src/backend/app/Console/Commands/CreateDummyCompanyWithData.php @@ -17,6 +17,7 @@ class CreateDummyCompanyWithData extends Command 'dummy_ticket_data.sql', 'dummy_transaction_data.sql', ]; + public const DUMMY_COMPANY_DATA = [ 'name' => 'Dummy Company', 'address' => 'Dummy Address', @@ -25,14 +26,17 @@ class CreateDummyCompanyWithData extends Command 'email' => 'dummy@company.com', 'protected_page_password' => '123123', ]; + public const DUMMY_COMPANY_USER = [ 'password' => '123123', 'email' => 'dummy@user.com', 'name' => 'Dummy User', ]; + public const DUMMY_DATABASE_NAME = 'DummyCompany_1'; protected $signature = 'dummy:create-company-with-dummy-data'; + protected $description = 'Create a dummy company with dummy data for development environment'; public function __construct( diff --git a/src/backend/app/Console/Commands/DummyDataCreator.php b/src/backend/app/Console/Commands/DummyDataCreator.php index aa892ba4d..05172ca62 100644 --- a/src/backend/app/Console/Commands/DummyDataCreator.php +++ b/src/backend/app/Console/Commands/DummyDataCreator.php @@ -27,6 +27,7 @@ class DummyDataCreator extends AbstractSharedCommand { protected $signature = 'dummy:create-data {amount} {--company-id=} {--type=}'; + protected $description = 'creates dummy data for demo company'; private $transactionTypes = [ @@ -73,7 +74,7 @@ public function handle() return; } - for ($i = 1; $i <= $amount; ++$i) { + for ($i = 1; $i <= $amount; $i++) { echo "$type is generating number: $i \n"; try { DB::connection('shard')->beginTransaction(); diff --git a/src/backend/app/Console/Commands/EcosysCustomerDatabaseParser.php b/src/backend/app/Console/Commands/EcosysCustomerDatabaseParser.php index c29ac1371..b0a3d5da4 100644 --- a/src/backend/app/Console/Commands/EcosysCustomerDatabaseParser.php +++ b/src/backend/app/Console/Commands/EcosysCustomerDatabaseParser.php @@ -9,6 +9,7 @@ class EcosysCustomerDatabaseParser extends AbstractSharedCommand { // --company-id=36 protected $signature = 'ecosys:db-file-parser {--company-id=}'; + protected $description = 'custom database file parser for ecosys'; public function __construct(private CustomerDatabaseParser $customerDatabaseParser) diff --git a/src/backend/app/Console/Commands/MakeMigrationTenant.php b/src/backend/app/Console/Commands/MakeMigrationTenant.php index b30d1de24..3e8755ee3 100644 --- a/src/backend/app/Console/Commands/MakeMigrationTenant.php +++ b/src/backend/app/Console/Commands/MakeMigrationTenant.php @@ -7,6 +7,7 @@ class MakeMigrationTenant extends Command { protected $signature = 'make:migration-tenant {migration-name}'; + protected $description = 'Create new migration file for tenant database(s)'; public function handle() diff --git a/src/backend/app/Console/Commands/MigrateTenant.php b/src/backend/app/Console/Commands/MigrateTenant.php index 131dc9888..1db9e3480 100644 --- a/src/backend/app/Console/Commands/MigrateTenant.php +++ b/src/backend/app/Console/Commands/MigrateTenant.php @@ -5,6 +5,7 @@ class MigrateTenant extends AbstractSharedCommand { protected $signature = 'migrate-tenant {--company-id=}'; + protected $description = 'Run the database migrations on provided tenant database(s)'; public function handle() diff --git a/src/backend/app/Console/Commands/MigrateTenantDrop.php b/src/backend/app/Console/Commands/MigrateTenantDrop.php index ba5d448a8..c534396d0 100644 --- a/src/backend/app/Console/Commands/MigrateTenantDrop.php +++ b/src/backend/app/Console/Commands/MigrateTenantDrop.php @@ -9,6 +9,7 @@ class MigrateTenantDrop extends Command { protected $signature = 'migrate-tenant:drop-demo-company'; + protected $description = 'Drop all tables on the Demo tenant database'; public function handle() diff --git a/src/backend/app/Console/Commands/MigrateTenantFresh.php b/src/backend/app/Console/Commands/MigrateTenantFresh.php index cb2c8fec8..f80de63bd 100644 --- a/src/backend/app/Console/Commands/MigrateTenantFresh.php +++ b/src/backend/app/Console/Commands/MigrateTenantFresh.php @@ -5,6 +5,7 @@ class MigrateTenantFresh extends AbstractSharedCommand { protected $signature = 'migrate-tenant:fresh {--company-id=}'; + protected $description = 'Drop all tables and re-run all migrations on provided tenant database(s)'; public function handle() diff --git a/src/backend/app/Console/Commands/MigrateTenantInstall.php b/src/backend/app/Console/Commands/MigrateTenantInstall.php index 461043ef2..0028f4396 100644 --- a/src/backend/app/Console/Commands/MigrateTenantInstall.php +++ b/src/backend/app/Console/Commands/MigrateTenantInstall.php @@ -5,6 +5,7 @@ class MigrateTenantInstall extends AbstractSharedCommand { protected $signature = 'migrate-tenant:install {--company-id=}'; + protected $description = 'Create the migration repository on provided tenant database(s)'; public function handle() diff --git a/src/backend/app/Console/Commands/MigrateTenantRefresh.php b/src/backend/app/Console/Commands/MigrateTenantRefresh.php index fbc7f612c..35c4f256f 100644 --- a/src/backend/app/Console/Commands/MigrateTenantRefresh.php +++ b/src/backend/app/Console/Commands/MigrateTenantRefresh.php @@ -5,6 +5,7 @@ class MigrateTenantRefresh extends AbstractSharedCommand { protected $signature = 'migrate-tenant:refresh {--company-id=}'; + protected $description = 'Reset and re-run all migrations on provided tenant database(s)'; public function handle() diff --git a/src/backend/app/Console/Commands/MigrateTenantReset.php b/src/backend/app/Console/Commands/MigrateTenantReset.php index 77be445c3..199f228c6 100644 --- a/src/backend/app/Console/Commands/MigrateTenantReset.php +++ b/src/backend/app/Console/Commands/MigrateTenantReset.php @@ -5,6 +5,7 @@ class MigrateTenantReset extends AbstractSharedCommand { protected $signature = 'migrate-tenant:reset {--company-id=}'; + protected $description = 'Rollback all database migrations on provided tenant database(s)'; public function handle() diff --git a/src/backend/app/Console/Commands/MigrateTenantRollback.php b/src/backend/app/Console/Commands/MigrateTenantRollback.php index fd13d5784..116a34dd7 100644 --- a/src/backend/app/Console/Commands/MigrateTenantRollback.php +++ b/src/backend/app/Console/Commands/MigrateTenantRollback.php @@ -5,6 +5,7 @@ class MigrateTenantRollback extends AbstractSharedCommand { protected $signature = 'migrate-tenant:rollback {--company-id=}'; + protected $description = 'Rollback the last database migration on provided tenant database(s)'; public function handle() diff --git a/src/backend/app/Console/Commands/MigrateTenantStatus.php b/src/backend/app/Console/Commands/MigrateTenantStatus.php index 5947c927c..a613a0f9f 100644 --- a/src/backend/app/Console/Commands/MigrateTenantStatus.php +++ b/src/backend/app/Console/Commands/MigrateTenantStatus.php @@ -5,6 +5,7 @@ class MigrateTenantStatus extends AbstractSharedCommand { protected $signature = 'migrate-tenant:status {--company-id=}'; + protected $description = 'Show the status of each migrations on provided tenant database(s)'; public function handle() diff --git a/src/backend/app/Console/Commands/OutsourceReportGenerator.php b/src/backend/app/Console/Commands/OutsourceReportGenerator.php index aedd72874..954efe84e 100644 --- a/src/backend/app/Console/Commands/OutsourceReportGenerator.php +++ b/src/backend/app/Console/Commands/OutsourceReportGenerator.php @@ -10,6 +10,7 @@ class OutsourceReportGenerator extends AbstractSharedCommand { protected $signature = 'reports:outsource {--start-date=}'; + protected $description = 'Create outsources reports'; public function __construct(private TicketExportController $reports) diff --git a/src/backend/app/Console/Commands/PackageGenerator.php b/src/backend/app/Console/Commands/PackageGenerator.php index 8c190d5b4..45a864a1c 100644 --- a/src/backend/app/Console/Commands/PackageGenerator.php +++ b/src/backend/app/Console/Commands/PackageGenerator.php @@ -7,6 +7,7 @@ class PackageGenerator extends Command { protected $signature = 'micropowermanager:new-package {package-name}'; + protected $description = 'Clones package development starter pack'; public function handle(): void diff --git a/src/backend/app/Console/Commands/ReportGenerator.php b/src/backend/app/Console/Commands/ReportGenerator.php index b0dc6e405..d0e663c65 100644 --- a/src/backend/app/Console/Commands/ReportGenerator.php +++ b/src/backend/app/Console/Commands/ReportGenerator.php @@ -8,6 +8,7 @@ class ReportGenerator extends AbstractSharedCommand { protected $signature = 'reports:city-revenue {type} {--start-date=} {--company-id=}'; + protected $description = 'Creates city revenue reports'; public function __construct(private Reports $reports) diff --git a/src/backend/app/Console/Commands/RoutesGenerator.php b/src/backend/app/Console/Commands/RoutesGenerator.php index 78fdad8a1..a06c31d17 100644 --- a/src/backend/app/Console/Commands/RoutesGenerator.php +++ b/src/backend/app/Console/Commands/RoutesGenerator.php @@ -5,6 +5,7 @@ class RoutesGenerator extends AbstractSharedCommand { protected $signature = 'routes:generate'; + protected $description = 'Generates new routes from packages'; public function runInCompanyScope(): void @@ -52,7 +53,7 @@ private function removeLine(string $packageRoutesTmp, string $type) } else { return; } - $file = join('', $lines); + $file = implode('', $lines); file_put_contents($packageRoutesTmp, $file); } @@ -68,7 +69,7 @@ private function appendLines(string $packageRoutesTmp, $coreRoutesTmp): void $newLine = str_pad($value, strlen($value) + 4, ' ', STR_PAD_LEFT); } fwrite($tmp, $newLine); - ++$counter; + $counter++; } fclose($tmp); } diff --git a/src/backend/app/Console/Commands/SendNonPayingCustomerMailCommand.php b/src/backend/app/Console/Commands/SendNonPayingCustomerMailCommand.php index 6dbbbd142..bacc02240 100644 --- a/src/backend/app/Console/Commands/SendNonPayingCustomerMailCommand.php +++ b/src/backend/app/Console/Commands/SendNonPayingCustomerMailCommand.php @@ -15,9 +15,11 @@ class SendNonPayingCustomerMailCommand extends AbstractSharedCommand { private const EMAIL_TEMPLATE = 'templates.mail.non_paying_mail'; + private const REPORT_TEMPLATE = 'templates.mail.non_paying_pdf'; protected $signature = 'reports:send-non-paying-customer-mail {--start-date=} {--end-date=}'; + protected $description = 'Creates a report that includes a list of customers that didnt buy anything in the given period'; diff --git a/src/backend/app/Console/Commands/ShiftEcosysSHSdataForDeviceFeature.php b/src/backend/app/Console/Commands/ShiftEcosysSHSdataForDeviceFeature.php index 26048ad52..47408f0b6 100644 --- a/src/backend/app/Console/Commands/ShiftEcosysSHSdataForDeviceFeature.php +++ b/src/backend/app/Console/Commands/ShiftEcosysSHSdataForDeviceFeature.php @@ -13,6 +13,7 @@ class ShiftEcosysSHSdataForDeviceFeature extends AbstractSharedCommand { // --company-id=36 protected $signature = 'ecosys:shift-data {--company-id=}'; + protected $description = 'custom data shifting command for ecosys'; private $assetTypePricePeer = [ diff --git a/src/backend/app/Console/Kernel.php b/src/backend/app/Console/Kernel.php index 37cb47820..6e54c1655 100644 --- a/src/backend/app/Console/Kernel.php +++ b/src/backend/app/Console/Kernel.php @@ -54,7 +54,6 @@ class Kernel extends ConsoleKernel /** * Define the application's command schedule. * - * @param Schedule $schedule * * @return void */ diff --git a/src/backend/app/Events/AssetPersonCreated.php b/src/backend/app/Events/AssetPersonCreated.php index 8154a8f8d..04117796c 100644 --- a/src/backend/app/Events/AssetPersonCreated.php +++ b/src/backend/app/Events/AssetPersonCreated.php @@ -26,8 +26,6 @@ public function __construct(AssetPerson $assetPerson) /** * Get the channels the event should broadcast on. - * - * @return PrivateChannel */ public function broadcastOn(): PrivateChannel { diff --git a/src/backend/app/Events/ClusterEvent.php b/src/backend/app/Events/ClusterEvent.php index 060339e07..2d41070f9 100644 --- a/src/backend/app/Events/ClusterEvent.php +++ b/src/backend/app/Events/ClusterEvent.php @@ -19,10 +19,12 @@ class ClusterEvent * @var Cluster */ public $cluster; + /** * @var string */ public $type; + /** * @var mixed contains geo coordinates array or external url to fetch */ @@ -30,10 +32,6 @@ class ClusterEvent /** * Create a new event instance. - * - * @param Cluster $cluster - * @param string $type - * @param $data */ public function __construct(Cluster $cluster, string $type, $data) { @@ -45,8 +43,6 @@ public function __construct(Cluster $cluster, string $type, $data) /** * Get the channels the event should broadcast on. - * - * @return PrivateChannel */ public function broadcastOn(): PrivateChannel { diff --git a/src/backend/app/Events/HistoryEvent.php b/src/backend/app/Events/HistoryEvent.php index 0d13afea6..fe407fe3b 100644 --- a/src/backend/app/Events/HistoryEvent.php +++ b/src/backend/app/Events/HistoryEvent.php @@ -17,17 +17,11 @@ class HistoryEvent implements ShouldBroadcast /** * Create a new event instance. - * - * @param History $historyModel */ - public function __construct(private readonly History $historyModel) - { - } + public function __construct(private readonly History $historyModel) {} /** * Get the channels the event should broadcast on. - * - * @return PrivateChannel */ public function broadcastOn(): PrivateChannel { diff --git a/src/backend/app/Events/NewTicket.php b/src/backend/app/Events/NewTicket.php index 924945116..6fe38ee99 100644 --- a/src/backend/app/Events/NewTicket.php +++ b/src/backend/app/Events/NewTicket.php @@ -17,8 +17,6 @@ class NewTicket implements ShouldBroadcast /** * Create a new event instance. - * - * @param Ticket $ticket */ public function __construct(private Ticket $ticket) { diff --git a/src/backend/app/Events/PersonDeleting.php b/src/backend/app/Events/PersonDeleting.php index 614e2c69b..06dca7bf3 100644 --- a/src/backend/app/Events/PersonDeleting.php +++ b/src/backend/app/Events/PersonDeleting.php @@ -28,8 +28,6 @@ public function __construct(Person $person) /** * Get the channels the event should broadcast on. - * - * @return PrivateChannel */ public function broadcastOn(): PrivateChannel { diff --git a/src/backend/app/Exceptions/AccessRates/NoAccessRateFound.php b/src/backend/app/Exceptions/AccessRates/NoAccessRateFound.php index d6235e778..e2ee7b607 100644 --- a/src/backend/app/Exceptions/AccessRates/NoAccessRateFound.php +++ b/src/backend/app/Exceptions/AccessRates/NoAccessRateFound.php @@ -2,6 +2,4 @@ namespace App\Exceptions\AccessRates; -class NoAccessRateFound extends \Exception -{ -} +class NoAccessRateFound extends \Exception {} diff --git a/src/backend/app/Exceptions/ActiveSheetNotCreatedException.php b/src/backend/app/Exceptions/ActiveSheetNotCreatedException.php index 15050ae28..00ab89f41 100644 --- a/src/backend/app/Exceptions/ActiveSheetNotCreatedException.php +++ b/src/backend/app/Exceptions/ActiveSheetNotCreatedException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class ActiveSheetNotCreatedException extends \Exception -{ -} +class ActiveSheetNotCreatedException extends \Exception {} diff --git a/src/backend/app/Exceptions/AgentRiskBalanceExceeded.php b/src/backend/app/Exceptions/AgentRiskBalanceExceeded.php index 0d3dabe95..ab293d85d 100644 --- a/src/backend/app/Exceptions/AgentRiskBalanceExceeded.php +++ b/src/backend/app/Exceptions/AgentRiskBalanceExceeded.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class AgentRiskBalanceExceeded extends \Exception -{ -} +class AgentRiskBalanceExceeded extends \Exception {} diff --git a/src/backend/app/Exceptions/CustomerGroup/CustomerGroupNotFound.php b/src/backend/app/Exceptions/CustomerGroup/CustomerGroupNotFound.php index ad4f23d0f..42aa2753a 100644 --- a/src/backend/app/Exceptions/CustomerGroup/CustomerGroupNotFound.php +++ b/src/backend/app/Exceptions/CustomerGroup/CustomerGroupNotFound.php @@ -2,6 +2,4 @@ namespace App\Exceptions\CustomerGroup; -class CustomerGroupNotFound extends \Exception -{ -} +class CustomerGroupNotFound extends \Exception {} diff --git a/src/backend/app/Exceptions/Device/DeviceIsNotAssignedToCustomer.php b/src/backend/app/Exceptions/Device/DeviceIsNotAssignedToCustomer.php index 2bc75c1b8..f84ec75f0 100644 --- a/src/backend/app/Exceptions/Device/DeviceIsNotAssignedToCustomer.php +++ b/src/backend/app/Exceptions/Device/DeviceIsNotAssignedToCustomer.php @@ -2,6 +2,4 @@ namespace App\Exceptions\Device; -class DeviceIsNotAssignedToCustomer extends \Exception -{ -} +class DeviceIsNotAssignedToCustomer extends \Exception {} diff --git a/src/backend/app/Exceptions/DownPaymentBiggerThanAmountException.php b/src/backend/app/Exceptions/DownPaymentBiggerThanAmountException.php index 27781ada7..8d61ef9e9 100644 --- a/src/backend/app/Exceptions/DownPaymentBiggerThanAmountException.php +++ b/src/backend/app/Exceptions/DownPaymentBiggerThanAmountException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class DownPaymentBiggerThanAmountException extends \Exception -{ -} +class DownPaymentBiggerThanAmountException extends \Exception {} diff --git a/src/backend/app/Exceptions/DownPaymentBiggerThanAppliancePriceException.php b/src/backend/app/Exceptions/DownPaymentBiggerThanAppliancePriceException.php index 390707fee..7841d0b5b 100644 --- a/src/backend/app/Exceptions/DownPaymentBiggerThanAppliancePriceException.php +++ b/src/backend/app/Exceptions/DownPaymentBiggerThanAppliancePriceException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class DownPaymentBiggerThanAppliancePriceException extends \Exception -{ -} +class DownPaymentBiggerThanAppliancePriceException extends \Exception {} diff --git a/src/backend/app/Exceptions/DownPaymentNotFoundException.php b/src/backend/app/Exceptions/DownPaymentNotFoundException.php index 40aca906f..ad5558551 100644 --- a/src/backend/app/Exceptions/DownPaymentNotFoundException.php +++ b/src/backend/app/Exceptions/DownPaymentNotFoundException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class DownPaymentNotFoundException extends \Exception -{ -} +class DownPaymentNotFoundException extends \Exception {} diff --git a/src/backend/app/Exceptions/GeoFormatException.php b/src/backend/app/Exceptions/GeoFormatException.php index 983c839ff..97898c940 100644 --- a/src/backend/app/Exceptions/GeoFormatException.php +++ b/src/backend/app/Exceptions/GeoFormatException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class GeoFormatException extends \Exception -{ -} +class GeoFormatException extends \Exception {} diff --git a/src/backend/app/Exceptions/Handler.php b/src/backend/app/Exceptions/Handler.php index a1eec9f81..426b70947 100644 --- a/src/backend/app/Exceptions/Handler.php +++ b/src/backend/app/Exceptions/Handler.php @@ -34,7 +34,6 @@ class Handler extends ExceptionHandler /** * Report or log an exception. * - * @param \Throwable $exception * * @return void */ @@ -47,9 +46,8 @@ public function report(\Throwable $exception) /** * Render an exception into an HTTP response. * - * @param Request $request - * @param \Throwable $exception - * + * @param Request $request + * @param \Throwable $exception * @return \Illuminate\Http\JsonResponse */ public function render($request, \Exception|\Throwable $exception) diff --git a/src/backend/app/Exceptions/InvalidBingApiKeyException.php b/src/backend/app/Exceptions/InvalidBingApiKeyException.php index 1de422650..76a1e6db7 100644 --- a/src/backend/app/Exceptions/InvalidBingApiKeyException.php +++ b/src/backend/app/Exceptions/InvalidBingApiKeyException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class InvalidBingApiKeyException extends \Exception -{ -} +class InvalidBingApiKeyException extends \Exception {} diff --git a/src/backend/app/Exceptions/MailNotSentException.php b/src/backend/app/Exceptions/MailNotSentException.php index 3d1906639..44dac52ea 100644 --- a/src/backend/app/Exceptions/MailNotSentException.php +++ b/src/backend/app/Exceptions/MailNotSentException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class MailNotSentException extends \Exception -{ -} +class MailNotSentException extends \Exception {} diff --git a/src/backend/app/Exceptions/Manufacturer/ApiCallDoesNotSupportedException.php b/src/backend/app/Exceptions/Manufacturer/ApiCallDoesNotSupportedException.php index 545df482e..4e40fbc1b 100644 --- a/src/backend/app/Exceptions/Manufacturer/ApiCallDoesNotSupportedException.php +++ b/src/backend/app/Exceptions/Manufacturer/ApiCallDoesNotSupportedException.php @@ -2,6 +2,4 @@ namespace App\Exceptions\Manufacturer; -class ApiCallDoesNotSupportedException extends \Exception -{ -} +class ApiCallDoesNotSupportedException extends \Exception {} diff --git a/src/backend/app/Exceptions/Manufacturer/MeterIsNotReadable.php b/src/backend/app/Exceptions/Manufacturer/MeterIsNotReadable.php index 0ba7e64fc..fc34249d1 100644 --- a/src/backend/app/Exceptions/Manufacturer/MeterIsNotReadable.php +++ b/src/backend/app/Exceptions/Manufacturer/MeterIsNotReadable.php @@ -2,6 +2,4 @@ namespace App\Exceptions\Manufacturer; -class MeterIsNotReadable extends \Exception -{ -} +class MeterIsNotReadable extends \Exception {} diff --git a/src/backend/app/Exceptions/MeterParameter/MeterParameterNotFound.php b/src/backend/app/Exceptions/MeterParameter/MeterParameterNotFound.php index e6626356f..c1aaa2541 100644 --- a/src/backend/app/Exceptions/MeterParameter/MeterParameterNotFound.php +++ b/src/backend/app/Exceptions/MeterParameter/MeterParameterNotFound.php @@ -2,6 +2,4 @@ namespace App\Exceptions\MeterParameter; -class MeterParameterNotFound extends \Exception -{ -} +class MeterParameterNotFound extends \Exception {} diff --git a/src/backend/app/Exceptions/Meters/MeterIsNotAssignedToCustomer.php b/src/backend/app/Exceptions/Meters/MeterIsNotAssignedToCustomer.php index 654c62302..a4eac9638 100644 --- a/src/backend/app/Exceptions/Meters/MeterIsNotAssignedToCustomer.php +++ b/src/backend/app/Exceptions/Meters/MeterIsNotAssignedToCustomer.php @@ -2,6 +2,4 @@ namespace App\Exceptions\Meters; -class MeterIsNotAssignedToCustomer extends \Exception -{ -} +class MeterIsNotAssignedToCustomer extends \Exception {} diff --git a/src/backend/app/Exceptions/Meters/MeterIsNotInUse.php b/src/backend/app/Exceptions/Meters/MeterIsNotInUse.php index 07b393f18..f5889877f 100644 --- a/src/backend/app/Exceptions/Meters/MeterIsNotInUse.php +++ b/src/backend/app/Exceptions/Meters/MeterIsNotInUse.php @@ -2,6 +2,4 @@ namespace App\Exceptions\Meters; -class MeterIsNotInUse extends \Exception -{ -} +class MeterIsNotInUse extends \Exception {} diff --git a/src/backend/app/Exceptions/MissingSmsReferencesException.php b/src/backend/app/Exceptions/MissingSmsReferencesException.php index 1d8433f92..194b81871 100644 --- a/src/backend/app/Exceptions/MissingSmsReferencesException.php +++ b/src/backend/app/Exceptions/MissingSmsReferencesException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class MissingSmsReferencesException extends \Exception -{ -} +class MissingSmsReferencesException extends \Exception {} diff --git a/src/backend/app/Exceptions/NotificationSendFailedException.php b/src/backend/app/Exceptions/NotificationSendFailedException.php index 92a565e89..51c61ae21 100644 --- a/src/backend/app/Exceptions/NotificationSendFailedException.php +++ b/src/backend/app/Exceptions/NotificationSendFailedException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class NotificationSendFailedException extends \Exception -{ -} +class NotificationSendFailedException extends \Exception {} diff --git a/src/backend/app/Exceptions/PaymentAmountBiggerThanTotalRemainingAmount.php b/src/backend/app/Exceptions/PaymentAmountBiggerThanTotalRemainingAmount.php index cb54ff880..677de17a8 100644 --- a/src/backend/app/Exceptions/PaymentAmountBiggerThanTotalRemainingAmount.php +++ b/src/backend/app/Exceptions/PaymentAmountBiggerThanTotalRemainingAmount.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class PaymentAmountBiggerThanTotalRemainingAmount extends \Exception -{ -} +class PaymentAmountBiggerThanTotalRemainingAmount extends \Exception {} diff --git a/src/backend/app/Exceptions/PaymentAmountSmallerThanZero.php b/src/backend/app/Exceptions/PaymentAmountSmallerThanZero.php index 24ac1608b..df6a1a9f0 100644 --- a/src/backend/app/Exceptions/PaymentAmountSmallerThanZero.php +++ b/src/backend/app/Exceptions/PaymentAmountSmallerThanZero.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class PaymentAmountSmallerThanZero extends \Exception -{ -} +class PaymentAmountSmallerThanZero extends \Exception {} diff --git a/src/backend/app/Exceptions/PaymentProviderNotIdentified.php b/src/backend/app/Exceptions/PaymentProviderNotIdentified.php index 2329b28cf..dfe162a50 100644 --- a/src/backend/app/Exceptions/PaymentProviderNotIdentified.php +++ b/src/backend/app/Exceptions/PaymentProviderNotIdentified.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class PaymentProviderNotIdentified extends \Exception -{ -} +class PaymentProviderNotIdentified extends \Exception {} diff --git a/src/backend/app/Exceptions/PurchaseNotProcessable.php b/src/backend/app/Exceptions/PurchaseNotProcessable.php index 532d80829..616376ab8 100644 --- a/src/backend/app/Exceptions/PurchaseNotProcessable.php +++ b/src/backend/app/Exceptions/PurchaseNotProcessable.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class PurchaseNotProcessable extends \Exception -{ -} +class PurchaseNotProcessable extends \Exception {} diff --git a/src/backend/app/Exceptions/SmsAndroidSettingNotExistingException.php b/src/backend/app/Exceptions/SmsAndroidSettingNotExistingException.php index 68734f748..2255ebfa2 100644 --- a/src/backend/app/Exceptions/SmsAndroidSettingNotExistingException.php +++ b/src/backend/app/Exceptions/SmsAndroidSettingNotExistingException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class SmsAndroidSettingNotExistingException extends \Exception -{ -} +class SmsAndroidSettingNotExistingException extends \Exception {} diff --git a/src/backend/app/Exceptions/SmsBodyParserNotExtendedException.php b/src/backend/app/Exceptions/SmsBodyParserNotExtendedException.php index d1d728b80..6c51bbf00 100644 --- a/src/backend/app/Exceptions/SmsBodyParserNotExtendedException.php +++ b/src/backend/app/Exceptions/SmsBodyParserNotExtendedException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class SmsBodyParserNotExtendedException extends \Exception -{ -} +class SmsBodyParserNotExtendedException extends \Exception {} diff --git a/src/backend/app/Exceptions/SmsTypeNotFoundException.php b/src/backend/app/Exceptions/SmsTypeNotFoundException.php index af2112275..72bf5e6e6 100644 --- a/src/backend/app/Exceptions/SmsTypeNotFoundException.php +++ b/src/backend/app/Exceptions/SmsTypeNotFoundException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class SmsTypeNotFoundException extends \Exception -{ -} +class SmsTypeNotFoundException extends \Exception {} diff --git a/src/backend/app/Exceptions/SpreadSheetNotCreatedException.php b/src/backend/app/Exceptions/SpreadSheetNotCreatedException.php index 4d2144d5d..03bf69994 100644 --- a/src/backend/app/Exceptions/SpreadSheetNotCreatedException.php +++ b/src/backend/app/Exceptions/SpreadSheetNotCreatedException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class SpreadSheetNotCreatedException extends \Exception -{ -} +class SpreadSheetNotCreatedException extends \Exception {} diff --git a/src/backend/app/Exceptions/SpreadSheetNotSavedException.php b/src/backend/app/Exceptions/SpreadSheetNotSavedException.php index a2e4d6bdf..4cd121be1 100644 --- a/src/backend/app/Exceptions/SpreadSheetNotSavedException.php +++ b/src/backend/app/Exceptions/SpreadSheetNotSavedException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class SpreadSheetNotSavedException extends \Exception -{ -} +class SpreadSheetNotSavedException extends \Exception {} diff --git a/src/backend/app/Exceptions/Tariffs/TariffNotFound.php b/src/backend/app/Exceptions/Tariffs/TariffNotFound.php index 361c1168a..3bdb79c3d 100644 --- a/src/backend/app/Exceptions/Tariffs/TariffNotFound.php +++ b/src/backend/app/Exceptions/Tariffs/TariffNotFound.php @@ -2,6 +2,4 @@ namespace App\Exceptions\Tariffs; -class TariffNotFound extends \Exception -{ -} +class TariffNotFound extends \Exception {} diff --git a/src/backend/app/Exceptions/TransactionAmountNotEnoughException.php b/src/backend/app/Exceptions/TransactionAmountNotEnoughException.php index 539125a97..a73731e7b 100644 --- a/src/backend/app/Exceptions/TransactionAmountNotEnoughException.php +++ b/src/backend/app/Exceptions/TransactionAmountNotEnoughException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class TransactionAmountNotEnoughException extends \Exception -{ -} +class TransactionAmountNotEnoughException extends \Exception {} diff --git a/src/backend/app/Exceptions/TransactionAmountNotFoundException.php b/src/backend/app/Exceptions/TransactionAmountNotFoundException.php index c8d2dcb1f..c1e3e959b 100644 --- a/src/backend/app/Exceptions/TransactionAmountNotFoundException.php +++ b/src/backend/app/Exceptions/TransactionAmountNotFoundException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class TransactionAmountNotFoundException extends \Exception -{ -} +class TransactionAmountNotFoundException extends \Exception {} diff --git a/src/backend/app/Exceptions/TransactionFetchingException.php b/src/backend/app/Exceptions/TransactionFetchingException.php index 04e2b11d1..1342ac6b5 100644 --- a/src/backend/app/Exceptions/TransactionFetchingException.php +++ b/src/backend/app/Exceptions/TransactionFetchingException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class TransactionFetchingException extends \Exception -{ -} +class TransactionFetchingException extends \Exception {} diff --git a/src/backend/app/Exceptions/TransactionIsInvalidForProcessingIncomingRequestException.php b/src/backend/app/Exceptions/TransactionIsInvalidForProcessingIncomingRequestException.php index 7e676b2f7..c3072f9d0 100644 --- a/src/backend/app/Exceptions/TransactionIsInvalidForProcessingIncomingRequestException.php +++ b/src/backend/app/Exceptions/TransactionIsInvalidForProcessingIncomingRequestException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class TransactionIsInvalidForProcessingIncomingRequestException extends \Exception -{ -} +class TransactionIsInvalidForProcessingIncomingRequestException extends \Exception {} diff --git a/src/backend/app/Exceptions/TransactionNotInitializedException.php b/src/backend/app/Exceptions/TransactionNotInitializedException.php index 72bb1fb9a..4f1a18b22 100644 --- a/src/backend/app/Exceptions/TransactionNotInitializedException.php +++ b/src/backend/app/Exceptions/TransactionNotInitializedException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class TransactionNotInitializedException extends \Exception -{ -} +class TransactionNotInitializedException extends \Exception {} diff --git a/src/backend/app/Exceptions/TrelloAPIException.php b/src/backend/app/Exceptions/TrelloAPIException.php index 7ef91cb43..0d4efe486 100644 --- a/src/backend/app/Exceptions/TrelloAPIException.php +++ b/src/backend/app/Exceptions/TrelloAPIException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class TrelloAPIException extends \Exception -{ -} +class TrelloAPIException extends \Exception {} diff --git a/src/backend/app/Exceptions/UserAddressNorFoundException.php b/src/backend/app/Exceptions/UserAddressNorFoundException.php index 719bcbecc..ab0988f00 100644 --- a/src/backend/app/Exceptions/UserAddressNorFoundException.php +++ b/src/backend/app/Exceptions/UserAddressNorFoundException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class UserAddressNorFoundException extends \Exception -{ -} +class UserAddressNorFoundException extends \Exception {} diff --git a/src/backend/app/Exceptions/ValidationException.php b/src/backend/app/Exceptions/ValidationException.php index f71d1829e..3fdeb2d7a 100644 --- a/src/backend/app/Exceptions/ValidationException.php +++ b/src/backend/app/Exceptions/ValidationException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class ValidationException extends \Exception -{ -} +class ValidationException extends \Exception {} diff --git a/src/backend/app/Exceptions/VodacomHeartBeatException.php b/src/backend/app/Exceptions/VodacomHeartBeatException.php index 11b8f4871..0eb591ca4 100644 --- a/src/backend/app/Exceptions/VodacomHeartBeatException.php +++ b/src/backend/app/Exceptions/VodacomHeartBeatException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class VodacomHeartBeatException extends \Exception -{ -} +class VodacomHeartBeatException extends \Exception {} diff --git a/src/backend/app/Exceptions/WeatherParametersMissing.php b/src/backend/app/Exceptions/WeatherParametersMissing.php index 872494fcc..7dbd55f3d 100644 --- a/src/backend/app/Exceptions/WeatherParametersMissing.php +++ b/src/backend/app/Exceptions/WeatherParametersMissing.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class WeatherParametersMissing extends \Exception -{ -} +class WeatherParametersMissing extends \Exception {} diff --git a/src/backend/app/Exceptions/WeatherProviderUnreachable.php b/src/backend/app/Exceptions/WeatherProviderUnreachable.php index 06f5e6c76..ca2e60999 100644 --- a/src/backend/app/Exceptions/WeatherProviderUnreachable.php +++ b/src/backend/app/Exceptions/WeatherProviderUnreachable.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class WeatherProviderUnreachable extends \Exception -{ -} +class WeatherProviderUnreachable extends \Exception {} diff --git a/src/backend/app/Helpers/MailHelper.php b/src/backend/app/Helpers/MailHelper.php index becf42d89..70ed158b1 100644 --- a/src/backend/app/Helpers/MailHelper.php +++ b/src/backend/app/Helpers/MailHelper.php @@ -35,10 +35,7 @@ private function configure(): void } /** - * @param $to - * @param $title - * @param $body - * @param null $attachment + * @param null $attachment * * @throws MailNotSentException * @throws PHPMailerException @@ -63,7 +60,7 @@ public function sendPlain($to, $title, $body, $attachment = null): void $this->mailer->AltBody = $this->mailSettings['default_message']; - if (!$this->mailer->send()) { + if (! $this->mailer->send()) { throw new MailNotSentException($this->mailer->ErrorInfo); } } @@ -87,7 +84,7 @@ public function sendViaTemplate(string $to, string $title, string $templatePath, $this->mailer->addAttachment($attachmentPath); } - if (!$this->mailer->send()) { + if (! $this->mailer->send()) { throw new MailNotSentException($this->mailer->ErrorInfo); } } diff --git a/src/backend/app/Helpers/MailHelperInterface.php b/src/backend/app/Helpers/MailHelperInterface.php index 1497c93c3..bd59bfe98 100644 --- a/src/backend/app/Helpers/MailHelperInterface.php +++ b/src/backend/app/Helpers/MailHelperInterface.php @@ -8,10 +8,7 @@ interface MailHelperInterface { /** - * @param $to - * @param $title - * @param $body - * @param null $attachment + * @param null $attachment * * @throws MailNotSentException * @throws PHPMailerException diff --git a/src/backend/app/Helpers/MailHelperMock.php b/src/backend/app/Helpers/MailHelperMock.php index 43f3d186a..313fd2256 100644 --- a/src/backend/app/Helpers/MailHelperMock.php +++ b/src/backend/app/Helpers/MailHelperMock.php @@ -8,21 +8,12 @@ class MailHelperMock implements MailHelperInterface { /** - * @param $to - * @param $title - * @param $body - * @param null $attachment + * @param null $attachment * * @throws MailNotSentException * @throws PHPMailerException */ - public function sendPlain($to, $title, $body, $attachment = null): void - { - return; - } + public function sendPlain($to, $title, $body, $attachment = null): void {} - public function sendViaTemplate(string $to, string $title, string $templatePath, ?array $variables = null, ?string $attachmentPath = null): void - { - return; - } + public function sendViaTemplate(string $to, string $title, string $templatePath, ?array $variables = null, ?string $attachmentPath = null): void {} } diff --git a/src/backend/app/Helpers/PowerConverter.php b/src/backend/app/Helpers/PowerConverter.php index 181ba96ac..103f2dca5 100644 --- a/src/backend/app/Helpers/PowerConverter.php +++ b/src/backend/app/Helpers/PowerConverter.php @@ -14,7 +14,7 @@ class PowerConverter ]; /** - * @param int|string $power + * @param int|string $power */ public static function convert($power, $powerUnit, string $expectedUnit = 'Wh') { diff --git a/src/backend/app/Helpers/RelationsManager.php b/src/backend/app/Helpers/RelationsManager.php index a9ee86ac7..23f2ee172 100644 --- a/src/backend/app/Helpers/RelationsManager.php +++ b/src/backend/app/Helpers/RelationsManager.php @@ -30,7 +30,7 @@ trait RelationsManager public static function getAllRelations($type = null): array { - if (!self::$relationsInitialized) { + if (! self::$relationsInitialized) { self::initAllRelations(); } if ($type) { diff --git a/src/backend/app/Http/Controllers/AddressController.php b/src/backend/app/Http/Controllers/AddressController.php index fa76d322e..ea52ce4f7 100644 --- a/src/backend/app/Http/Controllers/AddressController.php +++ b/src/backend/app/Http/Controllers/AddressController.php @@ -13,8 +13,7 @@ public function __construct( private AddressesService $addressService, private PersonService $personService, private PersonAddressService $personAddressService, - ) { - } + ) {} public function index(): ApiResource { diff --git a/src/backend/app/Http/Controllers/AgentAssignedApplianceWebController.php b/src/backend/app/Http/Controllers/AgentAssignedApplianceWebController.php index 7d705f424..cf7466cfb 100644 --- a/src/backend/app/Http/Controllers/AgentAssignedApplianceWebController.php +++ b/src/backend/app/Http/Controllers/AgentAssignedApplianceWebController.php @@ -12,8 +12,7 @@ class AgentAssignedApplianceWebController extends Controller { public function __construct( private AgentAssignedApplianceService $agentAssignedApplianceService, - ) { - } + ) {} /** * Store a newly created resource in storage. @@ -23,8 +22,6 @@ public function __construct( * @bodyParam appliance_type_id integer required * @bodyParam cost integer required * - * @param CreateAgentAssignedApplianceRequest $request - * * @return ApiResource */ public function store(CreateAgentAssignedApplianceRequest $request) @@ -42,9 +39,7 @@ public function store(CreateAgentAssignedApplianceRequest $request) /** * List for Web interface. * - * @param Agent $agent - * @param Request $request - * + * @param Agent $agent * @return ApiResource */ public function index($agentId, Request $request) diff --git a/src/backend/app/Http/Controllers/AgentAssignedAppliancesController.php b/src/backend/app/Http/Controllers/AgentAssignedAppliancesController.php index 50117b109..0d15523e9 100644 --- a/src/backend/app/Http/Controllers/AgentAssignedAppliancesController.php +++ b/src/backend/app/Http/Controllers/AgentAssignedAppliancesController.php @@ -17,13 +17,11 @@ class AgentAssignedAppliancesController extends Controller public function __construct( private AgentAssignedApplianceService $agentAssignedApplianceService, private AgentService $agentService, - ) { - } + ) {} /** * List for Android-APP. * - * @param Request $request * * @return ApiResource */ diff --git a/src/backend/app/Http/Controllers/AgentAuthController.php b/src/backend/app/Http/Controllers/AgentAuthController.php index 19a8994eb..953260e87 100644 --- a/src/backend/app/Http/Controllers/AgentAuthController.php +++ b/src/backend/app/Http/Controllers/AgentAuthController.php @@ -16,8 +16,6 @@ class AgentAuthController extends Controller { /** * Create a new AuthController instance. - * - * @param AgentService $agentService */ public function __construct(private AgentService $agentService) { @@ -36,7 +34,7 @@ public function login(Request $request) { $credentials = $request->only(['email', 'password']); - if (!$token = auth('agent_api')->setTTL(525600)->attempt($credentials)) { + if (! $token = auth('agent_api')->setTTL(525600)->attempt($credentials)) { return response()->json(['data' => ['message' => 'Unauthorized', 'status' => 401]], 401); } @@ -84,8 +82,7 @@ public function refresh() /** * Get the token array structure. * - * @param string $token - * + * @param string $token * @return JsonResponse */ protected function respondWithToken($token) diff --git a/src/backend/app/Http/Controllers/AgentBalanceController.php b/src/backend/app/Http/Controllers/AgentBalanceController.php index 6725fb5e5..69fff4b0d 100644 --- a/src/backend/app/Http/Controllers/AgentBalanceController.php +++ b/src/backend/app/Http/Controllers/AgentBalanceController.php @@ -9,8 +9,7 @@ class AgentBalanceController extends Controller { public function __construct( private AgentService $agentService, - ) { - } + ) {} public function show(Request $request) { diff --git a/src/backend/app/Http/Controllers/AgentBalanceHistoryController.php b/src/backend/app/Http/Controllers/AgentBalanceHistoryController.php index 776c3b337..11cf9551b 100644 --- a/src/backend/app/Http/Controllers/AgentBalanceHistoryController.php +++ b/src/backend/app/Http/Controllers/AgentBalanceHistoryController.php @@ -20,11 +20,6 @@ public function __construct(AgentBalanceHistoryService $agentBalanceHistoryServi /** * Store a newly created resource in storage. - * - * @param Agent $agent - * @param CreateAgentBalanceHistoryRequest $request - * - * @return ApiResource */ public function store(Agent $agent, CreateAgentBalanceHistoryRequest $request): ApiResource { @@ -43,34 +38,24 @@ public function store(Agent $agent, CreateAgentBalanceHistoryRequest $request): /** * Display the specified resource. * - * @param AgentBalanceHistory $agent_balance_history * * @return void */ - public function show(AgentBalanceHistory $agent_balance_history) - { - } + public function show(AgentBalanceHistory $agent_balance_history) {} /** * Update the specified resource in storage. * - * @param Request $request - * @param AgentBalanceHistory $agent_balance_history * * @return void */ - public function update(Request $request, AgentBalanceHistory $agent_balance_history) - { - } + public function update(Request $request, AgentBalanceHistory $agent_balance_history) {} /** * Remove the specified resource from storage. * - * @param AgentBalanceHistory $agent_balance_history * * @return void */ - public function destroy(AgentBalanceHistory $agent_balance_history) - { - } + public function destroy(AgentBalanceHistory $agent_balance_history) {} } diff --git a/src/backend/app/Http/Controllers/AgentBalanceHistoryWebController.php b/src/backend/app/Http/Controllers/AgentBalanceHistoryWebController.php index e943a7ec4..2f2ed550c 100644 --- a/src/backend/app/Http/Controllers/AgentBalanceHistoryWebController.php +++ b/src/backend/app/Http/Controllers/AgentBalanceHistoryWebController.php @@ -8,9 +8,7 @@ class AgentBalanceHistoryWebController extends Controller { - public function __construct(private AgentBalanceHistoryService $agentBalanceHistoryService) - { - } + public function __construct(private AgentBalanceHistoryService $agentBalanceHistoryService) {} public function index($agentId, Request $request) { diff --git a/src/backend/app/Http/Controllers/AgentChargeWebController.php b/src/backend/app/Http/Controllers/AgentChargeWebController.php index 15de11c83..2333cbdb8 100644 --- a/src/backend/app/Http/Controllers/AgentChargeWebController.php +++ b/src/backend/app/Http/Controllers/AgentChargeWebController.php @@ -10,8 +10,7 @@ class AgentChargeWebController extends Controller { public function __construct( private AgentChargeService $agentChargeService, - ) { - } + ) {} public function store(CreateAgentChargeRequest $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/AgentCommissionWebController.php b/src/backend/app/Http/Controllers/AgentCommissionWebController.php index 75482faf0..06d24f184 100644 --- a/src/backend/app/Http/Controllers/AgentCommissionWebController.php +++ b/src/backend/app/Http/Controllers/AgentCommissionWebController.php @@ -9,14 +9,10 @@ class AgentCommissionWebController extends Controller { - public function __construct(private AgentCommissionService $agentCommissionService) - { - } + public function __construct(private AgentCommissionService $agentCommissionService) {} /** * Display a listing of the resource. - * - * @return ApiResource */ public function index(Request $request): ApiResource { @@ -28,7 +24,6 @@ public function index(Request $request): ApiResource /** * Store a newly created resource in storage. * - * @param CreateAgentCommissionRequest $request * * @return ApiResource */ @@ -41,11 +36,6 @@ public function store(CreateAgentCommissionRequest $request) /** * Update the specified resource in storage. - * - * @param $agentCommissionId - * @param CreateAgentCommissionRequest $request - * - * @return ApiResource */ public function update($agentCommissionId, CreateAgentCommissionRequest $request): ApiResource { @@ -56,10 +46,6 @@ public function update($agentCommissionId, CreateAgentCommissionRequest $request /** * Remove the specified resource from storage. - * - * @param $agentCommissionId - * - * @return ApiResource */ public function destroy($agentCommissionId): ApiResource { diff --git a/src/backend/app/Http/Controllers/AgentCustomerController.php b/src/backend/app/Http/Controllers/AgentCustomerController.php index 19bc26360..140803377 100644 --- a/src/backend/app/Http/Controllers/AgentCustomerController.php +++ b/src/backend/app/Http/Controllers/AgentCustomerController.php @@ -12,13 +12,11 @@ class AgentCustomerController extends Controller public function __construct( private AgentCustomerService $agentCustomerService, private AgentService $agentService, - ) { - } + ) {} /** * Display a listing of the resource. * - * @param Request $request * * @return ApiResource */ diff --git a/src/backend/app/Http/Controllers/AgentCustomerTicketController.php b/src/backend/app/Http/Controllers/AgentCustomerTicketController.php index d10413907..fba58192e 100644 --- a/src/backend/app/Http/Controllers/AgentCustomerTicketController.php +++ b/src/backend/app/Http/Controllers/AgentCustomerTicketController.php @@ -9,9 +9,7 @@ class AgentCustomerTicketController extends Controller { - public function __construct(private AgentService $agentService, private TicketService $ticketService) - { - } + public function __construct(private AgentService $agentService, private TicketService $ticketService) {} public function show($customerId, Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/AgentCustomersPaymentHistoryController.php b/src/backend/app/Http/Controllers/AgentCustomersPaymentHistoryController.php index da8dcd519..758d19b61 100644 --- a/src/backend/app/Http/Controllers/AgentCustomersPaymentHistoryController.php +++ b/src/backend/app/Http/Controllers/AgentCustomersPaymentHistoryController.php @@ -10,8 +10,7 @@ class AgentCustomersPaymentHistoryController extends Controller public function __construct( private AgentService $agentService, private AgentCustomersPaymentHistoryService $agentCustomersPaymentHistoryService, - ) { - } + ) {} public function show(int $customerId, string $period, $limit = null, $order = 'ASC') { diff --git a/src/backend/app/Http/Controllers/AgentDashboardBalanceHistoryController.php b/src/backend/app/Http/Controllers/AgentDashboardBalanceHistoryController.php index 434d4de10..a2cba7b39 100644 --- a/src/backend/app/Http/Controllers/AgentDashboardBalanceHistoryController.php +++ b/src/backend/app/Http/Controllers/AgentDashboardBalanceHistoryController.php @@ -14,8 +14,7 @@ public function __construct( private AgentService $agentService, private AgentBalanceHistoryService $agentBalanceHistoryService, private AgentReceiptService $agentReceiptService, - ) { - } + ) {} public function show(Request $request, Response $response) { diff --git a/src/backend/app/Http/Controllers/AgentDashboardBoxesController.php b/src/backend/app/Http/Controllers/AgentDashboardBoxesController.php index 00ce9eec1..3c1af77d7 100644 --- a/src/backend/app/Http/Controllers/AgentDashboardBoxesController.php +++ b/src/backend/app/Http/Controllers/AgentDashboardBoxesController.php @@ -14,8 +14,7 @@ public function __construct( private AgentService $agentService, private AgentBalanceHistoryService $agentBalanceHistoryService, private AgentReceiptService $agentReceiptService, - ) { - } + ) {} public function show(Request $request, Response $response) { diff --git a/src/backend/app/Http/Controllers/AgentDashboardRevenueController.php b/src/backend/app/Http/Controllers/AgentDashboardRevenueController.php index a6f16fee1..e9036adb9 100644 --- a/src/backend/app/Http/Controllers/AgentDashboardRevenueController.php +++ b/src/backend/app/Http/Controllers/AgentDashboardRevenueController.php @@ -12,8 +12,7 @@ class AgentDashboardRevenueController extends Controller public function __construct( private AgentService $agentService, private AgentBalanceHistoryService $agentBalanceHistoryService, - ) { - } + ) {} public function show(Request $request, Response $response) { diff --git a/src/backend/app/Http/Controllers/AgentFirebaseController.php b/src/backend/app/Http/Controllers/AgentFirebaseController.php index 0a14c5b57..f84d55303 100644 --- a/src/backend/app/Http/Controllers/AgentFirebaseController.php +++ b/src/backend/app/Http/Controllers/AgentFirebaseController.php @@ -10,8 +10,7 @@ class AgentFirebaseController extends Controller { public function __construct( private AgentService $agentService, - ) { - } + ) {} public function update(Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/AgentReceiptDetailController.php b/src/backend/app/Http/Controllers/AgentReceiptDetailController.php index 26a7d1a51..6b4f26a3b 100644 --- a/src/backend/app/Http/Controllers/AgentReceiptDetailController.php +++ b/src/backend/app/Http/Controllers/AgentReceiptDetailController.php @@ -2,6 +2,4 @@ namespace App\Http\Controllers; -class AgentReceiptDetailController extends Controller -{ -} +class AgentReceiptDetailController extends Controller {} diff --git a/src/backend/app/Http/Controllers/AgentReceiptWebController.php b/src/backend/app/Http/Controllers/AgentReceiptWebController.php index 7dc73ea5f..c4e79c4d0 100644 --- a/src/backend/app/Http/Controllers/AgentReceiptWebController.php +++ b/src/backend/app/Http/Controllers/AgentReceiptWebController.php @@ -13,14 +13,11 @@ class AgentReceiptWebController extends Controller public function __construct( private AgentReceiptService $agentReceiptService, private AgentBalanceHistoryService $agentBalanceHistoryService, - ) { - } + ) {} /** * Display a listing of the resource. * - * @param $agentId - * @param Request $request * * @return ApiResource */ @@ -34,7 +31,6 @@ public function show($agentId, Request $request) /** * Display a listing of the resource. * - * @param Request $request * * @return ApiResource */ @@ -48,9 +44,7 @@ public function index(Request $request) /** * Store a newly created resource in storage. * - * @param $agentId - * @param CreateAgentReceiptRequest $request - * + * @param $agentId * @return ApiResource */ public function store(CreateAgentReceiptRequest $request) diff --git a/src/backend/app/Http/Controllers/AgentSoldApplianceController.php b/src/backend/app/Http/Controllers/AgentSoldApplianceController.php index fd2764f5c..35d2efd73 100644 --- a/src/backend/app/Http/Controllers/AgentSoldApplianceController.php +++ b/src/backend/app/Http/Controllers/AgentSoldApplianceController.php @@ -15,8 +15,7 @@ class AgentSoldApplianceController extends Controller public function __construct( private AgentSoldApplianceService $agentSoldApplianceService, private AgentService $agentService, - ) { - } + ) {} public function index(Request $request) { @@ -36,7 +35,6 @@ public function show($customerId, Request $request): ApiResource /** * Store a newly created resource in storage. * - * @param CreateAgentSoldApplianceRequest $request * * @return ApiResource */ diff --git a/src/backend/app/Http/Controllers/AgentSoldApplianceWebController.php b/src/backend/app/Http/Controllers/AgentSoldApplianceWebController.php index 2ca847494..cc365bd52 100644 --- a/src/backend/app/Http/Controllers/AgentSoldApplianceWebController.php +++ b/src/backend/app/Http/Controllers/AgentSoldApplianceWebController.php @@ -8,9 +8,7 @@ class AgentSoldApplianceWebController extends Controller { - public function __construct(private AgentSoldApplianceService $agentSoldApplianceService) - { - } + public function __construct(private AgentSoldApplianceService $agentSoldApplianceService) {} public function index($agentId, Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/AgentTicketController.php b/src/backend/app/Http/Controllers/AgentTicketController.php index 5f111655f..8666d7b49 100644 --- a/src/backend/app/Http/Controllers/AgentTicketController.php +++ b/src/backend/app/Http/Controllers/AgentTicketController.php @@ -17,6 +17,7 @@ class AgentTicketController extends Controller { private $board; + private $card; public function __construct( @@ -56,7 +57,7 @@ public function store(CreateAgentTicketRequest $request): TicketResource $ownerId = $ticketData['owner_id']; $owner = $this->personService->getById($ownerId); - if (!$owner) { + if (! $owner) { throw new TicketOwnerNotFoundException('Ticket owner with following id not found '.$ownerId); } diff --git a/src/backend/app/Http/Controllers/AgentTransactionWebController.php b/src/backend/app/Http/Controllers/AgentTransactionWebController.php index 34fa60bf9..a4ca9ebcf 100644 --- a/src/backend/app/Http/Controllers/AgentTransactionWebController.php +++ b/src/backend/app/Http/Controllers/AgentTransactionWebController.php @@ -8,9 +8,7 @@ class AgentTransactionWebController extends Controller { - public function __construct(private AgentTransactionService $agentTransactionService) - { - } + public function __construct(private AgentTransactionService $agentTransactionService) {} public function index($agentId, Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/AgentTransactionsController.php b/src/backend/app/Http/Controllers/AgentTransactionsController.php index f4c747da3..e99f6ad2c 100644 --- a/src/backend/app/Http/Controllers/AgentTransactionsController.php +++ b/src/backend/app/Http/Controllers/AgentTransactionsController.php @@ -14,8 +14,7 @@ class AgentTransactionsController extends Controller public function __construct( private AgentTransactionService $agentTransactionService, private AgentService $agentService, - ) { - } + ) {} public function index(Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/AgentWebController.php b/src/backend/app/Http/Controllers/AgentWebController.php index 5554868ba..1dc258e28 100644 --- a/src/backend/app/Http/Controllers/AgentWebController.php +++ b/src/backend/app/Http/Controllers/AgentWebController.php @@ -25,8 +25,7 @@ public function __construct( private CountryService $countryService, private CompanyDatabaseService $companyDatabaseService, private DatabaseProxyService $databaseProxyService, - ) { - } + ) {} public function index(Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/AppliancePaymentController.php b/src/backend/app/Http/Controllers/AppliancePaymentController.php index b134182ef..891a925c2 100644 --- a/src/backend/app/Http/Controllers/AppliancePaymentController.php +++ b/src/backend/app/Http/Controllers/AppliancePaymentController.php @@ -10,9 +10,7 @@ class AppliancePaymentController extends Controller { - public function __construct(private AppliancePaymentService $appliancePaymentService) - { - } + public function __construct(private AppliancePaymentService $appliancePaymentService) {} public function store(AssetPerson $appliancePerson, Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/AssetController.php b/src/backend/app/Http/Controllers/AssetController.php index 4dcd824d9..6d8c0843a 100644 --- a/src/backend/app/Http/Controllers/AssetController.php +++ b/src/backend/app/Http/Controllers/AssetController.php @@ -11,14 +11,10 @@ class AssetController extends Controller { - public function __construct(private AssetService $assetService) - { - } + public function __construct(private AssetService $assetService) {} /** * Display a listing of the resource. - * - * @return ApiResource */ public function index(Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/AssetPersonController.php b/src/backend/app/Http/Controllers/AssetPersonController.php index 01199feba..3d56abe02 100644 --- a/src/backend/app/Http/Controllers/AssetPersonController.php +++ b/src/backend/app/Http/Controllers/AssetPersonController.php @@ -36,17 +36,12 @@ public function __construct( private CashTransactionService $cashTransactionService, private AssetService $applianceService, private ApplianceRateService $applianceRateService, - ) { - } + ) {} /** * Store a newly created resource in storage. * - * @param AssetType $assetType - * @param Person $person - * @param Request $request - * - * @return ApiResource + * @param AssetType $assetType */ public function store( Asset $asset, @@ -109,7 +104,7 @@ public function store( $this->geographicalInformationService->save($geographicalInformation); } if ($downPayment > 0) { - $sender = !isset($addressData) ? '-' : $addressData['phone']; + $sender = ! isset($addressData) ? '-' : $addressData['phone']; $transaction = $this->cashTransactionService->createCashTransaction( $user->id, $downPayment, @@ -141,11 +136,6 @@ public function store( /** * Display the specified resource. - * - * @param Person $person - * @param Request $request - * - * @return ApiResource */ public function index(Person $person, Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/AssetRateController.php b/src/backend/app/Http/Controllers/AssetRateController.php index 4b0e90d7f..591bf9a13 100644 --- a/src/backend/app/Http/Controllers/AssetRateController.php +++ b/src/backend/app/Http/Controllers/AssetRateController.php @@ -13,12 +13,12 @@ class AssetRateController extends Controller /** * Update the specified resource in storage. * - * @param Request $request - * @param AssetRate $assetRate - * + * @param Request $request + * @param AssetRate $assetRate * @return ApiResource */ private $cashTransactionService; + private $applianceRateService; public function __construct( @@ -41,7 +41,7 @@ public function update(Request $request, AssetRate $applianceRate): ApiResource if ($newCost === 0) { $this->applianceRateService ->deleteUpdatedApplianceRateIfCostZero($applianceRate, $creatorId, $cost, $newCost); - --$appliancePerson->rate_count; + $appliancePerson->rate_count--; } else { $this->applianceRateService->updateApplianceRateCost($applianceRate, $creatorId, $cost, $newCost); } diff --git a/src/backend/app/Http/Controllers/AssetTypeController.php b/src/backend/app/Http/Controllers/AssetTypeController.php index 100c724d1..e5df4e5d0 100644 --- a/src/backend/app/Http/Controllers/AssetTypeController.php +++ b/src/backend/app/Http/Controllers/AssetTypeController.php @@ -26,8 +26,6 @@ public function __construct(ApplianceTypeService $applianceTypeService) /** * Display a listing of the resource. - * - * @return ApiResource */ public function index(Request $request): ApiResource { @@ -36,10 +34,6 @@ public function index(Request $request): ApiResource /** * Store a newly created resource in storage. - * - * @param AssetTypeCreateRequest $request - * - * @return ApiResource */ public function store(AssetTypeCreateRequest $request): ApiResource { @@ -50,11 +44,6 @@ public function store(AssetTypeCreateRequest $request): ApiResource /** * Update the specified resource in storage. - * - * @param AssetTypeUpdateRequest $request - * @param AssetType $assetType - * - * @return ApiResource */ public function update(AssetTypeUpdateRequest $request, AssetType $assetType): ApiResource { @@ -66,9 +55,7 @@ public function update(AssetTypeUpdateRequest $request, AssetType $assetType): A /** * Remove the specified resource from storage. * - * @param AssetType $assetType * - * @return ApiResource * * @throws \Exception */ diff --git a/src/backend/app/Http/Controllers/AuthController.php b/src/backend/app/Http/Controllers/AuthController.php index 5c0a69433..51e67fee4 100644 --- a/src/backend/app/Http/Controllers/AuthController.php +++ b/src/backend/app/Http/Controllers/AuthController.php @@ -31,7 +31,7 @@ public function login() { $credentials = request(['email', 'password']); - if (!$token = auth('api')->attempt($credentials)) { + if (! $token = auth('api')->attempt($credentials)) { return response()->json(['data' => ['message' => 'Unauthorized', 'status' => 401]], 401); } @@ -75,8 +75,7 @@ public function refresh() /** * Get the token array structure. * - * @param string $token - * + * @param string $token * @return JsonResponse */ protected function respondWithToken($token) diff --git a/src/backend/app/Http/Controllers/CityController.php b/src/backend/app/Http/Controllers/CityController.php index e2be57a09..bc68110cc 100644 --- a/src/backend/app/Http/Controllers/CityController.php +++ b/src/backend/app/Http/Controllers/CityController.php @@ -15,8 +15,7 @@ public function __construct( private CityService $cityService, private GeographicalInformationService $geographicalInformationService, private CityGeographicalInformationService $cityGeographicalInformationService, - ) { - } + ) {} public function index(Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/ClusterController.php b/src/backend/app/Http/Controllers/ClusterController.php index aa968b833..f442d02b6 100644 --- a/src/backend/app/Http/Controllers/ClusterController.php +++ b/src/backend/app/Http/Controllers/ClusterController.php @@ -17,8 +17,7 @@ public function __construct( private ClusterMeterService $clusterMetersService, private ClusterTransactionService $clusterTransactionsService, private ClusterPopulationService $clusterPopulationService, - ) { - } + ) {} /** * @throws \Exception diff --git a/src/backend/app/Http/Controllers/ClusterMiniGridRevenueController.php b/src/backend/app/Http/Controllers/ClusterMiniGridRevenueController.php index cc58a8509..e0d047afe 100644 --- a/src/backend/app/Http/Controllers/ClusterMiniGridRevenueController.php +++ b/src/backend/app/Http/Controllers/ClusterMiniGridRevenueController.php @@ -10,8 +10,7 @@ class ClusterMiniGridRevenueController extends Controller { public function __construct( private ClusterRevenueService $clusterRevenueService, - ) { - } + ) {} public function show($clusterId, Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/ClusterRevenueAnalysisController.php b/src/backend/app/Http/Controllers/ClusterRevenueAnalysisController.php index 648ce6866..d6e04d075 100644 --- a/src/backend/app/Http/Controllers/ClusterRevenueAnalysisController.php +++ b/src/backend/app/Http/Controllers/ClusterRevenueAnalysisController.php @@ -14,8 +14,7 @@ public function __construct( private ClusterService $clusterService, private ClusterRevenueService $clusterRevenueService, private ConnectionTypeService $connectionTypeService, - ) { - } + ) {} public function show($clusterId, Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/ClusterRevenueController.php b/src/backend/app/Http/Controllers/ClusterRevenueController.php index c17d2cbaa..c1cc227ba 100644 --- a/src/backend/app/Http/Controllers/ClusterRevenueController.php +++ b/src/backend/app/Http/Controllers/ClusterRevenueController.php @@ -22,8 +22,7 @@ public function __construct( private ClusterTransactionService $clusterTransactionService, private ClusterPopulationService $clusterPopulationService, private PeriodService $periodService, - ) { - } + ) {} public function index(Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/ClustersDashboardCacheDataController.php b/src/backend/app/Http/Controllers/ClustersDashboardCacheDataController.php index fe1b2b170..51b3eb7b0 100644 --- a/src/backend/app/Http/Controllers/ClustersDashboardCacheDataController.php +++ b/src/backend/app/Http/Controllers/ClustersDashboardCacheDataController.php @@ -10,8 +10,7 @@ class ClustersDashboardCacheDataController extends Controller { public function __construct( private ClustersDashboardCacheDataService $clustersDashboardCacheDataService, - ) { - } + ) {} public function index() { diff --git a/src/backend/app/Http/Controllers/CompanyController.php b/src/backend/app/Http/Controllers/CompanyController.php index 8b6f0c889..4b36b46a5 100644 --- a/src/backend/app/Http/Controllers/CompanyController.php +++ b/src/backend/app/Http/Controllers/CompanyController.php @@ -27,8 +27,7 @@ public function __construct( private MpmPluginService $mpmPluginService, private RegistrationTailService $registrationTailService, private MainSettingsService $mainSettingsService, - ) { - } + ) {} public function store(CompanyRegistrationRequest $request): JsonResponse { @@ -94,7 +93,7 @@ function () use ($company, $plugins) { '-', $mpmPlugin->tail_tag ) : null, - 'adjusted' => !isset($mpmPlugin->tail_tag), + 'adjusted' => ! isset($mpmPlugin->tail_tag), ]; Artisan::call($mpmPlugin->installation_command); } diff --git a/src/backend/app/Http/Controllers/ConnectionGroupController.php b/src/backend/app/Http/Controllers/ConnectionGroupController.php index 66694b28b..16a2f482f 100644 --- a/src/backend/app/Http/Controllers/ConnectionGroupController.php +++ b/src/backend/app/Http/Controllers/ConnectionGroupController.php @@ -11,8 +11,7 @@ class ConnectionGroupController { public function __construct( private ConnectionGroupService $connectionGroupService, - ) { - } + ) {} public function index(Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/ConnectionTypeController.php b/src/backend/app/Http/Controllers/ConnectionTypeController.php index 105d13fa1..d03a924c5 100644 --- a/src/backend/app/Http/Controllers/ConnectionTypeController.php +++ b/src/backend/app/Http/Controllers/ConnectionTypeController.php @@ -8,9 +8,7 @@ class ConnectionTypeController extends Controller { - public function __construct(private ConnectionTypeService $connectionTypeService) - { - } + public function __construct(private ConnectionTypeService $connectionTypeService) {} public function index(Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/CustomerRegistrationAppController.php b/src/backend/app/Http/Controllers/CustomerRegistrationAppController.php index 29039e8ff..7e35fa10a 100644 --- a/src/backend/app/Http/Controllers/CustomerRegistrationAppController.php +++ b/src/backend/app/Http/Controllers/CustomerRegistrationAppController.php @@ -10,9 +10,7 @@ class CustomerRegistrationAppController extends Controller { - public function __construct(private CustomerRegistrationAppService $customerRegistrationAppService) - { - } + public function __construct(private CustomerRegistrationAppService $customerRegistrationAppService) {} public function store(AndroidAppRequest $request) { diff --git a/src/backend/app/Http/Controllers/DeviceAddressController.php b/src/backend/app/Http/Controllers/DeviceAddressController.php index d608d1f36..9867b276a 100644 --- a/src/backend/app/Http/Controllers/DeviceAddressController.php +++ b/src/backend/app/Http/Controllers/DeviceAddressController.php @@ -12,8 +12,7 @@ class DeviceAddressController extends Controller public function __construct( private DeviceAddressService $deviceAddressService, private DeviceService $deviceService, - ) { - } + ) {} public function update(Request $request) { diff --git a/src/backend/app/Http/Controllers/DeviceController.php b/src/backend/app/Http/Controllers/DeviceController.php index f51150283..d041771f1 100644 --- a/src/backend/app/Http/Controllers/DeviceController.php +++ b/src/backend/app/Http/Controllers/DeviceController.php @@ -9,9 +9,7 @@ class DeviceController extends Controller { - public function __construct(private DeviceService $deviceService) - { - } + public function __construct(private DeviceService $deviceService) {} public function index() { diff --git a/src/backend/app/Http/Controllers/EBikeController.php b/src/backend/app/Http/Controllers/EBikeController.php index 893e7c334..898fe2803 100644 --- a/src/backend/app/Http/Controllers/EBikeController.php +++ b/src/backend/app/Http/Controllers/EBikeController.php @@ -19,8 +19,7 @@ public function __construct( private EBikeDeviceService $eBikeDeviceService, private ManufacturerService $manufacturerService, private AppliancePersonService $appliancePersonService, - ) { - } + ) {} public function index(Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/HomeController.php b/src/backend/app/Http/Controllers/HomeController.php index 9a0fbe2ab..9ecceed21 100644 --- a/src/backend/app/Http/Controllers/HomeController.php +++ b/src/backend/app/Http/Controllers/HomeController.php @@ -9,9 +9,7 @@ class HomeController extends Controller * * @return void */ - public function __construct() - { - } + public function __construct() {} /** * Show the application dashboard. diff --git a/src/backend/app/Http/Controllers/MailSettingsController.php b/src/backend/app/Http/Controllers/MailSettingsController.php index 6bbc9861c..e9f97bcd4 100644 --- a/src/backend/app/Http/Controllers/MailSettingsController.php +++ b/src/backend/app/Http/Controllers/MailSettingsController.php @@ -13,6 +13,7 @@ class MailSettingsController extends Controller * @MailSettings */ private $mailSettings; + private $mailSettingsService; public function __construct( diff --git a/src/backend/app/Http/Controllers/MainSettingsController.php b/src/backend/app/Http/Controllers/MainSettingsController.php index 7147e3728..1222c64df 100644 --- a/src/backend/app/Http/Controllers/MainSettingsController.php +++ b/src/backend/app/Http/Controllers/MainSettingsController.php @@ -9,9 +9,7 @@ class MainSettingsController extends Controller { - public function __construct(private MainSettingsService $mainSettingsService) - { - } + public function __construct(private MainSettingsService $mainSettingsService) {} public function index(): ApiResource { diff --git a/src/backend/app/Http/Controllers/MaintenanceUserController.php b/src/backend/app/Http/Controllers/MaintenanceUserController.php index f32799c85..497723cf1 100644 --- a/src/backend/app/Http/Controllers/MaintenanceUserController.php +++ b/src/backend/app/Http/Controllers/MaintenanceUserController.php @@ -20,8 +20,7 @@ public function __construct( private Person $person, private PersonService $personService, private AddressService $addressService, - ) { - } + ) {} public function index(): ApiResource { @@ -30,11 +29,6 @@ public function index(): ApiResource return new ApiResource($maintenance_user_list); } - /** - * @param MaintenanceRequest $request - * - * @return JsonResponse - */ public function store(MaintenanceRequest $request): JsonResponse { $phone = $request->get('phone'); diff --git a/src/backend/app/Http/Controllers/ManufacturerController.php b/src/backend/app/Http/Controllers/ManufacturerController.php index 76d439325..ca09b5a25 100644 --- a/src/backend/app/Http/Controllers/ManufacturerController.php +++ b/src/backend/app/Http/Controllers/ManufacturerController.php @@ -16,13 +16,10 @@ public function __construct( private ManufacturerService $manufacturerService, private ManufacturerAddressService $manufacturerAddressService, private AddressesService $addressService, - ) { - } + ) {} /** * Display a listing of the resource. - * - * @return ApiResource */ public function index(Request $request): ApiResource { @@ -33,10 +30,6 @@ public function index(Request $request): ApiResource /** * Store a newly created resource in storage. - * - * @param ManufacturerRequest $request - * - * @return JsonResponse */ public function store(ManufacturerRequest $request): JsonResponse { @@ -55,9 +48,7 @@ public function store(ManufacturerRequest $request): JsonResponse /** * Display the specified resource. * - * @param int $manufacturerId - * - * @return ApiResource + * @param int $manufacturerId */ public function show($manufacturerId): ApiResource { diff --git a/src/backend/app/Http/Controllers/MeterConsumptionController.php b/src/backend/app/Http/Controllers/MeterConsumptionController.php index b0b05511a..455543a16 100644 --- a/src/backend/app/Http/Controllers/MeterConsumptionController.php +++ b/src/backend/app/Http/Controllers/MeterConsumptionController.php @@ -11,8 +11,7 @@ class MeterConsumptionController extends Controller public function __construct( private MeterService $meterService, private MeterConsumptionService $meterConsumptionService, - ) { - } + ) {} /** * Consumption List @@ -24,12 +23,6 @@ public function __construct( * @urlParam end YYYY-mm-dd format * * @responseFile responses/meters/meter.consumption.list.json - * - * @param $serialNumber - * @param $start - * @param $end - * - * @return ApiResource */ public function show($serialNumber, $start, $end): ApiResource { diff --git a/src/backend/app/Http/Controllers/MeterController.php b/src/backend/app/Http/Controllers/MeterController.php index 05c357603..d692200b5 100644 --- a/src/backend/app/Http/Controllers/MeterController.php +++ b/src/backend/app/Http/Controllers/MeterController.php @@ -15,8 +15,7 @@ class MeterController extends Controller { public function __construct( private MeterService $meterService, - ) { - } + ) {} /** * List @@ -27,10 +26,6 @@ public function __construct( * @urlParam in_use int to list wether used or all meters * * @responseFile responses/meters/meters.list.json - * - * @param Request $request - * - * @return ApiResource */ public function index(Request $request): ApiResource { @@ -44,7 +39,6 @@ public function index(Request $request): ApiResource * Create * Stores a new meter. * - * @param MeterRequest $request * * @bodyParam serial_number string required * @bodyParam meter_type_id int required @@ -73,10 +67,6 @@ public function store(MeterRequest $request) * * @urlParam serialNumber string * - * @param string $serialNumber - * - * @return ApiResource - * * @responseFile responses/meters/meter.detail.json */ public function show(string $serialNumber): ApiResource @@ -92,8 +82,6 @@ public function show(string $serialNumber): ApiResource * * @bodyParam term string required * - * @return ApiResource - * * @responseFile responses/meters/meters.search.json */ public function search(): ApiResource @@ -109,10 +97,6 @@ public function search(): ApiResource * Deletes the meter with its all releations. * * @urlParam meterId. The ID of the meter to be delete - * - * @param $meterId - * - * @return JsonResponse */ public function destroy($meterId): JsonResponse { diff --git a/src/backend/app/Http/Controllers/MeterGeographicalInformationController.php b/src/backend/app/Http/Controllers/MeterGeographicalInformationController.php index 82050b825..c20d95a12 100644 --- a/src/backend/app/Http/Controllers/MeterGeographicalInformationController.php +++ b/src/backend/app/Http/Controllers/MeterGeographicalInformationController.php @@ -17,8 +17,7 @@ public function __construct( private PersonMeterService $personMeterService, private CityService $cityService, private MeterService $meterService, - ) { - } + ) {} /** * List with geo and access rate @@ -27,8 +26,6 @@ public function __construct( * * @urlParam mini_grid_id * - * @return ApiResource - * * @responseFile responses/meters/meters.geo.list.json */ public function index($miniGridId): ApiResource @@ -55,9 +52,7 @@ public function index($miniGridId): ApiResource * * @urlParam person required The ID of the person * - * @param int $person - * - * @return ApiResource + * @param int $person * * @responseFile responses/people/person.meter.list.json */ @@ -74,8 +69,7 @@ public function show(int $personId): ApiResource * * @bodyParam points string. Comma seperated latitude and longitude. Example 1,2 * - * @param Request $request - * @param Meter $meter + * @param Meter $meter */ public function update(Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/MeterPaymentHistoryController.php b/src/backend/app/Http/Controllers/MeterPaymentHistoryController.php index 59a7c453c..96cbf524d 100644 --- a/src/backend/app/Http/Controllers/MeterPaymentHistoryController.php +++ b/src/backend/app/Http/Controllers/MeterPaymentHistoryController.php @@ -9,8 +9,7 @@ class MeterPaymentHistoryController { public function __construct( private PaymentHistoryService $paymentHistoryService, - ) { - } + ) {} public function show(string $serialNumber) { diff --git a/src/backend/app/Http/Controllers/MeterRevenueController.php b/src/backend/app/Http/Controllers/MeterRevenueController.php index 915bd428f..b9b7c312a 100644 --- a/src/backend/app/Http/Controllers/MeterRevenueController.php +++ b/src/backend/app/Http/Controllers/MeterRevenueController.php @@ -9,8 +9,7 @@ class MeterRevenueController extends Controller { public function __construct( private MeterRevenueService $meterRevenueService, - ) { - } + ) {} /** * Revenue @@ -21,10 +20,6 @@ public function __construct( * @bodyParam serialNumber string required. * * @responseFile responses/meters/meter.revenue.json - * - * @param $serialNumber - * - * @return ApiResource */ public function show(string $serialNumber): ApiResource { diff --git a/src/backend/app/Http/Controllers/MeterTariffController.php b/src/backend/app/Http/Controllers/MeterTariffController.php index a777f9def..041aeeccf 100644 --- a/src/backend/app/Http/Controllers/MeterTariffController.php +++ b/src/backend/app/Http/Controllers/MeterTariffController.php @@ -13,8 +13,7 @@ class MeterTariffController extends Controller { public function __construct( private MeterTariffService $meterTariffService, - ) { - } + ) {} /** * List @@ -22,8 +21,6 @@ public function __construct( * The list is paginated and each page contains 15 results. * * @responseFile responses/tariffs/tariffs.list.json - * - * @return ApiResource */ public function index(Request $request): ApiResource { @@ -39,9 +36,7 @@ public function index(Request $request): ApiResource * * @responseFile responses/tariffs/tariff.detail.json * - * @param MeterTariff $tariff - * - * @return ApiResource + * @param MeterTariff $tariff */ public function show(Request $request, $meterTariffId): ApiResource { @@ -56,8 +51,6 @@ public function show(Request $request, $meterTariffId): ApiResource * @bodyParam currency string * @bodyParam price int required. * - * @param TariffCreateRequest $request - * * @return ApiResource */ public function store(TariffCreateRequest $request): JsonResponse diff --git a/src/backend/app/Http/Controllers/MeterTariffMeterParameterController.php b/src/backend/app/Http/Controllers/MeterTariffMeterParameterController.php index b19fb416b..964568bba 100644 --- a/src/backend/app/Http/Controllers/MeterTariffMeterParameterController.php +++ b/src/backend/app/Http/Controllers/MeterTariffMeterParameterController.php @@ -9,27 +9,16 @@ class MeterTariffMeterParameterController extends Controller { public function __construct( private MeterTariffMeterParameterService $meterTariffMeterParameterService, - ) { - } + ) {} /** * Display a list of meters which using a particular tariff. - * - * @param $meterTariffId - * - * @return ApiResource */ public function show($meterTariffId): ApiResource { return ApiResource::make($this->meterTariffMeterParameterService->getCountById($meterTariffId)); } - /** - * @param $meterTariffId - * @param int $changeId - * - * @return ApiResource - */ public function update($meterTariffId, int $changeId): ApiResource { $result = $this->meterTariffMeterParameterService->changeMetersTariff($meterTariffId, $changeId); diff --git a/src/backend/app/Http/Controllers/MeterTypeController.php b/src/backend/app/Http/Controllers/MeterTypeController.php index e87832856..a602a7d5d 100644 --- a/src/backend/app/Http/Controllers/MeterTypeController.php +++ b/src/backend/app/Http/Controllers/MeterTypeController.php @@ -17,16 +17,12 @@ class MeterTypeController extends Controller { use SoftDeletes; - public function __construct(private MeterTypeService $meterTypeService) - { - } + public function __construct(private MeterTypeService $meterTypeService) {} /** * List. * * @responseFile responses/metertypes/meter.types.list.json - * - * @return ApiResource */ public function index(Request $request): ApiResource { @@ -43,8 +39,6 @@ public function index(Request $request): ApiResource * @bodyParam phase int required * @bodyParam max_current int required * - * @param MeterTypeCreateRequest $request - * * @return ApiResource */ public function store(MeterTypeCreateRequest $request) @@ -59,9 +53,7 @@ public function store(MeterTypeCreateRequest $request) * * @bodyParam id int required * - * @param int $meterTypeId - * - * @return ApiResource + * @param int $meterTypeId */ public function show($meterTypeId): ApiResource { @@ -78,10 +70,7 @@ public function show($meterTypeId): ApiResource * @bodyParam phase int required * @bodyParam max_current int required * - * @param MeterTypeUpdateRequest $request - * @param int $meterTypeId - * - * @return ApiResource + * @param int $meterTypeId */ public function update(MeterTypeUpdateRequest $request, $meterTypeId): ApiResource { diff --git a/src/backend/app/Http/Controllers/MeterTypeMeterController.php b/src/backend/app/Http/Controllers/MeterTypeMeterController.php index 5241521fa..7839b0074 100644 --- a/src/backend/app/Http/Controllers/MeterTypeMeterController.php +++ b/src/backend/app/Http/Controllers/MeterTypeMeterController.php @@ -8,9 +8,7 @@ class MeterTypeMeterController extends Controller { - public function __construct(private MeterTypeMeterService $meterTypeMeterService) - { - } + public function __construct(private MeterTypeMeterService $meterTypeMeterService) {} /** * List with Meters @@ -20,9 +18,6 @@ public function __construct(private MeterTypeMeterService $meterTypeMeterService * * @responseFile responses/metertypes/metertypes.meter.list.json * - * @param Request $request - * @param $meterTypeId - * * @return ApiResource */ public function show(Request $request, $meterTypeId) diff --git a/src/backend/app/Http/Controllers/MiniGridController.php b/src/backend/app/Http/Controllers/MiniGridController.php index a11023534..ef70e2cbe 100644 --- a/src/backend/app/Http/Controllers/MiniGridController.php +++ b/src/backend/app/Http/Controllers/MiniGridController.php @@ -17,15 +17,10 @@ public function __construct( private MiniGridService $miniGridService, private GeographicalInformationService $geographicalInformationService, private MiniGridGeographicalInformationService $miniGridGeographicalInformationService, - ) { - } + ) {} /** * List. - * - * @param Request $request - * - * @return ApiResource */ public function index(Request $request): ApiResource { @@ -39,10 +34,7 @@ public function index(Request $request): ApiResource * * @bodyParam id int required * - * @param int $id - * @param Request $request - * - * @return ApiResource + * @param int $id */ public function show($miniGridId, Request $request): ApiResource { @@ -73,10 +65,7 @@ public function store(StoreMiniGridRequest $request): ApiResource * * @bodyParam name string The name of the MiniGrid. * - * @param MiniGrid $miniGrid - * @param UpdateMiniGridRequest $request - * - * @return ApiResource + * @param MiniGrid $miniGrid */ public function update($miniGridId, UpdateMiniGridRequest $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/MiniGridDashboardCacheController.php b/src/backend/app/Http/Controllers/MiniGridDashboardCacheController.php index b3747c48b..1907feb40 100644 --- a/src/backend/app/Http/Controllers/MiniGridDashboardCacheController.php +++ b/src/backend/app/Http/Controllers/MiniGridDashboardCacheController.php @@ -8,9 +8,7 @@ class MiniGridDashboardCacheController extends Controller { - public function __construct(private MiniGridDashboardCacheDataService $miniGridDashboardCacheDataService) - { - } + public function __construct(private MiniGridDashboardCacheDataService $miniGridDashboardCacheDataService) {} public function index(): ApiResource { diff --git a/src/backend/app/Http/Controllers/MiniGridDeviceController.php b/src/backend/app/Http/Controllers/MiniGridDeviceController.php index 0b5f2d485..f197bb3b6 100644 --- a/src/backend/app/Http/Controllers/MiniGridDeviceController.php +++ b/src/backend/app/Http/Controllers/MiniGridDeviceController.php @@ -10,8 +10,7 @@ class MiniGridDeviceController extends Controller { public function __construct( private MiniGridDeviceService $miniGridDeviceService, - ) { - } + ) {} public function index(Request $request, $miniGridId): ApiResource { diff --git a/src/backend/app/Http/Controllers/MiniGridRevenueController.php b/src/backend/app/Http/Controllers/MiniGridRevenueController.php index ae683213f..55105a86e 100644 --- a/src/backend/app/Http/Controllers/MiniGridRevenueController.php +++ b/src/backend/app/Http/Controllers/MiniGridRevenueController.php @@ -12,8 +12,7 @@ class MiniGridRevenueController public function __construct( private MeterService $meterService, private MiniGridRevenueService $miniGridRevenueService, - ) { - } + ) {} public function show($miniGridId, Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/MpmPluginController.php b/src/backend/app/Http/Controllers/MpmPluginController.php index 7581190d5..cce654445 100644 --- a/src/backend/app/Http/Controllers/MpmPluginController.php +++ b/src/backend/app/Http/Controllers/MpmPluginController.php @@ -8,9 +8,7 @@ class MpmPluginController extends Controller { - public function __construct(private MpmPluginService $mpmPluginService) - { - } + public function __construct(private MpmPluginService $mpmPluginService) {} public function index(Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/OutstandingDebtsExportController.php b/src/backend/app/Http/Controllers/OutstandingDebtsExportController.php index 8191980f0..b9930bf96 100644 --- a/src/backend/app/Http/Controllers/OutstandingDebtsExportController.php +++ b/src/backend/app/Http/Controllers/OutstandingDebtsExportController.php @@ -12,8 +12,7 @@ class OutstandingDebtsExportController { public function __construct( private OutstandingDebtsExportService $outstandingDebtsExportService, - ) { - } + ) {} public function download(): BinaryFileResponse { diff --git a/src/backend/app/Http/Controllers/PaymentHistoryController.php b/src/backend/app/Http/Controllers/PaymentHistoryController.php index 6a857e832..6c87cbb1f 100644 --- a/src/backend/app/Http/Controllers/PaymentHistoryController.php +++ b/src/backend/app/Http/Controllers/PaymentHistoryController.php @@ -23,8 +23,6 @@ class PaymentHistoryController /** * PaymentHistoryController constructor. - * - * @param PaymentHistory $history */ public function __construct(PaymentHistory $history) { @@ -39,11 +37,8 @@ public function __construct(PaymentHistory $history) * @urlParam limit integer * @urlParam order string * - * @param int $payerId - * @param string $period - * @param null $limit - * @param string $order - * + * @param null $limit + * @param string $order * @return array */ public function show(int $payerId, string $period, $limit = null, $order = 'ASC') @@ -79,8 +74,7 @@ public function show(int $payerId, string $period, $limit = null, $order = 'ASC' * * @urlParam personId integer required * - * @param $personId - * + * @param $personId * @return ApiResource * * @throws \Exception @@ -107,10 +101,7 @@ public function getPaymentPeriod(Person $person) * * @urlParam personId integer required * - * @param int $personId - * @param int|null $year * - * @return array **/ public function byYear(int $personId, ?int $year = null): array { @@ -130,8 +121,7 @@ public function byYear(int $personId, ?int $year = null): array * @urlParam personId integer required * checks if the person has any debts to the system * - * @param int $personId - * + * @param int $personId * @return ApiResource */ public function debts($personId) @@ -161,8 +151,6 @@ public function debts($personId) * @bodyParam begin string * @bodyParam end string * - * @return ApiResource - * * @throws \Exception */ public function getPaymentRange(): ApiResource diff --git a/src/backend/app/Http/Controllers/PersonAddressesController.php b/src/backend/app/Http/Controllers/PersonAddressesController.php index 6b4fef374..9dfe08e45 100644 --- a/src/backend/app/Http/Controllers/PersonAddressesController.php +++ b/src/backend/app/Http/Controllers/PersonAddressesController.php @@ -15,8 +15,7 @@ public function __construct( private AddressesService $addressService, private PersonService $personService, private PersonAddressService $personAddressService, - ) { - } + ) {} /** * Addresses @@ -26,10 +25,6 @@ public function __construct( * * @responseFile responses/people/person.addresses.list.json * - * @param int $personId - * - * @return ApiResource - * * @apiResourceModel \App\Models\Person\Person */ public function show(int $personId): ApiResource diff --git a/src/backend/app/Http/Controllers/PersonController.php b/src/backend/app/Http/Controllers/PersonController.php index bc23d4603..21a0775ab 100644 --- a/src/backend/app/Http/Controllers/PersonController.php +++ b/src/backend/app/Http/Controllers/PersonController.php @@ -27,8 +27,7 @@ public function __construct( private PersonAddressService $personAddressService, private MaintenanceUserService $maintenanceUserService, private CountryService $countryService, - ) { - } + ) {} /** * List customer/other @@ -37,8 +36,6 @@ public function __construct( * @urlParam is_customer int optinal. To get a list of customers or non customer. Default : 1 * * @responseFile responses/people/people.list.json - * - * @return ApiResource */ public function index(Request $request): ApiResource { @@ -56,9 +53,7 @@ public function index(Request $request): ApiResource * - Role * - Meter list. * - * @param int $personId * - * @return ApiResource * * @apiResourceModel App\Models\Person\Person * @@ -71,10 +66,6 @@ public function show(int $personId): ApiResource /** * Create. - * - * @param PersonRequest $request - * - * @return JsonResponse */ public function store(PersonRequest $request): JsonResponse { @@ -127,10 +118,6 @@ public function store(PersonRequest $request): JsonResponse * @bodyParam sex string. The title of the person. Example: Dr. * @bodyParam education string. The title of the person. Example: Dr. * - * @param int $personId - * - * @return ApiResource - * * @apiResourceModel App\Models\Person\Person * * @responseFile responses/people/person.update.json @@ -150,9 +137,7 @@ public function update( * The list of all transactions(paginated) which belong to that person. * Each page contains 7 entries of the last transaction. * - * @param $personId * - * @return ApiResource * * @bodyParam person_id int required the ID of the person. Example: 2 * @@ -178,8 +163,6 @@ public function transactions( * @urlParam term The ID of the post. Example: John Doe * @urlParam paginage int The page number. Example:1 * - * @return ApiResource - * * @responseFile responses/people/people.search.json */ public function search( @@ -198,10 +181,6 @@ public function search( * * @urlParam person required The ID of the person. Example:1 * - * @param int $personId - * - * @return ApiResource - * * @throws \Exception * * @apiResourceModel App\Models\Person\Person diff --git a/src/backend/app/Http/Controllers/PersonDocumentController.php b/src/backend/app/Http/Controllers/PersonDocumentController.php index 3b029547a..7a8c8d23d 100644 --- a/src/backend/app/Http/Controllers/PersonDocumentController.php +++ b/src/backend/app/Http/Controllers/PersonDocumentController.php @@ -2,6 +2,4 @@ namespace App\Http\Controllers; -class PersonDocumentController extends Controller -{ -} +class PersonDocumentController extends Controller {} diff --git a/src/backend/app/Http/Controllers/PersonMeterController.php b/src/backend/app/Http/Controllers/PersonMeterController.php index 53f786164..715718a4e 100644 --- a/src/backend/app/Http/Controllers/PersonMeterController.php +++ b/src/backend/app/Http/Controllers/PersonMeterController.php @@ -9,20 +9,15 @@ class PersonMeterController { public function __construct( private PersonMeterService $personMeterService, - ) { - } + ) {} /** * @group People * Person with Meters & Tariff * Person details with his/her owned meter(s) and its assigned tariff * - * @param int $personId - * * @urlParam person required The ID of the person * - * @return ApiResource - * * @responseFile responses/people/person.meter.tariff.json */ public function show(int $personId): ApiResource diff --git a/src/backend/app/Http/Controllers/PluginController.php b/src/backend/app/Http/Controllers/PluginController.php index d3ca01642..15c09d0c9 100644 --- a/src/backend/app/Http/Controllers/PluginController.php +++ b/src/backend/app/Http/Controllers/PluginController.php @@ -17,8 +17,7 @@ public function __construct( private MpmPluginService $mpmPluginService, private CompanyDatabaseService $companyDatabaseService, private RegistrationTailService $registrationTailService, - ) { - } + ) {} public function index(Request $request): ApiResource { @@ -36,14 +35,14 @@ public function update(Request $request, $mpmPluginId): ApiResource 'status' => $request->input('checked'), ]; - if (!$plugin && !$request->input('checked')) { + if (! $plugin && ! $request->input('checked')) { throw new \Exception('Plugin not found'); } if ($request->input('checked')) { // Check if this is the first time we are installing the plugin. // In that case we also need to run install commands, if present - if (!$plugin) { + if (! $plugin) { $createdPlugin = $this->pluginsService->create($pluginData); $this->registrationTailService->addMpmPluginToRegistrationTail($registrationTail, $mpmPlugin); diff --git a/src/backend/app/Http/Controllers/RegistrationTailController.php b/src/backend/app/Http/Controllers/RegistrationTailController.php index aa753aa42..74f9e66da 100644 --- a/src/backend/app/Http/Controllers/RegistrationTailController.php +++ b/src/backend/app/Http/Controllers/RegistrationTailController.php @@ -9,9 +9,7 @@ class RegistrationTailController extends Controller { - public function __construct(private RegistrationTailService $registrationTailService) - { - } + public function __construct(private RegistrationTailService $registrationTailService) {} public function index(): ApiResource { diff --git a/src/backend/app/Http/Controllers/ReportController.php b/src/backend/app/Http/Controllers/ReportController.php index 75ea04362..ceba5a5fa 100644 --- a/src/backend/app/Http/Controllers/ReportController.php +++ b/src/backend/app/Http/Controllers/ReportController.php @@ -20,7 +20,7 @@ public function __construct(Report $report) public function download($id) { - if (!$id) { + if (! $id) { return; } $report = $this->report->find($id); diff --git a/src/backend/app/Http/Controllers/Reports.php b/src/backend/app/Http/Controllers/Reports.php index 77726409d..26b5dc1d9 100644 --- a/src/backend/app/Http/Controllers/Reports.php +++ b/src/backend/app/Http/Controllers/Reports.php @@ -33,8 +33,11 @@ class Reports { private array $totalSold = []; + private array $connectionTypeCells = []; + private string|int $lastIndex; + private array $subConnectionRows; public function __construct( @@ -46,8 +49,7 @@ public function __construct( private City $city, private Target $target, private Report $report, - ) { - } + ) {} private function monthlyTargetRibbon(Worksheet $sheet): void { @@ -121,12 +123,12 @@ private function addTargetConnectionGroups(Worksheet $sheet): void )->get(); foreach ($connections as $connection) { $sheet->setCellValue($column.$row, $connection->name); - ++$row; + $row++; foreach ($connection->subConnections as $subConnection) { foreach ($subConnection->meterParameters as $meterParameter) { $sheet->setCellValue($subColumn.$row, $meterParameter->connectionGroup()->first()->name); $this->subConnectionRows[$meterParameter->connectionGroup()->first()->name] = $row; - ++$row; + $row++; } } } @@ -139,7 +141,7 @@ private function addTargetConnectionGroups(Worksheet $sheet): void */ private function initSheet(): void { - $this->spreadsheet = new Spreadsheet(); + $this->spreadsheet = new Spreadsheet; $this->totalSold = []; } @@ -161,10 +163,6 @@ public function generateWithJob($startDate, $endDate, $reportType): void } /** - * @param Worksheet $sheet - * @param string $coordinate - * @param string $color - * * @throws \PhpOffice\PhpSpreadsheet\Exception */ private function fillBackground(Worksheet $sheet, string $coordinate, string $color): void @@ -173,11 +171,6 @@ private function fillBackground(Worksheet $sheet, string $coordinate, string $co } /** - * @param Worksheet $sheet - * @param $column - * @param string|null $border - * @param string|null $color - * * @throws \PhpOffice\PhpSpreadsheet\Exception */ private function styleSheet(Worksheet $sheet, string $column, ?string $border, ?string $color): void @@ -193,11 +186,6 @@ private function styleSheet(Worksheet $sheet, string $column, ?string $border, ? } /** - * @param Worksheet $sheet - * @param $dateRange - * - * @return void - * * @throws \PhpOffice\PhpSpreadsheet\Exception */ private function addStaticText(Worksheet $sheet, string $dateRange): void @@ -247,9 +235,7 @@ private function addStaticText(Worksheet $sheet, string $dateRange): void } /** - * @param Worksheet $sheet - * @param string $dateRange - * @param Builder[]|Collection $transactions + * @param Builder[]|Collection $transactions * * @throws CustomerGroupNotFound * @throws \PhpOffice\PhpSpreadsheet\Exception @@ -278,9 +264,8 @@ public function generateXls( } /** - * @param Worksheet $sheet - * @param bool $addPurchaseBreakDown - * @param Builder[]|Collection $transactions + * @param bool $addPurchaseBreakDown + * @param Builder[]|Collection $transactions * * @throws CustomerGroupNotFound */ @@ -290,7 +275,7 @@ private function addTransactions(Worksheet $sheet, $transactions, $addPurchaseBr $balance = 0; foreach ($transactions as $index => $transaction) { - if (!$transaction->meter || !$transaction->meter->meterParameter) { + if (! $transaction->meter || ! $transaction->meter->meterParameter) { continue; } @@ -342,11 +327,6 @@ private function addTransactions(Worksheet $sheet, $transactions, $addPurchaseBr /** * Add the breakdown of the transaction amount into the right place on the spreadsheet. * - * @param Worksheet $sheet - * @param $paymentHistories - * @param int $index - * @param string $connectionGroupName - * @param $tariff * * @throws CustomerGroupNotFound */ @@ -379,10 +359,6 @@ private function purchaseBreakDown( } /** - * @param string $connectionGroupName - * - * @return string - * * @throws CustomerGroupNotFound */ private function getConnectionGroupColumn(string $connectionGroupName): string @@ -404,11 +380,7 @@ private function storeConnectionGroupColumn(string $connectionGroup, string $col } /** - * @param Worksheet $sheet - * @param $connectionGroups - * @param string $startingColumn - * @param int $startingRow - * @param Builder[]|Collection $connectionGroups + * @param Builder[]|Collection $connectionGroups * * @throws \PhpOffice\PhpSpreadsheet\Exception */ @@ -436,23 +408,23 @@ private function addConnectionGroupsToXLS( if ($accessRate) { if ($accessRate->amount > 0) { $nextColumn = $startingColumn; - ++$nextColumn; + $nextColumn++; $sheet->mergeCells($startingColumn.$startingRow.':'. $nextColumn.$startingRow); - ++$startingColumn; + $startingColumn++; break; } } } } - ++$startingColumn; + $startingColumn++; } } private function addSoldTotal(string $connectionGroupName, array $amount, $unit = null): void { - if (!array_key_exists($connectionGroupName, $this->totalSold)) { + if (! array_key_exists($connectionGroupName, $this->totalSold)) { $this->totalSold[$connectionGroupName] = [ 'energy' => 0, 'access_rate' => 0, @@ -469,8 +441,6 @@ private function addSoldTotal(string $connectionGroupName, array $amount, $unit } /** - * @param Worksheet $sheet - * * @throws CustomerGroupNotFound * @throws \PhpOffice\PhpSpreadsheet\Exception */ @@ -510,14 +480,12 @@ private function addSoldSummary(Worksheet $sheet): void } /** - * @return \Generator - * * @psalm-return Generator */ private function excelColumnRange(string $lower, string $upper): \Generator { - ++$upper; - for ($i = $lower; $i !== $upper; ++$i) { + $upper++; + for ($i = $lower; $i !== $upper; $i++) { yield $i; } } @@ -526,12 +494,6 @@ private function excelColumnRange(string $lower, string $upper): \Generator private $monthlyTargetDatas = []; /** - * @param int $cityId - * @param $cityName - * @param $startDate - * @param $endDate - * @param $reportType - * * @throws CustomerGroupNotFound * @throws \PhpOffice\PhpSpreadsheet\Exception */ @@ -576,14 +538,14 @@ static function ($q) { $this->generateXls($sheet, $dateRange, $transactions); if ($reportType === 'weekly') { - $sheet2 = new Worksheet(); + $sheet2 = new Worksheet; $sheet2 = $this->spreadsheet->addSheet($sheet2); $this->addStaticText($sheet2, $dateRange); $sheet2->setTitle($dateRange); // Add transactions, customer name, balances to the sheet $this->addTransactions($sheet2, $transactions, false); } elseif ($reportType === 'monthly') { - $sheet2 = new Worksheet(); + $sheet2 = new Worksheet; $sheet2 = $this->spreadsheet->addSheet($sheet2); $sheet2->setTitle('monthly'); // Add targets @@ -598,7 +560,7 @@ static function ($q) { $databaseProxy = app()->make(DatabaseProxy::class); $companyId = $databaseProxy->findByEmail($user->email)->getCompanyId(); - if (!file_exists($dirPath) && !mkdir($dirPath, 0774, true) && !is_dir($dirPath)) { + if (! file_exists($dirPath) && ! mkdir($dirPath, 0774, true) && ! is_dir($dirPath)) { throw new \RuntimeException(sprintf('Directory "%s" was not created', $dirPath)); } try { @@ -619,10 +581,6 @@ static function ($q) { /** * Total number of customer groups until given date. - * - * @param string $date - * - * @return void */ private function getCustomerGroupCountPerMonth(string $date): void { @@ -654,10 +612,10 @@ private function getCustomerGroupEnergyUsagePerMonth(array $dates): void $tariffPrice = $groupRevenue->tariff_price; - if (!$tariffPrice || $tariffPrice === 0) { + if (! $tariffPrice || $tariffPrice === 0) { continue; } - if (!$energyRevenue || $energyRevenue === 0) { + if (! $energyRevenue || $energyRevenue === 0) { continue; } $tariffPrice /= 100; @@ -702,7 +660,7 @@ private function addTargetsToXls(Worksheet $sheet): void { foreach ($this->monthlyTargetDatas as $subConnection => $monthlyTargetData) { $row = $this->subConnectionRows[$subConnection]; - if (!$row) { + if (! $row) { continue; } $sheet->setCellValue('E'.$row, $monthlyTargetData['connections']); @@ -720,12 +678,12 @@ private function addStoredTargets(Worksheet $sheet, int $cityId, $endDate): void ->where('owner_id', $cityId) ->orderBy('target_date', 'asc')->first(); - if (!$targetData) { // no target is defined for that mini-grid + if (! $targetData) { // no target is defined for that mini-grid return; } foreach ($targetData->subTargets as $subTarget) { - if (!isset($this->subConnectionRows[$subTarget->connectionType->name])) { + if (! isset($this->subConnectionRows[$subTarget->connectionType->name])) { continue; } $row = $this->subConnectionRows[$subTarget->connectionType->name]; diff --git a/src/backend/app/Http/Controllers/RestrictionController.php b/src/backend/app/Http/Controllers/RestrictionController.php index 74c9de4f3..f23f22a94 100644 --- a/src/backend/app/Http/Controllers/RestrictionController.php +++ b/src/backend/app/Http/Controllers/RestrictionController.php @@ -18,6 +18,7 @@ class RestrictionController extends Controller * @var Restriction */ private $restriction; + /** * @var Client */ @@ -29,9 +30,6 @@ public function __construct(Restriction $restriction, Client $httpClient) $this->httpClient = $httpClient; } - /** - * @return Response - */ public function store(Request $request, Response $response): Response { $productId = $request->input('product_id'); @@ -102,11 +100,6 @@ public function store(Request $request, Response $response): Response } /** - * @param $target - * @param int $toAdd - * - * @return void - * * @throws PurchaseNotProcessable */ private function updateRestriction(string $target, int $toAdd = 1): void diff --git a/src/backend/app/Http/Controllers/RevenueController.php b/src/backend/app/Http/Controllers/RevenueController.php index 0922fcad5..72c1d42f8 100644 --- a/src/backend/app/Http/Controllers/RevenueController.php +++ b/src/backend/app/Http/Controllers/RevenueController.php @@ -27,8 +27,7 @@ public function __construct( private RevenueService $revenueService, private MeterRevenueService $meterRevenueService, private Target $target, - ) { - } + ) {} public function ticketData($id): ApiResource { @@ -78,7 +77,7 @@ public function trending($id, Request $request): ApiResource $cities = $this->city::query()->where('mini_grid_id', $id)->get(); $cityIds = implode(',', $cities->pluck('id')->toArray()); - if (!count($cities)) { + if (! count($cities)) { $response = ['data' => null, 'message' => 'There is no city for this MiniGrid']; return ApiResource::make($response); @@ -117,7 +116,6 @@ public function trending($id, Request $request): ApiResource /** * Prepares the data for revenue dashboard. * - * @param Request $request * * @return array|mixed */ @@ -146,7 +144,7 @@ public function revenueData(Request $request): ApiResource $formattedTarget = []; if ($targets === null) { // no target defined for that mini-grid - $targets = new \stdClass(); + $targets = new \stdClass; $connections = ConnectionGroup::query()->get(); foreach ($connections as $connection) { $formattedTarget[$connection->name] = [ diff --git a/src/backend/app/Http/Controllers/SmsController.php b/src/backend/app/Http/Controllers/SmsController.php index 49640f7aa..952c7f5d3 100644 --- a/src/backend/app/Http/Controllers/SmsController.php +++ b/src/backend/app/Http/Controllers/SmsController.php @@ -26,8 +26,7 @@ public function __construct( private MeterParameter $meterParameter, private SmsService $smsService, private TicketCommentService $commentService, - ) { - } + ) {} public function index(): ApiResource { @@ -218,9 +217,7 @@ static function ($q) { /** * Marks the sms as sent. * - * @param string $uuid - * - * @return void + * @param string $uuid */ public function updateForDelivered($uuid): void { diff --git a/src/backend/app/Http/Controllers/SolarHomeSystemController.php b/src/backend/app/Http/Controllers/SolarHomeSystemController.php index fc09ce18a..17583339b 100644 --- a/src/backend/app/Http/Controllers/SolarHomeSystemController.php +++ b/src/backend/app/Http/Controllers/SolarHomeSystemController.php @@ -15,8 +15,7 @@ public function __construct( private DeviceService $deviceService, private SolarHomeSystemService $solarHomeSystemService, private SolarHomeSystemDeviceService $solarHomeSystemDeviceService, - ) { - } + ) {} public function index(Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/SubConnectionTypeController.php b/src/backend/app/Http/Controllers/SubConnectionTypeController.php index 7fb9f488f..9717ffff2 100644 --- a/src/backend/app/Http/Controllers/SubConnectionTypeController.php +++ b/src/backend/app/Http/Controllers/SubConnectionTypeController.php @@ -10,9 +10,7 @@ class SubConnectionTypeController extends Controller { - public function __construct(private SubConnectionTypeService $subConnectionTypeService) - { - } + public function __construct(private SubConnectionTypeService $subConnectionTypeService) {} public function index(Request $request, $connectionTypeId = null): ApiResource { @@ -27,10 +25,6 @@ public function index(Request $request, $connectionTypeId = null): ApiResource /** * Show the form for creating a new resource. - * - * @param SubConnectionTypeCreateRequest $request - * - * @return ApiResource */ public function store(SubConnectionTypeCreateRequest $request): ApiResource { @@ -42,9 +36,7 @@ public function store(SubConnectionTypeCreateRequest $request): ApiResource /** * Update the specified resource in storage. * - * @param SubConnectionType $subConnectionType - * - * @return ApiResource + * @param SubConnectionType $subConnectionType */ public function update(Request $request, $subConnectionTypeId): ApiResource { diff --git a/src/backend/app/Http/Controllers/TargetController.php b/src/backend/app/Http/Controllers/TargetController.php index e2210c432..fca4aa2aa 100644 --- a/src/backend/app/Http/Controllers/TargetController.php +++ b/src/backend/app/Http/Controllers/TargetController.php @@ -17,8 +17,7 @@ public function __construct( private ClusterService $clusterService, private MiniGridService $miniGridService, private SubTargetService $subTargetService, - ) { - } + ) {} public function index(Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/TicketSettingsController.php b/src/backend/app/Http/Controllers/TicketSettingsController.php index f39318abd..97509f242 100644 --- a/src/backend/app/Http/Controllers/TicketSettingsController.php +++ b/src/backend/app/Http/Controllers/TicketSettingsController.php @@ -8,9 +8,7 @@ class TicketSettingsController extends Controller { - public function __construct(private TicketSettings $ticketSettings) - { - } + public function __construct(private TicketSettings $ticketSettings) {} public function index(): ApiResource { diff --git a/src/backend/app/Http/Controllers/TimeOfUsageController.php b/src/backend/app/Http/Controllers/TimeOfUsageController.php index c86a30adc..c44cfb58e 100644 --- a/src/backend/app/Http/Controllers/TimeOfUsageController.php +++ b/src/backend/app/Http/Controllers/TimeOfUsageController.php @@ -10,8 +10,7 @@ class TimeOfUsageController extends Controller public function __construct( private TimeOfUsageService $timeOfUsageService, private MeterTariffService $meterTariffService, - ) { - } + ) {} public function destroy($timeOfUsageId): ?bool { diff --git a/src/backend/app/Http/Controllers/TransactionAdvancedController.php b/src/backend/app/Http/Controllers/TransactionAdvancedController.php index 897c3da39..4d6fc354d 100644 --- a/src/backend/app/Http/Controllers/TransactionAdvancedController.php +++ b/src/backend/app/Http/Controllers/TransactionAdvancedController.php @@ -10,8 +10,7 @@ class TransactionAdvancedController extends Controller { public function __construct( private TransactionService $transactionService, - ) { - } + ) {} public function searchAdvanced(Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/TransactionController.php b/src/backend/app/Http/Controllers/TransactionController.php index cd966524f..56c691d92 100644 --- a/src/backend/app/Http/Controllers/TransactionController.php +++ b/src/backend/app/Http/Controllers/TransactionController.php @@ -12,8 +12,7 @@ class TransactionController extends Controller { public function __construct( private TransactionService $transactionService, - ) { - } + ) {} public function index(): ApiResource { diff --git a/src/backend/app/Http/Controllers/TransactionExportController.php b/src/backend/app/Http/Controllers/TransactionExportController.php index 96576a19b..fbd294825 100644 --- a/src/backend/app/Http/Controllers/TransactionExportController.php +++ b/src/backend/app/Http/Controllers/TransactionExportController.php @@ -12,8 +12,7 @@ class TransactionExportController public function __construct( private TransactionService $transactionService, private TransactionExportService $transactionExportService, - ) { - } + ) {} public function download( Request $request, diff --git a/src/backend/app/Http/Controllers/UsageTypeController.php b/src/backend/app/Http/Controllers/UsageTypeController.php index c1381c68f..9517abaa6 100644 --- a/src/backend/app/Http/Controllers/UsageTypeController.php +++ b/src/backend/app/Http/Controllers/UsageTypeController.php @@ -8,9 +8,7 @@ class UsageTypeController extends Controller { - public function __construct(private UsageTypeService $usageTypeService) - { - } + public function __construct(private UsageTypeService $usageTypeService) {} public function index(Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/UserController.php b/src/backend/app/Http/Controllers/UserController.php index ac6d13a98..fdec54b90 100644 --- a/src/backend/app/Http/Controllers/UserController.php +++ b/src/backend/app/Http/Controllers/UserController.php @@ -16,8 +16,7 @@ public function __construct( private UserService $userService, private DatabaseProxyService $databaseProxyService, private CompanyDatabaseService $companyDatabaseService, - ) { - } + ) {} public function index(Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/UserPasswordController.php b/src/backend/app/Http/Controllers/UserPasswordController.php index 960b86cb6..4fb67e1ef 100644 --- a/src/backend/app/Http/Controllers/UserPasswordController.php +++ b/src/backend/app/Http/Controllers/UserPasswordController.php @@ -20,7 +20,7 @@ public function __construct(UserService $userService) public function forgotPassword(AdminResetPasswordRequest $request, Response $response): Response { - if (!$this->userService->resetPassword($request->input('email'))) { + if (! $this->userService->resetPassword($request->input('email'))) { return $response->setStatusCode(422)->setContent( [ 'data' => [ diff --git a/src/backend/app/Http/Controllers/VodacomTransactionController.php b/src/backend/app/Http/Controllers/VodacomTransactionController.php index a8603d2a2..621326fde 100644 --- a/src/backend/app/Http/Controllers/VodacomTransactionController.php +++ b/src/backend/app/Http/Controllers/VodacomTransactionController.php @@ -9,10 +9,6 @@ class VodacomTransactionController extends Controller { /** * Store a newly created resource in storage. - * - * @param Request $request - * - * @return void */ public function store(Request $request): void { diff --git a/src/backend/app/Http/Middleware/AgentBalanceMiddleware.php b/src/backend/app/Http/Middleware/AgentBalanceMiddleware.php index bbc5cdbd8..15222ba82 100644 --- a/src/backend/app/Http/Middleware/AgentBalanceMiddleware.php +++ b/src/backend/app/Http/Middleware/AgentBalanceMiddleware.php @@ -17,15 +17,12 @@ public function __construct( private AgentService $agentService, private AgentAssignedApplianceService $agentAssignedApplianceService, private AgentTransactionService $agentTransactionService, - ) { - } + ) {} /** * Handle an incoming request. * - * @param \Illuminate\Http\Request $request - * @param \Closure $next - * + * @param \Illuminate\Http\Request $request * @return mixed */ public function handle($request, \Closure $next) @@ -38,11 +35,11 @@ public function handle($request, \Closure $next) if ($routeName === 'agent-sell-appliance') { $assignedApplianceCost = $this->agentAssignedApplianceService->getById($request->input('agent_assigned_appliance_id')); $downPayment = $request->input('down_payment'); - if (!$assignedApplianceCost) { + if (! $assignedApplianceCost) { throw new ModelNotFoundException('Assigned Appliance not found'); } - if (!isset($downPayment)) { + if (! isset($downPayment)) { throw new DownPaymentNotFoundException('DownPayment not found'); } diff --git a/src/backend/app/Http/Middleware/JwtMiddleware.php b/src/backend/app/Http/Middleware/JwtMiddleware.php index a7cb48e0d..6cdffcf62 100644 --- a/src/backend/app/Http/Middleware/JwtMiddleware.php +++ b/src/backend/app/Http/Middleware/JwtMiddleware.php @@ -17,12 +17,6 @@ class JwtMiddleware extends BaseMiddleware { /** * Handle an incoming request. - * - * @param Request $request - * @param \Closure $next - * @param string $type - * - * @return mixed */ public function handle(Request $request, \Closure $next, string $type = 'user'): mixed { diff --git a/src/backend/app/Http/Middleware/RedirectIfAuthenticated.php b/src/backend/app/Http/Middleware/RedirectIfAuthenticated.php index 4d55e11ec..5765f549f 100644 --- a/src/backend/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/src/backend/app/Http/Middleware/RedirectIfAuthenticated.php @@ -10,10 +10,8 @@ class RedirectIfAuthenticated /** * Handle an incoming request. * - * @param Request $request - * @param \Closure $next - * @param string|null $guard - * + * @param Request $request + * @param string|null $guard * @return mixed */ public function handle($request, \Closure $next, $guard = null) diff --git a/src/backend/app/Http/Middleware/RestrictionMiddleware.php b/src/backend/app/Http/Middleware/RestrictionMiddleware.php index bf16953c1..fd751604d 100644 --- a/src/backend/app/Http/Middleware/RestrictionMiddleware.php +++ b/src/backend/app/Http/Middleware/RestrictionMiddleware.php @@ -18,16 +18,13 @@ public function __construct( private RestrictionService $restrictionService, private MaintenanceUserService $maintenanceUserService, private MiniGridService $miniGridService, - ) { - } + ) {} /** * Handle an incoming request. * - * @param Request $request - * @param \Closure $next - * @param $type - * + * @param Request $request + * @param $type * @return mixed */ public function handle($request, \Closure $next, $target) @@ -36,7 +33,7 @@ public function handle($request, \Closure $next, $target) $restriction = $this->restrictionService->getRestrictionForTarget($target); $restrictionResult = $this->handleRestriction($restriction->limit, $target, $request); - if (!$restrictionResult) { + if (! $restrictionResult) { $baseMessage = 'Your free limit of %s is exceeded. You can order more slots below.'; if ($target === 'maintenance-user') { diff --git a/src/backend/app/Http/Middleware/TransactionRequest.php b/src/backend/app/Http/Middleware/TransactionRequest.php index 43369e79d..2641e1dfe 100644 --- a/src/backend/app/Http/Middleware/TransactionRequest.php +++ b/src/backend/app/Http/Middleware/TransactionRequest.php @@ -11,9 +11,7 @@ class TransactionRequest /** * Handle an incoming request. * - * @param Request $request - * @param \Closure $next - * + * @param Request $request * @return mixed */ public function handle($request, \Closure $next) diff --git a/src/backend/app/Http/Middleware/UserDefaultDatabaseConnectionMiddleware.php b/src/backend/app/Http/Middleware/UserDefaultDatabaseConnectionMiddleware.php index 7a8216a46..208b992ed 100644 --- a/src/backend/app/Http/Middleware/UserDefaultDatabaseConnectionMiddleware.php +++ b/src/backend/app/Http/Middleware/UserDefaultDatabaseConnectionMiddleware.php @@ -21,8 +21,7 @@ public function __construct( private DatabaseProxyManagerService $databaseProxyManager, private ApiCompanyResolverService $apiCompanyResolverService, private ApiResolverMap $apiResolverMap, - ) { - } + ) {} public function handle($request, \Closure $next) { @@ -76,7 +75,7 @@ private function handleApiRequest(Request $request, \Closure $next) $companyId = $databaseProxy->getCompanyId(); } elseif ($this->isAgentApp($request->path())) { // agent app authenticated user requests $companyId = auth('agent_api')->payload()->get('companyId'); - if (!is_numeric($companyId)) { + if (! is_numeric($companyId)) { throw new \Exception('JWT is not provided'); } } elseif ($this->resolveThirdPartyApi($request->path())) { @@ -87,7 +86,7 @@ private function handleApiRequest(Request $request, \Closure $next) } else { // web client authenticated user requests $companyId = auth('api')->payload()->get('companyId'); - if (!is_numeric($companyId)) { + if (! is_numeric($companyId)) { throw new \Exception('JWT is not provided'); } } diff --git a/src/backend/app/Http/Requests/AdminResetPasswordRequest.php b/src/backend/app/Http/Requests/AdminResetPasswordRequest.php index 03e6e18a8..ee25ab8cb 100644 --- a/src/backend/app/Http/Requests/AdminResetPasswordRequest.php +++ b/src/backend/app/Http/Requests/AdminResetPasswordRequest.php @@ -18,8 +18,6 @@ public function authorize() /** * Get the validation rules that apply to the request. - * - * @return array */ public function rules(): array { diff --git a/src/backend/app/Http/Requests/CityRequest.php b/src/backend/app/Http/Requests/CityRequest.php index 7cd8a3dce..04d9d9e8e 100644 --- a/src/backend/app/Http/Requests/CityRequest.php +++ b/src/backend/app/Http/Requests/CityRequest.php @@ -8,14 +8,15 @@ class CityRequest extends FormRequest { private const PARAM_NAME = 'name'; + private const PARAM_MINI_GRID = 'mini_grid_id'; + private const PARAM_CLUSTER_ID = 'cluster_id'; + private const PARAM_COUNTRY_ID = 'country_id'; /** * Determine if the user is authorized to make this request. - * - * @return bool */ public function authorize(): bool { @@ -24,8 +25,6 @@ public function authorize(): bool /** * Get the validation rules that apply to the request. - * - * @return array */ public function rules(): array { @@ -37,7 +36,7 @@ public function rules(): array public function getCity(): City { - $city = new City(); + $city = new City; $city->setName($this->input(self::PARAM_NAME)); $city->setCountryId($this->input(self::PARAM_COUNTRY_ID, 0)); $city->setClusterId($this->input(self::PARAM_CLUSTER_ID)); diff --git a/src/backend/app/Http/Requests/ClusterRequest.php b/src/backend/app/Http/Requests/ClusterRequest.php index de9467fb0..a2cab730a 100644 --- a/src/backend/app/Http/Requests/ClusterRequest.php +++ b/src/backend/app/Http/Requests/ClusterRequest.php @@ -18,8 +18,6 @@ class ClusterRequest extends FormRequest { /** * Determine if the user is authorized to make this request. - * - * @return bool */ public function authorize(): bool { @@ -28,8 +26,6 @@ public function authorize(): bool /** * Get the validation rules that apply to the request. - * - * @return array */ public function rules(): array { diff --git a/src/backend/app/Http/Requests/CompanyRegistrationRequest.php b/src/backend/app/Http/Requests/CompanyRegistrationRequest.php index ce3a72f87..96fe645ff 100644 --- a/src/backend/app/Http/Requests/CompanyRegistrationRequest.php +++ b/src/backend/app/Http/Requests/CompanyRegistrationRequest.php @@ -8,8 +8,6 @@ class CompanyRegistrationRequest extends FormRequest { /** * Get the validation rules that apply to the request. - * - * @return array */ public function rules(): array { diff --git a/src/backend/app/Http/Requests/StoreEBikeRequest.php b/src/backend/app/Http/Requests/StoreEBikeRequest.php index 7b8f0257a..0e23a6f9b 100644 --- a/src/backend/app/Http/Requests/StoreEBikeRequest.php +++ b/src/backend/app/Http/Requests/StoreEBikeRequest.php @@ -8,8 +8,6 @@ class StoreEBikeRequest extends FormRequest { /** * Determine if the user is authorized to make this request. - * - * @return bool */ public function authorize(): bool { diff --git a/src/backend/app/Http/Requests/StoreMiniGridRequest.php b/src/backend/app/Http/Requests/StoreMiniGridRequest.php index 5e0eabfee..79a3f58fa 100644 --- a/src/backend/app/Http/Requests/StoreMiniGridRequest.php +++ b/src/backend/app/Http/Requests/StoreMiniGridRequest.php @@ -8,6 +8,7 @@ class StoreMiniGridRequest extends FormRequest { public const PARAM_CLUSTER_ID = 'cluster_id'; + public const PARAM_NAME = 'name'; /** @@ -36,7 +37,7 @@ public function rules() public function getMiniGrid(): MiniGrid { - $miniGrid = new MiniGrid(); + $miniGrid = new MiniGrid; $miniGrid->setClusterId($this->input(self::PARAM_CLUSTER_ID)); $miniGrid->setName($this->input(self::PARAM_NAME)); diff --git a/src/backend/app/Http/Requests/StoreSolarHomeSystemRequest.php b/src/backend/app/Http/Requests/StoreSolarHomeSystemRequest.php index 3be928a58..b8d85e41c 100644 --- a/src/backend/app/Http/Requests/StoreSolarHomeSystemRequest.php +++ b/src/backend/app/Http/Requests/StoreSolarHomeSystemRequest.php @@ -8,8 +8,6 @@ class StoreSolarHomeSystemRequest extends FormRequest { /** * Determine if the user is authorized to make this request. - * - * @return bool */ public function authorize(): bool { diff --git a/src/backend/app/Http/Requests/SubConnectionTypeCreateRequest.php b/src/backend/app/Http/Requests/SubConnectionTypeCreateRequest.php index 3155ae65c..fd4be7cfb 100644 --- a/src/backend/app/Http/Requests/SubConnectionTypeCreateRequest.php +++ b/src/backend/app/Http/Requests/SubConnectionTypeCreateRequest.php @@ -8,8 +8,6 @@ class SubConnectionTypeCreateRequest extends FormRequest { /** * Determine if the user is authorized to make this request. - * - * @return bool */ public function authorize(): bool { @@ -18,8 +16,6 @@ public function authorize(): bool /** * Get the validation rules that apply to the request. - * - * @return array */ public function rules(): array { diff --git a/src/backend/app/Http/Resources/ApiResource.php b/src/backend/app/Http/Resources/ApiResource.php index 5016dea38..1095cd954 100644 --- a/src/backend/app/Http/Resources/ApiResource.php +++ b/src/backend/app/Http/Resources/ApiResource.php @@ -10,8 +10,7 @@ class ApiResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request - * + * @param Request $request * @return array */ public function toArray($request) diff --git a/src/backend/app/Http/Resources/MeterResource.php b/src/backend/app/Http/Resources/MeterResource.php index 4eba9a77d..1054b63f7 100644 --- a/src/backend/app/Http/Resources/MeterResource.php +++ b/src/backend/app/Http/Resources/MeterResource.php @@ -10,8 +10,7 @@ class MeterResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request - * + * @param Request $request * @return array */ public function toArray($request) diff --git a/src/backend/app/Http/Resources/MeterTypeResource.php b/src/backend/app/Http/Resources/MeterTypeResource.php index 0f79f0186..500cdbe9b 100644 --- a/src/backend/app/Http/Resources/MeterTypeResource.php +++ b/src/backend/app/Http/Resources/MeterTypeResource.php @@ -10,8 +10,7 @@ class MeterTypeResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request - * + * @param Request $request * @return array */ public function toArray($request) diff --git a/src/backend/app/Http/Resources/SmsSearchResultResource.php b/src/backend/app/Http/Resources/SmsSearchResultResource.php index ab9722154..9cd0980a2 100644 --- a/src/backend/app/Http/Resources/SmsSearchResultResource.php +++ b/src/backend/app/Http/Resources/SmsSearchResultResource.php @@ -7,9 +7,9 @@ use Illuminate\Support\Collection; /** - * @property int $id - * @property string $name - * @property string $surname + * @property int $id + * @property string $name + * @property string $surname * @property Collection $addresses */ class SmsSearchResultResource extends JsonResource @@ -17,9 +17,7 @@ class SmsSearchResultResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request - * - * @return array + * @param Request $request */ public function toArray($request): array { diff --git a/src/backend/app/Http/Resources/UserResource.php b/src/backend/app/Http/Resources/UserResource.php index 9aa7c241a..9197f45c6 100644 --- a/src/backend/app/Http/Resources/UserResource.php +++ b/src/backend/app/Http/Resources/UserResource.php @@ -10,8 +10,7 @@ class UserResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request - * + * @param Request $request * @return array */ public function toArray($request) diff --git a/src/backend/app/Jobs/AbstractJob.php b/src/backend/app/Jobs/AbstractJob.php index 10762ee3f..f814d1fa0 100644 --- a/src/backend/app/Jobs/AbstractJob.php +++ b/src/backend/app/Jobs/AbstractJob.php @@ -19,6 +19,7 @@ abstract class AbstractJob implements ShouldQueue use SerializesModels; protected int $companyId; + protected CompanyJob $companyJob; public ?string $parentId = null; diff --git a/src/backend/app/Jobs/ApplianceTransactionProcessor.php b/src/backend/app/Jobs/ApplianceTransactionProcessor.php index 9a175e938..030a8c5f9 100644 --- a/src/backend/app/Jobs/ApplianceTransactionProcessor.php +++ b/src/backend/app/Jobs/ApplianceTransactionProcessor.php @@ -11,6 +11,7 @@ class ApplianceTransactionProcessor extends AbstractJob { private Transaction $transaction; + protected const TYPE = 'deferred_payment'; public function __construct(private int $transactionId) diff --git a/src/backend/app/Jobs/EnergyTransactionProcessor.php b/src/backend/app/Jobs/EnergyTransactionProcessor.php index 82d4fa139..e9a1ba931 100644 --- a/src/backend/app/Jobs/EnergyTransactionProcessor.php +++ b/src/backend/app/Jobs/EnergyTransactionProcessor.php @@ -11,6 +11,7 @@ class EnergyTransactionProcessor extends AbstractJob { private Transaction $transaction; + protected const TYPE = 'energy'; public function __construct(private $transactionId) @@ -71,7 +72,7 @@ private function checkForMinimumPurchaseAmount(TransactionDataContainer $transac if ($minimumPurchaseAmount > 0) { $validator = resolve('MinimumPurchaseAmountValidator'); try { - if (!$validator->validate($transactionData, $minimumPurchaseAmount)) { + if (! $validator->validate($transactionData, $minimumPurchaseAmount)) { throw new TransactionAmountNotEnoughException("Minimum purchase amount not reached for {$transactionData->device->device_serial}"); } } catch (\Exception $e) { diff --git a/src/backend/app/Jobs/HearthBeat.php b/src/backend/app/Jobs/HearthBeat.php index fae5b6fd3..14237a5f8 100644 --- a/src/backend/app/Jobs/HearthBeat.php +++ b/src/backend/app/Jobs/HearthBeat.php @@ -21,9 +21,7 @@ class HearthBeat implements ShouldQueue * * @return void */ - public function __construct() - { - } + public function __construct() {} /** * Execute the job. diff --git a/src/backend/app/Jobs/MeterReader.php b/src/backend/app/Jobs/MeterReader.php index 26dcf3ce0..97e9adeac 100644 --- a/src/backend/app/Jobs/MeterReader.php +++ b/src/backend/app/Jobs/MeterReader.php @@ -20,6 +20,7 @@ class MeterReader extends AbstractJob * @var CalinReadMeter */ public $meterReader; + /** * @var Meter */ @@ -27,9 +28,6 @@ class MeterReader extends AbstractJob /** * Create a new job instance. - * - * @param CalinReadMeter $meterReader - * @param Meter $meters */ public function __construct(CalinReadMeter $meterReader, Meter $meters) { @@ -40,8 +38,6 @@ public function __construct(CalinReadMeter $meterReader, Meter $meters) /** * Execute the job. - * - * @return void */ public function executeJob(): void { diff --git a/src/backend/app/Jobs/ProcessPayment.php b/src/backend/app/Jobs/ProcessPayment.php index d25708605..72f2afcb4 100644 --- a/src/backend/app/Jobs/ProcessPayment.php +++ b/src/backend/app/Jobs/ProcessPayment.php @@ -24,7 +24,7 @@ class ProcessPayment extends AbstractJob /** * Create a new job instance. * - * @param int $transaction_id + * @param int $transaction_id */ public function __construct(int $transactionId) { @@ -35,8 +35,6 @@ public function __construct(int $transactionId) /** * Execute the job. - * - * @return void */ public function executeJob(): void { diff --git a/src/backend/app/Jobs/SmsLoadBalancer.php b/src/backend/app/Jobs/SmsLoadBalancer.php index b80920a6a..e95b9dc7c 100644 --- a/src/backend/app/Jobs/SmsLoadBalancer.php +++ b/src/backend/app/Jobs/SmsLoadBalancer.php @@ -18,7 +18,9 @@ class SmsLoadBalancer extends AbstractJob use SerializesModels; public $timeout = 600; + public $tries = 250; + public $gateways; public $smsBody; @@ -46,7 +48,7 @@ private function sendSms($data): string { $smsCollection = collect($data); $smsCollection = $smsCollection->chunk(3); - $httpClient = new Client(); + $httpClient = new Client; $request = $httpClient->post( $smsCollection[1]['setting']['url'], [ diff --git a/src/backend/app/Jobs/SmsProcessor.php b/src/backend/app/Jobs/SmsProcessor.php index 17c1f848d..41fe1bcf9 100644 --- a/src/backend/app/Jobs/SmsProcessor.php +++ b/src/backend/app/Jobs/SmsProcessor.php @@ -22,9 +22,9 @@ class SmsProcessor extends AbstractJob /** * Create a new job instance. * - * @param $data - * @param int $smsType - * @param $smsConfigs + * @param $data + * @param int $smsType + * @param $smsConfigs */ public function __construct(private SmsSender $smsSender) { diff --git a/src/backend/app/Jobs/TokenProcessor.php b/src/backend/app/Jobs/TokenProcessor.php index 9f4cceccc..818c8a327 100644 --- a/src/backend/app/Jobs/TokenProcessor.php +++ b/src/backend/app/Jobs/TokenProcessor.php @@ -19,8 +19,11 @@ class TokenProcessor extends AbstractJob use SerializesModels; private TransactionDataContainer $transactionContainer; + private bool $reCreate; + private int $counter; + private const MAX_TRIES = 3; public function __construct( @@ -90,7 +93,7 @@ private function generateToken($api): void private function handleTokenGenerationFailure(\Exception $e): void { - if (self::MAX_TRIES > $this->counter) { + if ($this->counter < self::MAX_TRIES) { $this->retryTokenGeneration(); return; @@ -111,7 +114,7 @@ private function handleTokenGenerationFailure(\Exception $e): void private function retryTokenGeneration(): void { - ++$this->counter; + $this->counter++; self::dispatch( $this->transactionContainer, false, diff --git a/src/backend/app/Jobs/UpdatePiggyBankEntry.php b/src/backend/app/Jobs/UpdatePiggyBankEntry.php index 2365c996a..d9add72bc 100644 --- a/src/backend/app/Jobs/UpdatePiggyBankEntry.php +++ b/src/backend/app/Jobs/UpdatePiggyBankEntry.php @@ -39,7 +39,7 @@ public function __construct(MeterParameter $meterParameter) public function executeJob() { $socialTariff = $this->meterParameter->tariff()->first()->socialTariff; - if (!$socialTariff) { + if (! $socialTariff) { echo "meter has no social tariff should be deleted \n"; // meter parameter has no social tariff diff --git a/src/backend/app/Lib/IManufacturerAPI.php b/src/backend/app/Lib/IManufacturerAPI.php index 870b9e8e9..09394b7d5 100644 --- a/src/backend/app/Lib/IManufacturerAPI.php +++ b/src/backend/app/Lib/IManufacturerAPI.php @@ -7,11 +7,6 @@ interface IManufacturerAPI { - /** - * @param TransactionDataContainer $transactionContainer - * - * @return array - */ public function chargeDevice(TransactionDataContainer $transactionContainer): array; public function clearDevice(Device $device); diff --git a/src/backend/app/Lib/IMeterReader.php b/src/backend/app/Lib/IMeterReader.php index 6fd9939bd..7448672be 100644 --- a/src/backend/app/Lib/IMeterReader.php +++ b/src/backend/app/Lib/IMeterReader.php @@ -7,9 +7,7 @@ interface IMeterReader /** * Reads the data for a single meter. * - * @param $meterIdentifier - * @param int $type defines what to read from the remote api - * + * @param int $type defines what to read from the remote api * @return mixed */ public function readMeter($meterIdentifier, $type); @@ -17,10 +15,8 @@ public function readMeter($meterIdentifier, $type); /** * Reads the data for a given meter list. * - * @param $meterList - * @param int $type defines what to read from the remote api - * * @param array $options - * + * @param int $type defines what to read from the remote api + * * @param array $options * @return mixed */ public function readBatch($meterList, $type, $options); diff --git a/src/backend/app/Lib/ISmsProvider.php b/src/backend/app/Lib/ISmsProvider.php index db2aac738..5feb3a3d9 100644 --- a/src/backend/app/Lib/ISmsProvider.php +++ b/src/backend/app/Lib/ISmsProvider.php @@ -9,10 +9,6 @@ interface ISmsProvider /** * Sends the sms to the sms provider. * - * @param string $number - * @param string $body - * @param string $callback - * @param SmsAndroidSetting $smsAndroidSetting * * @return mixed */ diff --git a/src/backend/app/Listeners/AccessRateListener.php b/src/backend/app/Listeners/AccessRateListener.php index e417d5534..2045546f7 100644 --- a/src/backend/app/Listeners/AccessRateListener.php +++ b/src/backend/app/Listeners/AccessRateListener.php @@ -15,11 +15,11 @@ public function initializeAccessRatePayment(Meter $meter): void { try { $accessRate = $meter->tariff()->first()->accessRate; - if (!$accessRate) { + if (! $accessRate) { throw new NoAccessRateFound('Access Rate is not set'); } $nextPaymentDate = Carbon::now()->addDays($accessRate->period)->toDateString(); - $accessRatePayment = new AccessRatePayment(); + $accessRatePayment = new AccessRatePayment; $accessRatePayment->accessRate()->associate($accessRate); $accessRatePayment->meter()->associate($meter); $accessRatePayment->due_date = $nextPaymentDate; diff --git a/src/backend/app/Listeners/ClusterGeoListener.php b/src/backend/app/Listeners/ClusterGeoListener.php index 059b0acda..aa9e068e3 100644 --- a/src/backend/app/Listeners/ClusterGeoListener.php +++ b/src/backend/app/Listeners/ClusterGeoListener.php @@ -13,10 +13,6 @@ class ClusterGeoListener { /** * Handle the event. - * - * @param ClusterEvent $event - * - * @return void */ public function handle(ClusterEvent $event): void { @@ -48,9 +44,6 @@ public function handle(ClusterEvent $event): void /** * Creates a json file which has the same name as the cluster. - * - * @param Cluster $cluster - * @param $data */ private function storeData(Cluster $cluster, $data): void { @@ -60,7 +53,6 @@ private function storeData(Cluster $cluster, $data): void /** * External geojson resource has lon,lat format. Change order to lat,lon. * - * @param $data * * @return array[] * @@ -71,15 +63,15 @@ private function storeData(Cluster $cluster, $data): void public function reformatExternalData($data): array { $formatted = []; - if (is_array($data) && !array_key_exists('geojson', $data)) { + if (is_array($data) && ! array_key_exists('geojson', $data)) { $data = $data[0]; } - if (!array_key_exists('geojson', $data)) { + if (! array_key_exists('geojson', $data)) { throw new GeoFormatException('external resource should contain a geojson key'); } - if (!array_key_exists('coordinates', $data['geojson'])) { + if (! array_key_exists('coordinates', $data['geojson'])) { throw new GeoFormatException('geojson key has not coordinates key'); } diff --git a/src/backend/app/Listeners/HistoryListener.php b/src/backend/app/Listeners/HistoryListener.php index c197d67ed..c756bb014 100644 --- a/src/backend/app/Listeners/HistoryListener.php +++ b/src/backend/app/Listeners/HistoryListener.php @@ -16,8 +16,6 @@ class HistoryListener /** * Create the event listener. - * - * @param $historyModel */ public function __construct(History $historyModel) { @@ -27,10 +25,8 @@ public function __construct(History $historyModel) /** * Saves a new event in to the histories table. * - * @param mixed $data is an object which should be stored on the histories table - * @param string $content the stringified message about the entry - * @param string $type - * @param string|null $field + * @param mixed $data is an object which should be stored on the histories table + * @param string $content the stringified message about the entry */ public function save($data, string $content, string $type, ?string $field): void { diff --git a/src/backend/app/Listeners/MeterListener.php b/src/backend/app/Listeners/MeterListener.php index bb814a45f..94e9c6122 100644 --- a/src/backend/app/Listeners/MeterListener.php +++ b/src/backend/app/Listeners/MeterListener.php @@ -9,10 +9,6 @@ class MeterListener { /** * Sets the in_use to true. - * - * @param int $meter_id - * - * @return void */ public function onParameterSaved(int $meter_id): void { diff --git a/src/backend/app/Listeners/PaymentListener.php b/src/backend/app/Listeners/PaymentListener.php index 190f2646a..f7fced3e7 100644 --- a/src/backend/app/Listeners/PaymentListener.php +++ b/src/backend/app/Listeners/PaymentListener.php @@ -25,8 +25,7 @@ public function __construct( private ApplianceRatePaymentHistoryService $applianceRatePaymentHistoryService, private AccessRatePaymentHistoryService $accessRatePaymentHistoryService, private TransactionPaymentHistoryService $transactionPaymentHistoryService, - ) { - } + ) {} public function onEnergyPayment(ITransactionProvider $transactionProvider): void { @@ -40,9 +39,7 @@ public function onEnergyPayment(ITransactionProvider $transactionProvider): void } } - public function onLoanPayment(string $customer_id, int $amount): void - { - } + public function onLoanPayment(string $customer_id, int $amount): void {} public function onPaymentFailed(): void { @@ -50,13 +47,10 @@ public function onPaymentFailed(): void } /** - * @param int $amount - * @param string $paymentService the name of the Payment gateway - * @param $paymentType - * @param mixed $sender : The number or person who sent the money - * @param mixed $paidFor the identifier for the payment. Ex; { LoanID, TokenID } - * @param $payer - * @param $transaction + * @param int $amount + * @param string $paymentService the name of the Payment gateway + * @param mixed $sender : The number or person who sent the money + * @param mixed $paidFor the identifier for the payment. Ex; { LoanID, TokenID } */ public function onPaymentSuccess( $amount, diff --git a/src/backend/app/Listeners/PaymentPeriodListener.php b/src/backend/app/Listeners/PaymentPeriodListener.php index c760b9f17..ebd2d3e93 100644 --- a/src/backend/app/Listeners/PaymentPeriodListener.php +++ b/src/backend/app/Listeners/PaymentPeriodListener.php @@ -15,6 +15,7 @@ class PaymentPeriodListener * @var PaymentProfile */ public $paymentProfile; + /** * @var PaymentHistory */ @@ -22,9 +23,6 @@ class PaymentPeriodListener /** * Create the event listener. - * - * @param PaymentProfile $paymentProfile - * @param PaymentHistory $history */ public function __construct(PaymentProfile $paymentProfile, PaymentHistory $history) { @@ -40,7 +38,7 @@ public function recalculate(Person $person): void ->groupBy('transaction_id')->get(); $totalAmount = 0; $difference = (new Carbon($transactions[0]->created_at)) - ->diffInDays(new Carbon($transactions[\count($transactions) - 1]->created_at)) / \count($transactions); + ->diffInDays(new Carbon($transactions[\count($transactions) - 1]->created_at)) / \count($transactions); foreach ($transactions as $transaction) { $totalAmount += $transaction->amount; } diff --git a/src/backend/app/Listeners/SmsListener.php b/src/backend/app/Listeners/SmsListener.php index d62d09cc5..e023ad4a6 100644 --- a/src/backend/app/Listeners/SmsListener.php +++ b/src/backend/app/Listeners/SmsListener.php @@ -13,7 +13,9 @@ class SmsListener { private $smsResendInformationKeyService; + private $transaction; + private $smsService; public function __construct( @@ -29,11 +31,11 @@ public function __construct( public function onSmsStored($sender, $message) { $resendInformationKey = $this->smsResendInformationKeyService->getResendInformationKeys()->first(); - if (!$resendInformationKey) { + if (! $resendInformationKey) { return; } $resend = strpos(strtolower($message), strtolower($resendInformationKey)); - if (!$resend) { + if (! $resend) { return; } $wordsInMessage = explode(' ', $message); diff --git a/src/backend/app/Listeners/SoldApplianceListener.php b/src/backend/app/Listeners/SoldApplianceListener.php index 3d2b619dd..c3ee81aaf 100644 --- a/src/backend/app/Listeners/SoldApplianceListener.php +++ b/src/backend/app/Listeners/SoldApplianceListener.php @@ -12,8 +12,7 @@ class SoldApplianceListener public function __construct( private ApplianceRateService $applianceRateService, private PersonService $personService, - ) { - } + ) {} public function initializeApplianceRates(SoldApplianceDataContainer $soldAppliance): void { diff --git a/src/backend/app/Listeners/TokenListener.php b/src/backend/app/Listeners/TokenListener.php index cd5c221b1..199c70b20 100644 --- a/src/backend/app/Listeners/TokenListener.php +++ b/src/backend/app/Listeners/TokenListener.php @@ -13,6 +13,7 @@ class TokenListener { private $token; + protected $tokenData; /** @@ -25,9 +26,6 @@ public function __construct(MeterToken $token) $this->token = $token; } - /** - * @param TransactionDataContainer $transactionContainer - */ public function generateToken(TransactionDataContainer $transactionContainer): void { $api = null; diff --git a/src/backend/app/ManufacturerApi/CalinReadMeter.php b/src/backend/app/ManufacturerApi/CalinReadMeter.php index db0d34a15..095b18789 100644 --- a/src/backend/app/ManufacturerApi/CalinReadMeter.php +++ b/src/backend/app/ManufacturerApi/CalinReadMeter.php @@ -11,10 +11,12 @@ class CalinReadMeter implements IMeterReader { public const READ_DAILY = 1; + /** * @var \SoapClient */ private $api; + /** * @var MeterConsumption */ @@ -23,7 +25,6 @@ class CalinReadMeter implements IMeterReader /** * CalinReadMeter constructor. * - * @param MeterConsumption $consumption * * @throws \SoapFault */ @@ -37,9 +38,8 @@ public function __construct(MeterConsumption $consumption) } /** - * @param string $meterId serial number of the meter - * @param string $date y-m-d format date - * + * @param string $meterId serial number of the meter + * @param string $date y-m-d format date * @return mixed */ public function readDailyData($meterId, $date) @@ -59,28 +59,22 @@ public function readDailyData($meterId, $date) /** * Reads the total consumption of a meter. * - * @param $meterId - * @param $type * * @return void */ - public function readMeter($meterId, $type) - { - } + public function readMeter($meterId, $type) {} /** * Reads the data for a given meter list. * - * @param $meterList - * @param int $type defines what to read from the remote api - * @param array $options - * + * @param int $type defines what to read from the remote api + * @param array $options * @return void */ public function readBatch($meterList, $type, $options) { if ($type === self::READ_DAILY) { - if (!isset($options['date'])) { + if (! isset($options['date'])) { throw new InvalidDateException('Date', 'date is not set. Send date within the options array'); } foreach ($meterList as $meter) { @@ -96,6 +90,7 @@ public function readBatch($meterList, $type, $options) 'Meter Reading, negative consumption ', ['meter_id' => $meter->id, 'consumption' => $meterData[0]] ); + continue; } @@ -118,10 +113,6 @@ public function readBatch($meterList, $type, $options) /** * Calculates the difference of usages with the prev. reading. - * - * @param MeterConsumption $consumption - * - * @return MeterConsumption */ private function calculateDifference(MeterConsumption $consumption): MeterConsumption { @@ -136,8 +127,6 @@ private function calculateDifference(MeterConsumption $consumption): MeterConsum } /** - * @param $data - * * @return string[] * * @throws MeterIsNotReadable @@ -159,12 +148,7 @@ private function fetchResponseData($data): array } /** - * @param string $meterId - * @param string $year - * @param string $month - * @param string $day - * @param string $action - * + * @param string $action * @return array (\Illuminate\Config\Repository|float|mixed)[] */ private function prepareDailyReq(string $meterId, string $year, string $month, string $day, $action = 'Read'): array diff --git a/src/backend/app/Misc/LoanDataContainer.php b/src/backend/app/Misc/LoanDataContainer.php index b982cfc4d..b41afd284 100644 --- a/src/backend/app/Misc/LoanDataContainer.php +++ b/src/backend/app/Misc/LoanDataContainer.php @@ -17,6 +17,7 @@ class LoanDataContainer { private ?Person $meterOwner; + private Transaction $transaction; public array $paid_rates = []; @@ -28,7 +29,7 @@ public function initialize(Transaction $transaction): void public function loanCost() { - if (!$this->meterOwner) { + if (! $this->meterOwner) { throw new MeterParameterNotFound('loan data container'); } $loans = $this->getCustomerDueRates($this->meterOwner); @@ -87,8 +88,6 @@ public function loanCost() } /** - * @param $owner - * * @return Builder[]|Collection * * @psalm-return Collection|array @@ -105,8 +104,6 @@ private function getCustomerDueRates($owner): Collection } /** - * @param string $serialNumber - * * @return mixed * * @throws MeterIsNotInUse @@ -124,7 +121,7 @@ private function getMeterOwner(string $serialNumber): ?Person } // meter is not been used by anyone - if (!$meter->in_use) { + if (! $meter->in_use) { throw new MeterIsNotInUse($serialNumber.' meter is not in use'); } diff --git a/src/backend/app/Misc/SoldApplianceDataContainer.php b/src/backend/app/Misc/SoldApplianceDataContainer.php index 64374b393..1bac55562 100644 --- a/src/backend/app/Misc/SoldApplianceDataContainer.php +++ b/src/backend/app/Misc/SoldApplianceDataContainer.php @@ -14,8 +14,7 @@ public function __construct( private AssetType $assetType, private AssetPerson $assetPerson, private ?Transaction $transaction = null, - ) { - } + ) {} public function getAsset() { diff --git a/src/backend/app/Misc/TransactionDataContainer.php b/src/backend/app/Misc/TransactionDataContainer.php index 1f2b182b7..6924506d0 100644 --- a/src/backend/app/Misc/TransactionDataContainer.php +++ b/src/backend/app/Misc/TransactionDataContainer.php @@ -15,18 +15,31 @@ class TransactionDataContainer { public int $accessRateDebt; + public Transaction $transaction; + public Device $device; + public ?MeterTariff $tariff; + public Manufacturer $manufacturer; + public Token $token; + public array $paidRates; + public float $chargedEnergy; + public float $amount; + public float $totalAmount; + public float $rawAmount; + public ?AssetPerson $appliancePerson; + public float $installmentCost; + public string $dayDifferenceBetweenTwoInstallments; public static function initialize(Transaction $transaction): TransactionDataContainer diff --git a/src/backend/app/Models/Address/Address.php b/src/backend/app/Models/Address/Address.php index e2de67a16..d7b17aa1d 100644 --- a/src/backend/app/Models/Address/Address.php +++ b/src/backend/app/Models/Address/Address.php @@ -16,17 +16,19 @@ * @property string|null $email * @property string|null $phone * @property string|null $street - * @property int $city_id - * @property int $is_primary - * @property int $owner_id - * @property string $owner_type + * @property int $city_id + * @property int $is_primary + * @property int $owner_id + * @property string $owner_type */ class Address extends BaseModel { use HasFactory; public const RELATION_NAME = 'address'; + protected $hidden = ['owner_id', 'owner_type']; + public static $rules = [ 'city_id' => 'required|exists:cities,id', ]; diff --git a/src/backend/app/Models/Admin.php b/src/backend/app/Models/Admin.php index 3a3bbba45..2cf81e2be 100644 --- a/src/backend/app/Models/Admin.php +++ b/src/backend/app/Models/Admin.php @@ -2,6 +2,4 @@ namespace App\Models; -class Admin extends BaseModel -{ -} +class Admin extends BaseModel {} diff --git a/src/backend/app/Models/Agent.php b/src/backend/app/Models/Agent.php index 49dcbf3ee..9182a5e1e 100644 --- a/src/backend/app/Models/Agent.php +++ b/src/backend/app/Models/Agent.php @@ -18,19 +18,19 @@ /** * Class Agent. * - * @property int $id - * @property int $person_id - * @property int $mini_grid_id - * @property int $agent_commission_id + * @property int $id + * @property int $person_id + * @property int $mini_grid_id + * @property int $agent_commission_id * @property string $device_id * @property string $name * @property string $email * @property string $password * @property string $fire_base_token - * @property float $balance - * @property float $available_balance + * @property float $balance + * @property float $available_balance * @property string $remember_token - * @property int $company_id + * @property int $company_id */ class Agent extends Authenticatable implements JWTSubject { diff --git a/src/backend/app/Models/AgentAssignedAppliances.php b/src/backend/app/Models/AgentAssignedAppliances.php index 5af37cfaf..5d5ac7337 100644 --- a/src/backend/app/Models/AgentAssignedAppliances.php +++ b/src/backend/app/Models/AgentAssignedAppliances.php @@ -9,6 +9,7 @@ class AgentAssignedAppliances extends BaseModel { public const RELATION_NAME = 'agent_appliance'; + protected $guarded = []; public function agent(): BelongsTo diff --git a/src/backend/app/Models/AgentCommission.php b/src/backend/app/Models/AgentCommission.php index bf5c3e75d..aac65eeb7 100644 --- a/src/backend/app/Models/AgentCommission.php +++ b/src/backend/app/Models/AgentCommission.php @@ -10,7 +10,7 @@ /** * Class AgentCommission. * - * @property int $id + * @property int $id * @property float $energy_commission * @property float $appliance_commission * @property float $risk_balance diff --git a/src/backend/app/Models/Asset.php b/src/backend/app/Models/Asset.php index 2224a9966..7c95a1bbf 100644 --- a/src/backend/app/Models/Asset.php +++ b/src/backend/app/Models/Asset.php @@ -13,6 +13,7 @@ class Asset extends BaseModel use HasFactory; public const RELATION_NAME = 'appliance'; + protected $table = 'assets'; public function assetType(): BelongsTo diff --git a/src/backend/app/Models/AssetRate.php b/src/backend/app/Models/AssetRate.php index fb7eb22ae..027bbbd53 100644 --- a/src/backend/app/Models/AssetRate.php +++ b/src/backend/app/Models/AssetRate.php @@ -11,9 +11,9 @@ /** * Class AssetRate. * - * @property int $asset_person_id - * @property int $rate_cost - * @property int $remaining + * @property int $asset_person_id + * @property int $rate_cost + * @property int $remaining * @property string $due_date * @property AssetPerson assetPerson */ diff --git a/src/backend/app/Models/Base/BaseModel.php b/src/backend/app/Models/Base/BaseModel.php index 635661df6..53bfa76e4 100644 --- a/src/backend/app/Models/Base/BaseModel.php +++ b/src/backend/app/Models/Base/BaseModel.php @@ -14,6 +14,7 @@ abstract class BaseModel extends Model { protected $guarded = ['id']; + public static $rules = []; public function __construct(array $attributes = []) diff --git a/src/backend/app/Models/Base/BaseModelCore.php b/src/backend/app/Models/Base/BaseModelCore.php index 6d43ebc05..60376555b 100644 --- a/src/backend/app/Models/Base/BaseModelCore.php +++ b/src/backend/app/Models/Base/BaseModelCore.php @@ -13,6 +13,7 @@ abstract class BaseModelCore extends Model { protected $guarded = ['id']; + public static $rules = []; public function __construct(array $attributes = []) diff --git a/src/backend/app/Models/City.php b/src/backend/app/Models/City.php index 696945aa0..01556cb04 100644 --- a/src/backend/app/Models/City.php +++ b/src/backend/app/Models/City.php @@ -12,11 +12,11 @@ /** * Class City. * - * @property int $id + * @property int $id * @property string $name - * @property int $country_id - * @property int $cluster_id - * @property int $mini_grid_id + * @property int $country_id + * @property int $cluster_id + * @property int $mini_grid_id */ class City extends BaseModel { diff --git a/src/backend/app/Models/Cluster.php b/src/backend/app/Models/Cluster.php index acf8bfaf2..776f234f5 100644 --- a/src/backend/app/Models/Cluster.php +++ b/src/backend/app/Models/Cluster.php @@ -11,7 +11,7 @@ /** * Class Cluster. * - * @property int $id + * @property int $id * @property string $name * @property int manager_id * @property string geo_data diff --git a/src/backend/app/Models/Company.php b/src/backend/app/Models/Company.php index 584247dca..a7362016d 100644 --- a/src/backend/app/Models/Company.php +++ b/src/backend/app/Models/Company.php @@ -8,7 +8,7 @@ use Illuminate\Database\Eloquent\Relations\HasOne; /** - * @property int $id + * @property int $id * @property string $name; */ class Company extends BaseModelCore diff --git a/src/backend/app/Models/CompanyDatabase.php b/src/backend/app/Models/CompanyDatabase.php index 7a21fbb58..e4580350e 100644 --- a/src/backend/app/Models/CompanyDatabase.php +++ b/src/backend/app/Models/CompanyDatabase.php @@ -17,7 +17,9 @@ class CompanyDatabase extends BaseModelCore use HasFactory; public const TABLE_NAME = 'company_databases'; + public const COL_DATABASE_NAME = 'database_name'; + public const COL_COMPANY_ID = 'company_id'; public function company(): BelongsTo diff --git a/src/backend/app/Models/CompanyJob.php b/src/backend/app/Models/CompanyJob.php index ce9c9089d..a833335b5 100644 --- a/src/backend/app/Models/CompanyJob.php +++ b/src/backend/app/Models/CompanyJob.php @@ -7,7 +7,9 @@ class CompanyJob extends BaseModelCore { public const STATUS_PENDING = 0; + public const STATUS_SUCCESS = 1; + public const STATUS_FAILED = -1; // has one company diff --git a/src/backend/app/Models/Country.php b/src/backend/app/Models/Country.php index 4f3fa2088..e66ad90ca 100644 --- a/src/backend/app/Models/Country.php +++ b/src/backend/app/Models/Country.php @@ -7,9 +7,6 @@ class Country extends BaseModel { - /** - * @return string - */ public function getRouteKeyName(): string { return 'country_code'; diff --git a/src/backend/app/Models/DatabaseProxy.php b/src/backend/app/Models/DatabaseProxy.php index ddfd19060..88d2ac9e4 100644 --- a/src/backend/app/Models/DatabaseProxy.php +++ b/src/backend/app/Models/DatabaseProxy.php @@ -14,7 +14,9 @@ class DatabaseProxy extends BaseModelCore { public const COL_DATABASE_CONNECTION = 'database_connection'; + public const COL_COMPANY_ID = 'fk_company_id'; + public const COL_EMAIL = 'email'; private function buildQuery(?int $companyId = null): Builder diff --git a/src/backend/app/Models/EBike.php b/src/backend/app/Models/EBike.php index 0b3839223..c12eb8335 100644 --- a/src/backend/app/Models/EBike.php +++ b/src/backend/app/Models/EBike.php @@ -9,6 +9,7 @@ class EBike extends BaseModel { public const RELATION_NAME = 'e_bike'; + protected $table = 'e_bikes'; public function device(): MorphOne diff --git a/src/backend/app/Models/History.php b/src/backend/app/Models/History.php index 85ff55636..2c0bcb105 100644 --- a/src/backend/app/Models/History.php +++ b/src/backend/app/Models/History.php @@ -8,15 +8,17 @@ /** * Class History holds all the changes in the system for the current day. * - * @property int $id - * @property string $action the type of the action like created, updated, deleted/closed - * @property string $field the affected field. Only required for the update action + * @property int $id + * @property string $action the type of the action like created, updated, deleted/closed + * @property string $field the affected field. Only required for the update action * @property string $content; */ class History extends BaseModel { public const ACTION_CREATED = 'create'; + public const ACTION_UPDATE = 'update'; + public const ACTION_DELETE = 'delete'; public function target(): MorphTo diff --git a/src/backend/app/Models/MailSettings.php b/src/backend/app/Models/MailSettings.php index 7168b56bd..e3e6a16a7 100644 --- a/src/backend/app/Models/MailSettings.php +++ b/src/backend/app/Models/MailSettings.php @@ -7,6 +7,4 @@ /** * Class MailSettings. */ -class MailSettings extends BaseModel -{ -} +class MailSettings extends BaseModel {} diff --git a/src/backend/app/Models/MainSettings.php b/src/backend/app/Models/MainSettings.php index d64c2a842..07c3406cb 100644 --- a/src/backend/app/Models/MainSettings.php +++ b/src/backend/app/Models/MainSettings.php @@ -7,15 +7,13 @@ /** * Class MainSettings. * - * @property int $id + * @property int $id * @property string $site_title * @property string $company_name * @property string $currency * @property string $country * @property string $language - * @property float $vat_energy - * @property float $vat_appliance + * @property float $vat_energy + * @property float $vat_appliance * */ -class MainSettings extends BaseModel -{ -} +class MainSettings extends BaseModel {} diff --git a/src/backend/app/Models/Manufacturer.php b/src/backend/app/Models/Manufacturer.php index 412739b6b..617d540b0 100644 --- a/src/backend/app/Models/Manufacturer.php +++ b/src/backend/app/Models/Manufacturer.php @@ -14,6 +14,7 @@ class Manufacturer extends BaseModel public const RELATION_NAME = 'manufacturer'; protected $hidden = ['api_name']; + protected $guarded = []; public function address(): MorphMany diff --git a/src/backend/app/Models/MapSettings.php b/src/backend/app/Models/MapSettings.php index dbb4ea829..cf47ecc07 100644 --- a/src/backend/app/Models/MapSettings.php +++ b/src/backend/app/Models/MapSettings.php @@ -7,11 +7,9 @@ /** * Class MapSettings. * - * @property int $id + * @property int $id * @property float $zoom * @property float $latitude * @property float $longitude */ -class MapSettings extends BaseModel -{ -} +class MapSettings extends BaseModel {} diff --git a/src/backend/app/Models/Meter/Meter.php b/src/backend/app/Models/Meter/Meter.php index 1443b008c..b614bbad3 100644 --- a/src/backend/app/Models/Meter/Meter.php +++ b/src/backend/app/Models/Meter/Meter.php @@ -17,16 +17,18 @@ use Illuminate\Database\Eloquent\Relations\MorphOne; /** - * @property int $id + * @property int $id * @property MeterTariff $tariff - * @property bool $in_use + * @property bool $in_use */ class Meter extends BaseModel { use HasFactory; public const RELATION_NAME = 'meter'; + protected $guarded = []; + public static $rules = [ 'serial_number' => 'required|min:1|unique:meters', 'meter_type_id' => 'exists:shard.meter_types,id', diff --git a/src/backend/app/Models/Meter/MeterConsumption.php b/src/backend/app/Models/Meter/MeterConsumption.php index d922b5bd8..4fd8c17f4 100644 --- a/src/backend/app/Models/Meter/MeterConsumption.php +++ b/src/backend/app/Models/Meter/MeterConsumption.php @@ -8,11 +8,11 @@ /** * Class MeterConsumption. * - * @property int $id - * @property int $meter_id - * @property float $total_consumption - * @property float $consumption - * @property float $credit_on_meter + * @property int $id + * @property int $meter_id + * @property float $total_consumption + * @property float $consumption + * @property float $credit_on_meter * @property string $reading_date */ class MeterConsumption extends BaseModel diff --git a/src/backend/app/Models/Meter/MeterParameter.php b/src/backend/app/Models/Meter/MeterParameter.php index f4076bbf6..d866fb96b 100644 --- a/src/backend/app/Models/Meter/MeterParameter.php +++ b/src/backend/app/Models/Meter/MeterParameter.php @@ -30,7 +30,9 @@ class MeterParameter extends BaseModel { public const RELATION_NAME = 'meter_parameter'; + protected $hidden = ['owner_id', 'owner_type', 'meter_id', 'tariff_id']; + protected $guarded = []; public function connectionType(): BelongsTo diff --git a/src/backend/app/Models/Meter/MeterTariff.php b/src/backend/app/Models/Meter/MeterTariff.php index a1a986a4b..46d752f7e 100644 --- a/src/backend/app/Models/Meter/MeterTariff.php +++ b/src/backend/app/Models/Meter/MeterTariff.php @@ -17,23 +17,26 @@ /** * Class Tariff. * - * @property string $name - * @property int $price (100 times the price. Allows to play with .00 decimals) - * @property int $total_price (100 times the price. Allows to play with .00 decimals) - * @property string $currency - * @property int|null $factor + * @property string $name + * @property int $price (100 times the price. Allows to play with .00 decimals) + * @property int $total_price (100 times the price. Allows to play with .00 decimals) + * @property string $currency + * @property int|null $factor * @property AccessRate $accessRate */ class MeterTariff extends BaseModel { - use SoftDeletes; use HasFactory; + use SoftDeletes; public const RELATION_NAME = 'meter_tariff'; + public const DEFAULT_FACTOR = 1; // for energy usage + public const SHS_FACTOR = 2; // for shs usage protected $table = 'meter_tariffs'; + protected $guarded = []; public function meterParameter(): HasMany diff --git a/src/backend/app/Models/Meter/MeterToken.php b/src/backend/app/Models/Meter/MeterToken.php index 1a0fc809d..e122e3551 100644 --- a/src/backend/app/Models/Meter/MeterToken.php +++ b/src/backend/app/Models/Meter/MeterToken.php @@ -14,7 +14,7 @@ * Class Token. * * @property string $token - * @property float $energy + * @property float $energy */ class MeterToken extends BaseModel { @@ -43,7 +43,7 @@ public function paymentHistories(): MorphOne public function soldEnergyPerPeriod($startDate, $endDate): Builder { return $this::query() - ->select(DB::raw(' SUM( energy) as sold,YEARWEEK(created_at,3) as period')) + ->select(DB::raw(' SUM( energy) as sold,YEARWEEK(created_at,3) as period')) ->whereBetween('created_at', [$startDate, $endDate]) ->groupBy(DB::raw('YEARWEEK(created_at,3)')); } diff --git a/src/backend/app/Models/Meter/MeterType.php b/src/backend/app/Models/Meter/MeterType.php index 4393e3b3d..8faf50d5e 100644 --- a/src/backend/app/Models/Meter/MeterType.php +++ b/src/backend/app/Models/Meter/MeterType.php @@ -7,10 +7,10 @@ use Illuminate\Database\Eloquent\Relations\HasMany; /** - * @property int $id - * @property bool $online + * @property int $id + * @property bool $online * @property string $phase - * @property int $max_current + * @property int $max_current */ class MeterType extends BaseModel { diff --git a/src/backend/app/Models/MiniGrid.php b/src/backend/app/Models/MiniGrid.php index e4347b37c..0f214ec9e 100644 --- a/src/backend/app/Models/MiniGrid.php +++ b/src/backend/app/Models/MiniGrid.php @@ -14,9 +14,9 @@ /** * Class MiniGrid. * - * @property int $id - * @property string $name - * @property int $cluster_id + * @property int $id + * @property string $name + * @property int $cluster_id * @property Collection $cities */ class MiniGrid extends BaseModel implements TargetAssignable @@ -24,6 +24,7 @@ class MiniGrid extends BaseModel implements TargetAssignable use HasFactory; public const RELATION_NAME = 'mini-grid'; + protected $guarded = []; public function cities(): HasMany diff --git a/src/backend/app/Models/MpmPlugin.php b/src/backend/app/Models/MpmPlugin.php index 8e4104b72..b7ce38f48 100644 --- a/src/backend/app/Models/MpmPlugin.php +++ b/src/backend/app/Models/MpmPlugin.php @@ -14,21 +14,37 @@ class MpmPlugin extends BaseModelCore use HasFactory; public const SPARK_METER = 1; + public const STEAMACO_METER = 2; + public const CALIN_METER = 3; + public const CALIN_SMART_METER = 4; + public const KELIN_METER = 5; + public const STRON_METER = 6; + public const SWIFTA_PAYMENT_PROVIDER = 7; + public const MESOMB_PAYMENT_PROVIDER = 8; + public const BULK_REGISTRATION = 9; + public const VIBER_MESSAGING = 10; + public const WAVE_MONEY_PAYMENT_PROVIDER = 11; + public const MICRO_STAR_METERS = 12; + public const SUN_KING_SHS = 13; + public const GOME_LONG_METERS = 14; + public const WAVECOM_PAYMENT_PROVIDER = 15; + public const DALY_BMS = 16; + public const AGAZA_SHS = 17; protected $table = 'mpm_plugins'; diff --git a/src/backend/app/Models/Payment/PaymentProfile.php b/src/backend/app/Models/Payment/PaymentProfile.php index a236f88d4..dc2b491fa 100644 --- a/src/backend/app/Models/Payment/PaymentProfile.php +++ b/src/backend/app/Models/Payment/PaymentProfile.php @@ -4,6 +4,4 @@ use App\Models\Base\BaseModel; -class PaymentProfile extends BaseModel -{ -} +class PaymentProfile extends BaseModel {} diff --git a/src/backend/app/Models/PaymentHistory.php b/src/backend/app/Models/PaymentHistory.php index 6601fa629..0253d7695 100644 --- a/src/backend/app/Models/PaymentHistory.php +++ b/src/backend/app/Models/PaymentHistory.php @@ -84,8 +84,8 @@ public function getPaymentFlow(string $payer_type, int $payer_id, int $year) } /** - * @param Request|array|string $begin - * @param Request|array|string $end + * @param Request|array|string $begin + * @param Request|array|string $end */ public function getOverview($begin, $end) { diff --git a/src/backend/app/Models/Person/Person.php b/src/backend/app/Models/Person/Person.php index 92840e38d..0e6a2d8fd 100644 --- a/src/backend/app/Models/Person/Person.php +++ b/src/backend/app/Models/Person/Person.php @@ -28,20 +28,20 @@ /** * Class Person. * - * @property int $id + * @property int $id * @property string $title * @property string $education * @property string $name * @property string $surname - * @property mixed $birth_date - * @property string $sex TODO: replace with gender - * @property int $nationality - * @property int $is_customer + * @property mixed $birth_date + * @property string $sex TODO: replace with gender + * @property int $nationality + * @property int $is_customer */ class Person extends BaseModel implements HasAddressesInterface, RoleInterface { - use SoftDeletes; use HasFactory; + use SoftDeletes; public const RELATION_NAME = 'person'; diff --git a/src/backend/app/Models/Plugins.php b/src/backend/app/Models/Plugins.php index bec300114..a5e9e0c97 100644 --- a/src/backend/app/Models/Plugins.php +++ b/src/backend/app/Models/Plugins.php @@ -7,5 +7,6 @@ class Plugins extends BaseModel { public const ACTIVE = 1; + public const INACTIVE = 0; } diff --git a/src/backend/app/Models/Report.php b/src/backend/app/Models/Report.php index 2b4d2e9a2..0d6aa1498 100644 --- a/src/backend/app/Models/Report.php +++ b/src/backend/app/Models/Report.php @@ -7,12 +7,10 @@ /** * Class Report. * - * @property int $id + * @property int $id * @property string $name * @property string $date * @property string $path * @property string $type */ -class Report extends BaseModel -{ -} +class Report extends BaseModel {} diff --git a/src/backend/app/Models/Restriction.php b/src/backend/app/Models/Restriction.php index 98bd99ed2..ffae96ca7 100644 --- a/src/backend/app/Models/Restriction.php +++ b/src/backend/app/Models/Restriction.php @@ -8,10 +8,10 @@ /** * Class Restriction. * - * @property int $id + * @property int $id * @property string $target - * @property int $default - * @property int $limit + * @property int $default + * @property int $limit */ class Restriction extends BaseModel { diff --git a/src/backend/app/Models/Role/RoleDefinition.php b/src/backend/app/Models/Role/RoleDefinition.php index fcfd9d8e2..71b867497 100644 --- a/src/backend/app/Models/Role/RoleDefinition.php +++ b/src/backend/app/Models/Role/RoleDefinition.php @@ -7,6 +7,7 @@ class RoleDefinition extends BaseModel { public $timestamps = false; + protected $connection = 'micro_power_manager'; public function roles(): void diff --git a/src/backend/app/Models/Role/Roles.php b/src/backend/app/Models/Role/Roles.php index 534e542e5..65d27c71a 100644 --- a/src/backend/app/Models/Role/Roles.php +++ b/src/backend/app/Models/Role/Roles.php @@ -10,9 +10,6 @@ class Roles extends BaseModel { protected $connection = 'micro_power_manager'; - /** - * @return BelongsTo - */ public function definitions(): BelongsTo { return $this->belongsTo(RoleDefinition::class, 'role_definition_id'); diff --git a/src/backend/app/Models/Sms.php b/src/backend/app/Models/Sms.php index 36cbdbf81..37e23fb66 100644 --- a/src/backend/app/Models/Sms.php +++ b/src/backend/app/Models/Sms.php @@ -10,15 +10,15 @@ /** * Class Sms. * - * @property int $id + * @property int $id * @property string $trigger_type - * @property int $trigger_id + * @property int $trigger_id * @property string $receiver * @property string $body - * @property int $status the status of the sms 0 : waiting, 1 sent out to the receiver by sms provider - * @property string $uuid used for the callback to update the status of the sms - * @property int $direction - * @property int $sender_id + * @property int $status the status of the sms 0 : waiting, 1 sent out to the receiver by sms provider + * @property string $uuid used for the callback to update the status of the sms + * @property int $direction + * @property int $sender_id */ class Sms extends BaseModel { diff --git a/src/backend/app/Models/SocialTariffPiggyBank.php b/src/backend/app/Models/SocialTariffPiggyBank.php index 3deb05a7a..2f78c4988 100644 --- a/src/backend/app/Models/SocialTariffPiggyBank.php +++ b/src/backend/app/Models/SocialTariffPiggyBank.php @@ -9,9 +9,9 @@ /** * Class SocialTariffPiggyBank. * - * @property int $owner_id + * @property int $owner_id * @property string $owner_type - * @property int $savings + * @property int $savings */ class SocialTariffPiggyBank extends BaseModel { diff --git a/src/backend/app/Models/SolarHomeSystem.php b/src/backend/app/Models/SolarHomeSystem.php index da5f3de96..4f9d40753 100644 --- a/src/backend/app/Models/SolarHomeSystem.php +++ b/src/backend/app/Models/SolarHomeSystem.php @@ -12,6 +12,7 @@ class SolarHomeSystem extends BaseModel use HasFactory; public const RELATION_NAME = 'solar_home_system'; + protected $table = 'solar_home_systems'; public function device(): MorphOne diff --git a/src/backend/app/Models/SubTarget.php b/src/backend/app/Models/SubTarget.php index 3db49a4a5..85549f23b 100644 --- a/src/backend/app/Models/SubTarget.php +++ b/src/backend/app/Models/SubTarget.php @@ -16,17 +16,11 @@ */ class SubTarget extends BaseModel { - /** - * @return BelongsTo - */ public function target(): BelongsTo { return $this->belongsTo(Target::class); } - /** - * @return BelongsTo - */ public function connectionType(): BelongsTo { return $this->belongsTo(ConnectionGroup::class, 'connection_id'); diff --git a/src/backend/app/Models/Subscription.php b/src/backend/app/Models/Subscription.php index bbc1d7bd2..3d0b1dff6 100644 --- a/src/backend/app/Models/Subscription.php +++ b/src/backend/app/Models/Subscription.php @@ -8,8 +8,8 @@ /** * Class Subscription. * - * @property int $id - * @property int $upgrade_id + * @property int $id + * @property int $upgrade_id * @property string $expires * @property string $transaction_id */ diff --git a/src/backend/app/Models/Target.php b/src/backend/app/Models/Target.php index aa3371560..7ebea43bd 100644 --- a/src/backend/app/Models/Target.php +++ b/src/backend/app/Models/Target.php @@ -12,10 +12,10 @@ /** * Class Target. * - * @property int $id + * @property int $id * @property string $start_date * @property string $end_date - * @property int $city_id + * @property int $city_id */ class Target extends BaseModel { @@ -29,12 +29,6 @@ public function subTargets(): HasMany return $this->hasMany(SubTarget::class); } - /** - * @param $cityId - * @param string $endDate - * - * @return Builder - */ public function targetForMiniGrid($cityId, string $endDate): Builder { return $this::with('subTargets.connectionType', 'city') diff --git a/src/backend/app/Models/TariffPricingComponent.php b/src/backend/app/Models/TariffPricingComponent.php index 73422b6e0..cf7b9edab 100644 --- a/src/backend/app/Models/TariffPricingComponent.php +++ b/src/backend/app/Models/TariffPricingComponent.php @@ -8,10 +8,10 @@ /** * Class TariffPricingComponent. * - * @property int $id + * @property int $id * @property string $name - * @property int $price - * @property int $owner_id + * @property int $price + * @property int $owner_id * @property string $owner_type */ class TariffPricingComponent extends BaseModel diff --git a/src/backend/app/Models/TicketSettings.php b/src/backend/app/Models/TicketSettings.php index 081c3f385..c52610a27 100644 --- a/src/backend/app/Models/TicketSettings.php +++ b/src/backend/app/Models/TicketSettings.php @@ -7,12 +7,10 @@ /** * Class TicketSettings. * - * @property int $id + * @property int $id * @property string $name * @property string $api_token * @property string $api_url * @property string $api_key * */ -class TicketSettings extends BaseModel -{ -} +class TicketSettings extends BaseModel {} diff --git a/src/backend/app/Models/Transaction/AgentTransaction.php b/src/backend/app/Models/Transaction/AgentTransaction.php index ac93657bf..5af770914 100644 --- a/src/backend/app/Models/Transaction/AgentTransaction.php +++ b/src/backend/app/Models/Transaction/AgentTransaction.php @@ -16,7 +16,7 @@ * @property int status * @property string sender */ -class AgentTransaction extends BaseModel implements IRawTransaction, FullySupportedTransactionInterface +class AgentTransaction extends BaseModel implements FullySupportedTransactionInterface, IRawTransaction { public const RELATION_NAME = 'agent_transaction'; diff --git a/src/backend/app/Models/Transaction/AirtelTransaction.php b/src/backend/app/Models/Transaction/AirtelTransaction.php index f0c397a80..afe8d2364 100644 --- a/src/backend/app/Models/Transaction/AirtelTransaction.php +++ b/src/backend/app/Models/Transaction/AirtelTransaction.php @@ -11,20 +11,17 @@ /** * Class AirtelTransaction. * - * @property int $id + * @property int $id * @property string $interface_id * @property string $business_number * @property string $trans_id - * @property int $status + * @property int $status * @property string $tr_id */ -class AirtelTransaction extends BaseModel implements IRawTransaction, FullySupportedTransactionInterface +class AirtelTransaction extends BaseModel implements FullySupportedTransactionInterface, IRawTransaction { public const RELATION_NAME = 'airtel_transaction'; - /** - * @return MorphOne - */ public function transaction(): MorphOne { return $this->morphOne(Transaction::class, 'original_transaction'); diff --git a/src/backend/app/Models/Transaction/Transaction.php b/src/backend/app/Models/Transaction/Transaction.php index e13e91df2..bf5e24c22 100644 --- a/src/backend/app/Models/Transaction/Transaction.php +++ b/src/backend/app/Models/Transaction/Transaction.php @@ -20,8 +20,8 @@ /** * Class Transaction. * - * @property int $id - * @property int $amount + * @property int $id + * @property int $amount * @property string $type * @property string $sender * @property string $message @@ -32,6 +32,7 @@ class Transaction extends BaseModel use RelationsManager; public const RELATION_NAME = 'transaction'; + public const TYPE_IMPORTED = 'imported'; public function originalTransaction(): MorphTo diff --git a/src/backend/app/Models/Transaction/VodacomTransaction.php b/src/backend/app/Models/Transaction/VodacomTransaction.php index 180c15651..7cd110e3f 100644 --- a/src/backend/app/Models/Transaction/VodacomTransaction.php +++ b/src/backend/app/Models/Transaction/VodacomTransaction.php @@ -17,7 +17,7 @@ * @property string transaction_date * @property int status */ -class VodacomTransaction extends BaseModel implements IRawTransaction, FullySupportedTransactionInterface +class VodacomTransaction extends BaseModel implements FullySupportedTransactionInterface, IRawTransaction { public const RELATION_NAME = 'vodacom_transaction'; diff --git a/src/backend/app/Models/User.php b/src/backend/app/Models/User.php index 200706f66..df44d4add 100644 --- a/src/backend/app/Models/User.php +++ b/src/backend/app/Models/User.php @@ -17,18 +17,20 @@ /** * Class User. * - * @property int $id - * @property int $company_id - * @property string $name + * @property int $id + * @property int $company_id + * @property string $name * @property string|null $email */ class User extends Authenticatable implements JWTSubject { - use Notifiable; use HasFactory; + use Notifiable; public const RELATION_NAME = 'admin'; + public const COL_ID = 'id'; + public const COL_COMPANY_ID = 'company_id'; public function __construct(array $attributes = []) diff --git a/src/backend/app/Observers/AddressesObserver.php b/src/backend/app/Observers/AddressesObserver.php index b44fbba3b..274dfbae3 100644 --- a/src/backend/app/Observers/AddressesObserver.php +++ b/src/backend/app/Observers/AddressesObserver.php @@ -8,10 +8,6 @@ class AddressesObserver { /** * Handles 'deleted' event of Address. - * - * @param Address $address - * - * @return void */ public function deleted(Address $address): void { diff --git a/src/backend/app/Observers/AgentBalanceHistoryObserver.php b/src/backend/app/Observers/AgentBalanceHistoryObserver.php index 2e7097188..f42b073e6 100644 --- a/src/backend/app/Observers/AgentBalanceHistoryObserver.php +++ b/src/backend/app/Observers/AgentBalanceHistoryObserver.php @@ -14,13 +14,11 @@ class AgentBalanceHistoryObserver { public function __construct( private AgentService $agentService, - ) { - } + ) {} /** * Handle the asset person "updated" event. * - * @param AgentBalanceHistory $agentBalanceHistory * * @return void */ diff --git a/src/backend/app/Observers/AgentChargeObserver.php b/src/backend/app/Observers/AgentChargeObserver.php index fa9d39e67..d4274204f 100644 --- a/src/backend/app/Observers/AgentChargeObserver.php +++ b/src/backend/app/Observers/AgentChargeObserver.php @@ -13,8 +13,7 @@ public function __construct( private AgentChargeHistoryBalanceService $agentChargeHistoryBalanceService, private AgentBalanceHistoryService $agentBalanceHistoryService, private AgentService $agentService, - ) { - } + ) {} public function created(AgentCharge $agentCharge): void { diff --git a/src/backend/app/Observers/AgentObserver.php b/src/backend/app/Observers/AgentObserver.php index d7f4d5b4f..157dfe6bc 100644 --- a/src/backend/app/Observers/AgentObserver.php +++ b/src/backend/app/Observers/AgentObserver.php @@ -8,9 +8,7 @@ class AgentObserver { - public function created(Agent $agent): void - { - } + public function created(Agent $agent): void {} public function updated(Agent $agent): void { diff --git a/src/backend/app/Observers/AgentReceiptObserver.php b/src/backend/app/Observers/AgentReceiptObserver.php index 59c46f608..ae172038c 100644 --- a/src/backend/app/Observers/AgentReceiptObserver.php +++ b/src/backend/app/Observers/AgentReceiptObserver.php @@ -18,8 +18,7 @@ public function __construct( private AgentReceiptService $agentReceiptService, private AgentReceiptDetailService $agentReceiptDetailService, private AgentReceiptHistoryBalanceService $agentReceiptHistoryBalanceService, - ) { - } + ) {} public function created(AgentReceipt $receipt): void { diff --git a/src/backend/app/Observers/AgentSoldApplianceObserver.php b/src/backend/app/Observers/AgentSoldApplianceObserver.php index 6da696d97..41466c0d3 100644 --- a/src/backend/app/Observers/AgentSoldApplianceObserver.php +++ b/src/backend/app/Observers/AgentSoldApplianceObserver.php @@ -29,8 +29,7 @@ public function __construct( private AgentAssignedApplianceHistoryBalanceService $agentAssignedApplianceHistoryBalanceService, private AgentCommissionService $agentCommissionService, private AgentCommissionHistoryBalanceService $agentCommissionHistoryBalanceService, - ) { - } + ) {} public function created(AgentSoldAppliance $agentSoldAppliance): void { diff --git a/src/backend/app/Observers/MeterParameterObserver.php b/src/backend/app/Observers/MeterParameterObserver.php index c928cc40d..6cbecb5dd 100644 --- a/src/backend/app/Observers/MeterParameterObserver.php +++ b/src/backend/app/Observers/MeterParameterObserver.php @@ -10,16 +10,10 @@ class MeterParameterObserver { - public function __construct(private MeterParameterService $meterParameterService) - { - } + public function __construct(private MeterParameterService $meterParameterService) {} /** * Handle "deleted" event. - * - * @param MeterParameter $meterParameter - * - * @return void */ public function deleted(MeterParameter $meterParameter): void { diff --git a/src/backend/app/Observers/PersonObserver.php b/src/backend/app/Observers/PersonObserver.php index 72526f50d..0e23a6ac5 100644 --- a/src/backend/app/Observers/PersonObserver.php +++ b/src/backend/app/Observers/PersonObserver.php @@ -9,10 +9,6 @@ class PersonObserver { /** * Handle the Person "updated" event. - * - * @param Person $person - * - * @return void */ public function updated(Person $person): void { @@ -21,10 +17,6 @@ public function updated(Person $person): void /** * Handle the User "deleted" event. - * - * @param Person $person - * - * @return void */ public function deleted(Person $person): void { diff --git a/src/backend/app/PaymentHandler/AccessRate.php b/src/backend/app/PaymentHandler/AccessRate.php index 7323f5d96..057194973 100644 --- a/src/backend/app/PaymentHandler/AccessRate.php +++ b/src/backend/app/PaymentHandler/AccessRate.php @@ -15,6 +15,7 @@ class AccessRate * @var AccessRate */ private $accessRate; + /** * @var MeterParameter */ @@ -23,17 +24,11 @@ class AccessRate /** * AccessRatePayment constructor. * - * @param AccessRate $accessRate + * @param AccessRate $accessRate */ - public function __construct() - { - } + public function __construct() {} /** - * @param MeterParameter $meterParameter - * - * @return AccessRate - * * @throws NoAccessRateFound */ public static function withMeterParameters(MeterParameter $meterParameter): AccessRate @@ -41,7 +36,7 @@ public static function withMeterParameters(MeterParameter $meterParameter): Acce if ($meterParameter->tariffAccessRate() === null) { throw new NoAccessRateFound('Tariff '.$meterParameter->tariff()->first()->name.' has no access rate'); } - $accessRate = new self(); + $accessRate = new self; $accessRate->accessRate = $meterParameter->tariffAccessRate(); $accessRate->setMeterParameter($meterParameter); @@ -54,8 +49,6 @@ private function setMeterParameter(MeterParameter $meterParameter): void } /** - * @return AccessRatePayment - * * @throws NoAccessRateFound */ public function initializeAccessRatePayment(): AccessRatePayment @@ -66,7 +59,7 @@ public function initializeAccessRatePayment(): AccessRatePayment // get current date and add AccessRate.period days $nextPaymentDate = Carbon::now()->addDays($this->accessRate->period)->toDateString(); // create accessRatePayment instance and fill with the variables - $accessRatePayment = new AccessRatePayment(); + $accessRatePayment = new AccessRatePayment; $accessRatePayment->accessRate()->associate($this->accessRate); $accessRatePayment->meter()->associate($this->meterParameter->meter()->first()); $accessRatePayment->due_date = $nextPaymentDate; @@ -76,8 +69,6 @@ public function initializeAccessRatePayment(): AccessRatePayment } /** - * @return int - * * @throws NoAccessRateFound */ private function getDebt(Meter $meter): int @@ -91,15 +82,13 @@ private function getDebt(Meter $meter): int } /** - * @param TransactionDataContainer $transactionData - * * @return int * * @deprecated */ public static function payAccessRate(TransactionDataContainer $transactionData): TransactionDataContainer { - $nonStaticGateway = new self(); + $nonStaticGateway = new self; // get accessRatePayment $accessRatePayment = $nonStaticGateway->getAccessRatePayment($transactionData->meter); try { diff --git a/src/backend/app/PaymentHandler/EnergyPayment.php b/src/backend/app/PaymentHandler/EnergyPayment.php index bc17ecacd..de76192f4 100644 --- a/src/backend/app/PaymentHandler/EnergyPayment.php +++ b/src/backend/app/PaymentHandler/EnergyPayment.php @@ -2,6 +2,4 @@ namespace App\PaymentHandler; -class EnergyPayment -{ -} +class EnergyPayment {} diff --git a/src/backend/app/Providers/AppServiceProvider.php b/src/backend/app/Providers/AppServiceProvider.php index 4554acc28..9ac2d29f2 100644 --- a/src/backend/app/Providers/AppServiceProvider.php +++ b/src/backend/app/Providers/AppServiceProvider.php @@ -99,8 +99,6 @@ public function boot() /** * Register any application services. - * - * @return void */ public function register(): void { diff --git a/src/backend/app/Providers/ServicesProvider.php b/src/backend/app/Providers/ServicesProvider.php index 538756ce2..de50c837d 100644 --- a/src/backend/app/Providers/ServicesProvider.php +++ b/src/backend/app/Providers/ServicesProvider.php @@ -30,8 +30,6 @@ class ServicesProvider extends ServiceProvider { /** * Bootstrap services. - * - * @return void */ public function boot(): void { @@ -52,8 +50,6 @@ static function ($request) { /** * Register services. - * - * @return void */ public function register(): void { diff --git a/src/backend/app/Providers/VodacomServiceProvider.php b/src/backend/app/Providers/VodacomServiceProvider.php index 32bee4568..cdb64ebf1 100644 --- a/src/backend/app/Providers/VodacomServiceProvider.php +++ b/src/backend/app/Providers/VodacomServiceProvider.php @@ -13,16 +13,12 @@ class VodacomServiceProvider extends ServiceProvider * * @return void */ - public function boot() - { - } + public function boot() {} /** * Register services. * * @return void */ - public function register() - { - } + public function register() {} } diff --git a/src/backend/app/Relations/BelongsToMorph.php b/src/backend/app/Relations/BelongsToMorph.php index 652792acd..d1c8073d8 100644 --- a/src/backend/app/Relations/BelongsToMorph.php +++ b/src/backend/app/Relations/BelongsToMorph.php @@ -17,6 +17,7 @@ class BelongsToMorph extends BelongsTo * @var string */ protected $morphName; + /** * The type of the polymorphic relation. * @@ -34,10 +35,9 @@ public function __construct(Builder $query, Model $parent, $name, $type, $id, $o /** * Add the constraints for a relationship query. * - * @param Builder $query - * @param Builder $parent - * @param array|mixed $columns - * + * @param Builder $query + * @param Builder $parent + * @param array|mixed $columns * @return Builder */ /** @@ -64,11 +64,9 @@ public function getResults() /** * Get the polymorphic relationship columns. * - * @param string $name - * @param string $type - * @param string $id - * - * @return array + * @param string $name + * @param string $type + * @param string $id */ protected static function getMorphs($name, $type, $id): array { @@ -81,15 +79,12 @@ protected static function getMorphs($name, $type, $id): array /** * Define an inverse morph relationship. * - * @param Model $parent - * @param string $related - * @param string $name - * @param null $type - * @param null $id - * @param null $otherKey - * @param null $relation - * - * @return BelongsToMorph + * @param string $related + * @param string $name + * @param null $type + * @param null $id + * @param null $otherKey + * @param null $relation */ public static function build( Model $parent, @@ -104,12 +99,12 @@ public static function build( // the calling method's name and use that as the relationship name as most // of the time this will be what we desire to use for the relationships. if (is_null($relation)) { - list($current, $caller) = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2); + [$current, $caller] = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2); $relation = $caller['function']; } $morphName = Arr::get(array_flip(Relation::morphMap()), $related, $related); - list($type, $id) = self::getMorphs(Str::snake($name), $type, $id); - $instance = new $related(); + [$type, $id] = self::getMorphs(Str::snake($name), $type, $id); + $instance = new $related; // Once we have the foreign key names, we'll just create a new Eloquent query // for the related models and returns the relationship instance which will // actually be responsible for retrieving and hydrating every relations. diff --git a/src/backend/app/Services/AbstractExportService.php b/src/backend/app/Services/AbstractExportService.php index 07a836c0d..05adde591 100644 --- a/src/backend/app/Services/AbstractExportService.php +++ b/src/backend/app/Services/AbstractExportService.php @@ -17,11 +17,17 @@ abstract class AbstractExportService { protected IReader $reader; + protected Worksheet $worksheet; + protected Spreadsheet $spreadsheet; + protected Collection $exportingData; + protected string $currency; + protected string $timeZone; + protected string $recentlyCreatedSpreadSheetId; abstract public function setExportingData(); @@ -68,7 +74,7 @@ public function readable($amount, $separator = ',') $amount = strval($amount); // If the amount is not a valid float, return it as is - if (!is_numeric($amount) || floatval($amount) != $amount) { + if (! is_numeric($amount) || floatval($amount) != $amount) { return $amount; } diff --git a/src/backend/app/Services/AbstractPaymentAggregatorTransactionService.php b/src/backend/app/Services/AbstractPaymentAggregatorTransactionService.php index de1f7c7bf..9f174c163 100644 --- a/src/backend/app/Services/AbstractPaymentAggregatorTransactionService.php +++ b/src/backend/app/Services/AbstractPaymentAggregatorTransactionService.php @@ -16,10 +16,15 @@ abstract class AbstractPaymentAggregatorTransactionService { private const MINIMUM_TRANSACTION_AMOUNT = 0; + protected string $payerPhoneNumber; + protected string $meterSerialNumber; + protected float $minimumPurchaseAmount; + protected int $customerId; + protected float $amount; public function __construct( @@ -28,22 +33,21 @@ public function __construct( private Transaction $transaction, private MeterParameter $meterParameter, private IRawTransaction $paymentAggregatorTransaction, - ) { - } + ) {} public function validatePaymentOwner(string $meterSerialNumber, float $amount): void { - if (!$meter = $this->meter->findBySerialNumber($meterSerialNumber)) { + if (! $meter = $this->meter->findBySerialNumber($meterSerialNumber)) { throw new ModelNotFoundException('Meter not found with serial number you entered'); } - if (!$meterTariff = $meter->meterParameter->tariff) { + if (! $meterTariff = $meter->meterParameter->tariff) { throw new ModelNotFoundException('Tariff not found with meter serial number you entered'); } $customerId = $meter->MeterParameter->owner_id; - if (!$customerId) { + if (! $customerId) { throw new ModelNotFoundException('Customer not found with meter serial number you entered'); } @@ -94,7 +98,7 @@ private function isImitationTransactionValid($transaction) $validator = resolve('MinimumPurchaseAmountValidator'); try { - if (!$validator->validate($transactionData, $this->getMinimumPurchaseAmount())) { + if (! $validator->validate($transactionData, $this->getMinimumPurchaseAmount())) { throw new TransactionAmountNotEnoughException('Transaction amount is not enough'); } } catch (TransactionAmountNotEnoughException $e) { diff --git a/src/backend/app/Services/AccessRatePaymentHistoryService.php b/src/backend/app/Services/AccessRatePaymentHistoryService.php index f072a3a88..5b658a979 100644 --- a/src/backend/app/Services/AccessRatePaymentHistoryService.php +++ b/src/backend/app/Services/AccessRatePaymentHistoryService.php @@ -12,6 +12,7 @@ class AccessRatePaymentHistoryService implements IAssignationService { private PaymentHistory $paymentHistory; + private AccessRate $accessRate; public function setAssigned($paymentHistory): void diff --git a/src/backend/app/Services/AccessRatePaymentService.php b/src/backend/app/Services/AccessRatePaymentService.php index 395257da0..cd7a04ba8 100644 --- a/src/backend/app/Services/AccessRatePaymentService.php +++ b/src/backend/app/Services/AccessRatePaymentService.php @@ -14,8 +14,7 @@ class AccessRatePaymentService implements IBaseService { public function __construct( private AccessRatePayment $accessRatePayment, - ) { - } + ) {} public function getById(int $id): AccessRatePayment { diff --git a/src/backend/app/Services/AccessRateService.php b/src/backend/app/Services/AccessRateService.php index a28e5bc55..fc796c5ec 100644 --- a/src/backend/app/Services/AccessRateService.php +++ b/src/backend/app/Services/AccessRateService.php @@ -13,8 +13,7 @@ class AccessRateService implements IBaseService { public function __construct( private AccessRate $accessRate, - ) { - } + ) {} public function getById(int $accessRateId): AccessRate { diff --git a/src/backend/app/Services/AddressGeographicalInformationService.php b/src/backend/app/Services/AddressGeographicalInformationService.php index 7bb67513a..e911bfca3 100644 --- a/src/backend/app/Services/AddressGeographicalInformationService.php +++ b/src/backend/app/Services/AddressGeographicalInformationService.php @@ -12,6 +12,7 @@ class AddressGeographicalInformationService implements IAssignationService { private GeographicalInformation $geographicInformation; + private Address $address; public function setAssigned($assigned): void diff --git a/src/backend/app/Services/AddressesService.php b/src/backend/app/Services/AddressesService.php index 45c128d74..52aaabcba 100644 --- a/src/backend/app/Services/AddressesService.php +++ b/src/backend/app/Services/AddressesService.php @@ -14,12 +14,11 @@ * @implements IBaseService
* @implements IAssociative
*/ -class AddressesService implements IBaseService, IAssociative +class AddressesService implements IAssociative, IBaseService { public function __construct( private Address $address, - ) { - } + ) {} // fills the object and returns it without saving. public function instantiate(array $params): Address diff --git a/src/backend/app/Services/AgentAppliancePersonService.php b/src/backend/app/Services/AgentAppliancePersonService.php index 1c2d8edc2..b5b8e30e3 100644 --- a/src/backend/app/Services/AgentAppliancePersonService.php +++ b/src/backend/app/Services/AgentAppliancePersonService.php @@ -12,6 +12,7 @@ class AgentAppliancePersonService implements IAssignationService { private AssetPerson $appliancePerson; + private Agent $agent; public function setAssigned($appliancePerson): void diff --git a/src/backend/app/Services/AgentAssignedApplianceHistoryBalanceService.php b/src/backend/app/Services/AgentAssignedApplianceHistoryBalanceService.php index 23c18ac4d..76cde4207 100644 --- a/src/backend/app/Services/AgentAssignedApplianceHistoryBalanceService.php +++ b/src/backend/app/Services/AgentAssignedApplianceHistoryBalanceService.php @@ -12,6 +12,7 @@ class AgentAssignedApplianceHistoryBalanceService implements IAssignationService { private AgentBalanceHistory $agentBalanceHistory; + private AgentAssignedAppliances $agentAssignedAppliance; public function setAssigned($agentBalanceHistory): void diff --git a/src/backend/app/Services/AgentAssignedApplianceService.php b/src/backend/app/Services/AgentAssignedApplianceService.php index b5b4756ec..f2ae66afd 100644 --- a/src/backend/app/Services/AgentAssignedApplianceService.php +++ b/src/backend/app/Services/AgentAssignedApplianceService.php @@ -14,8 +14,7 @@ class AgentAssignedApplianceService implements IBaseService { public function __construct( private AgentAssignedAppliances $agentAssignedAppliance, - ) { - } + ) {} public function create(array $applianceData): AgentAssignedAppliances { diff --git a/src/backend/app/Services/AgentBalanceHistoryService.php b/src/backend/app/Services/AgentBalanceHistoryService.php index 68bc2ce97..8d3bed328 100644 --- a/src/backend/app/Services/AgentBalanceHistoryService.php +++ b/src/backend/app/Services/AgentBalanceHistoryService.php @@ -13,13 +13,12 @@ * @implements IBaseService * @implements IAssociative */ -class AgentBalanceHistoryService implements IBaseService, IAssociative +class AgentBalanceHistoryService implements IAssociative, IBaseService { public function __construct( private AgentBalanceHistory $agentBalanceHistory, private PeriodService $periodService, - ) { - } + ) {} public function getAll(?int $limit = null, ?int $agentId = null): Collection|LengthAwarePaginator { @@ -103,7 +102,7 @@ public function getGraphValues($agent, $lastReceiptDate) $period[$history[0]->date]['balance'] = -1 * ($history[0]->due_to_supplier - $history[0]->amount); $period[$history[0]->date]['due'] = $history[0]->due_to_supplier - $history[0]->amount; } elseif (count($history) === 0) { - $date = new \DateTime(); + $date = new \DateTime; $key = $date->format('Y-m-d'); $period[$key] = [ 'balance' => 0, @@ -151,7 +150,7 @@ public function getPeriod($agent, $date): array '>=', $date )->groupBy(DB::connection($this->agentBalanceHistory->getConnectionName()) - ->raw('DATE_FORMAT(created_at,\'%Y-%m-%d\')')) + ->raw('DATE_FORMAT(created_at,\'%Y-%m-%d\')')) ->get(); $period = []; foreach ($days as $key => $item) { diff --git a/src/backend/app/Services/AgentChargeHistoryBalanceService.php b/src/backend/app/Services/AgentChargeHistoryBalanceService.php index e5d6fc27d..d7f9e1dce 100644 --- a/src/backend/app/Services/AgentChargeHistoryBalanceService.php +++ b/src/backend/app/Services/AgentChargeHistoryBalanceService.php @@ -12,6 +12,7 @@ class AgentChargeHistoryBalanceService implements IAssignationService { private AgentBalanceHistory $agentBalanceHistory; + private AgentCharge $agentCharge; public function setAssigned($agentBalanceHistory): void diff --git a/src/backend/app/Services/AgentChargeService.php b/src/backend/app/Services/AgentChargeService.php index e05307ee8..11a3823af 100644 --- a/src/backend/app/Services/AgentChargeService.php +++ b/src/backend/app/Services/AgentChargeService.php @@ -13,8 +13,7 @@ class AgentChargeService implements IBaseService { public function __construct( private AgentCharge $agentCharge, - ) { - } + ) {} public function create(array $agentChargeData): AgentCharge { diff --git a/src/backend/app/Services/AgentCommissionHistoryBalanceService.php b/src/backend/app/Services/AgentCommissionHistoryBalanceService.php index 57507f394..dc3d563f7 100644 --- a/src/backend/app/Services/AgentCommissionHistoryBalanceService.php +++ b/src/backend/app/Services/AgentCommissionHistoryBalanceService.php @@ -12,6 +12,7 @@ class AgentCommissionHistoryBalanceService implements IAssignationService { private AgentBalanceHistory $agentBalanceHistory; + private AgentCommission $agentCommission; public function setAssigned($agentBalanceHistory): void diff --git a/src/backend/app/Services/AgentCommissionService.php b/src/backend/app/Services/AgentCommissionService.php index 9c1e5d1af..b041ea685 100644 --- a/src/backend/app/Services/AgentCommissionService.php +++ b/src/backend/app/Services/AgentCommissionService.php @@ -14,8 +14,7 @@ class AgentCommissionService implements IBaseService { public function __construct( private AgentCommission $agentCommission, - ) { - } + ) {} public function create(array $agentCommissiondata): AgentCommission { diff --git a/src/backend/app/Services/AgentCustomerService.php b/src/backend/app/Services/AgentCustomerService.php index 07c79211b..89d7da427 100644 --- a/src/backend/app/Services/AgentCustomerService.php +++ b/src/backend/app/Services/AgentCustomerService.php @@ -8,9 +8,7 @@ class AgentCustomerService { - public function __construct(private Agent $agent, private Person $person) - { - } + public function __construct(private Agent $agent, private Person $person) {} public function list(Agent $agent): LengthAwarePaginator { diff --git a/src/backend/app/Services/AgentCustomersPaymentHistoryService.php b/src/backend/app/Services/AgentCustomersPaymentHistoryService.php index 6982f3169..55cc4b9c4 100644 --- a/src/backend/app/Services/AgentCustomersPaymentHistoryService.php +++ b/src/backend/app/Services/AgentCustomersPaymentHistoryService.php @@ -9,8 +9,7 @@ class AgentCustomersPaymentHistoryService { public function __construct( private PaymentHistory $paymentHistory, - ) { - } + ) {} public function getPaymentFlowByCustomerId($period, $customerId, $limit, $order = 'ASC') { diff --git a/src/backend/app/Services/AgentReceiptDetailService.php b/src/backend/app/Services/AgentReceiptDetailService.php index 8612d91b4..d6d33a0cb 100644 --- a/src/backend/app/Services/AgentReceiptDetailService.php +++ b/src/backend/app/Services/AgentReceiptDetailService.php @@ -13,8 +13,7 @@ class AgentReceiptDetailService implements IBaseService { public function __construct( private AgentReceiptDetail $agentReceiptDetail, - ) { - } + ) {} public function getSummary($agentId) { diff --git a/src/backend/app/Services/AgentReceiptHistoryBalanceService.php b/src/backend/app/Services/AgentReceiptHistoryBalanceService.php index 8eeb63041..9c282796e 100644 --- a/src/backend/app/Services/AgentReceiptHistoryBalanceService.php +++ b/src/backend/app/Services/AgentReceiptHistoryBalanceService.php @@ -12,6 +12,7 @@ class AgentReceiptHistoryBalanceService implements IAssignationService { private AgentBalanceHistory $agentBalanceHistory; + private AgentReceipt $agentReceipt; public function setAssigned($agentBalanceHistory): void diff --git a/src/backend/app/Services/AgentReceiptService.php b/src/backend/app/Services/AgentReceiptService.php index 1d86579c3..f8d748c1f 100644 --- a/src/backend/app/Services/AgentReceiptService.php +++ b/src/backend/app/Services/AgentReceiptService.php @@ -14,8 +14,7 @@ class AgentReceiptService implements IBaseService { public function __construct( private AgentReceipt $agentReceipt, - ) { - } + ) {} public function getAll(?int $limit = null, ?int $agentId = null): Collection|LengthAwarePaginator { diff --git a/src/backend/app/Services/AgentService.php b/src/backend/app/Services/AgentService.php index 67426c1c8..d70c51f95 100644 --- a/src/backend/app/Services/AgentService.php +++ b/src/backend/app/Services/AgentService.php @@ -23,8 +23,7 @@ public function __construct( private AgentBalanceHistory $agentBalanceHistory, private PeriodService $periodService, private PersonService $personService, - ) { - } + ) {} public function resetPassword(string $email) { diff --git a/src/backend/app/Services/AgentSoldApplianceService.php b/src/backend/app/Services/AgentSoldApplianceService.php index 12f5f0f5e..d01fb83b5 100644 --- a/src/backend/app/Services/AgentSoldApplianceService.php +++ b/src/backend/app/Services/AgentSoldApplianceService.php @@ -17,8 +17,7 @@ class AgentSoldApplianceService implements IBaseService public function __construct( private AgentSoldAppliance $agentSoldAppliance, private AssetPerson $assetPerson, - ) { - } + ) {} public function create($applianceData): AgentSoldAppliance { diff --git a/src/backend/app/Services/AgentTicketService.php b/src/backend/app/Services/AgentTicketService.php index 769ac940e..bd976ff72 100644 --- a/src/backend/app/Services/AgentTicketService.php +++ b/src/backend/app/Services/AgentTicketService.php @@ -12,6 +12,7 @@ class AgentTicketService implements IAssignationService { private Ticket $ticket; + private Agent $agent; public function setAssigned($ticket): void diff --git a/src/backend/app/Services/AgentTransactionHistoryBalanceService.php b/src/backend/app/Services/AgentTransactionHistoryBalanceService.php index 0fa694703..2ef31cb57 100644 --- a/src/backend/app/Services/AgentTransactionHistoryBalanceService.php +++ b/src/backend/app/Services/AgentTransactionHistoryBalanceService.php @@ -12,6 +12,7 @@ class AgentTransactionHistoryBalanceService implements IAssignationService { private AgentBalanceHistory $agentBalanceHistory; + private AgentTransaction $agentTransaction; public function setAssigned($agentBalanceHistory): void diff --git a/src/backend/app/Services/AgentTransactionService.php b/src/backend/app/Services/AgentTransactionService.php index 7d75e37cf..c399815c8 100644 --- a/src/backend/app/Services/AgentTransactionService.php +++ b/src/backend/app/Services/AgentTransactionService.php @@ -18,8 +18,7 @@ public function __construct( private AgentTransaction $agentTransaction, private Transaction $transaction, private Device $device, - ) { - } + ) {} public function getAll( ?int $limit = null, @@ -54,7 +53,7 @@ public function getById(int $agentId, ?int $customerId = null): AgentTransaction $customerDeviceSerials = $this->device->newQuery()->where('person_id', $customerId) ->get()->pluck('device_serial'); - if (!$customerDeviceSerials->count()) { + if (! $customerDeviceSerials->count()) { return null; } diff --git a/src/backend/app/Services/AgentTransactionTransactionService.php b/src/backend/app/Services/AgentTransactionTransactionService.php index a2901f2a3..73af9fc6d 100644 --- a/src/backend/app/Services/AgentTransactionTransactionService.php +++ b/src/backend/app/Services/AgentTransactionTransactionService.php @@ -12,6 +12,7 @@ class AgentTransactionTransactionService implements IAssignationService { private Transaction $transaction; + private AgentTransaction $agentTransaction; public function setAssigned($transaction): void diff --git a/src/backend/app/Services/AppliancePaymentService.php b/src/backend/app/Services/AppliancePaymentService.php index 73d5ef8f4..f763d0667 100644 --- a/src/backend/app/Services/AppliancePaymentService.php +++ b/src/backend/app/Services/AppliancePaymentService.php @@ -21,8 +21,7 @@ public function __construct( private MainSettings $mainSettings, private AppliancePersonService $appliancePersonService, private DeviceService $deviceService, - ) { - } + ) {} public function getPaymentForAppliance($request, $appliancePerson) { @@ -131,7 +130,7 @@ private function processPaymentForDevice($deviceSerial, $transaction, $appliance { $device = $this->deviceService->getBySerialNumber($deviceSerial); - if (!$device) { + if (! $device) { throw new ModelNotFoundException("No device found with $deviceSerial"); } diff --git a/src/backend/app/Services/AppliancePersonService.php b/src/backend/app/Services/AppliancePersonService.php index bb6222603..a055f3d97 100644 --- a/src/backend/app/Services/AppliancePersonService.php +++ b/src/backend/app/Services/AppliancePersonService.php @@ -16,14 +16,13 @@ * @implements IBaseService * @implements IAssociative */ -class AppliancePersonService implements IBaseService, IAssociative +class AppliancePersonService implements IAssociative, IBaseService { public function __construct( private MainSettings $mainSettings, private AssetPerson $assetPerson, private CashTransactionService $cashTransactionService, - ) { - } + ) {} public function make(array $data): AssetPerson { diff --git a/src/backend/app/Services/ApplianceRatePaymentHistoryService.php b/src/backend/app/Services/ApplianceRatePaymentHistoryService.php index a532e78e4..b5c109618 100644 --- a/src/backend/app/Services/ApplianceRatePaymentHistoryService.php +++ b/src/backend/app/Services/ApplianceRatePaymentHistoryService.php @@ -12,6 +12,7 @@ class ApplianceRatePaymentHistoryService implements IAssignationService { private PaymentHistory $paymentHistory; + private AssetRate $assetRate; public function setAssigned($paymentHistory): void diff --git a/src/backend/app/Services/ApplianceRateService.php b/src/backend/app/Services/ApplianceRateService.php index 7f5fa6820..061e5f1cf 100644 --- a/src/backend/app/Services/ApplianceRateService.php +++ b/src/backend/app/Services/ApplianceRateService.php @@ -16,8 +16,7 @@ class ApplianceRateService public function __construct( private AssetRate $applianceRate, private MainSettings $mainSettings, - ) { - } + ) {} public function getCurrencyFromMainSettings(): string { diff --git a/src/backend/app/Services/AssetService.php b/src/backend/app/Services/AssetService.php index d4a4c71e1..b791cced3 100644 --- a/src/backend/app/Services/AssetService.php +++ b/src/backend/app/Services/AssetService.php @@ -6,9 +6,7 @@ class AssetService { - public function __construct(private Asset $asset) - { - } + public function __construct(private Asset $asset) {} public function getAssets($request) { diff --git a/src/backend/app/Services/CashTransactionService.php b/src/backend/app/Services/CashTransactionService.php index b62535b75..edf152f45 100644 --- a/src/backend/app/Services/CashTransactionService.php +++ b/src/backend/app/Services/CashTransactionService.php @@ -8,6 +8,7 @@ class CashTransactionService { private $cashTransaction; + private $transaction; public function __construct(CashTransaction $cashTransaction, Transaction $transaction) diff --git a/src/backend/app/Services/CityGeographicalInformationService.php b/src/backend/app/Services/CityGeographicalInformationService.php index 06b0d3bdc..4ff96020f 100644 --- a/src/backend/app/Services/CityGeographicalInformationService.php +++ b/src/backend/app/Services/CityGeographicalInformationService.php @@ -12,6 +12,7 @@ class CityGeographicalInformationService implements IAssignationService { private GeographicalInformation $geographicInformation; + private City $city; public function setAssigned($assigned): void diff --git a/src/backend/app/Services/CityService.php b/src/backend/app/Services/CityService.php index 4690699ce..74676a6b8 100644 --- a/src/backend/app/Services/CityService.php +++ b/src/backend/app/Services/CityService.php @@ -14,8 +14,7 @@ class CityService implements IBaseService { public function __construct( private City $city, - ) { - } + ) {} public function getCityIdsByMiniGridId($miniGridId): array { diff --git a/src/backend/app/Services/ClusterMeterService.php b/src/backend/app/Services/ClusterMeterService.php index 6929a8091..b68aef756 100644 --- a/src/backend/app/Services/ClusterMeterService.php +++ b/src/backend/app/Services/ClusterMeterService.php @@ -7,9 +7,7 @@ class ClusterMeterService { - public function __construct(private Cluster $cluster, private Meter $meter) - { - } + public function __construct(private Cluster $cluster, private Meter $meter) {} public function getCountById($clusterId): int { diff --git a/src/backend/app/Services/ClusterMiniGridService.php b/src/backend/app/Services/ClusterMiniGridService.php index 896357a6d..6cf1eb84f 100644 --- a/src/backend/app/Services/ClusterMiniGridService.php +++ b/src/backend/app/Services/ClusterMiniGridService.php @@ -7,9 +7,7 @@ class ClusterMiniGridService { - public function __construct(private Cluster $cluster, private MiniGrid $miniGrid) - { - } + public function __construct(private Cluster $cluster, private MiniGrid $miniGrid) {} public function getClustersWithMiniGrids() { diff --git a/src/backend/app/Services/ClusterPopulationService.php b/src/backend/app/Services/ClusterPopulationService.php index b686b3a7a..29f38b12e 100644 --- a/src/backend/app/Services/ClusterPopulationService.php +++ b/src/backend/app/Services/ClusterPopulationService.php @@ -7,9 +7,7 @@ class ClusterPopulationService { - public function __construct(private Person $person, private Cluster $cluster) - { - } + public function __construct(private Person $person, private Cluster $cluster) {} public function getById($clusterId, $onlyCustomers = true): int { diff --git a/src/backend/app/Services/ClusterRevenueService.php b/src/backend/app/Services/ClusterRevenueService.php index 1c8169f03..10d6703ed 100644 --- a/src/backend/app/Services/ClusterRevenueService.php +++ b/src/backend/app/Services/ClusterRevenueService.php @@ -14,8 +14,7 @@ public function __construct( private PeriodService $periodService, private Cluster $cluster, private Transaction $transaction, - ) { - } + ) {} public function getTransactionsForMonthlyPeriodById( $clusterId, @@ -169,10 +168,10 @@ public function getRevenueAnalysisForConnectionTypesByCluser( $periods = $this->periodService->generatePeriodicList($startDate, $endDate, $period, 0); foreach ($connectionTypes as $connectionType) { - if (!isset($revenueAnalysis[$connectionType->name])) { + if (! isset($revenueAnalysis[$connectionType->name])) { $revenueAnalysis[$connectionType->name] = $periods; } - if (!isset($revenueAnalysis['Total'])) { + if (! isset($revenueAnalysis['Total'])) { $revenueAnalysis['Total'] = $periods; } @@ -216,11 +215,11 @@ public function getMonthlyRevenueAnalysisForConnectionTypesById( $periods = $this->periodService->generatePeriodicList($startDate, $endDate, $period, 0); foreach ($connectionTypes as $connectionType) { - if (!isset($revenueAnalysis[$connectionType->name])) { + if (! isset($revenueAnalysis[$connectionType->name])) { $revenueAnalysis[$connectionType->name] = $periods; } - if (!isset($revenueAnalysis['Total'])) { + if (! isset($revenueAnalysis['Total'])) { $revenueAnalysis['Total'] = $periods; } @@ -311,8 +310,8 @@ public function getMiniGridBasedRevenueById( public function setDatesForRequest($startDate, $endDate): array { - if (!$startDate) { - $start = new \DateTime(); + if (! $startDate) { + $start = new \DateTime; $start->setDate($start->format('Y'), $start->format('n'), 1); // Normalize the day to 1 $start->setTime(0, 0, 0); // Normalize time to midnight $start->sub(new \DateInterval('P12M')); diff --git a/src/backend/app/Services/ClusterService.php b/src/backend/app/Services/ClusterService.php index 7288bbb2b..3a82b748c 100644 --- a/src/backend/app/Services/ClusterService.php +++ b/src/backend/app/Services/ClusterService.php @@ -14,8 +14,7 @@ class ClusterService implements IBaseService { public function __construct( private Cluster $cluster, - ) { - } + ) {} protected function setClusterMeterCount(Cluster $cluster, int $meterCount) { @@ -98,7 +97,7 @@ public function update($model, array $data): Cluster { throw new \Exception('Method update() not yet implemented.'); - return new Cluster(); + return new Cluster; } public function delete($model): ?bool diff --git a/src/backend/app/Services/ClusterTransactionService.php b/src/backend/app/Services/ClusterTransactionService.php index b64c1cfc0..02387de4b 100644 --- a/src/backend/app/Services/ClusterTransactionService.php +++ b/src/backend/app/Services/ClusterTransactionService.php @@ -7,9 +7,7 @@ class ClusterTransactionService { - public function __construct(private Cluster $cluster, private Transaction $transaction) - { - } + public function __construct(private Cluster $cluster, private Transaction $transaction) {} public function getById($clusterId, array $range) { diff --git a/src/backend/app/Services/ClustersDashboardCacheDataService.php b/src/backend/app/Services/ClustersDashboardCacheDataService.php index a02bb6d2f..dac6372ad 100644 --- a/src/backend/app/Services/ClustersDashboardCacheDataService.php +++ b/src/backend/app/Services/ClustersDashboardCacheDataService.php @@ -31,7 +31,7 @@ public function setData($dateRange = []) $dateRange[0] = $startDate; $dateRange[1] = $endDate; } else { - list($startDate, $endDate) = $dateRange; + [$startDate, $endDate] = $dateRange; } $monthlyPeriods = $this->periodService->generatePeriodicList($startDate, $endDate, 'monthly', [ diff --git a/src/backend/app/Services/CompanyDatabaseService.php b/src/backend/app/Services/CompanyDatabaseService.php index fae0c3f1e..32e5c1e32 100644 --- a/src/backend/app/Services/CompanyDatabaseService.php +++ b/src/backend/app/Services/CompanyDatabaseService.php @@ -17,8 +17,7 @@ class CompanyDatabaseService implements IBaseService public function __construct( private CompanyDatabase $companyDatabase, private DatabaseProxyManagerService $databaseProxyManagerService, - ) { - } + ) {} public function getById(int $id): CompanyDatabase { diff --git a/src/backend/app/Services/CompanyService.php b/src/backend/app/Services/CompanyService.php index 5f978ca7e..a6b7ece2e 100644 --- a/src/backend/app/Services/CompanyService.php +++ b/src/backend/app/Services/CompanyService.php @@ -13,8 +13,7 @@ class CompanyService implements IBaseService { public function __construct( private Company $company, - ) { - } + ) {} public function getByName($name): Company { diff --git a/src/backend/app/Services/ConnectionGroupService.php b/src/backend/app/Services/ConnectionGroupService.php index c29f1060e..f5274e3ce 100644 --- a/src/backend/app/Services/ConnectionGroupService.php +++ b/src/backend/app/Services/ConnectionGroupService.php @@ -13,8 +13,7 @@ { public function __construct( private ConnectionGroup $connectionGroup, - ) { - } + ) {} public function create(array $connectionGroupData): ConnectionGroup { diff --git a/src/backend/app/Services/ConnectionTypeService.php b/src/backend/app/Services/ConnectionTypeService.php index f8c8bcd5f..2473ed677 100644 --- a/src/backend/app/Services/ConnectionTypeService.php +++ b/src/backend/app/Services/ConnectionTypeService.php @@ -16,8 +16,7 @@ class ConnectionTypeService implements IBaseService { public function __construct( private ConnectionType $connectionType, - ) { - } + ) {} public function getByIdWithMeterCountRelation($connectionTypeId): Model|Builder { diff --git a/src/backend/app/Services/CountryService.php b/src/backend/app/Services/CountryService.php index 7be1f06d1..41d62e6c0 100644 --- a/src/backend/app/Services/CountryService.php +++ b/src/backend/app/Services/CountryService.php @@ -13,8 +13,7 @@ class CountryService implements IBaseService { public function __construct( private Country $country, - ) { - } + ) {} public function getByCode(?string $countryCode) { diff --git a/src/backend/app/Services/DatabaseProxyService.php b/src/backend/app/Services/DatabaseProxyService.php index d0d6b558c..3597d39d3 100644 --- a/src/backend/app/Services/DatabaseProxyService.php +++ b/src/backend/app/Services/DatabaseProxyService.php @@ -11,15 +11,13 @@ */ class DatabaseProxyService implements IBaseService { - public function __construct(private DatabaseProxy $databaseProxy) - { - } + public function __construct(private DatabaseProxy $databaseProxy) {} public function getById($id): DatabaseProxy { throw new \Exception('Method getById() not yet implemented.'); - return new DatabaseProxy(); + return new DatabaseProxy; } public function create(array $databaseProxyData): DatabaseProxy diff --git a/src/backend/app/Services/FirebaseService.php b/src/backend/app/Services/FirebaseService.php index 22ba42fec..dcf62670e 100644 --- a/src/backend/app/Services/FirebaseService.php +++ b/src/backend/app/Services/FirebaseService.php @@ -11,7 +11,7 @@ class FirebaseService public function sendNotify($firebaseToken, $body): string { try { - $httpClient = new Client(); + $httpClient = new Client; $request = $httpClient->post( config()->get('services.sms.android.url'), [ diff --git a/src/backend/app/Services/GeographicalInformationService.php b/src/backend/app/Services/GeographicalInformationService.php index 7b76b9d49..e9615ffdf 100644 --- a/src/backend/app/Services/GeographicalInformationService.php +++ b/src/backend/app/Services/GeographicalInformationService.php @@ -12,12 +12,11 @@ * @implements IBaseService * @implements IAssociative */ -class GeographicalInformationService implements IBaseService, IAssociative +class GeographicalInformationService implements IAssociative, IBaseService { public function __construct( private GeographicalInformation $geographicalInformation, - ) { - } + ) {} // This function will be removed until devices feature migration is done public function changeOwnerWithAddress($meterParameter, $addressId) diff --git a/src/backend/app/Services/Interfaces/IAssociative.php b/src/backend/app/Services/Interfaces/IAssociative.php index 12859bb1f..1de36ad03 100644 --- a/src/backend/app/Services/Interfaces/IAssociative.php +++ b/src/backend/app/Services/Interfaces/IAssociative.php @@ -14,7 +14,7 @@ interface IAssociative public function make(array $data): Model; /** - * @param T $model + * @param T $model */ public function save(Model $model): bool; } diff --git a/src/backend/app/Services/Interfaces/IBaseService.php b/src/backend/app/Services/Interfaces/IBaseService.php index 90651b23e..4c2d225b1 100644 --- a/src/backend/app/Services/Interfaces/IBaseService.php +++ b/src/backend/app/Services/Interfaces/IBaseService.php @@ -20,8 +20,7 @@ public function getById(int $id): ?Model; public function create(array $data): Model; /** - * @param T $model - * + * @param T $model * @return T */ public function update(Model $model, array $data): Model; diff --git a/src/backend/app/Services/Interfaces/ISettingsService.php b/src/backend/app/Services/Interfaces/ISettingsService.php index 37a6f47a3..5d73f9348 100644 --- a/src/backend/app/Services/Interfaces/ISettingsService.php +++ b/src/backend/app/Services/Interfaces/ISettingsService.php @@ -15,8 +15,7 @@ interface ISettingsService public function get(): ?Model; /** - * @param T $model - * + * @param T $model * @return T */ public function update(Model $model, array $data): Model; diff --git a/src/backend/app/Services/MainSettingsService.php b/src/backend/app/Services/MainSettingsService.php index ed83749b0..4132f4ee6 100644 --- a/src/backend/app/Services/MainSettingsService.php +++ b/src/backend/app/Services/MainSettingsService.php @@ -15,21 +15,20 @@ class MainSettingsService implements IBaseService { public function __construct( private MainSettings $mainSettings, - ) { - } + ) {} public function getById(int $id): MainSettings { throw new \Exception('Method getById() not yet implemented.'); - return new MainSettings(); + return new MainSettings; } public function create(array $data): MainSettings { throw new \Exception('Method create() not yet implemented.'); - return new MainSettings(); + return new MainSettings; } public function update($mainSettings, $mainSettingsData): MainSettings diff --git a/src/backend/app/Services/MaintenanceUserService.php b/src/backend/app/Services/MaintenanceUserService.php index b2d4700a1..0f30ca0e5 100644 --- a/src/backend/app/Services/MaintenanceUserService.php +++ b/src/backend/app/Services/MaintenanceUserService.php @@ -13,8 +13,7 @@ class MaintenanceUserService implements IBaseService { public function __construct( private MaintenanceUsers $maintenanceUser, - ) { - } + ) {} public function getMaintenanceUsersCount() { diff --git a/src/backend/app/Services/MaintenanceUserTicketService.php b/src/backend/app/Services/MaintenanceUserTicketService.php index 4544f06f3..b995ce601 100644 --- a/src/backend/app/Services/MaintenanceUserTicketService.php +++ b/src/backend/app/Services/MaintenanceUserTicketService.php @@ -12,6 +12,7 @@ class MaintenanceUserTicketService implements IAssignationService { private Ticket $ticket; + private MaintenanceUsers $maintenanceUser; public function setAssigned($ticket): void diff --git a/src/backend/app/Services/ManufacturerAddressService.php b/src/backend/app/Services/ManufacturerAddressService.php index 8397a7eb6..3835c8bc6 100644 --- a/src/backend/app/Services/ManufacturerAddressService.php +++ b/src/backend/app/Services/ManufacturerAddressService.php @@ -12,6 +12,7 @@ class ManufacturerAddressService implements IAssignationService { private Address $address; + private Manufacturer $manufacturer; public function setAssigned($address): void diff --git a/src/backend/app/Services/ManufacturerService.php b/src/backend/app/Services/ManufacturerService.php index 3f936b697..48fd11aef 100644 --- a/src/backend/app/Services/ManufacturerService.php +++ b/src/backend/app/Services/ManufacturerService.php @@ -15,8 +15,7 @@ class ManufacturerService implements IBaseService { public function __construct( private Manufacturer $manufacturer, - ) { - } + ) {} public function createManufacturerDataFromRequest(Request $request): array { diff --git a/src/backend/app/Services/MeterConsumptionService.php b/src/backend/app/Services/MeterConsumptionService.php index 3605922d0..25556febe 100644 --- a/src/backend/app/Services/MeterConsumptionService.php +++ b/src/backend/app/Services/MeterConsumptionService.php @@ -14,8 +14,7 @@ class MeterConsumptionService implements IBaseService { public function __construct( private MeterConsumption $meterConsumption, - ) { - } + ) {} public function getByMeter(Meter $meter, $start, $end): Collection|array { diff --git a/src/backend/app/Services/MeterGeographicalInformationService.php b/src/backend/app/Services/MeterGeographicalInformationService.php index aa1c741db..a37f16f11 100644 --- a/src/backend/app/Services/MeterGeographicalInformationService.php +++ b/src/backend/app/Services/MeterGeographicalInformationService.php @@ -10,8 +10,7 @@ class MeterGeographicalInformationService public function __construct( private GeographicalInformation $geographicalInformation, private Meter $meter, - ) { - } + ) {} public function updateGeographicalInformation(array $meters): array { diff --git a/src/backend/app/Services/MeterParameterAddressService.php b/src/backend/app/Services/MeterParameterAddressService.php index 8948c9259..461173dfa 100644 --- a/src/backend/app/Services/MeterParameterAddressService.php +++ b/src/backend/app/Services/MeterParameterAddressService.php @@ -12,6 +12,7 @@ class MeterParameterAddressService implements IAssignationService { private MeterParameter $meterParameter; + private Address $address; public function setAssignee($meterParameter): void diff --git a/src/backend/app/Services/MeterParameterService.php b/src/backend/app/Services/MeterParameterService.php index a724be0c2..f3eb2eee3 100644 --- a/src/backend/app/Services/MeterParameterService.php +++ b/src/backend/app/Services/MeterParameterService.php @@ -10,8 +10,7 @@ class MeterParameterService { public function __construct( private MeterParameter $meterParameter, - ) { - } + ) {} public function createMeterParameter( array $meterParameterData, diff --git a/src/backend/app/Services/MeterRevenueService.php b/src/backend/app/Services/MeterRevenueService.php index bb1f3aad5..692bb5486 100644 --- a/src/backend/app/Services/MeterRevenueService.php +++ b/src/backend/app/Services/MeterRevenueService.php @@ -14,8 +14,7 @@ class MeterRevenueService public function __construct( private MeterToken $meterToken, private Transaction $transaction, - ) { - } + ) {} public function getBySerialNumber(string $serialNumber) { diff --git a/src/backend/app/Services/MeterService.php b/src/backend/app/Services/MeterService.php index 6511d4631..d842405cc 100644 --- a/src/backend/app/Services/MeterService.php +++ b/src/backend/app/Services/MeterService.php @@ -14,8 +14,7 @@ class MeterService implements IBaseService { public function __construct( private Meter $meter, - ) { - } + ) {} public function getBySerialNumber($serialNumber) { diff --git a/src/backend/app/Services/MeterTariffMeterParameterService.php b/src/backend/app/Services/MeterTariffMeterParameterService.php index 290645901..40b3c6e1f 100644 --- a/src/backend/app/Services/MeterTariffMeterParameterService.php +++ b/src/backend/app/Services/MeterTariffMeterParameterService.php @@ -12,8 +12,7 @@ public function __construct( private MeterTariff $meterTariff, private MeterParameter $meterParameter, private Meter $meter, - ) { - } + ) {} public function getCountById($meterTariffId): array { diff --git a/src/backend/app/Services/MeterTariffService.php b/src/backend/app/Services/MeterTariffService.php index 895cc2e20..2c07a8145 100644 --- a/src/backend/app/Services/MeterTariffService.php +++ b/src/backend/app/Services/MeterTariffService.php @@ -14,8 +14,7 @@ class MeterTariffService implements IBaseService { public function __construct( private MeterTariff $meterTariff, - ) { - } + ) {} public function getById(int $meterTariffId): MeterTariff { diff --git a/src/backend/app/Services/MeterTokenPaymentHistoryService.php b/src/backend/app/Services/MeterTokenPaymentHistoryService.php index ecc5873d6..9ed3409b6 100644 --- a/src/backend/app/Services/MeterTokenPaymentHistoryService.php +++ b/src/backend/app/Services/MeterTokenPaymentHistoryService.php @@ -12,6 +12,7 @@ class MeterTokenPaymentHistoryService implements IAssignationService { private PaymentHistory $paymentHistory; + private MeterToken $meterToken; public function setAssigned($paymentHistory): void diff --git a/src/backend/app/Services/MeterTypeMeterService.php b/src/backend/app/Services/MeterTypeMeterService.php index bcc35a1ed..49dc3dccf 100644 --- a/src/backend/app/Services/MeterTypeMeterService.php +++ b/src/backend/app/Services/MeterTypeMeterService.php @@ -6,9 +6,7 @@ class MeterTypeMeterService { - public function __construct(private MeterType $meterType) - { - } + public function __construct(private MeterType $meterType) {} public function getByIdWithMeters($meterTypeId) { diff --git a/src/backend/app/Services/MeterTypeService.php b/src/backend/app/Services/MeterTypeService.php index 8fc62632b..bff37bf0d 100644 --- a/src/backend/app/Services/MeterTypeService.php +++ b/src/backend/app/Services/MeterTypeService.php @@ -12,9 +12,7 @@ */ class MeterTypeService implements IBaseService { - public function __construct(private MeterType $meterType) - { - } + public function __construct(private MeterType $meterType) {} public function create(array $meterTypeData): MeterType { diff --git a/src/backend/app/Services/MiniGridDashboardCacheDataService.php b/src/backend/app/Services/MiniGridDashboardCacheDataService.php index e29fa1d37..2bd6d854c 100644 --- a/src/backend/app/Services/MiniGridDashboardCacheDataService.php +++ b/src/backend/app/Services/MiniGridDashboardCacheDataService.php @@ -40,7 +40,7 @@ public function setData($dateRange = []) $dateRange[0] = $startDate; $dateRange[1] = $endDate; } else { - list($startDate, $endDate) = $dateRange; + [$startDate, $endDate] = $dateRange; } $miniGrids = $this->miniGridService->getAll(); diff --git a/src/backend/app/Services/MiniGridEnergyService.php b/src/backend/app/Services/MiniGridEnergyService.php index c8f756a32..d632d5136 100644 --- a/src/backend/app/Services/MiniGridEnergyService.php +++ b/src/backend/app/Services/MiniGridEnergyService.php @@ -9,9 +9,7 @@ class MiniGridEnergyService { - public function __construct(private MiniGrid $miniGrid, private Energy $energy) - { - } + public function __construct(private MiniGrid $miniGrid, private Energy $energy) {} public function getById($miniGridId, $startDate, $endDate): Collection|array { diff --git a/src/backend/app/Services/MiniGridGeographicalInformationService.php b/src/backend/app/Services/MiniGridGeographicalInformationService.php index b556001a2..daf7ac8d6 100644 --- a/src/backend/app/Services/MiniGridGeographicalInformationService.php +++ b/src/backend/app/Services/MiniGridGeographicalInformationService.php @@ -12,6 +12,7 @@ class MiniGridGeographicalInformationService implements IAssignationService { private GeographicalInformation $geographicInformation; + private MiniGrid $miniGrid; public function setAssigned($assigned): void diff --git a/src/backend/app/Services/MiniGridRevenueService.php b/src/backend/app/Services/MiniGridRevenueService.php index 12153cec8..74be6b79a 100644 --- a/src/backend/app/Services/MiniGridRevenueService.php +++ b/src/backend/app/Services/MiniGridRevenueService.php @@ -11,8 +11,7 @@ class MiniGridRevenueService public function __construct( private Transaction $transaction, private MeterToken $meterToken, - ) { - } + ) {} public function getById($miniGridId, $startDate, $endDate, $miniGridDeviceService) { diff --git a/src/backend/app/Services/MiniGridService.php b/src/backend/app/Services/MiniGridService.php index c9f9f1aa8..114ed077c 100644 --- a/src/backend/app/Services/MiniGridService.php +++ b/src/backend/app/Services/MiniGridService.php @@ -16,8 +16,7 @@ class MiniGridService implements IBaseService public function __construct( private MiniGrid $miniGrid, private Cluster $cluster, - ) { - } + ) {} public function getByIdWithLocation($miniGridId) { diff --git a/src/backend/app/Services/MpmPluginService.php b/src/backend/app/Services/MpmPluginService.php index 78b9c5e53..c5f9cfe98 100644 --- a/src/backend/app/Services/MpmPluginService.php +++ b/src/backend/app/Services/MpmPluginService.php @@ -14,8 +14,7 @@ class MpmPluginService implements IBaseService { public function __construct( private MpmPlugin $mpmPlugin, - ) { - } + ) {} public function getById($id): MpmPlugin { diff --git a/src/backend/app/Services/PaymentHistoryService.php b/src/backend/app/Services/PaymentHistoryService.php index 63896d00e..c85fec556 100644 --- a/src/backend/app/Services/PaymentHistoryService.php +++ b/src/backend/app/Services/PaymentHistoryService.php @@ -16,8 +16,7 @@ class PaymentHistoryService implements IAssociative { public function __construct( private PaymentHistory $paymentHistory, - ) { - } + ) {} public function findPayingCustomersInRange( array $customerIds, diff --git a/src/backend/app/Services/PeriodService.php b/src/backend/app/Services/PeriodService.php index 62495e2d6..c09d5409f 100644 --- a/src/backend/app/Services/PeriodService.php +++ b/src/backend/app/Services/PeriodService.php @@ -5,13 +5,7 @@ class PeriodService { /** - * @param $startDate - * @param $endDate - * @param $interval - * @param $initialData - * @param (int|int[])[]|int $initialData - * - * @return array + * @param (int|int[])[]|int $initialData * * @throws \Exception */ diff --git a/src/backend/app/Services/PersonAddressService.php b/src/backend/app/Services/PersonAddressService.php index da991bae3..db2b9c2eb 100644 --- a/src/backend/app/Services/PersonAddressService.php +++ b/src/backend/app/Services/PersonAddressService.php @@ -12,6 +12,7 @@ class PersonAddressService implements IAssignationService { private Address $address; + private Person $person; public function setOldPrimaryAddressToNotPrimary(): Person diff --git a/src/backend/app/Services/PersonMeterService.php b/src/backend/app/Services/PersonMeterService.php index f9d3ddffb..a54e13128 100644 --- a/src/backend/app/Services/PersonMeterService.php +++ b/src/backend/app/Services/PersonMeterService.php @@ -10,8 +10,7 @@ class PersonMeterService public function __construct( private Person $person, private Meter $meter, - ) { - } + ) {} public function getPersonMeters(int $personId) { diff --git a/src/backend/app/Services/PersonPaymentHistoryService.php b/src/backend/app/Services/PersonPaymentHistoryService.php index 1e0d7ad7a..029d600ba 100644 --- a/src/backend/app/Services/PersonPaymentHistoryService.php +++ b/src/backend/app/Services/PersonPaymentHistoryService.php @@ -12,6 +12,7 @@ class PersonPaymentHistoryService implements IAssignationService { private PaymentHistory $paymentHistory; + private Person $person; public function setAssigned($paymentHistory): void diff --git a/src/backend/app/Services/PersonService.php b/src/backend/app/Services/PersonService.php index 4011bf9f2..c7c70ec30 100644 --- a/src/backend/app/Services/PersonService.php +++ b/src/backend/app/Services/PersonService.php @@ -19,8 +19,7 @@ class PersonService implements IBaseService { public function __construct( private Person $person, - ) { - } + ) {} public function getAllRegisteredPeople(): Collection|array { @@ -35,7 +34,7 @@ public function addCitizenship(Person $person, Country $country): Model public function getDetails(int $personID, bool $allRelations = false) { - if (!$allRelations) { + if (! $allRelations) { return $this->getById($personID); } @@ -54,9 +53,8 @@ public function getDetails(int $personID, bool $allRelations = false) } /** - * @param string $searchTerm could either phone, name or surname - * @param Request|array|int|string $paginate - * + * @param string $searchTerm could either phone, name or surname + * @param Request|array|int|string $paginate * @return Builder[]|Collection|LengthAwarePaginator * * @psalm-return Collection|LengthAwarePaginator|array diff --git a/src/backend/app/Services/PersonTicketService.php b/src/backend/app/Services/PersonTicketService.php index 43c04bc27..a4ba8e05c 100644 --- a/src/backend/app/Services/PersonTicketService.php +++ b/src/backend/app/Services/PersonTicketService.php @@ -12,6 +12,7 @@ class PersonTicketService implements IAssignationService { private Ticket $ticket; + private Person $person; public function setAssigned($ticket): void diff --git a/src/backend/app/Services/PluginsService.php b/src/backend/app/Services/PluginsService.php index 6ecde7a27..014da24d9 100644 --- a/src/backend/app/Services/PluginsService.php +++ b/src/backend/app/Services/PluginsService.php @@ -10,8 +10,7 @@ class PluginsService { public function __construct( private Plugins $plugin, - ) { - } + ) {} public function create(array $pluginData): Plugins { diff --git a/src/backend/app/Services/RegistrationTailService.php b/src/backend/app/Services/RegistrationTailService.php index 82af06afb..53e2ce64f 100644 --- a/src/backend/app/Services/RegistrationTailService.php +++ b/src/backend/app/Services/RegistrationTailService.php @@ -15,8 +15,7 @@ class RegistrationTailService implements IBaseService { public function __construct( private RegistrationTail $registrationTail, - ) { - } + ) {} public function getById(int $id): RegistrationTail { @@ -58,7 +57,7 @@ public function getFirst($limit = null) public function addMpmPluginToRegistrationTail(RegistrationTail $registrationTail, MpmPlugin $mpmPlugin): RegistrationTail { - $tail = !empty($registrationTail->tail) ? json_decode($registrationTail->tail, true) : []; + $tail = ! empty($registrationTail->tail) ? json_decode($registrationTail->tail, true) : []; array_push($tail, [ 'tag' => $mpmPlugin->tail_tag, @@ -67,7 +66,7 @@ public function addMpmPluginToRegistrationTail(RegistrationTail $registrationTai '-', $mpmPlugin->tail_tag ) : null, - 'adjusted' => !isset($mpmPlugin->tail_tag), + 'adjusted' => ! isset($mpmPlugin->tail_tag), ]); return $this->update( @@ -78,7 +77,7 @@ public function addMpmPluginToRegistrationTail(RegistrationTail $registrationTai public function removeMpmPluginFromRegistrationTail(RegistrationTail $registrationTail, MpmPlugin $mpmPlugin): RegistrationTail { - $tail = !empty($registrationTail->tail) ? json_decode($registrationTail->tail, true) : []; + $tail = ! empty($registrationTail->tail) ? json_decode($registrationTail->tail, true) : []; $updatedTail = array_filter($tail, function ($item) use ($mpmPlugin) { return $item['tag'] !== $mpmPlugin->tail_tag; diff --git a/src/backend/app/Services/RestrictionService.php b/src/backend/app/Services/RestrictionService.php index f9a3220d7..97def9e89 100644 --- a/src/backend/app/Services/RestrictionService.php +++ b/src/backend/app/Services/RestrictionService.php @@ -13,8 +13,7 @@ class RestrictionService implements IBaseService { public function __construct( private Restriction $restriction, - ) { - } + ) {} public function getRestrictionForTarget($target) { diff --git a/src/backend/app/Services/RolesService.php b/src/backend/app/Services/RolesService.php index b1a2f14a1..1730148d7 100644 --- a/src/backend/app/Services/RolesService.php +++ b/src/backend/app/Services/RolesService.php @@ -15,6 +15,7 @@ class RolesService * @var Roles */ private $role; + /** * @var RoleDefinition */ diff --git a/src/backend/app/Services/SessionService.php b/src/backend/app/Services/SessionService.php index a85928ba0..97704825e 100644 --- a/src/backend/app/Services/SessionService.php +++ b/src/backend/app/Services/SessionService.php @@ -13,7 +13,7 @@ public function setModel(BaseModel|Model $model): void { $this->model = $model; $databaseName = $model->getConnectionName(); - if (!$this->checkDatabaseName($databaseName)) { + if (! $this->checkDatabaseName($databaseName)) { $this->model->setConnection($this->getAuthenticatedUserDatabaseName()); } } diff --git a/src/backend/app/Services/SmsAndroidSettingService.php b/src/backend/app/Services/SmsAndroidSettingService.php index c69937670..8454e53e0 100644 --- a/src/backend/app/Services/SmsAndroidSettingService.php +++ b/src/backend/app/Services/SmsAndroidSettingService.php @@ -7,6 +7,7 @@ class SmsAndroidSettingService { private string $fireBaseKey; + private string $callbackUrl; public function __construct(private SmsAndroidSetting $smsAndroidSetting, private UserService $userService) diff --git a/src/backend/app/Services/SmsApplianceRemindRateService.php b/src/backend/app/Services/SmsApplianceRemindRateService.php index 9abc32fe9..878736929 100644 --- a/src/backend/app/Services/SmsApplianceRemindRateService.php +++ b/src/backend/app/Services/SmsApplianceRemindRateService.php @@ -11,8 +11,7 @@ class SmsApplianceRemindRateService public function __construct( private SmsApplianceRemindRate $smsApplianceRemindRate, private Asset $appliance, - ) { - } + ) {} public function getApplianceRemindRatesWithAppliances(): Collection { diff --git a/src/backend/app/Services/SmsService.php b/src/backend/app/Services/SmsService.php index 0b01bcf6f..a6ea5b582 100644 --- a/src/backend/app/Services/SmsService.php +++ b/src/backend/app/Services/SmsService.php @@ -17,13 +17,14 @@ class SmsService { public const TICKET = 1; + public const FEEDBACK = 2; + public const DIRECTION_OUTGOING = 1; public function __construct( private Sms $sms, - ) { - } + ) {} public function checkMessageType($message) { @@ -94,13 +95,13 @@ public function sendSms($data, $smsType, $smsConfigs) private function resolveSmsType($data, $smsType, $smsConfigs, $smsAndroidSettings) { $configs = resolve($smsConfigs); - if (!array_key_exists($smsType, $configs->smsTypes)) { + if (! array_key_exists($smsType, $configs->smsTypes)) { throw new SmsTypeNotFoundException('SmsType could not resolve.'); } $smsBodyService = resolve($configs->servicePath); $reflection = new \ReflectionClass($configs->smsTypes[$smsType]); - if (!$reflection->isSubclassOf(SmsSender::class)) { + if (! $reflection->isSubclassOf(SmsSender::class)) { throw new SmsBodyParserNotExtendedException('SmsBodyParser has not extended.'); } @@ -114,7 +115,7 @@ private function resolveSmsType($data, $smsType, $smsConfigs, $smsAndroidSetting private function associateSmsWithForSmsType($smsType, $data, $uuid, $receiver, $smsAndroidSettings) { - if (!($smsType instanceof ManualSms)) { + if (! ($smsType instanceof ManualSms)) { $sms = Sms::query()->make([ 'uuid' => $uuid, 'body' => $smsType->body, diff --git a/src/backend/app/Services/SocialTariffService.php b/src/backend/app/Services/SocialTariffService.php index 08b08122d..c9cb8c0a5 100644 --- a/src/backend/app/Services/SocialTariffService.php +++ b/src/backend/app/Services/SocialTariffService.php @@ -13,8 +13,7 @@ class SocialTariffService implements IBaseService { public function __construct( private SocialTariff $socialTariff, - ) { - } + ) {} public function create(array $socialTariffData): SocialTariff { diff --git a/src/backend/app/Services/SubConnectionTypeService.php b/src/backend/app/Services/SubConnectionTypeService.php index ac5a968b9..b756d1479 100644 --- a/src/backend/app/Services/SubConnectionTypeService.php +++ b/src/backend/app/Services/SubConnectionTypeService.php @@ -14,15 +14,14 @@ class SubConnectionTypeService implements IBaseService { public function __construct( private SubConnectionType $subConnectionType, - ) { - } + ) {} public function getSubConnectionTypesByConnectionTypeId($connectionTypeId, $limit = null): LengthAwarePaginator|Collection { return $limit ? $this->subConnectionType->newQuery()->where('connection_type_id', $connectionTypeId) ->paginate($limit) : $this->subConnectionType->newQuery()->where('connection_type_id', $connectionTypeId) - ->get(); + ->get(); } public function getById(int $subConnectionTypeId): SubConnectionType diff --git a/src/backend/app/Services/SubTargetService.php b/src/backend/app/Services/SubTargetService.php index 8177906a2..b174418fb 100644 --- a/src/backend/app/Services/SubTargetService.php +++ b/src/backend/app/Services/SubTargetService.php @@ -13,14 +13,13 @@ class SubTargetService implements IBaseService { public function __construct( private SubTarget $subTarget, - ) { - } + ) {} public function getById(int $id): SubTarget { throw new \Exception('Method getById() not yet implemented.'); - return new SubTarget(); + return new SubTarget; } public function create(array $subTargetData): SubTarget @@ -46,7 +45,7 @@ public function update($model, array $data): SubTarget { throw new \Exception('Method update() not yet implemented.'); - return new SubTarget(); + return new SubTarget; } public function delete($model): ?bool diff --git a/src/backend/app/Services/TargetService.php b/src/backend/app/Services/TargetService.php index 5a8d4193d..c178d8b2e 100644 --- a/src/backend/app/Services/TargetService.php +++ b/src/backend/app/Services/TargetService.php @@ -12,9 +12,7 @@ class TargetService { - public function __construct(private Target $target) - { - } + public function __construct(private Target $target) {} public function getById($targetId): Target { @@ -31,7 +29,7 @@ public function create(CarbonImmutable $period, string $targetForType, TargetAss 'target_date' => $period->format('Y-m-d'), 'type' => $targetForType, ]); - if (!$targetOwner instanceof Model) { + if (! $targetOwner instanceof Model) { throw new ValidationException('target owner should be a model'); } $target->owner()->associate($targetOwner); diff --git a/src/backend/app/Services/TariffPricingComponentService.php b/src/backend/app/Services/TariffPricingComponentService.php index 0f42ea050..a774fab3d 100644 --- a/src/backend/app/Services/TariffPricingComponentService.php +++ b/src/backend/app/Services/TariffPricingComponentService.php @@ -13,8 +13,7 @@ class TariffPricingComponentService implements IBaseService { public function __construct( private TariffPricingComponent $tariffPricingComponent, - ) { - } + ) {} public function make($tariffPricingComponentData) { diff --git a/src/backend/app/Services/TicketSettingsService.php b/src/backend/app/Services/TicketSettingsService.php index 5bea79434..473249021 100644 --- a/src/backend/app/Services/TicketSettingsService.php +++ b/src/backend/app/Services/TicketSettingsService.php @@ -12,8 +12,7 @@ class TicketSettingsService implements ISettingsService { public function __construct( private TicketSettings $ticketSettings, - ) { - } + ) {} public function update($ticketSettings, array $ticketSettingsData): TicketSettings { diff --git a/src/backend/app/Services/TimeOfUsageService.php b/src/backend/app/Services/TimeOfUsageService.php index 348b267c2..d03a771f7 100644 --- a/src/backend/app/Services/TimeOfUsageService.php +++ b/src/backend/app/Services/TimeOfUsageService.php @@ -13,8 +13,7 @@ class TimeOfUsageService implements IBaseService { public function __construct( private TimeOfUsage $timeOfUsage, - ) { - } + ) {} public function create(array $timeOfUsageData): TimeOfUsage { diff --git a/src/backend/app/Services/TokenService.php b/src/backend/app/Services/TokenService.php index c71b6485e..03e34fcdd 100644 --- a/src/backend/app/Services/TokenService.php +++ b/src/backend/app/Services/TokenService.php @@ -14,8 +14,7 @@ class TokenService implements IBaseService { public function __construct( private Token $token, - ) { - } + ) {} public function getById(int $id): Token { @@ -31,7 +30,7 @@ public function update($model, array $data): Token { throw new \Exception('Method update() not yet implemented.'); - return new Token(); + return new Token; } public function delete($model): ?bool diff --git a/src/backend/app/Services/TransactionPaymentHistoryService.php b/src/backend/app/Services/TransactionPaymentHistoryService.php index 6d05d2107..e962a18b3 100644 --- a/src/backend/app/Services/TransactionPaymentHistoryService.php +++ b/src/backend/app/Services/TransactionPaymentHistoryService.php @@ -12,6 +12,7 @@ class TransactionPaymentHistoryService implements IAssignationService { private PaymentHistory $paymentHistory; + private Transaction $transaction; public function setAssigned($paymentHistory): void diff --git a/src/backend/app/Services/TransactionProviderService.php b/src/backend/app/Services/TransactionProviderService.php index 73af1789d..b2bb3ab62 100644 --- a/src/backend/app/Services/TransactionProviderService.php +++ b/src/backend/app/Services/TransactionProviderService.php @@ -10,8 +10,6 @@ class TransactionProviderService /** * TransactionProviderService constructor. - * - * @param Transaction $transaction */ public function __construct(Transaction $transaction) { diff --git a/src/backend/app/Services/UsageTypeService.php b/src/backend/app/Services/UsageTypeService.php index ff76287af..b6a2b631e 100644 --- a/src/backend/app/Services/UsageTypeService.php +++ b/src/backend/app/Services/UsageTypeService.php @@ -14,8 +14,7 @@ class UsageTypeService implements IBaseService { public function __construct( private UsageType $usageType, - ) { - } + ) {} public function getAll(?int $limit = null): Collection|LengthAwarePaginator { @@ -26,21 +25,21 @@ public function getById(int $id): UsageType { throw new \Exception('Method getById() not yet implemented.'); - return new UsageType(); + return new UsageType; } public function create(array $data): UsageType { throw new \Exception('Method create() not yet implemented.'); - return new UsageType(); + return new UsageType; } public function update($model, array $data): UsageType { throw new \Exception('Method update() not yet implemented.'); - return new UsageType(); + return new UsageType; } public function delete($model): ?bool diff --git a/src/backend/app/Services/UserAddressService.php b/src/backend/app/Services/UserAddressService.php index d2e0a5060..eb3478d24 100644 --- a/src/backend/app/Services/UserAddressService.php +++ b/src/backend/app/Services/UserAddressService.php @@ -8,6 +8,7 @@ class UserAddressService { private $address; + private $user; public function __construct(Address $address, User $user) @@ -37,7 +38,7 @@ public function update(User $user, $data) $user->name = $data['name']; $user->update(); $address = $user->address()->first(); - if (!$address) { + if (! $address) { $address = $this->address->newQuery()->create([ 'email' => $user->email, 'phone' => $data['phone'], diff --git a/src/backend/app/Services/UserAppliancePersonService.php b/src/backend/app/Services/UserAppliancePersonService.php index 8f2d1d891..9ffddb78b 100644 --- a/src/backend/app/Services/UserAppliancePersonService.php +++ b/src/backend/app/Services/UserAppliancePersonService.php @@ -12,6 +12,7 @@ class UserAppliancePersonService implements IAssignationService { private AssetPerson $appliancePerson; + private User $user; public function setAssigned($appliancePerson): void diff --git a/src/backend/app/Services/UserService.php b/src/backend/app/Services/UserService.php index 8d0f6ef96..47c5890f4 100644 --- a/src/backend/app/Services/UserService.php +++ b/src/backend/app/Services/UserService.php @@ -13,9 +13,7 @@ class UserService { - public function __construct(private User $user, private MailHelperInterface $mailHelper) - { - } + public function __construct(private User $user, private MailHelperInterface $mailHelper) {} public function create(array $userData, ?int $companyId = null): User { diff --git a/src/backend/app/Services/UserTicketService.php b/src/backend/app/Services/UserTicketService.php index 9e4240034..6f8eab875 100644 --- a/src/backend/app/Services/UserTicketService.php +++ b/src/backend/app/Services/UserTicketService.php @@ -12,6 +12,7 @@ class UserTicketService implements IAssignationService { private Ticket $ticket; + private User $user; public function setAssigned($ticket): void diff --git a/src/backend/app/Sms/AndroidGateway.php b/src/backend/app/Sms/AndroidGateway.php index 4067480dc..2baf09487 100644 --- a/src/backend/app/Sms/AndroidGateway.php +++ b/src/backend/app/Sms/AndroidGateway.php @@ -12,14 +12,11 @@ class AndroidGateway implements ISmsProvider /** * Sends the sms to the sms provider. * - * @param string $number - * @param string $body - * @param string $callback - * @param SmsAndroidSetting $smsAndroidSettings + * @param SmsAndroidSetting $smsAndroidSettings */ public function sendSms(string $number, string $body, string $callback, SmsAndroidSetting $smsAndroidSetting) { - if (!config('app.env') == 'production') { + if (! config('app.env') == 'production') { Log::debug('Send sms on allowed in production', ['number' => $number, 'message' => $body]); return; diff --git a/src/backend/app/Sms/BodyParsers/AccessRateConfirmation.php b/src/backend/app/Sms/BodyParsers/AccessRateConfirmation.php index b7ae9b3b4..8dd9a3b9a 100644 --- a/src/backend/app/Sms/BodyParsers/AccessRateConfirmation.php +++ b/src/backend/app/Sms/BodyParsers/AccessRateConfirmation.php @@ -7,6 +7,7 @@ class AccessRateConfirmation extends SmsBodyParser { protected $variables = ['amount']; + protected $paymentHistory; public function __construct(PaymentHistory $paymentHistory) diff --git a/src/backend/app/Sms/BodyParsers/AssetRatePayment.php b/src/backend/app/Sms/BodyParsers/AssetRatePayment.php index 381810f19..297b358e2 100644 --- a/src/backend/app/Sms/BodyParsers/AssetRatePayment.php +++ b/src/backend/app/Sms/BodyParsers/AssetRatePayment.php @@ -7,6 +7,7 @@ class AssetRatePayment extends SmsBodyParser { protected $variables = ['appliance_type_name', 'amount']; + protected $paymentHistory; public function __construct(PaymentHistory $paymentHistory) diff --git a/src/backend/app/Sms/BodyParsers/AssetRateReminder.php b/src/backend/app/Sms/BodyParsers/AssetRateReminder.php index da9c6ba63..ca914eb14 100644 --- a/src/backend/app/Sms/BodyParsers/AssetRateReminder.php +++ b/src/backend/app/Sms/BodyParsers/AssetRateReminder.php @@ -7,6 +7,7 @@ class AssetRateReminder extends SmsBodyParser { protected $variables = ['appliance_type_name', 'remaining', 'due_date']; + protected $reminderData; public function __construct(AssetRate $reminderData) diff --git a/src/backend/app/Sms/BodyParsers/EnergyConfirmation.php b/src/backend/app/Sms/BodyParsers/EnergyConfirmation.php index 39a16d996..8ba16b169 100644 --- a/src/backend/app/Sms/BodyParsers/EnergyConfirmation.php +++ b/src/backend/app/Sms/BodyParsers/EnergyConfirmation.php @@ -7,6 +7,7 @@ class EnergyConfirmation extends SmsBodyParser { protected $variables = ['meter', 'token', 'energy', 'amount']; + protected $paymentHistory; public function __construct(PaymentHistory $paymentHistory) diff --git a/src/backend/app/Sms/BodyParsers/OverDueAssetRateReminder.php b/src/backend/app/Sms/BodyParsers/OverDueAssetRateReminder.php index 75325f2a5..f1f01d5a3 100644 --- a/src/backend/app/Sms/BodyParsers/OverDueAssetRateReminder.php +++ b/src/backend/app/Sms/BodyParsers/OverDueAssetRateReminder.php @@ -7,6 +7,7 @@ class OverDueAssetRateReminder extends SmsBodyParser { public $variables = ['appliance_type_name', 'remaining', 'due_date']; + protected $reminderData; public function __construct(AssetRate $reminderData) diff --git a/src/backend/app/Sms/BodyParsers/PricingDetails.php b/src/backend/app/Sms/BodyParsers/PricingDetails.php index 1af916854..0d568fa8e 100644 --- a/src/backend/app/Sms/BodyParsers/PricingDetails.php +++ b/src/backend/app/Sms/BodyParsers/PricingDetails.php @@ -8,8 +8,11 @@ class PricingDetails extends SmsBodyParser { public $variables = ['amount', 'vat_energy', 'vat_others']; + protected $transaction; + private $vatEnergy = 0; + private $vatOtherStaffs = 0; public function __construct(Transaction $transaction) diff --git a/src/backend/app/Sms/BodyParsers/ResendInformation.php b/src/backend/app/Sms/BodyParsers/ResendInformation.php index c8115b621..997b3955b 100644 --- a/src/backend/app/Sms/BodyParsers/ResendInformation.php +++ b/src/backend/app/Sms/BodyParsers/ResendInformation.php @@ -7,6 +7,7 @@ class ResendInformation extends SmsBodyParser { protected $variables = ['meter', 'token', 'energy', 'amount']; + protected $paymentHistory; public function __construct(PaymentHistory $paymentHistory) diff --git a/src/backend/app/Sms/BodyParsers/SmsReminderHeader.php b/src/backend/app/Sms/BodyParsers/SmsReminderHeader.php index 824114890..44cffc803 100644 --- a/src/backend/app/Sms/BodyParsers/SmsReminderHeader.php +++ b/src/backend/app/Sms/BodyParsers/SmsReminderHeader.php @@ -7,6 +7,7 @@ class SmsReminderHeader extends SmsBodyParser { protected $variables = ['name', 'surname']; + protected $reminderData; public function __construct(AssetRate $reminderData) diff --git a/src/backend/app/Sms/BodyParsers/SmsResendInformationHeader.php b/src/backend/app/Sms/BodyParsers/SmsResendInformationHeader.php index 1789c322a..6135ae592 100644 --- a/src/backend/app/Sms/BodyParsers/SmsResendInformationHeader.php +++ b/src/backend/app/Sms/BodyParsers/SmsResendInformationHeader.php @@ -7,6 +7,7 @@ class SmsResendInformationHeader extends SmsBodyParser { protected $variables = ['name', 'surname']; + protected $data; public function __construct($data) @@ -16,7 +17,7 @@ public function __construct($data) protected function getVariableValue($variable) { - if (!is_array($this->data)) { + if (! is_array($this->data)) { $person = $this->data->meter->meterParameter->owner()->first(); } else { try { diff --git a/src/backend/app/Sms/BodyParsers/SmsTransactionHeader.php b/src/backend/app/Sms/BodyParsers/SmsTransactionHeader.php index 75ca9612e..5ddec7c4c 100644 --- a/src/backend/app/Sms/BodyParsers/SmsTransactionHeader.php +++ b/src/backend/app/Sms/BodyParsers/SmsTransactionHeader.php @@ -7,6 +7,7 @@ class SmsTransactionHeader extends SmsBodyParser { protected $variables = ['name', 'surname', 'transaction_amount']; + protected $transaction; public function __construct(Transaction $transaction) diff --git a/src/backend/app/Sms/Senders/ManualSms.php b/src/backend/app/Sms/Senders/ManualSms.php index 35bf44cd5..ce277dfb7 100644 --- a/src/backend/app/Sms/Senders/ManualSms.php +++ b/src/backend/app/Sms/Senders/ManualSms.php @@ -5,7 +5,9 @@ class ManualSms extends SmsSender { protected $data; + public $body = ''; + protected $references = [ 'body' => '', ]; diff --git a/src/backend/app/Sms/Senders/ResendInformationNotification.php b/src/backend/app/Sms/Senders/ResendInformationNotification.php index 321f1f841..646a3b4c6 100644 --- a/src/backend/app/Sms/Senders/ResendInformationNotification.php +++ b/src/backend/app/Sms/Senders/ResendInformationNotification.php @@ -11,7 +11,9 @@ class ResendInformationNotification extends SmsSender { protected $data; + public $body = ''; + protected $references = [ 'header' => 'SmsResendInformationHeader', 'footer' => 'SmsResendInformationFooter', @@ -20,7 +22,7 @@ class ResendInformationNotification extends SmsSender public function prepareBody() { - if (!is_array($this->data)) { + if (! is_array($this->data)) { try { $smsBody = $this->smsBodyService->getSmsBodyByReference('ResendInformation'); } catch (ModelNotFoundException $exception) { diff --git a/src/backend/app/Sms/Senders/SmsConfigs.php b/src/backend/app/Sms/Senders/SmsConfigs.php index 5d4993ac3..f6065199a 100644 --- a/src/backend/app/Sms/Senders/SmsConfigs.php +++ b/src/backend/app/Sms/Senders/SmsConfigs.php @@ -2,6 +2,4 @@ namespace App\Sms\Senders; -class SmsConfigs extends SmsConfigsCore -{ -} +class SmsConfigs extends SmsConfigsCore {} diff --git a/src/backend/app/Sms/Senders/SmsConfigsCore.php b/src/backend/app/Sms/Senders/SmsConfigsCore.php index 911a23eef..ff663af3c 100644 --- a/src/backend/app/Sms/Senders/SmsConfigsCore.php +++ b/src/backend/app/Sms/Senders/SmsConfigsCore.php @@ -13,6 +13,8 @@ abstract class SmsConfigsCore SmsTypes::MANUAL_SMS => 'App\Sms\Senders\ManualSms', SmsTypes::RESEND_INFORMATION => 'App\Sms\Senders\ResendInformationNotification', ]; + public $bodyParsersPath = 'App\\Sms\\BodyParsers\\'; + public $servicePath = 'App\Services\SmsBodyService'; } diff --git a/src/backend/app/Sms/Senders/SmsSender.php b/src/backend/app/Sms/Senders/SmsSender.php index 4ef350066..8a80a2717 100644 --- a/src/backend/app/Sms/Senders/SmsSender.php +++ b/src/backend/app/Sms/Senders/SmsSender.php @@ -17,12 +17,19 @@ abstract class SmsSender { protected $smsBodyService; + protected $data; + protected $references; + public $body = ''; + protected $receiver; + protected $callback; + protected $parserSubPath; + private $smsAndroidSettings; public function __construct($data, $smsBodyService, $parserSubPath, $smsAndroidSettings) @@ -141,7 +148,7 @@ public function validateReferences() $this->prepareFooter(); } } catch (MissingSmsReferencesException $exception) { - throw new $exception(); + throw new $exception; } } @@ -155,7 +162,7 @@ public function getReceiver() '+' ) === 0 ? $this->data->assetPerson->person->addresses->first()->phone : '+'.$this->data->assetPerson->person->addresses->first()->phone; - } elseif (!is_array($this->data) && $this->data->mpmPerson) { + } elseif (! is_array($this->data) && $this->data->mpmPerson) { $this->receiver = strpos( $this->data->mpmPerson->addresses[0]->phone, '+' @@ -187,7 +194,7 @@ private function checkForViberIdOfReceiverIfPluginIsActive() if ($viberMessagingPlugin && $viberMessagingPlugin->status === Plugins::ACTIVE) { $viberContact = $viberContactService->getByReceiverPhoneNumber($this->receiver); - if (!$viberContact) { + if (! $viberContact) { return null; } diff --git a/src/backend/app/Sms/Senders/TransactionConfirmation.php b/src/backend/app/Sms/Senders/TransactionConfirmation.php index c7eb4df95..1e7e96c9c 100644 --- a/src/backend/app/Sms/Senders/TransactionConfirmation.php +++ b/src/backend/app/Sms/Senders/TransactionConfirmation.php @@ -9,14 +9,19 @@ class TransactionConfirmation extends SmsSender { protected $data; + public $body = ''; + protected $references = [ 'header' => 'SmsTransactionHeader', 'footer' => 'SmsTransactionFooter', 'body' => '', ]; + public const ENERGY_CONFIRMATION = 'energy'; + public const ACCESS_RATE_PAYMENT = 'access rate'; + public const ASSET_RATE_PAYMENT = 'loan rate'; public function prepareBody() diff --git a/src/backend/app/Sms/SmsTypes.php b/src/backend/app/Sms/SmsTypes.php index faed45285..5e713bf48 100644 --- a/src/backend/app/Sms/SmsTypes.php +++ b/src/backend/app/Sms/SmsTypes.php @@ -5,8 +5,12 @@ class SmsTypes { public const TRANSACTION_CONFIRMATION = 1; + public const APPLIANCE_RATE = 2; + public const OVER_DUE_APPLIANCE_RATE = 3; + public const MANUAL_SMS = 4; + public const RESEND_INFORMATION = 5; } diff --git a/src/backend/app/Traits/RestExceptionHandler.php b/src/backend/app/Traits/RestExceptionHandler.php index 19070639f..7655af9fc 100644 --- a/src/backend/app/Traits/RestExceptionHandler.php +++ b/src/backend/app/Traits/RestExceptionHandler.php @@ -16,9 +16,7 @@ trait RestExceptionHandler /** * Creates a new response based on exception type. * - * @param Request $request - * @param \Exception $e - * + * @param \Exception $e * @return JsonResponse */ protected function getJsonResponseForException(Request $request, \Exception|\Throwable $e) @@ -46,9 +44,8 @@ protected function getJsonResponseForException(Request $request, \Exception|\Thr /** * returns a json response for all excepion types except modelnotfoundexception. * - * @param string $message - * @param int $status_code - * + * @param string $message + * @param int $status_code * @return JsonResponse */ protected function badRequest($message = 'Bad request', $status_code = 400) @@ -65,9 +62,8 @@ protected function badRequest($message = 'Bad request', $status_code = 400) /** * Returns a json response for Model not found exception. * - * @param string $message - * @param int $status_code - * + * @param string $message + * @param int $status_code * @return JsonResponse */ protected function modelNotFound($message = 'Record not found', $status_code = 404) @@ -84,9 +80,8 @@ protected function modelNotFound($message = 'Record not found', $status_code = 4 /** * Generates validation error response. * - * @param string $message - * @param int $status_code - * + * @param string $message + * @param int $status_code * @return JsonResponse */ protected function validationError($message = 'Validation failed', $status_code = 422) @@ -103,9 +98,7 @@ protected function validationError($message = 'Validation failed', $status_code /** * Determines if the exception type is Model not found exception. * - * @param \Exception $e - * - * @return bool + * @param \Exception $e */ protected function isModelNotFoundException($e): bool { @@ -115,9 +108,7 @@ protected function isModelNotFoundException($e): bool /** * Determines if given Exception is Validation Exception. * - * @param \Exception $e - * - * @return bool + * @param \Exception $e */ protected function isValidationException($e): bool { @@ -127,12 +118,10 @@ protected function isValidationException($e): bool /** * Generates a json response & returns it. * - * @param array|null $payload - * @param $status_code * * @return JsonResponse */ - protected function jsonResponse(?array $payload = null, $status_code) + protected function jsonResponse(?array $payload, $status_code) { $payload = $payload ?: []; diff --git a/src/backend/app/Utils/AccessRatePayer.php b/src/backend/app/Utils/AccessRatePayer.php index 0c44df771..14d244848 100644 --- a/src/backend/app/Utils/AccessRatePayer.php +++ b/src/backend/app/Utils/AccessRatePayer.php @@ -10,9 +10,13 @@ class AccessRatePayer { public const MINIMUM_AMOUNT = 0; + private AccessRatePayment $accessRatePayment; + private TransactionDataContainer $transactionData; + private Transaction $transaction; + private float $debtAmount; public function __construct(private AccessRatePaymentService $accessRatePaymentService) diff --git a/src/backend/app/Utils/ApplianceInstallmentPayer.php b/src/backend/app/Utils/ApplianceInstallmentPayer.php index 27146da7d..f3d1bae46 100644 --- a/src/backend/app/Utils/ApplianceInstallmentPayer.php +++ b/src/backend/app/Utils/ApplianceInstallmentPayer.php @@ -16,9 +16,13 @@ class ApplianceInstallmentPayer { private Person $customer; + private Transaction $transaction; + public array $paidRates = []; + public ?AssetPerson $shsLoan = null; + public $consumableAmount; public function __construct( @@ -26,8 +30,7 @@ public function __construct( private ApplianceRateService $applianceRateService, private AppliancePaymentService $appliancePaymentService, private DeviceService $deviceService, - ) { - } + ) {} public function initialize(TransactionDataContainer $transactionData): void { @@ -80,7 +83,7 @@ private function getCustomerByDeviceSerial(string $serialNumber): Person { $device = $this->deviceService->getBySerialNumber($serialNumber); - if (!$device) { + if (! $device) { throw new DeviceIsNotAssignedToCustomer('Device is not assigned to customer'); } diff --git a/src/backend/app/Utils/DummyCompany.php b/src/backend/app/Utils/DummyCompany.php index 9b69b0dee..7a1a6a15e 100644 --- a/src/backend/app/Utils/DummyCompany.php +++ b/src/backend/app/Utils/DummyCompany.php @@ -5,5 +5,6 @@ class DummyCompany { public const DUMMY_COMPANY_ID = 1; + public const DUMMY_COMPANY_DATABASE_NAME = 'DummyCompany_1'; } diff --git a/src/backend/app/Utils/MinimumPurchaseAmountValidator.php b/src/backend/app/Utils/MinimumPurchaseAmountValidator.php index 640a544fb..ee25e4ed4 100644 --- a/src/backend/app/Utils/MinimumPurchaseAmountValidator.php +++ b/src/backend/app/Utils/MinimumPurchaseAmountValidator.php @@ -7,6 +7,7 @@ class MinimumPurchaseAmountValidator { private float $restAmount; + private TransactionDataContainer $transactionData; public function validate(TransactionDataContainer $transactionData, $minimumPurchaseAmount): bool diff --git a/src/backend/app/Utils/TariffPriceCalculator.php b/src/backend/app/Utils/TariffPriceCalculator.php index b524281ef..4b6e51efb 100644 --- a/src/backend/app/Utils/TariffPriceCalculator.php +++ b/src/backend/app/Utils/TariffPriceCalculator.php @@ -16,8 +16,7 @@ public function __construct( private SocialTariffService $socialTariffService, private TimeOfUsageService $timeOfUsageService, private TariffPricingComponentService $tariffPricingComponentService, - ) { - } + ) {} public function calculateTotalPrice( MeterTariff $meterTariff, diff --git a/src/backend/app/modules/Apps/CustomerRegistration/CustomerRegistrationAppService.php b/src/backend/app/modules/Apps/CustomerRegistration/CustomerRegistrationAppService.php index 267370fdb..2ab82a083 100644 --- a/src/backend/app/modules/Apps/CustomerRegistration/CustomerRegistrationAppService.php +++ b/src/backend/app/modules/Apps/CustomerRegistration/CustomerRegistrationAppService.php @@ -24,8 +24,7 @@ public function __construct( private DeviceAddressService $deviceAddressService, private GeographicalInformationService $geographicalInformationService, private AddressGeographicalInformationService $addressGeographicalInformationService, - ) { - } + ) {} public function createCustomer(AndroidAppRequest $request): Person { diff --git a/src/backend/app/modules/CustomBulkRegistration/Ecosys/CustomerDatabaseParser.php b/src/backend/app/modules/CustomBulkRegistration/Ecosys/CustomerDatabaseParser.php index 54f6a7fc7..8c903d44a 100644 --- a/src/backend/app/modules/CustomBulkRegistration/Ecosys/CustomerDatabaseParser.php +++ b/src/backend/app/modules/CustomBulkRegistration/Ecosys/CustomerDatabaseParser.php @@ -25,6 +25,7 @@ class CustomerDatabaseParser { private $path; + private $recentlyCreatedRecords; public function __construct(private Csv $csv) @@ -85,7 +86,7 @@ public function insertFromCsv() $city = $this->createRecordFromCsv($row, CityService::class); $row['city_id'] = $city->id; - if (!$isExistingPerson) { + if (! $isExistingPerson) { $this->createRecordFromCsv($row, AddressService::class); } @@ -105,7 +106,7 @@ public function insertFromCsv() $row['meter_parameter_id'] = $meterParameter->id; $this->createRecordFromCsv($row, GeographicalInformationService::class); - $meterAddress = new Address(); + $meterAddress = new Address; $address = $meterAddress->newQuery()->create([ 'city_id' => $city->id, ]); @@ -141,7 +142,7 @@ private function createRecordFromCsv($row, $service) private function checkRecordWasRecentlyCreated($record, $type) { if ($record->wasRecentlyCreated) { - ++$this->recentlyCreatedRecords[$type]; + $this->recentlyCreatedRecords[$type]++; } } } diff --git a/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/AppliancePersonService.php b/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/AppliancePersonService.php index b5b99d49c..fc434242e 100644 --- a/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/AppliancePersonService.php +++ b/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/AppliancePersonService.php @@ -16,15 +16,25 @@ class AppliancePersonService extends CreatorService { private $newTarifName; + private ?float $price = null; + private $minimumAmount; + private $meterParameterId; + private $personId; + private $downPayment; + private $applianceId; + private $totalPaid; + private $secondPaymentAmount; + private $createdAt; + private $lastPaymentDate; public function __construct(AssetPerson $appliancePerson) @@ -82,7 +92,7 @@ private function calculateRateCount($price, $downPayment, $minimumPaymentAmount) while ($rawCost > 0) { $rawCost = $rawCost - $minimumPaymentAmount; - ++$rateCount; + $rateCount++; } return $rateCount; diff --git a/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/ApplianceService.php b/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/ApplianceService.php index b49fcfc0b..0126ac0b0 100644 --- a/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/ApplianceService.php +++ b/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/ApplianceService.php @@ -8,6 +8,7 @@ class ApplianceService extends CreatorService { private $appliance1 = 'SunKing Home 40Plus - Sofala - Humanitário 2'; + private $appliance2 = 'SunKing Home 40Plus - Nacional - COVID PLUS 2'; public function __construct(Asset $asset) diff --git a/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/ConnectionGroupService.php b/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/ConnectionGroupService.php index e37c3a964..d7aad1803 100644 --- a/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/ConnectionGroupService.php +++ b/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/ConnectionGroupService.php @@ -8,6 +8,7 @@ class ConnectionGroupService extends CreatorService { private $group1 = 'SunKing Home 40Plus - Sofala - Humanitário 2'; + private $group2 = 'SunKing Home 40Plus - Nacional - COVID PLUS 2'; public function __construct(ConnectionGroup $connectionGroup) diff --git a/src/backend/app/modules/DatabaseProxy/DatabaseProxyManagerService.php b/src/backend/app/modules/DatabaseProxy/DatabaseProxyManagerService.php index 742bfd7f5..5f979d5d3 100644 --- a/src/backend/app/modules/DatabaseProxy/DatabaseProxyManagerService.php +++ b/src/backend/app/modules/DatabaseProxy/DatabaseProxyManagerService.php @@ -16,8 +16,7 @@ public function __construct( private DatabaseProxy $databaseProxy, private DatabaseManager $databaseManager, private CompanyDatabase $companyDatabase, - ) { - } + ) {} public function findByEmail(string $email): DatabaseProxy { diff --git a/src/backend/app/modules/Device/ClusterDeviceService.php b/src/backend/app/modules/Device/ClusterDeviceService.php index 70ccbdc6d..7e2a88a3a 100644 --- a/src/backend/app/modules/Device/ClusterDeviceService.php +++ b/src/backend/app/modules/Device/ClusterDeviceService.php @@ -8,9 +8,7 @@ class ClusterDeviceService { - public function __construct(private Cluster $cluster, private Device $device) - { - } + public function __construct(private Cluster $cluster, private Device $device) {} public function getCountByClusterId($clusterId): int { diff --git a/src/backend/app/modules/Device/DeviceAddressService.php b/src/backend/app/modules/Device/DeviceAddressService.php index 772b14ccc..3cb87f915 100644 --- a/src/backend/app/modules/Device/DeviceAddressService.php +++ b/src/backend/app/modules/Device/DeviceAddressService.php @@ -12,6 +12,7 @@ class DeviceAddressService implements IAssignationService { private Address $address; + private Device $device; public function setAssigned($assigned): void @@ -41,9 +42,6 @@ public function getAddressByDevice(Device $device): ?Address return $result; } - /** - * @return Address - */ public function updateDeviceAddress($deviceAddress, $addressData): Address { $points = $addressData['lat'].','.$addressData['lon']; diff --git a/src/backend/app/modules/Device/DeviceService.php b/src/backend/app/modules/Device/DeviceService.php index 3a107c842..8ab691dc2 100644 --- a/src/backend/app/modules/Device/DeviceService.php +++ b/src/backend/app/modules/Device/DeviceService.php @@ -12,12 +12,11 @@ * @implements IBaseService * @implements IAssociative */ -class DeviceService implements IBaseService, IAssociative +class DeviceService implements IAssociative, IBaseService { public function __construct( private Device $device, - ) { - } + ) {} public function make($deviceData): Device { @@ -48,14 +47,14 @@ public function getById(int $id): Device { throw new \Exception('Method getById() not yet implemented.'); - return new Device(); + return new Device; } public function create(array $data): Device { throw new \Exception('Method create() not yet implemented.'); - return new Device(); + return new Device; } public function update($device, array $deviceData): Device diff --git a/src/backend/app/modules/Device/MiniGridDeviceService.php b/src/backend/app/modules/Device/MiniGridDeviceService.php index 7bb80f7ad..8dbcb8af5 100644 --- a/src/backend/app/modules/Device/MiniGridDeviceService.php +++ b/src/backend/app/modules/Device/MiniGridDeviceService.php @@ -9,9 +9,7 @@ class MiniGridDeviceService { - public function __construct(private Device $device, private MiniGrid $miniGrid) - { - } + public function __construct(private Device $device, private MiniGrid $miniGrid) {} public function getMetersByMiniGridId($miniGridId) { diff --git a/src/backend/app/modules/EBike/EBikeDeviceService.php b/src/backend/app/modules/EBike/EBikeDeviceService.php index 3aed09e05..068f7187b 100644 --- a/src/backend/app/modules/EBike/EBikeDeviceService.php +++ b/src/backend/app/modules/EBike/EBikeDeviceService.php @@ -12,6 +12,7 @@ class EBikeDeviceService implements IAssignationService { private Device $device; + protected EBike $eBike; public function setAssigned($assigned): void diff --git a/src/backend/app/modules/EBike/EBikeService.php b/src/backend/app/modules/EBike/EBikeService.php index b9354369d..f31b3fbab 100644 --- a/src/backend/app/modules/EBike/EBikeService.php +++ b/src/backend/app/modules/EBike/EBikeService.php @@ -14,8 +14,7 @@ class EBikeService implements IBaseService { public function __construct( private EBike $eBike, - ) { - } + ) {} public function getAll(?int $limit = null): Collection|LengthAwarePaginator { @@ -45,7 +44,7 @@ public function search($term, $paginate): LengthAwarePaginator fn ($q) => $q->whereHas( 'person', fn ($q) => $q->where('name', 'LIKE', '%'.$term.'%') - ->orWhere('surname', 'LIKE', '%'.$term.'%') + ->orWhere('surname', 'LIKE', '%'.$term.'%') ) ) ->orWhere( diff --git a/src/backend/app/modules/Meter/MeterDeviceService.php b/src/backend/app/modules/Meter/MeterDeviceService.php index c9c9f1049..1a10e3bad 100644 --- a/src/backend/app/modules/Meter/MeterDeviceService.php +++ b/src/backend/app/modules/Meter/MeterDeviceService.php @@ -12,6 +12,7 @@ class MeterDeviceService implements IAssignationService { private Device $device; + private Meter $meter; public function setAssigned($assigned): void diff --git a/src/backend/app/modules/OutstandingDebts/OutstandingDebtsExportService.php b/src/backend/app/modules/OutstandingDebts/OutstandingDebtsExportService.php index 61ffe009c..b7d6f3ce8 100644 --- a/src/backend/app/modules/OutstandingDebts/OutstandingDebtsExportService.php +++ b/src/backend/app/modules/OutstandingDebts/OutstandingDebtsExportService.php @@ -17,8 +17,7 @@ public function __construct( private ApplianceRateService $applianceService, private ApplianceRateService $applianceRateService, private MailHelper $mailHelper, - ) { - } + ) {} private Collection $outstandingDebtsData; diff --git a/src/backend/app/modules/Sharding/ApiCompanyResolverService.php b/src/backend/app/modules/Sharding/ApiCompanyResolverService.php index 78b7dd31c..e37731973 100644 --- a/src/backend/app/modules/Sharding/ApiCompanyResolverService.php +++ b/src/backend/app/modules/Sharding/ApiCompanyResolverService.php @@ -12,14 +12,12 @@ class ApiCompanyResolverService { - public function __construct(private ApiResolverMap $apiResolverMap) - { - } + public function __construct(private ApiResolverMap $apiResolverMap) {} public function resolve(Request $request): int { $api = collect($this->apiResolverMap::RESOLVABLE_APIS)->filter(fn ($apiPath) => Str::startsWith(Str::lower($request->path()), Str::lower($apiPath))); - if (!$api) { + if (! $api) { throw new ValidationException('No api resolver registered for '.$request->path()); } @@ -31,7 +29,7 @@ public function resolve(Request $request): int private function startResolver(string $api): ApiResolverInterface { $apiResolver = $this->apiResolverMap->getApiResolver($api); - if (!$apiResolver) { + if (! $apiResolver) { throw new ValidationException('Api is registered to resolve but no resolver class is assigned'.$api); } /** @var ApiResolverInterface $resolver */ diff --git a/src/backend/app/modules/Sharding/ApiResolvers/Data/ApiResolverMap.php b/src/backend/app/modules/Sharding/ApiResolvers/Data/ApiResolverMap.php index 75141ed83..af99669aa 100644 --- a/src/backend/app/modules/Sharding/ApiResolvers/Data/ApiResolverMap.php +++ b/src/backend/app/modules/Sharding/ApiResolvers/Data/ApiResolverMap.php @@ -15,12 +15,19 @@ class ApiResolverMap { public const VIBER_API = 'api/viber-messaging/webhook'; + public const TEST_API = 'api/testApi'; + public const WAVE_MONEY_API = 'api/wave-money/wave-money-transaction'; + public const ANDROID_GATEWAY_CALLBACK_API = 'api/sms-android-callback'; + public const SWIFTA_PAYMENT_API = 'api/swifta/'; + public const REPORT_DOWNLOADING_API = 'api/report-downloading'; + public const DATA_EXPORTING_API = 'api/export'; + public const RESOLVABLE_APIS = [ self::TEST_API, self::VIBER_API, diff --git a/src/backend/app/modules/Sharding/ApiResolvers/DataExportResolver.php b/src/backend/app/modules/Sharding/ApiResolvers/DataExportResolver.php index d9018b46d..c434dab90 100644 --- a/src/backend/app/modules/Sharding/ApiResolvers/DataExportResolver.php +++ b/src/backend/app/modules/Sharding/ApiResolvers/DataExportResolver.php @@ -8,9 +8,7 @@ class DataExportResolver implements ApiResolverInterface { - public function __construct(private DatabaseProxyManagerService $databaseProxyManager) - { - } + public function __construct(private DatabaseProxyManagerService $databaseProxyManager) {} public function resolveCompanyId(Request $request): int { diff --git a/src/backend/app/modules/Sharding/ApiResolvers/TestApiResolver.php b/src/backend/app/modules/Sharding/ApiResolvers/TestApiResolver.php index d499c42ed..c8b572072 100644 --- a/src/backend/app/modules/Sharding/ApiResolvers/TestApiResolver.php +++ b/src/backend/app/modules/Sharding/ApiResolvers/TestApiResolver.php @@ -15,7 +15,7 @@ class TestApiResolver implements ApiResolverInterface public function resolveCompanyId(Request $request): int { $companyId = $request->input(self::QUERY_PARAM_COMPANY_ID); - if (!is_numeric($companyId)) { + if (! is_numeric($companyId)) { throw new ValidationException('the field which is used to identify the company is not provided'); } diff --git a/src/backend/app/modules/SolarHomeSystem/SolarHomeSystemDeviceService.php b/src/backend/app/modules/SolarHomeSystem/SolarHomeSystemDeviceService.php index a87031a57..a814deb30 100644 --- a/src/backend/app/modules/SolarHomeSystem/SolarHomeSystemDeviceService.php +++ b/src/backend/app/modules/SolarHomeSystem/SolarHomeSystemDeviceService.php @@ -12,6 +12,7 @@ class SolarHomeSystemDeviceService implements IAssignationService { private Device $device; + protected SolarHomeSystem $shs; public function setAssigned($assigned): void diff --git a/src/backend/app/modules/SolarHomeSystem/SolarHomeSystemService.php b/src/backend/app/modules/SolarHomeSystem/SolarHomeSystemService.php index b9b9c8c9a..24cf18842 100644 --- a/src/backend/app/modules/SolarHomeSystem/SolarHomeSystemService.php +++ b/src/backend/app/modules/SolarHomeSystem/SolarHomeSystemService.php @@ -12,9 +12,7 @@ */ class SolarHomeSystemService implements IBaseService { - public function __construct(private SolarHomeSystem $solarHomeSystem) - { - } + public function __construct(private SolarHomeSystem $solarHomeSystem) {} public function getAll(?int $limit = null): Collection|LengthAwarePaginator { diff --git a/src/backend/app/modules/Target/TargetAssignable.php b/src/backend/app/modules/Target/TargetAssignable.php index 3bdd14d62..c09a05565 100644 --- a/src/backend/app/modules/Target/TargetAssignable.php +++ b/src/backend/app/modules/Target/TargetAssignable.php @@ -2,6 +2,4 @@ namespace MPM\Target; -interface TargetAssignable -{ -} +interface TargetAssignable {} diff --git a/src/backend/app/modules/Transaction/ApplianceTransactionService.php b/src/backend/app/modules/Transaction/ApplianceTransactionService.php index d8e6cbe78..47a9a38ce 100644 --- a/src/backend/app/modules/Transaction/ApplianceTransactionService.php +++ b/src/backend/app/modules/Transaction/ApplianceTransactionService.php @@ -2,6 +2,4 @@ namespace MPM\Transaction; -class ApplianceTransactionService -{ -} +class ApplianceTransactionService {} diff --git a/src/backend/app/modules/Transaction/EBikeTransactionService.php b/src/backend/app/modules/Transaction/EBikeTransactionService.php index d2bf4123b..e9d6c4f4d 100644 --- a/src/backend/app/modules/Transaction/EBikeTransactionService.php +++ b/src/backend/app/modules/Transaction/EBikeTransactionService.php @@ -7,9 +7,7 @@ class EBikeTransactionService { - public function __construct(private Transaction $transaction) - { - } + public function __construct(private Transaction $transaction) {} public function search( ?string $serialNumber = null, diff --git a/src/backend/app/modules/Transaction/Export/TransactionExportService.php b/src/backend/app/modules/Transaction/Export/TransactionExportService.php index 42efc0a30..4d17556e7 100644 --- a/src/backend/app/modules/Transaction/Export/TransactionExportService.php +++ b/src/backend/app/modules/Transaction/Export/TransactionExportService.php @@ -7,6 +7,7 @@ class TransactionExportService extends AbstractExportService { private $path = __DIR__.'/export_transactions_template.xlsx'; + private $transactionData; public function writeTransactionData(): void diff --git a/src/backend/app/modules/Transaction/MeterTransactionService.php b/src/backend/app/modules/Transaction/MeterTransactionService.php index b72071e1a..b8ac8c2df 100644 --- a/src/backend/app/modules/Transaction/MeterTransactionService.php +++ b/src/backend/app/modules/Transaction/MeterTransactionService.php @@ -7,9 +7,7 @@ class MeterTransactionService { - public function __construct(private Transaction $transaction) - { - } + public function __construct(private Transaction $transaction) {} public function search( ?string $serialNumber = null, diff --git a/src/backend/app/modules/Transaction/Provider/AgentTransactionProvider.php b/src/backend/app/modules/Transaction/Provider/AgentTransactionProvider.php index c57ba5a5e..7cb63098b 100644 --- a/src/backend/app/modules/Transaction/Provider/AgentTransactionProvider.php +++ b/src/backend/app/modules/Transaction/Provider/AgentTransactionProvider.php @@ -20,13 +20,12 @@ public function __construct( private AgentTransactionModel $agentTransaction, private Transaction $transaction, private FirebaseService $fireBaseService, - ) { - } + ) {} public function saveTransaction(): void { - $this->agentTransaction = new AgentTransactionModel(); - $this->transaction = new Transaction(); + $this->agentTransaction = new AgentTransactionModel; + $this->transaction = new Transaction; // assign data $this->assignData($this->validData); // save transaction @@ -57,7 +56,7 @@ public function sendResult(bool $requestType, Transaction $transaction): void $this->agentTransaction->update(['status' => $requestType === true ? 1 : -1]); $agent = $this->agentTransaction->agent; - if (!$requestType) { + if (! $requestType) { $body = $this->prepareBodyFail($transaction); $this->fireBaseService->sendNotify($agent->fire_base_token, $body); @@ -184,7 +183,7 @@ public function init($transaction): void public function addConflict(?string $message): void { - $conflict = new TransactionConflicts(); + $conflict = new TransactionConflicts; $conflict->state = $message; $conflict->transaction()->associate($this->agentTransaction); $conflict->save(); diff --git a/src/backend/app/modules/Transaction/Provider/AirtelTransactionProvider.php b/src/backend/app/modules/Transaction/Provider/AirtelTransactionProvider.php index e8b11be50..348aa7c2e 100644 --- a/src/backend/app/modules/Transaction/Provider/AirtelTransactionProvider.php +++ b/src/backend/app/modules/Transaction/Provider/AirtelTransactionProvider.php @@ -17,14 +17,12 @@ class AirtelTransactionProvider implements ITransactionProvider { private \SimpleXMLElement $validData; - public function __construct(private AirtelTransaction $airtelTransaction, private Transaction $transaction) - { - } + public function __construct(private AirtelTransaction $airtelTransaction, private Transaction $transaction) {} public function saveTransaction(): void { - $this->airtelTransaction = new AirtelTransaction(); - $this->transaction = new Transaction(); + $this->airtelTransaction = new AirtelTransaction; + $this->transaction = new Transaction; // assign data $this->assignData($this->validData); @@ -32,10 +30,6 @@ public function saveTransaction(): void $this->saveData($this->airtelTransaction); } - /** - * @param bool $requestType - * @param Transaction $transaction - */ public function sendResult(bool $requestType, Transaction $transaction): void { // approve transaction : airtel transactions are automatically confirmed thus @@ -48,7 +42,7 @@ public function sendResult(bool $requestType, Transaction $transaction): void } else { // send cancellation to airtel gateway server and this will send the final request to airtel $requestContent = $this->prepareRequest($this->transaction, $this->airtelTransaction); - $client = new Client(); + $client = new Client; $response = $client->post( config('services.airtel.request_url'), [ @@ -157,8 +151,6 @@ private function assignData(\SimpleXMLElement $data): void /** * Saves the airtel transaction. - * - * @param AirtelTransaction $airtelTransaction */ public function saveData(AirtelTransaction $airtelTransaction): void { @@ -168,7 +160,7 @@ public function saveData(AirtelTransaction $airtelTransaction): void public function addConflict(?string $message): void { - $conflict = new TransactionConflicts(); + $conflict = new TransactionConflicts; $conflict->state = $message; $conflict->transaction()->associate($this->airtelTransaction); $conflict->save(); diff --git a/src/backend/app/modules/Transaction/Provider/AirtelVoltTerraProvider.php b/src/backend/app/modules/Transaction/Provider/AirtelVoltTerraProvider.php index ced9293c0..a0f5d0780 100644 --- a/src/backend/app/modules/Transaction/Provider/AirtelVoltTerraProvider.php +++ b/src/backend/app/modules/Transaction/Provider/AirtelVoltTerraProvider.php @@ -22,20 +22,16 @@ class AirtelVoltTerraProvider implements ITransactionProvider /** * DI will initialize the needed models. - * - * @param AirtelTransaction $airtelTransaction - * @param Transaction $transaction */ public function __construct( private AirtelTransaction $airtelTransaction, private Transaction $transaction, - ) { - } + ) {} public function saveTransaction(): void { - $this->airtelTransaction = new AirtelTransaction(); - $this->transaction = new Transaction(); + $this->airtelTransaction = new AirtelTransaction; + $this->transaction = new Transaction; // assign data $this->assignData(); @@ -43,10 +39,6 @@ public function saveTransaction(): void $this->saveData($this->airtelTransaction); } - /** - * @param bool $requestType - * @param Transaction $transaction - */ public function sendResult(bool $requestType, Transaction $transaction): void { if ($requestType) { @@ -81,19 +73,19 @@ public function validateRequest($request): bool throw new \Exception($validator->errors()->first()); } - $meterModel = new Meter(); + $meterModel = new Meter; - if (!$meter = $meterModel->findBySerialNumber($meterSerial)) { + if (! $meter = $meterModel->findBySerialNumber($meterSerial)) { throw new ModelNotFoundException('Meter not found with serial number you entered'); } - if (!$meterTariff = $meter->meterParameter->tariff) { + if (! $meterTariff = $meter->meterParameter->tariff) { throw new ModelNotFoundException('Tariff not found with meter serial number you entered'); } $customerId = $meter->MeterParameter->owner_id; - if (!$customerId) { + if (! $customerId) { throw new ModelNotFoundException('Customer not found with meter serial number you entered'); } $minimumPurchaseAmount = $meterTariff->minimum_purchase_amount ?? 0; @@ -172,7 +164,7 @@ public function saveCommonData(): Model public function addConflict(?string $message): void { - $conflict = new TransactionConflicts(); + $conflict = new TransactionConflicts; $conflict->state = $message; $conflict->transaction()->associate($this->airtelTransaction); $conflict->save(); diff --git a/src/backend/app/modules/Transaction/Provider/CashTransactionProvider.php b/src/backend/app/modules/Transaction/Provider/CashTransactionProvider.php index 318ac09a4..373a544d8 100644 --- a/src/backend/app/modules/Transaction/Provider/CashTransactionProvider.php +++ b/src/backend/app/modules/Transaction/Provider/CashTransactionProvider.php @@ -14,13 +14,12 @@ class CashTransactionProvider implements ITransactionProvider public function __construct( private CashTransaction $cashTransaction, private Transaction $transaction, - ) { - } + ) {} public function saveTransaction(): void { - $this->cashTransaction = new CashTransaction(); - $this->transaction = new Transaction(); + $this->cashTransaction = new CashTransaction; + $this->transaction = new Transaction; // assign data $this->assignData($this->validData); @@ -89,7 +88,7 @@ public function init($transaction): void public function addConflict(?string $message): void { - $conflict = new TransactionConflicts(); + $conflict = new TransactionConflicts; $conflict->state = $message; $conflict->transaction()->associate($this->cashTransaction); $conflict->save(); diff --git a/src/backend/app/modules/Transaction/Provider/TransactionAdapter.php b/src/backend/app/modules/Transaction/Provider/TransactionAdapter.php index 87217bcbf..a9a4cc1bf 100644 --- a/src/backend/app/modules/Transaction/Provider/TransactionAdapter.php +++ b/src/backend/app/modules/Transaction/Provider/TransactionAdapter.php @@ -12,9 +12,7 @@ class TransactionAdapter { /** - * @param ITransactionProvider $transactionProvider - * - * @return ITransactionProvider + * @param ITransactionProvider $transactionProvider */ public static function getTransaction($transactionProvider): ?ITransactionProvider { diff --git a/src/backend/app/modules/Transaction/Provider/VodacomTransactionProvider.php b/src/backend/app/modules/Transaction/Provider/VodacomTransactionProvider.php index 2864fa4f0..25fe9064b 100644 --- a/src/backend/app/modules/Transaction/Provider/VodacomTransactionProvider.php +++ b/src/backend/app/modules/Transaction/Provider/VodacomTransactionProvider.php @@ -18,7 +18,9 @@ class VodacomTransactionProvider implements ITransactionProvider { private VodacomTransaction $vodacomTransaction; + private Transaction $transaction; + private \SimpleXMLElement $valid_data; /** @@ -27,9 +29,9 @@ class VodacomTransactionProvider implements ITransactionProvider public function saveTransaction(): void { // initializes needed model - $this->vodacomTransaction = new VodacomTransaction(); + $this->vodacomTransaction = new VodacomTransaction; - $this->transaction = new Transaction(); + $this->transaction = new Transaction; // assign data $this->assignData($this->valid_data); @@ -39,18 +41,15 @@ public function saveTransaction(): void /** * Sends the final state of the transaction based on resultType. - * - * @param bool $requestType - * @param Transaction $transaction */ public function sendResult(bool $requestType, Transaction $transaction): void { - if (!app()->environment('production')) { + if (! app()->environment('production')) { return; } $requestContent = $this->prepareRequest($requestType); - $request = new Client(); + $request = new Client; try { $response = $request->post( @@ -67,7 +66,7 @@ public function sendResult(bool $requestType, Transaction $transaction): void ); // request was successful if ($response->getStatusCode() === 200) { - if (!$requestType) { + if (! $requestType) { Log::critical( 'Vodacom transaction cancelled', [ @@ -87,7 +86,7 @@ public function sendResult(bool $requestType, Transaction $transaction): void // vodacom returns 0 for confirmation and 999 for cancellation request // cast bool to int gives (0,1) as number. Multiply its inverse by // 999 gives 0 for true and 999 for false - $expectedResponseCode = (int) !$requestType * 999; + $expectedResponseCode = (int) ! $requestType * 999; if ((int) $xmlResponse->response->responseCode === $expectedResponseCode) { // mark transaction as done $this->vodacomTransaction->status = $requestType === true ? 1 : -1; @@ -125,7 +124,6 @@ public function sendResult(bool $requestType, Transaction $transaction): void * Validates incoming request * stores the request data to valid_data if request is valid. * - * @param $request * * @throws \Exception */ @@ -184,8 +182,6 @@ public function confirm(): void /** * The message which is been typed by the user. - * - * @return string */ public function getMessage(): string { @@ -194,8 +190,6 @@ public function getMessage(): string /** * The amount sent by the user. - * - * @return int */ public function getAmount(): int { @@ -204,8 +198,6 @@ public function getAmount(): int /** * The number, which sent money. - * - * @return string */ public function getSender(): string { @@ -224,8 +216,6 @@ public function saveCommonData(): Model /** * Assign request data to model. - * - * @param $data */ private function assignData(\SimpleXMLElement $data): void { @@ -254,7 +244,7 @@ private function prepareRequest(bool $requestType): string $providerPassword = $this->encryptProviderPassword($time); $phonePassword = $this->encryptPhonePassword(); - if (!$requestType) { + if (! $requestType) { $requestContent = $this->serveResult( $providerPassword, $phonePassword, @@ -278,13 +268,11 @@ private function prepareRequest(bool $requestType): string /** * Generates result for cancel/approve transaction. * - * @param string $serviceProviderPassword - * @param string $phonePassword - * @param string $time Y-md H:i:s - * @param string $result - * @param int $resultCode - * - * @return string + * @param string $serviceProviderPassword + * @param string $phonePassword + * @param string $time Y-md H:i:s + * @param string $result + * @param int $resultCode */ private function serveResult( $serviceProviderPassword, @@ -359,7 +347,7 @@ public function init($transaction): void public function addConflict(?string $message): void { - $conflict = new TransactionConflicts(); + $conflict = new TransactionConflicts; $conflict->state = $message; $conflict->transaction()->associate($this->vodacomTransaction); $conflict->save(); diff --git a/src/backend/app/modules/Transaction/SolarHomeSystemTransactionService.php b/src/backend/app/modules/Transaction/SolarHomeSystemTransactionService.php index 14f01472f..4d27b2493 100644 --- a/src/backend/app/modules/Transaction/SolarHomeSystemTransactionService.php +++ b/src/backend/app/modules/Transaction/SolarHomeSystemTransactionService.php @@ -7,9 +7,7 @@ class SolarHomeSystemTransactionService { - public function __construct(private Transaction $transaction) - { - } + public function __construct(private Transaction $transaction) {} public function search( ?string $serialNumber = null, diff --git a/src/backend/app/modules/Transaction/TransactionPaymentProcessor.php b/src/backend/app/modules/Transaction/TransactionPaymentProcessor.php index 3e8e020b0..ea4c9c78d 100644 --- a/src/backend/app/modules/Transaction/TransactionPaymentProcessor.php +++ b/src/backend/app/modules/Transaction/TransactionPaymentProcessor.php @@ -16,6 +16,7 @@ class TransactionPaymentProcessor SolarHomeSystem::RELATION_NAME => ApplianceTransactionProcessor::class, EBike::RELATION_NAME => ApplianceTransactionProcessor::class, ]; + protected const QUEUE_BY_DEVICE_TYPE = [ Meter::RELATION_NAME => 'energy', SolarHomeSystem::RELATION_NAME => 'payment', diff --git a/src/backend/app/modules/Transaction/TransactionService.php b/src/backend/app/modules/Transaction/TransactionService.php index 9bfc8ca1f..95d72e253 100644 --- a/src/backend/app/modules/Transaction/TransactionService.php +++ b/src/backend/app/modules/Transaction/TransactionService.php @@ -18,8 +18,11 @@ class TransactionService implements IAssociative, IBaseService { public const YESTERDAY = 0; + public const SAME_DAY_LAST_WEEK = 1; + public const LAST_SEVEN_DAYS = 2; + public const LAST_THIRTY_DAYS = 3; public const PERCENTAGE_DIVIDER = 100; @@ -30,8 +33,7 @@ public function __construct( private SolarHomeSystemTransactionService $solarHomeSystemTransactionService, private ApplianceTransactionService $applianceTransactionService, private EBikeTransactionService $eBikeTransactionService, - ) { - } + ) {} private function getTotalAmountOfConfirmedTransaction($transactionIds) { @@ -94,12 +96,12 @@ public function determinePeriod($period): ?array $duration = new \DateInterval('P1D'); $comparisonPeriod = [ 'currentPeriod' => [ - 'begins' => (new \DateTime())->format('Y-m-d 00:00:00'), - 'ends' => (new \DateTime())->format('Y-m-d 23:59:59'), + 'begins' => (new \DateTime)->format('Y-m-d 00:00:00'), + 'ends' => (new \DateTime)->format('Y-m-d 23:59:59'), ], 'lastPeriod' => [ - 'begins' => (new \DateTime())->sub($duration)->format('Y-m-d 00:00:00'), - 'ends' => (new \DateTime())->sub($duration)->format('Y-m-d 23:59:59'), + 'begins' => (new \DateTime)->sub($duration)->format('Y-m-d 00:00:00'), + 'ends' => (new \DateTime)->sub($duration)->format('Y-m-d 23:59:59'), ], ]; break; @@ -107,12 +109,12 @@ public function determinePeriod($period): ?array $duration = new \DateInterval('P7D'); $comparisonPeriod = [ 'currentPeriod' => [ - 'begins' => (new \DateTime())->format('Y-m-d 00:00:00'), - 'ends' => (new \DateTime())->format('Y-m-d 23:59:59'), + 'begins' => (new \DateTime)->format('Y-m-d 00:00:00'), + 'ends' => (new \DateTime)->format('Y-m-d 23:59:59'), ], 'lastPeriod' => [ - 'begins' => (new \DateTime())->sub($duration)->format('Y-m-d 00:00:00'), - 'ends' => (new \DateTime())->sub($duration)->format('Y-m-d 23:59:59'), + 'begins' => (new \DateTime)->sub($duration)->format('Y-m-d 00:00:00'), + 'ends' => (new \DateTime)->sub($duration)->format('Y-m-d 23:59:59'), ], ]; break; @@ -121,12 +123,12 @@ public function determinePeriod($period): ?array $lastDuration = new \DateInterval('P14D'); $comparisonPeriod = [ 'currentPeriod' => [ - 'begins' => (new \DateTime())->sub($currentDuration)->format('Y-m-d'), - 'ends' => (new \DateTime())->format('Y-m-d'), + 'begins' => (new \DateTime)->sub($currentDuration)->format('Y-m-d'), + 'ends' => (new \DateTime)->format('Y-m-d'), ], 'lastPeriod' => [ - 'begins' => (new \DateTime())->sub($lastDuration)->format('Y-m-d'), - 'ends' => (new \DateTime())->sub($currentDuration)->format('Y-m-d'), + 'begins' => (new \DateTime)->sub($lastDuration)->format('Y-m-d'), + 'ends' => (new \DateTime)->sub($currentDuration)->format('Y-m-d'), ], ]; break; @@ -135,12 +137,12 @@ public function determinePeriod($period): ?array $lastDuration = new \DateInterval('P60D'); $comparisonPeriod = [ 'currentPeriod' => [ - 'begins' => (new \DateTime())->sub($currentDuration)->format('Y-m-d'), - 'ends' => (new \DateTime())->format('Y-m-d'), + 'begins' => (new \DateTime)->sub($currentDuration)->format('Y-m-d'), + 'ends' => (new \DateTime)->format('Y-m-d'), ], 'lastPeriod' => [ - 'begins' => (new \DateTime())->sub($lastDuration)->format('Y-m-d'), - 'ends' => (new \DateTime())->sub($currentDuration)->format('Y-m-d'), + 'begins' => (new \DateTime)->sub($lastDuration)->format('Y-m-d'), + 'ends' => (new \DateTime)->sub($currentDuration)->format('Y-m-d'), ], ]; break; diff --git a/src/backend/app/modules/User/Events/UserCreatedEvent.php b/src/backend/app/modules/User/Events/UserCreatedEvent.php index 0e9a16609..7466dfa93 100644 --- a/src/backend/app/modules/User/Events/UserCreatedEvent.php +++ b/src/backend/app/modules/User/Events/UserCreatedEvent.php @@ -8,7 +8,5 @@ class UserCreatedEvent { - public function __construct(public User $user, public bool $shouldSyncUser) - { - } + public function __construct(public User $user, public bool $shouldSyncUser) {} } diff --git a/src/backend/app/modules/User/UserListener.php b/src/backend/app/modules/User/UserListener.php index 66ff8a0a2..94dca0b51 100644 --- a/src/backend/app/modules/User/UserListener.php +++ b/src/backend/app/modules/User/UserListener.php @@ -19,8 +19,7 @@ public function __construct( private TicketUserService $ticketUserService, private CompanyService $companyService, private MailHelperInterface $mailHelper, - ) { - } + ) {} public function handle($event): void { diff --git a/src/backend/database/factories/GeographicalInformationFactory.php b/src/backend/database/factories/GeographicalInformationFactory.php index c0a4da762..78bc235f7 100644 --- a/src/backend/database/factories/GeographicalInformationFactory.php +++ b/src/backend/database/factories/GeographicalInformationFactory.php @@ -11,7 +11,7 @@ class GeographicalInformationFactory extends Factory private function add_random_offset_to_coordinates(string $coord_string, int $distance): string { - list($lat, $lng) = explode(',', $coord_string); + [$lat, $lng] = explode(',', $coord_string); $lat = (float) $lat; $lng = (float) $lng; diff --git a/src/backend/database/factories/Person/PersonFactory.php b/src/backend/database/factories/Person/PersonFactory.php index 6d0c92dd6..3a3fee240 100644 --- a/src/backend/database/factories/Person/PersonFactory.php +++ b/src/backend/database/factories/Person/PersonFactory.php @@ -41,8 +41,6 @@ public function isAgent($village_name = 'Demo') /** * Define the model's default state. - * - * @return array */ public function definition(): array { diff --git a/src/backend/database/factories/VodacomTransactionFactory.php b/src/backend/database/factories/VodacomTransactionFactory.php index 3f14640ba..ed7982a77 100644 --- a/src/backend/database/factories/VodacomTransactionFactory.php +++ b/src/backend/database/factories/VodacomTransactionFactory.php @@ -16,8 +16,6 @@ class VodacomTransactionFactory extends Factory /** * Define the model's default state. - * - * @return array */ public function definition(): array { diff --git a/src/backend/database/migrations/2022_03_10_120408_create_companies_table.php b/src/backend/database/migrations/2022_03_10_120408_create_companies_table.php index f24dcc24e..9a877b2be 100644 --- a/src/backend/database/migrations/2022_03_10_120408_create_companies_table.php +++ b/src/backend/database/migrations/2022_03_10_120408_create_companies_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_03_10_134450_create_company_databases_table.php b/src/backend/database/migrations/2022_03_10_134450_create_company_databases_table.php index b2a1403cc..3d35c229d 100644 --- a/src/backend/database/migrations/2022_03_10_134450_create_company_databases_table.php +++ b/src/backend/database/migrations/2022_03_10_134450_create_company_databases_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_06_18_204649_create_database_proxies_table.php b/src/backend/database/migrations/2022_06_18_204649_create_database_proxies_table.php index bacc9187c..b602bc8da 100644 --- a/src/backend/database/migrations/2022_06_18_204649_create_database_proxies_table.php +++ b/src/backend/database/migrations/2022_06_18_204649_create_database_proxies_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ public function up(): void { Schema::create('database_proxies', function (Blueprint $table) { diff --git a/src/backend/database/migrations/2022_06_21_102121_create_mpm_plugins_table.php b/src/backend/database/migrations/2022_06_21_102121_create_mpm_plugins_table.php index ec38f54ba..e4c72fbec 100644 --- a/src/backend/database/migrations/2022_06_21_102121_create_mpm_plugins_table.php +++ b/src/backend/database/migrations/2022_06_21_102121_create_mpm_plugins_table.php @@ -7,7 +7,8 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_06_21_122032_add_email_to_companies_table.php b/src/backend/database/migrations/2022_06_21_122032_add_email_to_companies_table.php index 3c068cf02..97f813cff 100644 --- a/src/backend/database/migrations/2022_06_21_122032_add_email_to_companies_table.php +++ b/src/backend/database/migrations/2022_06_21_122032_add_email_to_companies_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_07_05_093903_add_tail_tag_to_mpm_plugins_table.php b/src/backend/database/migrations/2022_07_05_093903_add_tail_tag_to_mpm_plugins_table.php index 7ab9a9325..ed8a4129b 100644 --- a/src/backend/database/migrations/2022_07_05_093903_add_tail_tag_to_mpm_plugins_table.php +++ b/src/backend/database/migrations/2022_07_05_093903_add_tail_tag_to_mpm_plugins_table.php @@ -7,7 +7,8 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_07_07_140545_add_installation_command_to_mpm_plugins_table.php b/src/backend/database/migrations/2022_07_07_140545_add_installation_command_to_mpm_plugins_table.php index dd8b35d22..f3f527ed3 100644 --- a/src/backend/database/migrations/2022_07_07_140545_add_installation_command_to_mpm_plugins_table.php +++ b/src/backend/database/migrations/2022_07_07_140545_add_installation_command_to_mpm_plugins_table.php @@ -7,7 +7,8 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_09_20_0000000_add_bulk_registration_to_mpm_plugin_table.php b/src/backend/database/migrations/2022_09_20_0000000_add_bulk_registration_to_mpm_plugin_table.php index c579020a0..195bafe9a 100644 --- a/src/backend/database/migrations/2022_09_20_0000000_add_bulk_registration_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2022_09_20_0000000_add_bulk_registration_to_mpm_plugin_table.php @@ -5,7 +5,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class () extends Migration { +return new class extends Migration +{ public function up() { DB::table('mpm_plugins')->insert([ @@ -24,7 +25,7 @@ public function up() public function down() { DB::table('mpm_plugins') - ->where('id', MpmPlugin::BULK_REGISTRATION) - ->delete(); + ->where('id', MpmPlugin::BULK_REGISTRATION) + ->delete(); } }; diff --git a/src/backend/database/migrations/2022_11_08_0000000_add_viber_messaging_to_mpm_plugin_table.php b/src/backend/database/migrations/2022_11_08_0000000_add_viber_messaging_to_mpm_plugin_table.php index b53ad3bc0..77a0db62d 100644 --- a/src/backend/database/migrations/2022_11_08_0000000_add_viber_messaging_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2022_11_08_0000000_add_viber_messaging_to_mpm_plugin_table.php @@ -5,7 +5,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class () extends Migration { +return new class extends Migration +{ public function up() { DB::table('mpm_plugins')->insert([ @@ -24,7 +25,7 @@ public function up() public function down() { DB::table('mpm_plugins') - ->where('id', MpmPlugin::VIBER_MESSAGING) - ->delete(); + ->where('id', MpmPlugin::VIBER_MESSAGING) + ->delete(); } }; diff --git a/src/backend/database/migrations/2022_11_08_154321_update_email_field_for_database_proxies_table.php b/src/backend/database/migrations/2022_11_08_154321_update_email_field_for_database_proxies_table.php index e0ef9444c..077eed436 100644 --- a/src/backend/database/migrations/2022_11_08_154321_update_email_field_for_database_proxies_table.php +++ b/src/backend/database/migrations/2022_11_08_154321_update_email_field_for_database_proxies_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * @@ -24,7 +25,6 @@ public function up() */ public function down() { - Schema::table('database_proxies', function (Blueprint $table) { - }); + Schema::table('database_proxies', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/2022_11_21_000000_add_wave_money_payment_to_mpm_plugin_table.php b/src/backend/database/migrations/2022_11_21_000000_add_wave_money_payment_to_mpm_plugin_table.php index 4a8921bcd..f09c3f104 100644 --- a/src/backend/database/migrations/2022_11_21_000000_add_wave_money_payment_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2022_11_21_000000_add_wave_money_payment_to_mpm_plugin_table.php @@ -5,7 +5,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class () extends Migration { +return new class extends Migration +{ public function up() { DB::table('mpm_plugins')->insert([ @@ -24,7 +25,7 @@ public function up() public function down() { DB::table('mpm_plugins') - ->where('id', MpmPlugin::WAVE_MONEY_PAYMENT_PROVIDER) - ->delete(); + ->where('id', MpmPlugin::WAVE_MONEY_PAYMENT_PROVIDER) + ->delete(); } }; diff --git a/src/backend/database/migrations/2022_11_25_091725_create_company_jobs.php b/src/backend/database/migrations/2022_11_25_091725_create_company_jobs.php index 8fe3d2cb1..47ccca2a8 100644 --- a/src/backend/database/migrations/2022_11_25_091725_create_company_jobs.php +++ b/src/backend/database/migrations/2022_11_25_091725_create_company_jobs.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_11_29_000000_add_micro_star_to_mpm_plugin_table.php b/src/backend/database/migrations/2022_11_29_000000_add_micro_star_to_mpm_plugin_table.php index 655cb14fd..dada4f14c 100644 --- a/src/backend/database/migrations/2022_11_29_000000_add_micro_star_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2022_11_29_000000_add_micro_star_to_mpm_plugin_table.php @@ -5,7 +5,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class () extends Migration { +return new class extends Migration +{ public function up() { DB::table('mpm_plugins')->insert([ @@ -24,7 +25,7 @@ public function up() public function down() { DB::table('mpm_plugins') - ->where('id', MpmPlugin::MICRO_STAR_METERS) - ->delete(); + ->where('id', MpmPlugin::MICRO_STAR_METERS) + ->delete(); } }; diff --git a/src/backend/database/migrations/2022_12_12_000000_add_root_class_to_mpm_plugins_table.php b/src/backend/database/migrations/2022_12_12_000000_add_root_class_to_mpm_plugins_table.php index 8ecebf7bd..bfbae2468 100644 --- a/src/backend/database/migrations/2022_12_12_000000_add_root_class_to_mpm_plugins_table.php +++ b/src/backend/database/migrations/2022_12_12_000000_add_root_class_to_mpm_plugins_table.php @@ -7,7 +7,8 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_14_12_000000_add_sun_king_to_mpm_plugin_table.php b/src/backend/database/migrations/2022_14_12_000000_add_sun_king_to_mpm_plugin_table.php index fa533e156..4b6b7a24c 100644 --- a/src/backend/database/migrations/2022_14_12_000000_add_sun_king_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2022_14_12_000000_add_sun_king_to_mpm_plugin_table.php @@ -5,7 +5,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class () extends Migration { +return new class extends Migration +{ public function up() { DB::table('mpm_plugins')->insert([ @@ -25,7 +26,7 @@ public function up() public function down() { DB::table('mpm_plugins') - ->where('id', MpmPlugin::SUN_KING_SHS) - ->delete(); + ->where('id', MpmPlugin::SUN_KING_SHS) + ->delete(); } }; diff --git a/src/backend/database/migrations/2023_01_24_110414_create_protected_pages_table.php b/src/backend/database/migrations/2023_01_24_110414_create_protected_pages_table.php index f631c9b35..c5e12285d 100644 --- a/src/backend/database/migrations/2023_01_24_110414_create_protected_pages_table.php +++ b/src/backend/database/migrations/2023_01_24_110414_create_protected_pages_table.php @@ -6,7 +6,8 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/2023_01_24_112359_add_protected_page_password_to_companies_table.php b/src/backend/database/migrations/2023_01_24_112359_add_protected_page_password_to_companies_table.php index 654468da4..802133631 100644 --- a/src/backend/database/migrations/2023_01_24_112359_add_protected_page_password_to_companies_table.php +++ b/src/backend/database/migrations/2023_01_24_112359_add_protected_page_password_to_companies_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/2023_02_06_000000_add_gome_long_to_mpm_plugin_table.php b/src/backend/database/migrations/2023_02_06_000000_add_gome_long_to_mpm_plugin_table.php index a102559e0..4b0313f6d 100644 --- a/src/backend/database/migrations/2023_02_06_000000_add_gome_long_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2023_02_06_000000_add_gome_long_to_mpm_plugin_table.php @@ -5,7 +5,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class () extends Migration { +return new class extends Migration +{ public function up() { DB::table('mpm_plugins')->insert([ @@ -25,7 +26,7 @@ public function up() public function down() { DB::table('mpm_plugins') - ->where('id', MpmPlugin::GOME_LONG_METERS) - ->delete(); + ->where('id', MpmPlugin::GOME_LONG_METERS) + ->delete(); } }; diff --git a/src/backend/database/migrations/2023_04_02_121811_add_wavecom_to_mpm_plugin_table.php b/src/backend/database/migrations/2023_04_02_121811_add_wavecom_to_mpm_plugin_table.php index bc5ccc6dd..f918b822e 100644 --- a/src/backend/database/migrations/2023_04_02_121811_add_wavecom_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2023_04_02_121811_add_wavecom_to_mpm_plugin_table.php @@ -5,7 +5,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class () extends Migration { +return new class extends Migration +{ public function up() { DB::table('mpm_plugins')->insert([ @@ -25,7 +26,7 @@ public function up() public function down() { DB::table('mpm_plugins') - ->where('id', MpmPlugin::WAVECOM_PAYMENT_PROVIDER) - ->delete(); + ->where('id', MpmPlugin::WAVECOM_PAYMENT_PROVIDER) + ->delete(); } }; diff --git a/src/backend/database/migrations/2023_11_23_134944_update_description_column_in_mpm_plugins_table.php b/src/backend/database/migrations/2023_11_23_134944_update_description_column_in_mpm_plugins_table.php index a9b567b2f..f15ff5947 100644 --- a/src/backend/database/migrations/2023_11_23_134944_update_description_column_in_mpm_plugins_table.php +++ b/src/backend/database/migrations/2023_11_23_134944_update_description_column_in_mpm_plugins_table.php @@ -7,7 +7,8 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/2024_01_01_000000_add_daly_bms_to_mpm_plugin_table.php b/src/backend/database/migrations/2024_01_01_000000_add_daly_bms_to_mpm_plugin_table.php index 9a90e9d8c..ab3fee8ec 100644 --- a/src/backend/database/migrations/2024_01_01_000000_add_daly_bms_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2024_01_01_000000_add_daly_bms_to_mpm_plugin_table.php @@ -5,7 +5,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class () extends Migration { +return new class extends Migration +{ public function up() { DB::table('mpm_plugins')->insert([ @@ -25,7 +26,7 @@ public function up() public function down() { DB::table('mpm_plugins') - ->where('id', MpmPlugin::DALY_BMS) - ->delete(); + ->where('id', MpmPlugin::DALY_BMS) + ->delete(); } }; diff --git a/src/backend/database/migrations/2024_01_12_000000_add_angaza_to_mpm_plugin_table.php b/src/backend/database/migrations/2024_01_12_000000_add_angaza_to_mpm_plugin_table.php index 1303b87fa..47144188a 100644 --- a/src/backend/database/migrations/2024_01_12_000000_add_angaza_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2024_01_12_000000_add_angaza_to_mpm_plugin_table.php @@ -5,7 +5,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class () extends Migration { +return new class extends Migration +{ public function up() { DB::table('mpm_plugins')->insert([ @@ -25,7 +26,7 @@ public function up() public function down() { DB::table('mpm_plugins') - ->where('id', MpmPlugin::AGAZA_SHS) - ->delete(); + ->where('id', MpmPlugin::AGAZA_SHS) + ->delete(); } }; diff --git a/src/backend/database/migrations/2024_02_07_100345_create_usage_types_table.php b/src/backend/database/migrations/2024_02_07_100345_create_usage_types_table.php index 88e95fd43..70b197d4b 100644 --- a/src/backend/database/migrations/2024_02_07_100345_create_usage_types_table.php +++ b/src/backend/database/migrations/2024_02_07_100345_create_usage_types_table.php @@ -6,7 +6,8 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/2024_02_07_113319_add_usage_type_column_to_mpm_plugins_table.php b/src/backend/database/migrations/2024_02_07_113319_add_usage_type_column_to_mpm_plugins_table.php index a347ab7cb..4f77448ac 100644 --- a/src/backend/database/migrations/2024_02_07_113319_add_usage_type_column_to_mpm_plugins_table.php +++ b/src/backend/database/migrations/2024_02_07_113319_add_usage_type_column_to_mpm_plugins_table.php @@ -7,7 +7,8 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/2024_03_21_121825_add_message_and_trace_columns_to_company_jobs_table.php b/src/backend/database/migrations/2024_03_21_121825_add_message_and_trace_columns_to_company_jobs_table.php index 86819c41f..6432a3d10 100644 --- a/src/backend/database/migrations/2024_03_21_121825_add_message_and_trace_columns_to_company_jobs_table.php +++ b/src/backend/database/migrations/2024_03_21_121825_add_message_and_trace_columns_to_company_jobs_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2014_10_12_000000_create_users_table.php b/src/backend/database/migrations/micropowermanager/2014_10_12_000000_create_users_table.php index fb91c6e07..c888ab131 100644 --- a/src/backend/database/migrations/micropowermanager/2014_10_12_000000_create_users_table.php +++ b/src/backend/database/migrations/micropowermanager/2014_10_12_000000_create_users_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2014_10_12_100000_create_password_resets_table.php b/src/backend/database/migrations/micropowermanager/2014_10_12_100000_create_password_resets_table.php index 0ba694725..4caa4fddf 100644 --- a/src/backend/database/migrations/micropowermanager/2014_10_12_100000_create_password_resets_table.php +++ b/src/backend/database/migrations/micropowermanager/2014_10_12_100000_create_password_resets_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_24_195615_create_vodacom_transactions_table.php b/src/backend/database/migrations/micropowermanager/2018_05_24_195615_create_vodacom_transactions_table.php index 18a985c46..a88d5b834 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_24_195615_create_vodacom_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_24_195615_create_vodacom_transactions_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_24_201051_create_transactions_table.php b/src/backend/database/migrations/micropowermanager/2018_05_24_201051_create_transactions_table.php index 648c7237f..184752465 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_24_201051_create_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_24_201051_create_transactions_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_24_213335_create_airtel_transactions_table.php b/src/backend/database/migrations/micropowermanager/2018_05_24_213335_create_airtel_transactions_table.php index 1df046d52..7d6b4410e 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_24_213335_create_airtel_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_24_213335_create_airtel_transactions_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_25_131106_create_payment_histories_table.php b/src/backend/database/migrations/micropowermanager/2018_05_25_131106_create_payment_histories_table.php index a77d900e5..78b839949 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_25_131106_create_payment_histories_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_25_131106_create_payment_histories_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_25_131119_create_meter_tariffs_table.php b/src/backend/database/migrations/micropowermanager/2018_05_25_131119_create_meter_tariffs_table.php index e13d89193..d268b56c6 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_25_131119_create_meter_tariffs_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_25_131119_create_meter_tariffs_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_29_071453_create_addresses_table.php b/src/backend/database/migrations/micropowermanager/2018_05_29_071453_create_addresses_table.php index 9717baef7..5d977f9c0 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_29_071453_create_addresses_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_29_071453_create_addresses_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_29_080926_create_geographical_informations_table.php b/src/backend/database/migrations/micropowermanager/2018_05_29_080926_create_geographical_informations_table.php index 597f17d55..ed40ac120 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_29_080926_create_geographical_informations_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_29_080926_create_geographical_informations_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_29_140926_create_meter_types_table.php b/src/backend/database/migrations/micropowermanager/2018_05_29_140926_create_meter_types_table.php index b478b7158..079386382 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_29_140926_create_meter_types_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_29_140926_create_meter_types_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Reverse the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_30_124521_create_meters_table.php b/src/backend/database/migrations/micropowermanager/2018_05_30_124521_create_meters_table.php index 0389ee683..8c6c3f749 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_30_124521_create_meters_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_30_124521_create_meters_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_31_071601_create_manufacturers_table.php b/src/backend/database/migrations/micropowermanager/2018_05_31_071601_create_manufacturers_table.php index 12342d0ce..89bc9017f 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_31_071601_create_manufacturers_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_31_071601_create_manufacturers_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_31_075346_create_cities_table.php b/src/backend/database/migrations/micropowermanager/2018_05_31_075346_create_cities_table.php index aff7f86b7..1f2b6e787 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_31_075346_create_cities_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_31_075346_create_cities_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_31_075353_create_countries_table.php b/src/backend/database/migrations/micropowermanager/2018_05_31_075353_create_countries_table.php index 335d12b77..af45e40cd 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_31_075353_create_countries_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_31_075353_create_countries_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_06_01_141845_create_people_table.php b/src/backend/database/migrations/micropowermanager/2018_06_01_141845_create_people_table.php index 8dc05a7af..ee14b43c0 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_01_141845_create_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_01_141845_create_people_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_06_04_124637_create__roles_table.php b/src/backend/database/migrations/micropowermanager/2018_06_04_124637_create__roles_table.php index 23a5983ca..fb5048ca6 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_04_124637_create__roles_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_04_124637_create__roles_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_06_07_155444_create_meter_tokens_table.php b/src/backend/database/migrations/micropowermanager/2018_06_07_155444_create_meter_tokens_table.php index aa18106dd..167fd8f83 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_07_155444_create_meter_tokens_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_07_155444_create_meter_tokens_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_06_08_102610_create_meter_parameters_table.php b/src/backend/database/migrations/micropowermanager/2018_06_08_102610_create_meter_parameters_table.php index 0123e3aad..7c299597c 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_08_102610_create_meter_parameters_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_08_102610_create_meter_parameters_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_06_11_131951_create_sms_table.php b/src/backend/database/migrations/micropowermanager/2018_06_11_131951_create_sms_table.php index b1d9d8123..b246ab2c8 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_11_131951_create_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_11_131951_create_sms_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_06_15_082352_create_transaction_conflicts_table.php b/src/backend/database/migrations/micropowermanager/2018_06_15_082352_create_transaction_conflicts_table.php index c9ca7c8cc..e99ca2365 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_15_082352_create_transaction_conflicts_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_15_082352_create_transaction_conflicts_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_06_28_080905_create_access_rates_table.php b/src/backend/database/migrations/micropowermanager/2018_06_28_080905_create_access_rates_table.php index 9c811792b..920629066 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_28_080905_create_access_rates_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_28_080905_create_access_rates_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_06_28_080914_create_access_rate_payments_table.php b/src/backend/database/migrations/micropowermanager/2018_06_28_080914_create_access_rate_payments_table.php index 293f96abf..6dcc5df76 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_28_080914_create_access_rate_payments_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_28_080914_create_access_rate_payments_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_07_11_075002_create_permission_tables.php b/src/backend/database/migrations/micropowermanager/2018_07_11_075002_create_permission_tables.php index 647732e73..f98539fa5 100644 --- a/src/backend/database/migrations/micropowermanager/2018_07_11_075002_create_permission_tables.php +++ b/src/backend/database/migrations/micropowermanager/2018_07_11_075002_create_permission_tables.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_07_12_133700_create_loans_table.php b/src/backend/database/migrations/micropowermanager/2018_07_12_133700_create_loans_table.php index 130cfde42..2d370a4fa 100644 --- a/src/backend/database/migrations/micropowermanager/2018_07_12_133700_create_loans_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_07_12_133700_create_loans_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_07_12_134253_create_customers_table.php b/src/backend/database/migrations/micropowermanager/2018_07_12_134253_create_customers_table.php index 04e0b0554..865dcd793 100644 --- a/src/backend/database/migrations/micropowermanager/2018_07_12_134253_create_customers_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_07_12_134253_create_customers_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_10_04_195503_create_histories_table.php b/src/backend/database/migrations/micropowermanager/2018_10_04_195503_create_histories_table.php index 6f49a9ea5..67f7e0441 100644 --- a/src/backend/database/migrations/micropowermanager/2018_10_04_195503_create_histories_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_10_04_195503_create_histories_table.php @@ -4,11 +4,10 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. - * - * @return void */ public function up(): void { @@ -24,8 +23,6 @@ public function up(): void /** * Reverse the migrations. - * - * @return void */ public function down(): void { diff --git a/src/backend/database/migrations/micropowermanager/2018_10_12_110924_create_meter_consumptions_table.php b/src/backend/database/migrations/micropowermanager/2018_10_12_110924_create_meter_consumptions_table.php index d7d85ee9b..98a8dedc8 100644 --- a/src/backend/database/migrations/micropowermanager/2018_10_12_110924_create_meter_consumptions_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_10_12_110924_create_meter_consumptions_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_10_12_123911_create_payment_profiles_table.php b/src/backend/database/migrations/micropowermanager/2018_10_12_123911_create_payment_profiles_table.php index dd741492b..98c5982f6 100644 --- a/src/backend/database/migrations/micropowermanager/2018_10_12_123911_create_payment_profiles_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_10_12_123911_create_payment_profiles_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_11_29_090603_create_clusters_table.php b/src/backend/database/migrations/micropowermanager/2018_11_29_090603_create_clusters_table.php index c3b491cd9..bc99be88a 100644 --- a/src/backend/database/migrations/micropowermanager/2018_11_29_090603_create_clusters_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_11_29_090603_create_clusters_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_12_05_144906_create_revenues_table.php b/src/backend/database/migrations/micropowermanager/2018_12_05_144906_create_revenues_table.php index 0560c08da..fd00a7757 100644 --- a/src/backend/database/migrations/micropowermanager/2018_12_05_144906_create_revenues_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_12_05_144906_create_revenues_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_12_11_083717_create_connection_types_table.php b/src/backend/database/migrations/micropowermanager/2018_12_11_083717_create_connection_types_table.php index e45b79bd9..fe0131188 100644 --- a/src/backend/database/migrations/micropowermanager/2018_12_11_083717_create_connection_types_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_12_11_083717_create_connection_types_table.php @@ -6,7 +6,8 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_12_13_083722_create_targets_table.php b/src/backend/database/migrations/micropowermanager/2018_12_13_083722_create_targets_table.php index fdfe166e4..1bc921da4 100644 --- a/src/backend/database/migrations/micropowermanager/2018_12_13_083722_create_targets_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_12_13_083722_create_targets_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_12_13_100738_create_sub_targets_table.php b/src/backend/database/migrations/micropowermanager/2018_12_13_100738_create_sub_targets_table.php index 79190f40f..5cacf555c 100644 --- a/src/backend/database/migrations/micropowermanager/2018_12_13_100738_create_sub_targets_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_12_13_100738_create_sub_targets_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_04_19_083645_customer_group.php b/src/backend/database/migrations/micropowermanager/2019_04_19_083645_customer_group.php index cab29f323..89a2eb423 100644 --- a/src/backend/database/migrations/micropowermanager/2019_04_19_083645_customer_group.php +++ b/src/backend/database/migrations/micropowermanager/2019_04_19_083645_customer_group.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_04_25_092438_create_sub_connection_types_table.php b/src/backend/database/migrations/micropowermanager/2019_04_25_092438_create_sub_connection_types_table.php index b0c014c36..1c077adb6 100644 --- a/src/backend/database/migrations/micropowermanager/2019_04_25_092438_create_sub_connection_types_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_04_25_092438_create_sub_connection_types_table.php @@ -6,11 +6,10 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. - * - * @return void */ public function up(): void { @@ -33,8 +32,6 @@ public function up(): void /** * Reverse the migrations. - * - * @return void */ public function down(): void { diff --git a/src/backend/database/migrations/micropowermanager/2019_05_01_103123_create_connection_groups_table.php b/src/backend/database/migrations/micropowermanager/2019_05_01_103123_create_connection_groups_table.php index b97dd78d9..92551afe4 100644 --- a/src/backend/database/migrations/micropowermanager/2019_05_01_103123_create_connection_groups_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_05_01_103123_create_connection_groups_table.php @@ -6,7 +6,8 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_05_15_122118_reports.php b/src/backend/database/migrations/micropowermanager/2019_05_15_122118_reports.php index 076adfe74..b66cda092 100644 --- a/src/backend/database/migrations/micropowermanager/2019_05_15_122118_reports.php +++ b/src/backend/database/migrations/micropowermanager/2019_05_15_122118_reports.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_06_24_160040_create_mini_grids_table.php b/src/backend/database/migrations/micropowermanager/2019_06_24_160040_create_mini_grids_table.php index bae31d4ee..616fd839f 100644 --- a/src/backend/database/migrations/micropowermanager/2019_06_24_160040_create_mini_grids_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_06_24_160040_create_mini_grids_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_07_01_133655_create_maintenance_users_table.php b/src/backend/database/migrations/micropowermanager/2019_07_01_133655_create_maintenance_users_table.php index 2ecd0e202..e40e79039 100644 --- a/src/backend/database/migrations/micropowermanager/2019_07_01_133655_create_maintenance_users_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_07_01_133655_create_maintenance_users_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_11_06_121116_create_energies_table.php b/src/backend/database/migrations/micropowermanager/2019_11_06_121116_create_energies_table.php index 0028c9e56..d668d24f8 100644 --- a/src/backend/database/migrations/micropowermanager/2019_11_06_121116_create_energies_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_11_06_121116_create_energies_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_11_15_102431_create_solars_table.php b/src/backend/database/migrations/micropowermanager/2019_11_15_102431_create_solars_table.php index d9bdc6141..8bd4a4edd 100644 --- a/src/backend/database/migrations/micropowermanager/2019_11_15_102431_create_solars_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_11_15_102431_create_solars_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_11_26_063009_create_batteries_table.php b/src/backend/database/migrations/micropowermanager/2019_11_26_063009_create_batteries_table.php index 74e4824ad..788f00238 100644 --- a/src/backend/database/migrations/micropowermanager/2019_11_26_063009_create_batteries_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_11_26_063009_create_batteries_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_12_16_090907_create_assets_table.php b/src/backend/database/migrations/micropowermanager/2019_12_16_090907_create_assets_table.php index c781d65ee..7c2c0ec40 100644 --- a/src/backend/database/migrations/micropowermanager/2019_12_16_090907_create_assets_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_12_16_090907_create_assets_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_12_16_091934_create_asset_types_table.php b/src/backend/database/migrations/micropowermanager/2019_12_16_091934_create_asset_types_table.php index afa6517bd..1c165f0ca 100644 --- a/src/backend/database/migrations/micropowermanager/2019_12_16_091934_create_asset_types_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_12_16_091934_create_asset_types_table.php @@ -6,11 +6,10 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. - * - * @return void */ public function up(): void { @@ -24,29 +23,27 @@ public function up(): void // Insert initial data DB::connection('shard')->table('asset_types')->insert( [ - [ - 'name' => 'Solar Home System', - 'created_at' => Carbon::now(), - 'updated_at' => Carbon::now(), - ], - [ - 'name' => 'E-Bike', - 'created_at' => Carbon::now(), - 'updated_at' => Carbon::now(), - ], - [ - 'name' => 'Electronics', - 'created_at' => Carbon::now(), - 'updated_at' => Carbon::now(), - ], - ] + [ + 'name' => 'Solar Home System', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + [ + 'name' => 'E-Bike', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + [ + 'name' => 'Electronics', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + ] ); } /** * Reverse the migrations. - * - * @return void */ public function down(): void { diff --git a/src/backend/database/migrations/micropowermanager/2019_12_16_092044_create_asset_people_table.php b/src/backend/database/migrations/micropowermanager/2019_12_16_092044_create_asset_people_table.php index 0117a7115..9cbec51f9 100644 --- a/src/backend/database/migrations/micropowermanager/2019_12_16_092044_create_asset_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_12_16_092044_create_asset_people_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_12_16_093223_create_asset_rates_table.php b/src/backend/database/migrations/micropowermanager/2019_12_16_093223_create_asset_rates_table.php index ce01316e8..69b7e93e1 100644 --- a/src/backend/database/migrations/micropowermanager/2019_12_16_093223_create_asset_rates_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_12_16_093223_create_asset_rates_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_01_27_135206_create_logs_table.php b/src/backend/database/migrations/micropowermanager/2020_01_27_135206_create_logs_table.php index 555d4846a..d763fb203 100644 --- a/src/backend/database/migrations/micropowermanager/2020_01_27_135206_create_logs_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_01_27_135206_create_logs_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_04_05_233604_create_p_v_s_table.php b/src/backend/database/migrations/micropowermanager/2020_04_05_233604_create_p_v_s_table.php index b47d121eb..d78a89e90 100644 --- a/src/backend/database/migrations/micropowermanager/2020_04_05_233604_create_p_v_s_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_04_05_233604_create_p_v_s_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_04_19_234527_create_restrictions_table.php b/src/backend/database/migrations/micropowermanager/2020_04_19_234527_create_restrictions_table.php index ba22b236b..8580dad32 100644 --- a/src/backend/database/migrations/micropowermanager/2020_04_19_234527_create_restrictions_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_04_19_234527_create_restrictions_table.php @@ -5,7 +5,8 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_04_19_235421_create_upgrades_table.php b/src/backend/database/migrations/micropowermanager/2020_04_19_235421_create_upgrades_table.php index 43453dd9e..d3fd4bf00 100644 --- a/src/backend/database/migrations/micropowermanager/2020_04_19_235421_create_upgrades_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_04_19_235421_create_upgrades_table.php @@ -5,7 +5,8 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_04_20_001454_create_subscriptions_table.php b/src/backend/database/migrations/micropowermanager/2020_04_20_001454_create_subscriptions_table.php index b35909c56..51e2732c9 100644 --- a/src/backend/database/migrations/micropowermanager/2020_04_20_001454_create_subscriptions_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_04_20_001454_create_subscriptions_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_06_20_085555_weather_data.php b/src/backend/database/migrations/micropowermanager/2020_06_20_085555_weather_data.php index e89593640..8da6c591f 100644 --- a/src/backend/database/migrations/micropowermanager/2020_06_20_085555_weather_data.php +++ b/src/backend/database/migrations/micropowermanager/2020_06_20_085555_weather_data.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_06_21_131740_create_tariff_pricing_components_table.php b/src/backend/database/migrations/micropowermanager/2020_06_21_131740_create_tariff_pricing_components_table.php index d6a3d6842..eec5319b4 100644 --- a/src/backend/database/migrations/micropowermanager/2020_06_21_131740_create_tariff_pricing_components_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_06_21_131740_create_tariff_pricing_components_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_06_21_194542_create_social_tariffs_table.php b/src/backend/database/migrations/micropowermanager/2020_06_21_194542_create_social_tariffs_table.php index 81f08e18c..e041c1ba6 100644 --- a/src/backend/database/migrations/micropowermanager/2020_06_21_194542_create_social_tariffs_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_06_21_194542_create_social_tariffs_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_06_22_085345_create_social_tariff_piggy_banks_table.php b/src/backend/database/migrations/micropowermanager/2020_06_22_085345_create_social_tariff_piggy_banks_table.php index f1bb29501..81a03c8e3 100644 --- a/src/backend/database/migrations/micropowermanager/2020_06_22_085345_create_social_tariff_piggy_banks_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_06_22_085345_create_social_tariff_piggy_banks_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_06_22_115405_add_total_price_to_meter_tariffs.php b/src/backend/database/migrations/micropowermanager/2020_06_22_115405_add_total_price_to_meter_tariffs.php index efb03e96f..6d1158287 100644 --- a/src/backend/database/migrations/micropowermanager/2020_06_22_115405_add_total_price_to_meter_tariffs.php +++ b/src/backend/database/migrations/micropowermanager/2020_06_22_115405_add_total_price_to_meter_tariffs.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_07_12_192802_create_agents_table.php b/src/backend/database/migrations/micropowermanager/2020_07_12_192802_create_agents_table.php index 124e9c43c..4c1b40ee5 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_12_192802_create_agents_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_12_192802_create_agents_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_07_13_130601_create_agent_transactions_table.php b/src/backend/database/migrations/micropowermanager/2020_07_13_130601_create_agent_transactions_table.php index 9309c5d51..91af541ed 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_13_130601_create_agent_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_13_130601_create_agent_transactions_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_07_13_132006_create_agent_balance_histories_table.php b/src/backend/database/migrations/micropowermanager/2020_07_13_132006_create_agent_balance_histories_table.php index 56cfce334..bee2e11f2 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_13_132006_create_agent_balance_histories_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_13_132006_create_agent_balance_histories_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_07_13_132423_create_agent_assigned_appliances_table.php b/src/backend/database/migrations/micropowermanager/2020_07_13_132423_create_agent_assigned_appliances_table.php index c841a39b1..7045258dd 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_13_132423_create_agent_assigned_appliances_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_13_132423_create_agent_assigned_appliances_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_07_13_132811_create_agent_sold_appliances_table.php b/src/backend/database/migrations/micropowermanager/2020_07_13_132811_create_agent_sold_appliances_table.php index a9fd8c036..e92aefadd 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_13_132811_create_agent_sold_appliances_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_13_132811_create_agent_sold_appliances_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_07_25_083600_create_agent_commissions_table.php b/src/backend/database/migrations/micropowermanager/2020_07_25_083600_create_agent_commissions_table.php index fdf44f20b..5b89a8461 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_25_083600_create_agent_commissions_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_25_083600_create_agent_commissions_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_07_25_155837_create_agent_receipts_table.php b/src/backend/database/migrations/micropowermanager/2020_07_25_155837_create_agent_receipts_table.php index a648c6f3f..420597e81 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_25_155837_create_agent_receipts_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_25_155837_create_agent_receipts_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_08_03_081836_create_agent_charges_table.php b/src/backend/database/migrations/micropowermanager/2020_08_03_081836_create_agent_charges_table.php index 495526c62..3bab1cd87 100644 --- a/src/backend/database/migrations/micropowermanager/2020_08_03_081836_create_agent_charges_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_08_03_081836_create_agent_charges_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_08_05_133748_create_agent_receipt_details_table.php b/src/backend/database/migrations/micropowermanager/2020_08_05_133748_create_agent_receipt_details_table.php index 78f9e28fb..4aecde4d2 100644 --- a/src/backend/database/migrations/micropowermanager/2020_08_05_133748_create_agent_receipt_details_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_08_05_133748_create_agent_receipt_details_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_10_02_072509_create_time_of_usages_table.php b/src/backend/database/migrations/micropowermanager/2020_10_02_072509_create_time_of_usages_table.php index b76f584b1..fbe5b4036 100644 --- a/src/backend/database/migrations/micropowermanager/2020_10_02_072509_create_time_of_usages_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_10_02_072509_create_time_of_usages_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_10_19_122517_create_sub_menu_items_table.php b/src/backend/database/migrations/micropowermanager/2020_10_19_122517_create_sub_menu_items_table.php index 9e6680513..495999ce5 100644 --- a/src/backend/database/migrations/micropowermanager/2020_10_19_122517_create_sub_menu_items_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_10_19_122517_create_sub_menu_items_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_10_19_122649_create_menu_items_table.php b/src/backend/database/migrations/micropowermanager/2020_10_19_122649_create_menu_items_table.php index ab6e76457..8acef855d 100644 --- a/src/backend/database/migrations/micropowermanager/2020_10_19_122649_create_menu_items_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_10_19_122649_create_menu_items_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_10_29_170007_create_plugins_table.php b/src/backend/database/migrations/micropowermanager/2020_10_29_170007_create_plugins_table.php index 0242050b4..2d0c713f4 100644 --- a/src/backend/database/migrations/micropowermanager/2020_10_29_170007_create_plugins_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_10_29_170007_create_plugins_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_12_17_144527_create_main_settings_table.php b/src/backend/database/migrations/micropowermanager/2020_12_17_144527_create_main_settings_table.php index e98b9ee25..e0a7f9d78 100644 --- a/src/backend/database/migrations/micropowermanager/2020_12_17_144527_create_main_settings_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_12_17_144527_create_main_settings_table.php @@ -6,7 +6,8 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_12_23_165814_create_map_settings_table.php b/src/backend/database/migrations/micropowermanager/2020_12_23_165814_create_map_settings_table.php index 0b096710c..077e3062d 100644 --- a/src/backend/database/migrations/micropowermanager/2020_12_23_165814_create_map_settings_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_12_23_165814_create_map_settings_table.php @@ -6,7 +6,8 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_01_02_130016_add_manufacturer_transaction_to_agent_transactions_table.php b/src/backend/database/migrations/micropowermanager/2021_01_02_130016_add_manufacturer_transaction_to_agent_transactions_table.php index 9b96aa556..b71e501ab 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_02_130016_add_manufacturer_transaction_to_agent_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_02_130016_add_manufacturer_transaction_to_agent_transactions_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * @@ -25,7 +26,6 @@ public function up() */ public function down() { - Schema::connection('shard')->table('agent_transactions', function (Blueprint $table) { - }); + Schema::connection('shard')->table('agent_transactions', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2021_01_02_130412_create_third_party_transactions.php b/src/backend/database/migrations/micropowermanager/2021_01_02_130412_create_third_party_transactions.php index eb7b82826..7a07aac6e 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_02_130412_create_third_party_transactions.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_02_130412_create_third_party_transactions.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_01_02_134152_add_manufacturer_transaction_to_vodacom_transactions_table.php b/src/backend/database/migrations/micropowermanager/2021_01_02_134152_add_manufacturer_transaction_to_vodacom_transactions_table.php index 11950fc05..fd2cd93cd 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_02_134152_add_manufacturer_transaction_to_vodacom_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_02_134152_add_manufacturer_transaction_to_vodacom_transactions_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * @@ -25,7 +26,6 @@ public function up() */ public function down() { - Schema::connection('shard')->table('vodacom_transactions', function (Blueprint $table) { - }); + Schema::connection('shard')->table('vodacom_transactions', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2021_01_02_134212_add_manufacturer_transaction_to_airtel_transactions_table.php b/src/backend/database/migrations/micropowermanager/2021_01_02_134212_add_manufacturer_transaction_to_airtel_transactions_table.php index f3c424f4b..e9f437a7f 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_02_134212_add_manufacturer_transaction_to_airtel_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_02_134212_add_manufacturer_transaction_to_airtel_transactions_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * @@ -25,7 +26,6 @@ public function up() */ public function down() { - Schema::connection('shard')->table('airtel_transactions', function (Blueprint $table) { - }); + Schema::connection('shard')->table('airtel_transactions', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2021_01_05_234039_create_ticket_settings_table.php b/src/backend/database/migrations/micropowermanager/2021_01_05_234039_create_ticket_settings_table.php index 4f1f7fb36..ca41b6bb8 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_05_234039_create_ticket_settings_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_05_234039_create_ticket_settings_table.php @@ -6,7 +6,8 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_01_18_122556_add_columns_to_batteries_table.php b/src/backend/database/migrations/micropowermanager/2021_01_18_122556_add_columns_to_batteries_table.php index 3c2c4c615..748d273d2 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_18_122556_add_columns_to_batteries_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_18_122556_add_columns_to_batteries_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * @@ -32,7 +33,6 @@ public function up() */ public function down() { - Schema::connection('shard')->table('batteries', function (Blueprint $table) { - }); + Schema::connection('shard')->table('batteries', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2021_01_18_123245_add_columns_to_p_v_s_table.php b/src/backend/database/migrations/micropowermanager/2021_01_18_123245_add_columns_to_p_v_s_table.php index 1fc3328a8..c7848f8eb 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_18_123245_add_columns_to_p_v_s_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_18_123245_add_columns_to_p_v_s_table.php @@ -5,7 +5,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * @@ -26,7 +27,6 @@ public function up() */ public function down() { - Schema::connection('shard')->table('p_v_s', function (Blueprint $table) { - }); + Schema::connection('shard')->table('p_v_s', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_bodies.php b/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_bodies.php index 672cbd23d..127e3e1fc 100644 --- a/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_bodies.php +++ b/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_bodies.php @@ -6,7 +6,8 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * @@ -26,133 +27,133 @@ public function up() DB::connection('shard')->table('sms_bodies')->insert( [ - [ - 'reference' => 'SmsTransactionHeader', - 'place_holder' => 'Dear [name] [surname], we received your transaction [transaction_amount].', - 'body' => 'Dear [name] [surname], we received your transaction [transaction_amount].', - 'variables' => 'name,surname,transaction_amount', - 'title' => 'Sms Header', - 'created_at' => Carbon::now(), - 'updated_at' => Carbon::now(), - ], - [ - 'reference' => 'SmsReminderHeader', - 'place_holder' => 'Dear [name] [surname],', - 'body' => 'Dear [name] [surname],', - 'variables' => 'name,surname', - 'title' => 'Sms Header', - 'created_at' => Carbon::now(), - 'updated_at' => Carbon::now(), - ], - [ - 'reference' => 'SmsResendInformationHeader', - 'place_holder' => 'Dear [name] [surname], we received your resend last transaction information demand.', - 'body' => 'Dear [name] [surname], we received your resend last transaction information demand.', - 'variables' => 'name,surname', - 'title' => 'Sms Header', - 'created_at' => Carbon::now(), - 'updated_at' => Carbon::now(), - ], - [ - 'reference' => 'EnergyConfirmation', - 'place_holder' => 'Meter: [meter] , [token] Unit [energy] .', - 'body' => 'Meter: [meter] , [token] Unit [energy] .', - 'variables' => 'meter,token,energy', - 'title' => 'Meter Charge', - 'created_at' => Carbon::now(), - 'updated_at' => Carbon::now(), - ], - [ - 'reference' => 'AccessRateConfirmation', - 'place_holder' => 'Service Charge: [amount] ', - 'body' => 'Service Charge: [amount] ', - 'variables' => 'amount', - 'title' => 'Tariff Fixed Cost', - 'created_at' => Carbon::now(), - 'updated_at' => Carbon::now(), - ], - [ - 'reference' => 'AssetRateReminder', - 'place_holder' => 'the next rate of [appliance_type_name] ( . [remaining] . ) is due on [due_date]', - 'body' => 'the next rate of [appliance_type_name] ( . [remaining] . ) is due on [due_date]', - 'variables' => 'appliance_type_name,remaining,due_date', - 'title' => 'Appliance Payment Reminder', - 'created_at' => Carbon::now(), - 'updated_at' => Carbon::now(), - ], - [ - 'reference' => 'AssetRatePayment', - 'place_holder' => 'Appliance: [appliance_type_name] [amount]', - 'body' => 'Appliance: [appliance_type_name] [amount]', - 'variables' => 'appliance_type_name,amount', - 'title' => 'Appliance Payment', - 'created_at' => Carbon::now(), - 'updated_at' => Carbon::now(), - ], - [ - 'reference' => 'OverdueAssetRateReminder', - 'place_holder' => 'you forgot to pay the rate of [appliance_type_name] ( [remaining] ) on [due_date]. Please pay it as soon as possible, unless you wont be able to buy energy.', - 'body' => 'you forgot to pay the rate of [appliance_type_name] ( [remaining] ) on [due_date]. Please pay it as soon as possible, unless you wont be able to buy energy.', - 'variables' => 'appliance_type_name,remaining,due_date', - 'title' => 'Overdue Appliance Payment Reminder', - 'created_at' => Carbon::now(), - 'updated_at' => Carbon::now(), - ], - [ - 'reference' => 'PricingDetails', - 'place_holder' => 'Transaction amount is [amount], \n VAT for energy : [vat_energy] \n VAT for the other staffs : [vat_others] . ', - 'body' => 'Transaction amount is [amount], \n VAT for energy : [vat_energy] \n VAT for the other staffs : [vat_others] . ', - 'variables' => 'amount,vat_energy,vat_others', - 'title' => 'Pricing Details', - 'created_at' => Carbon::now(), - 'updated_at' => Carbon::now(), - ], - [ - 'reference' => 'ResendInformation', - 'place_holder' => 'Meter: [meter] , [token] Unit [energy] KWH. Service Charge: [amount]', - 'body' => 'Meter: [meter] , [token] Unit [energy] KWH. Service Charge: [amount]', - 'variables' => 'meter,token,energy,amount', - 'title' => 'Resend Last Transaction Information', - 'created_at' => Carbon::now(), - 'updated_at' => Carbon::now(), - ], - [ - 'reference' => 'ResendInformationLastTransactionNotFound', - 'place_holder' => 'Last transaction information not found for Meter: [meter]', - 'body' => 'Last transaction information not found for Meter: [meter]', - 'variables' => 'meter', - 'title' => 'Last Transaction Information Not Found', - 'created_at' => Carbon::now(), - 'updated_at' => Carbon::now(), - ], - [ - 'reference' => 'SmsReminderFooter', - 'place_holder' => 'Your Company etc.', - 'body' => 'Your Company etc.', - 'variables' => '', - 'title' => 'Sms Footer', - 'created_at' => Carbon::now(), - 'updated_at' => Carbon::now(), - ], - [ - 'reference' => 'SmsTransactionFooter', - 'place_holder' => 'Your Company etc.', - 'body' => 'Your Company etc.', - 'variables' => '', - 'title' => 'Sms Footer', - 'created_at' => Carbon::now(), - 'updated_at' => Carbon::now(), - ], - [ - 'reference' => 'SmsResendInformationFooter', - 'place_holder' => 'Your Company etc.', - 'body' => 'Your Company etc.', - 'variables' => '', - 'title' => 'Sms Footer', - 'created_at' => Carbon::now(), - 'updated_at' => Carbon::now(), - ], - ] + [ + 'reference' => 'SmsTransactionHeader', + 'place_holder' => 'Dear [name] [surname], we received your transaction [transaction_amount].', + 'body' => 'Dear [name] [surname], we received your transaction [transaction_amount].', + 'variables' => 'name,surname,transaction_amount', + 'title' => 'Sms Header', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + [ + 'reference' => 'SmsReminderHeader', + 'place_holder' => 'Dear [name] [surname],', + 'body' => 'Dear [name] [surname],', + 'variables' => 'name,surname', + 'title' => 'Sms Header', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + [ + 'reference' => 'SmsResendInformationHeader', + 'place_holder' => 'Dear [name] [surname], we received your resend last transaction information demand.', + 'body' => 'Dear [name] [surname], we received your resend last transaction information demand.', + 'variables' => 'name,surname', + 'title' => 'Sms Header', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + [ + 'reference' => 'EnergyConfirmation', + 'place_holder' => 'Meter: [meter] , [token] Unit [energy] .', + 'body' => 'Meter: [meter] , [token] Unit [energy] .', + 'variables' => 'meter,token,energy', + 'title' => 'Meter Charge', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + [ + 'reference' => 'AccessRateConfirmation', + 'place_holder' => 'Service Charge: [amount] ', + 'body' => 'Service Charge: [amount] ', + 'variables' => 'amount', + 'title' => 'Tariff Fixed Cost', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + [ + 'reference' => 'AssetRateReminder', + 'place_holder' => 'the next rate of [appliance_type_name] ( . [remaining] . ) is due on [due_date]', + 'body' => 'the next rate of [appliance_type_name] ( . [remaining] . ) is due on [due_date]', + 'variables' => 'appliance_type_name,remaining,due_date', + 'title' => 'Appliance Payment Reminder', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + [ + 'reference' => 'AssetRatePayment', + 'place_holder' => 'Appliance: [appliance_type_name] [amount]', + 'body' => 'Appliance: [appliance_type_name] [amount]', + 'variables' => 'appliance_type_name,amount', + 'title' => 'Appliance Payment', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + [ + 'reference' => 'OverdueAssetRateReminder', + 'place_holder' => 'you forgot to pay the rate of [appliance_type_name] ( [remaining] ) on [due_date]. Please pay it as soon as possible, unless you wont be able to buy energy.', + 'body' => 'you forgot to pay the rate of [appliance_type_name] ( [remaining] ) on [due_date]. Please pay it as soon as possible, unless you wont be able to buy energy.', + 'variables' => 'appliance_type_name,remaining,due_date', + 'title' => 'Overdue Appliance Payment Reminder', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + [ + 'reference' => 'PricingDetails', + 'place_holder' => 'Transaction amount is [amount], \n VAT for energy : [vat_energy] \n VAT for the other staffs : [vat_others] . ', + 'body' => 'Transaction amount is [amount], \n VAT for energy : [vat_energy] \n VAT for the other staffs : [vat_others] . ', + 'variables' => 'amount,vat_energy,vat_others', + 'title' => 'Pricing Details', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + [ + 'reference' => 'ResendInformation', + 'place_holder' => 'Meter: [meter] , [token] Unit [energy] KWH. Service Charge: [amount]', + 'body' => 'Meter: [meter] , [token] Unit [energy] KWH. Service Charge: [amount]', + 'variables' => 'meter,token,energy,amount', + 'title' => 'Resend Last Transaction Information', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + [ + 'reference' => 'ResendInformationLastTransactionNotFound', + 'place_holder' => 'Last transaction information not found for Meter: [meter]', + 'body' => 'Last transaction information not found for Meter: [meter]', + 'variables' => 'meter', + 'title' => 'Last Transaction Information Not Found', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + [ + 'reference' => 'SmsReminderFooter', + 'place_holder' => 'Your Company etc.', + 'body' => 'Your Company etc.', + 'variables' => '', + 'title' => 'Sms Footer', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + [ + 'reference' => 'SmsTransactionFooter', + 'place_holder' => 'Your Company etc.', + 'body' => 'Your Company etc.', + 'variables' => '', + 'title' => 'Sms Footer', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + [ + 'reference' => 'SmsResendInformationFooter', + 'place_holder' => 'Your Company etc.', + 'body' => 'Your Company etc.', + 'variables' => '', + 'title' => 'Sms Footer', + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + ], + ] ); } diff --git a/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_resend_information_keys.php b/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_resend_information_keys.php index 47c0a507d..58f5f1655 100644 --- a/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_resend_information_keys.php +++ b/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_resend_information_keys.php @@ -6,7 +6,8 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_02_18_156421_create_sms_appliance_remind_rates.php b/src/backend/database/migrations/micropowermanager/2021_02_18_156421_create_sms_appliance_remind_rates.php index c7a84e8a1..2652ee237 100644 --- a/src/backend/database/migrations/micropowermanager/2021_02_18_156421_create_sms_appliance_remind_rates.php +++ b/src/backend/database/migrations/micropowermanager/2021_02_18_156421_create_sms_appliance_remind_rates.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_03_03_140758_create_sms_android_settings.php b/src/backend/database/migrations/micropowermanager/2021_03_03_140758_create_sms_android_settings.php index 9cc789ad7..b0499a50e 100644 --- a/src/backend/database/migrations/micropowermanager/2021_03_03_140758_create_sms_android_settings.php +++ b/src/backend/database/migrations/micropowermanager/2021_03_03_140758_create_sms_android_settings.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_03_03_141706_create_sms_variable_default_values.php b/src/backend/database/migrations/micropowermanager/2021_03_03_141706_create_sms_variable_default_values.php index 34ed727b7..984f86e3f 100644 --- a/src/backend/database/migrations/micropowermanager/2021_03_03_141706_create_sms_variable_default_values.php +++ b/src/backend/database/migrations/micropowermanager/2021_03_03_141706_create_sms_variable_default_values.php @@ -6,7 +6,8 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_03_2_1561251_update_sms_table.php b/src/backend/database/migrations/micropowermanager/2021_03_2_1561251_update_sms_table.php index 0bdf6e842..4097f4960 100644 --- a/src/backend/database/migrations/micropowermanager/2021_03_2_1561251_update_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_03_2_1561251_update_sms_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * @@ -28,7 +29,6 @@ public function up() */ public function down() { - Schema::connection('shard')->table('sms', function (Blueprint $table) { - }); + Schema::connection('shard')->table('sms', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2021_04_28_103758_add_additional_json_column_to_people.php b/src/backend/database/migrations/micropowermanager/2021_04_28_103758_add_additional_json_column_to_people.php index c98c3f628..10c631e22 100644 --- a/src/backend/database/migrations/micropowermanager/2021_04_28_103758_add_additional_json_column_to_people.php +++ b/src/backend/database/migrations/micropowermanager/2021_04_28_103758_add_additional_json_column_to_people.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * @@ -24,7 +25,6 @@ public function up() */ public function down() { - Schema::connection('shard')->table('people', function (Blueprint $table) { - }); + Schema::connection('shard')->table('people', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2021_04_28_104840_create_person_documents_table.php b/src/backend/database/migrations/micropowermanager/2021_04_28_104840_create_person_documents_table.php index 25e5f6b45..9a7c204d3 100644 --- a/src/backend/database/migrations/micropowermanager/2021_04_28_104840_create_person_documents_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_04_28_104840_create_person_documents_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_06_04_085817_update_meter_consumptions_table.php b/src/backend/database/migrations/micropowermanager/2021_06_04_085817_update_meter_consumptions_table.php index ed0b7e714..19b797d02 100644 --- a/src/backend/database/migrations/micropowermanager/2021_06_04_085817_update_meter_consumptions_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_06_04_085817_update_meter_consumptions_table.php @@ -6,7 +6,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * @@ -14,7 +15,7 @@ */ public function up() { - if (!Type::hasType('double')) { + if (! Type::hasType('double')) { Type::addType('double', FloatType::class); } Schema::connection('shard')->table('meter_consumptions', function (Blueprint $table) { @@ -30,7 +31,6 @@ public function up() */ public function down() { - Schema::connection('shard')->table('meter_consumptions', function (Blueprint $table) { - }); + Schema::connection('shard')->table('meter_consumptions', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2021_08_17_090801_add_down_payment_to_asset_people_table.php b/src/backend/database/migrations/micropowermanager/2021_08_17_090801_add_down_payment_to_asset_people_table.php index 57a38caf6..391d9c4fb 100644 --- a/src/backend/database/migrations/micropowermanager/2021_08_17_090801_add_down_payment_to_asset_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_08_17_090801_add_down_payment_to_asset_people_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_08_17_090913_add_first_payment_date_to_asset_people_table.php b/src/backend/database/migrations/micropowermanager/2021_08_17_090913_add_first_payment_date_to_asset_people_table.php index 747895479..2c34d0c5f 100644 --- a/src/backend/database/migrations/micropowermanager/2021_08_17_090913_add_first_payment_date_to_asset_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_08_17_090913_add_first_payment_date_to_asset_people_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_09_07_092522_create_cash_transactions_table.php b/src/backend/database/migrations/micropowermanager/2021_09_07_092522_create_cash_transactions_table.php index 849193095..4c83b0f13 100644 --- a/src/backend/database/migrations/micropowermanager/2021_09_07_092522_create_cash_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_09_07_092522_create_cash_transactions_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_10_18_220817_create_mail_settings.php b/src/backend/database/migrations/micropowermanager/2021_10_18_220817_create_mail_settings.php index ceab71922..b7ef02738 100644 --- a/src/backend/database/migrations/micropowermanager/2021_10_18_220817_create_mail_settings.php +++ b/src/backend/database/migrations/micropowermanager/2021_10_18_220817_create_mail_settings.php @@ -6,7 +6,8 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_093215_update_meter_tariffs_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_093215_update_meter_tariffs_table.php index ceea23dfe..af1cece3d 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_093215_update_meter_tariffs_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_093215_update_meter_tariffs_table.php @@ -6,7 +6,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * @@ -14,7 +15,7 @@ */ public function up() { - if (!Type::hasType('double')) { + if (! Type::hasType('double')) { Type::addType('double', FloatType::class); } Schema::connection('shard')->table('meter_tariffs', function (Blueprint $table) { @@ -30,7 +31,6 @@ public function up() */ public function down() { - Schema::connection('shard')->table('meter_tariffs', function (Blueprint $table) { - }); + Schema::connection('shard')->table('meter_tariffs', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_101348_update_social_tariffs_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_101348_update_social_tariffs_table.php index 5045706f7..dc1148b59 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_101348_update_social_tariffs_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_101348_update_social_tariffs_table.php @@ -6,7 +6,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * @@ -14,7 +15,7 @@ */ public function up() { - if (!Type::hasType('double')) { + if (! Type::hasType('double')) { Type::addType('double', FloatType::class); } Schema::connection('shard')->table('social_tariffs', function (Blueprint $table) { @@ -30,7 +31,6 @@ public function up() */ public function down() { - Schema::connection('shard')->table('social_tariffs', function (Blueprint $table) { - }); + Schema::connection('shard')->table('social_tariffs', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_101616_update_tariff_pricing_components_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_101616_update_tariff_pricing_components_table.php index 93a9a8e63..c64432ed3 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_101616_update_tariff_pricing_components_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_101616_update_tariff_pricing_components_table.php @@ -6,7 +6,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * @@ -14,7 +15,7 @@ */ public function up() { - if (!Type::hasType('double')) { + if (! Type::hasType('double')) { Type::addType('double', FloatType::class); } Schema::connection('shard')->table('tariff_pricing_components', function (Blueprint $table) { @@ -29,7 +30,6 @@ public function up() */ public function down() { - Schema::connection('shard')->table('tariff_pricing_components', function (Blueprint $table) { - }); + Schema::connection('shard')->table('tariff_pricing_components', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_101855_update_social_tariff_piggy_banks_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_101855_update_social_tariff_piggy_banks_table.php index f63c65c9f..2d3a30c88 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_101855_update_social_tariff_piggy_banks_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_101855_update_social_tariff_piggy_banks_table.php @@ -6,7 +6,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * @@ -14,7 +15,7 @@ */ public function up() { - if (!Type::hasType('double')) { + if (! Type::hasType('double')) { Type::addType('double', FloatType::class); } Schema::connection('shard')->table('social_tariff_piggy_banks', function (Blueprint $table) { @@ -29,7 +30,6 @@ public function up() */ public function down() { - Schema::connection('shard')->table('social_tariff_piggy_banks', function (Blueprint $table) { - }); + Schema::connection('shard')->table('social_tariff_piggy_banks', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_102047_update_access_rates_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_102047_update_access_rates_table.php index 26258e963..30087e453 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_102047_update_access_rates_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_102047_update_access_rates_table.php @@ -6,7 +6,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * @@ -14,7 +15,7 @@ */ public function up() { - if (!Type::hasType('double')) { + if (! Type::hasType('double')) { Type::addType('double', FloatType::class); } Schema::connection('shard')->table('access_rates', function (Blueprint $table) { @@ -29,7 +30,6 @@ public function up() */ public function down() { - Schema::connection('shard')->table('access_rates', function (Blueprint $table) { - }); + Schema::connection('shard')->table('access_rates', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_102214_update_access_rate_payments_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_102214_update_access_rate_payments_table.php index 9322b857f..5db33513e 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_102214_update_access_rate_payments_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_102214_update_access_rate_payments_table.php @@ -6,7 +6,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * @@ -14,7 +15,7 @@ */ public function up() { - if (!Type::hasType('double')) { + if (! Type::hasType('double')) { Type::addType('double', FloatType::class); } Schema::connection('shard')->table('access_rate_payments', function (Blueprint $table) { @@ -30,7 +31,6 @@ public function up() */ public function down() { - Schema::connection('shard')->table('access_rate_payments', function (Blueprint $table) { - }); + Schema::connection('shard')->table('access_rate_payments', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_102507_update_asset_people_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_102507_update_asset_people_table.php index ab354684a..4457a4a15 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_102507_update_asset_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_102507_update_asset_people_table.php @@ -6,7 +6,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * @@ -14,7 +15,7 @@ */ public function up() { - if (!Type::hasType('double')) { + if (! Type::hasType('double')) { Type::addType('double', FloatType::class); } Schema::connection('shard')->table('asset_people', function (Blueprint $table) { @@ -29,7 +30,6 @@ public function up() */ public function down() { - Schema::connection('shard')->table('asset_people', function (Blueprint $table) { - }); + Schema::connection('shard')->table('asset_people', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_102649_update_transactions_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_102649_update_transactions_table.php index 4a9f36e6d..4cff50352 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_102649_update_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_102649_update_transactions_table.php @@ -6,7 +6,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * @@ -14,7 +15,7 @@ */ public function up() { - if (!Type::hasType('double')) { + if (! Type::hasType('double')) { Type::addType('double', FloatType::class); } Schema::connection('shard')->table('transactions', function (Blueprint $table) { @@ -29,7 +30,6 @@ public function up() */ public function down() { - Schema::connection('shard')->table('transactions', function (Blueprint $table) { - }); + Schema::connection('shard')->table('transactions', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_102805_update_payment_histories_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_102805_update_payment_histories_table.php index 42cbe729b..1c6b6e5c3 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_102805_update_payment_histories_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_102805_update_payment_histories_table.php @@ -6,7 +6,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * @@ -14,7 +15,7 @@ */ public function up() { - if (!Type::hasType('double')) { + if (! Type::hasType('double')) { Type::addType('double', FloatType::class); } Schema::connection('shard')->table('payment_histories', function (Blueprint $table) { @@ -29,7 +30,6 @@ public function up() */ public function down() { - Schema::connection('shard')->table('payment_histories', function (Blueprint $table) { - }); + Schema::connection('shard')->table('payment_histories', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2022_05_19_102938_update_asset_types_table.php b/src/backend/database/migrations/micropowermanager/2022_05_19_102938_update_asset_types_table.php index 4aaa9b462..c9d38c082 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_19_102938_update_asset_types_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_19_102938_update_asset_types_table.php @@ -6,7 +6,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * @@ -14,7 +15,7 @@ */ public function up() { - if (!Type::hasType('double')) { + if (! Type::hasType('double')) { Type::addType('double', FloatType::class); } Schema::connection('shard')->table('asset_types', function (Blueprint $table) { diff --git a/src/backend/database/migrations/micropowermanager/2022_05_23_104138_add_connection_column_to_agents_table.php b/src/backend/database/migrations/micropowermanager/2022_05_23_104138_add_connection_column_to_agents_table.php index a818cd1cb..548651eb4 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_23_104138_add_connection_column_to_agents_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_23_104138_add_connection_column_to_agents_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090125_create_calin_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090125_create_calin_tables.php index c8f8437e7..c32eddab1 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090125_create_calin_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090125_create_calin_tables.php @@ -4,10 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ public function up() { - if (!Schema::hasTable('calin_api_credentials')) { + if (! Schema::hasTable('calin_api_credentials')) { Schema::connection('shard')->create('calin_api_credentials', static function (Blueprint $table) { $table->increments('id'); $table->string('api_url')->default('http://api.calinhost.com/api'); @@ -16,7 +17,7 @@ public function up() $table->timestamps(); }); } - if (!Schema::hasTable('calin_transactions')) { + if (! Schema::hasTable('calin_transactions')) { Schema::connection('shard')->create('calin_transactions', static function (Blueprint $table) { $table->increments('id'); $table->timestamps(); diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090327_create_calin_smart_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090327_create_calin_smart_tables.php index 4cef9a0cd..7525fad5d 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090327_create_calin_smart_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090327_create_calin_smart_tables.php @@ -4,10 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ public function up() { - if (!Schema::hasTable('calin_smart_api_credentials')) { + if (! Schema::hasTable('calin_smart_api_credentials')) { Schema::connection('shard')->create('calin_smart_api_credentials', static function (Blueprint $table) { $table->increments('id'); $table->string('api_url')->default('https://ami.calinhost.com/api'); @@ -18,7 +19,7 @@ public function up() $table->timestamps(); }); } - if (!Schema::hasTable('calin_smart_transactions')) { + if (! Schema::hasTable('calin_smart_transactions')) { Schema::connection('shard')->create('calin_smart_transactions', static function (Blueprint $table) { $table->increments('id'); $table->timestamps(); diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090338_create_kelin_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090338_create_kelin_tables.php index 049d6e16b..c3057fadf 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090338_create_kelin_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090338_create_kelin_tables.php @@ -4,10 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ public function up() { - if (!Schema::hasTable('kelin_api_credentials')) { + if (! Schema::hasTable('kelin_api_credentials')) { Schema::connection('shard')->create('kelin_api_credentials', static function (Blueprint $table) { $table->increments('id'); $table->string('api_url')->nullable(); @@ -19,7 +20,7 @@ public function up() }); } - if (!Schema::hasTable('kelin_customers')) { + if (! Schema::hasTable('kelin_customers')) { Schema::connection('shard')->create('kelin_customers', static function (Blueprint $table) { $table->increments('id'); $table->integer('mpm_customer_id')->unique(); // Code of the customer, id of corresponding person in MPM @@ -31,7 +32,7 @@ public function up() }); } - if (!Schema::hasTable('kelin_meters')) { + if (! Schema::hasTable('kelin_meters')) { Schema::connection('shard')->create('kelin_meters', function (Blueprint $table) { $table->increments('id'); $table->integer('mpm_meter_id')->unique(); @@ -44,7 +45,7 @@ public function up() }); } - if (!Schema::hasTable('kelin_transactions')) { + if (! Schema::hasTable('kelin_transactions')) { Schema::connection('shard')->create('kelin_transactions', function (Blueprint $table) { $table->increments('id'); $table->string('meter_serial'); @@ -59,7 +60,7 @@ public function up() }); } - if (!Schema::hasTable('kelin_sync_actions')) { + if (! Schema::hasTable('kelin_sync_actions')) { Schema::connection('shard')->create('kelin_sync_actions', function (Blueprint $table) { $table->increments('id'); $table->integer('sync_setting_id'); @@ -70,7 +71,7 @@ public function up() }); } - if (!Schema::hasTable('kelin_sync_settings')) { + if (! Schema::hasTable('kelin_sync_settings')) { Schema::connection('shard')->create('kelin_sync_settings', function (Blueprint $table) { $table->increments('id'); $table->string('action_name')->unique(); @@ -81,7 +82,7 @@ public function up() }); } - if (!Schema::hasTable('kelin_meter_minutely_datas')) { + if (! Schema::hasTable('kelin_meter_minutely_datas')) { Schema::connection('shard')->create('kelin_meter_minutely_datas', static function (Blueprint $table) { $table->increments('id'); $table->integer('id_of_terminal'); @@ -116,7 +117,7 @@ public function up() }); } - if (!Schema::hasTable('kelin_meter_daily_datas')) { + if (! Schema::hasTable('kelin_meter_daily_datas')) { Schema::connection('shard')->create('kelin_meter_daily_datas', static function (Blueprint $table) { $table->increments('id'); $table->integer('id_of_terminal'); @@ -148,7 +149,7 @@ public function up() }); } - if (!Schema::hasTable('kelin_settings')) { + if (! Schema::hasTable('kelin_settings')) { Schema::connection('shard')->create('kelin_settings', function (Blueprint $table) { $table->increments('id'); $table->integer('setting_id'); diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090345_create_mesomb_payment_provider_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090345_create_mesomb_payment_provider_tables.php index 79791a008..ed89704a2 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090345_create_mesomb_payment_provider_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090345_create_mesomb_payment_provider_tables.php @@ -4,10 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ public function up() { - if (!Schema::hasTable('mesomb_transactions')) { + if (! Schema::hasTable('mesomb_transactions')) { Schema::connection('shard')->create('mesomb_transactions', static function (Blueprint $table) { $table->increments('id'); $table->string('pk'); diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090351_create_spark_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090351_create_spark_tables.php index f05231b84..225cf1f1a 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090351_create_spark_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090351_create_spark_tables.php @@ -4,10 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ public function up() { - if (!Schema::hasTable('sm_api_credentials')) { + if (! Schema::hasTable('sm_api_credentials')) { Schema::connection('shard')->create('sm_api_credentials', static function (Blueprint $table) { $table->increments('id'); $table->string('api_url')->default('https://www.sparkmeter.cloud/api/v0'); @@ -19,7 +20,7 @@ public function up() }); } - if (!Schema::hasTable('sm_customers')) { + if (! Schema::hasTable('sm_customers')) { Schema::connection('shard')->create('sm_customers', static function (Blueprint $table) { $table->increments('id'); $table->string('customer_id')->unique(); // Code of the customer, id of corresponding person in MPM @@ -32,7 +33,7 @@ public function up() }); } - if (!Schema::hasTable('sm_meter_models')) { + if (! Schema::hasTable('sm_meter_models')) { Schema::connection('shard')->create('sm_meter_models', static function (Blueprint $table) { $table->increments('id'); $table->string('site_id'); @@ -45,7 +46,7 @@ public function up() }); } - if (!Schema::hasTable('sm_organizations')) { + if (! Schema::hasTable('sm_organizations')) { Schema::connection('shard')->create('sm_organizations', static function (Blueprint $table) { $table->increments('id'); $table->string('organization_id')->unique(); @@ -55,7 +56,7 @@ public function up() }); } - if (!Schema::hasTable('sm_sites')) { + if (! Schema::hasTable('sm_sites')) { Schema::connection('shard')->create('sm_sites', static function (Blueprint $table) { $table->increments('id'); $table->string('site_id')->unique(); @@ -69,7 +70,7 @@ public function up() }); } - if (!Schema::hasTable('sm_tariffs')) { + if (! Schema::hasTable('sm_tariffs')) { Schema::connection('shard')->create('sm_tariffs', static function (Blueprint $table) { $table->increments('id'); $table->string('site_id'); @@ -83,7 +84,7 @@ public function up() }); } - if (!Schema::hasTable('sm_transactions')) { + if (! Schema::hasTable('sm_transactions')) { Schema::connection('shard')->create('sm_transactions', static function (Blueprint $table) { $table->increments('id'); $table->string('site_id'); @@ -96,7 +97,7 @@ public function up() }); } - if (!Schema::hasTable('sm_sync_actions')) { + if (! Schema::hasTable('sm_sync_actions')) { Schema::connection('shard')->create('sm_sync_actions', function (Blueprint $table) { $table->increments('id'); $table->integer('sync_setting_id'); @@ -107,7 +108,7 @@ public function up() }); } - if (!Schema::hasTable('sm_settings')) { + if (! Schema::hasTable('sm_settings')) { Schema::connection('shard')->create('sm_settings', function (Blueprint $table) { $table->increments('id'); $table->integer('setting_id'); @@ -116,7 +117,7 @@ public function up() }); } - if (!Schema::hasTable('sm_sms_settings')) { + if (! Schema::hasTable('sm_sms_settings')) { Schema::connection('shard')->create('sm_sms_settings', function (Blueprint $table) { $table->increments('id'); $table->string('state')->unique(); @@ -126,7 +127,7 @@ public function up() }); } - if (!Schema::hasTable('sm_sync_settings')) { + if (! Schema::hasTable('sm_sync_settings')) { Schema::connection('shard')->create('sm_sync_settings', function (Blueprint $table) { $table->increments('id'); $table->string('action_name')->unique(); @@ -137,7 +138,7 @@ public function up() }); } - if (!Schema::hasTable('sm_sms_notified_customers')) { + if (! Schema::hasTable('sm_sms_notified_customers')) { Schema::connection('shard')->create('sm_sms_notified_customers', function (Blueprint $table) { $table->increments('id'); $table->string('customer_id'); @@ -147,7 +148,7 @@ public function up() }); } - if (!Schema::hasTable('sm_sms_bodies')) { + if (! Schema::hasTable('sm_sms_bodies')) { Schema::connection('shard')->create('sm_sms_bodies', function (Blueprint $table) { $table->increments('id'); $table->string('reference', 50)->unique(); @@ -159,7 +160,7 @@ public function up() }); } - if (!Schema::hasTable('sm_sms_variable_default_values')) { + if (! Schema::hasTable('sm_sms_variable_default_values')) { Schema::connection('shard')->create('sm_sms_variable_default_values', function (Blueprint $table) { $table->id(); $table->string('variable'); @@ -168,7 +169,7 @@ public function up() }); } - if (!Schema::hasTable('sm_sales_accounts')) { + if (! Schema::hasTable('sm_sales_accounts')) { Schema::connection('shard')->create('sm_sales_accounts', static function (Blueprint $table) { $table->increments('id'); $table->string('sales_account_id'); @@ -183,7 +184,7 @@ public function up() }); } - if (!Schema::hasTable('sm_sms_feedback_words')) { + if (! Schema::hasTable('sm_sms_feedback_words')) { Schema::connection('shard')->create('sm_sms_feedback_words', function (Blueprint $table) { $table->increments('id'); $table->string('meter_reset')->nullable(); diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090402_create_steama_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090402_create_steama_tables.php index d1d5c1bf2..20ce44093 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090402_create_steama_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090402_create_steama_tables.php @@ -4,10 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ public function up() { - if (!Schema::hasTable('steama_agents')) { + if (! Schema::hasTable('steama_agents')) { Schema::connection('shard')->create('steama_agents', function (Blueprint $table) { $table->increments('id'); $table->integer('site_id'); @@ -20,7 +21,7 @@ public function up() }); } - if (!Schema::hasTable('steama_asset_rates_payment_plans')) { + if (! Schema::hasTable('steama_asset_rates_payment_plans')) { Schema::connection('shard')->create('steama_asset_rates_payment_plans', function (Blueprint $table) { $table->increments('id'); $table->integer('mpm_asset_people_id'); @@ -29,7 +30,7 @@ public function up() }); } - if (!Schema::hasTable('steama_credentials')) { + if (! Schema::hasTable('steama_credentials')) { Schema::connection('shard')->create('steama_credentials', function (Blueprint $table) { $table->increments('id'); $table->string('username')->nullable(); @@ -41,7 +42,7 @@ public function up() }); } - if (!Schema::hasTable('steama_customer_basis_payment_plans')) { + if (! Schema::hasTable('steama_customer_basis_payment_plans')) { Schema::connection('shard')->create('steama_customer_basis_payment_plans', function (Blueprint $table) { $table->increments('id'); $table->integer('customer_id'); @@ -51,7 +52,7 @@ public function up() }); } - if (!Schema::hasTable('steama_customer_basis_time_of_usages')) { + if (! Schema::hasTable('steama_customer_basis_time_of_usages')) { Schema::connection('shard')->create('steama_customer_basis_time_of_usages', function (Blueprint $table) { $table->increments('id'); $table->integer('start'); @@ -61,7 +62,7 @@ public function up() }); } - if (!Schema::hasTable('steama_customers')) { + if (! Schema::hasTable('steama_customers')) { Schema::connection('shard')->create('steama_customers', function (Blueprint $table) { $table->increments('id'); $table->integer('site_id'); @@ -76,7 +77,7 @@ public function up() }); } - if (!Schema::hasTable('steama_flat_rate_payment_plans')) { + if (! Schema::hasTable('steama_flat_rate_payment_plans')) { Schema::connection('shard')->create('steama_flat_rate_payment_plans', function (Blueprint $table) { $table->increments('id'); $table->decimal('energy_price')->default(0); @@ -84,7 +85,7 @@ public function up() }); } - if (!Schema::hasTable('steama_hybrid_payment_plans')) { + if (! Schema::hasTable('steama_hybrid_payment_plans')) { Schema::connection('shard')->create('steama_hybrid_payment_plans', function (Blueprint $table) { $table->increments('id'); $table->decimal('connection_fee')->nullable(); @@ -94,7 +95,7 @@ public function up() }); } - if (!Schema::hasTable('steama_meter_types')) { + if (! Schema::hasTable('steama_meter_types')) { Schema::connection('shard')->create('steama_meter_types', function (Blueprint $table) { $table->increments('id'); $table->integer('mpm_meter_type_id'); @@ -105,7 +106,7 @@ public function up() }); } - if (!Schema::hasTable('steama_meters')) { + if (! Schema::hasTable('steama_meters')) { Schema::connection('shard')->create('steama_meters', function (Blueprint $table) { $table->increments('id'); $table->integer('meter_id')->unique(); @@ -117,7 +118,7 @@ public function up() }); } - if (!Schema::hasTable('steama_minimum_top_up_requirements_payment_plans')) { + if (! Schema::hasTable('steama_minimum_top_up_requirements_payment_plans')) { Schema::connection('shard')->create('steama_minimum_top_up_requirements_payment_plans', function (Blueprint $table) { $table->increments('id'); $table->decimal('threshold')->default(0); @@ -125,7 +126,7 @@ public function up() }); } - if (!Schema::hasTable('steama_per_kwh_payment_plans')) { + if (! Schema::hasTable('steama_per_kwh_payment_plans')) { Schema::connection('shard')->create('steama_per_kwh_payment_plans', function (Blueprint $table) { $table->increments('id'); $table->decimal('energy_price')->default(0); @@ -133,7 +134,7 @@ public function up() }); } - if (!Schema::hasTable('steama_site_level_payment_plan_types')) { + if (! Schema::hasTable('steama_site_level_payment_plan_types')) { Schema::connection('shard')->create('steama_site_level_payment_plan_types', function (Blueprint $table) { $table->increments('id'); $table->string('name'); @@ -141,7 +142,7 @@ public function up() }); } - if (!Schema::hasTable('steama_site_level_payment_plans')) { + if (! Schema::hasTable('steama_site_level_payment_plans')) { Schema::connection('shard')->create('steama_site_level_payment_plans', function (Blueprint $table) { $table->increments('id'); $table->integer('site_id'); @@ -153,7 +154,7 @@ public function up() }); } - if (!Schema::hasTable('steama_sites')) { + if (! Schema::hasTable('steama_sites')) { Schema::connection('shard')->create('steama_sites', function (Blueprint $table) { $table->increments('id'); $table->integer('site_id')->unique(); @@ -163,7 +164,7 @@ public function up() }); } - if (!Schema::hasTable('steama_subscription_payment_plans')) { + if (! Schema::hasTable('steama_subscription_payment_plans')) { Schema::connection('shard')->create('steama_subscription_payment_plans', function (Blueprint $table) { $table->increments('id'); $table->decimal('plan_fee')->default(0); @@ -174,7 +175,7 @@ public function up() }); } - if (!Schema::hasTable('steama_tariff_override_payment_plans')) { + if (! Schema::hasTable('steama_tariff_override_payment_plans')) { Schema::connection('shard')->create('steama_tariff_override_payment_plans', function (Blueprint $table) { $table->increments('id'); $table->decimal('energy_price')->default(0); @@ -182,7 +183,7 @@ public function up() }); } - if (!Schema::hasTable('steama_tariffs')) { + if (! Schema::hasTable('steama_tariffs')) { Schema::connection('shard')->create('steama_tariffs', function (Blueprint $table) { $table->increments('id'); $table->integer('mpm_tariff_id')->unique(); @@ -190,7 +191,7 @@ public function up() }); } - if (!Schema::hasTable('steama_transactions')) { + if (! Schema::hasTable('steama_transactions')) { Schema::connection('shard')->create('steama_transactions', function (Blueprint $table) { $table->increments('id'); $table->integer('site_id'); @@ -205,7 +206,7 @@ public function up() }); } - if (!Schema::hasTable('steama_user_types')) { + if (! Schema::hasTable('steama_user_types')) { Schema::connection('shard')->create('steama_user_types', function (Blueprint $table) { $table->increments('id'); $table->integer('mpm_connection_type_id'); @@ -215,7 +216,7 @@ public function up() }); } - if (!Schema::hasTable('steama_sync_actions')) { + if (! Schema::hasTable('steama_sync_actions')) { Schema::connection('shard')->create('steama_sync_actions', function (Blueprint $table) { $table->increments('id'); $table->integer('sync_setting_id'); @@ -226,7 +227,7 @@ public function up() }); } - if (!Schema::hasTable('steama_settings')) { + if (! Schema::hasTable('steama_settings')) { Schema::connection('shard')->create('steama_settings', function (Blueprint $table) { $table->increments('id'); $table->integer('setting_id'); @@ -235,7 +236,7 @@ public function up() }); } - if (!Schema::hasTable('steama_sms_settings')) { + if (! Schema::hasTable('steama_sms_settings')) { Schema::connection('shard')->create('steama_sms_settings', function (Blueprint $table) { $table->increments('id'); $table->string('state')->unique(); @@ -245,7 +246,7 @@ public function up() }); } - if (!Schema::hasTable('steama_sync_settings')) { + if (! Schema::hasTable('steama_sync_settings')) { Schema::connection('shard')->create('steama_sync_settings', function (Blueprint $table) { $table->increments('id'); $table->string('action_name')->unique(); @@ -256,7 +257,7 @@ public function up() }); } - if (!Schema::hasTable('steama_sms_notified_customers')) { + if (! Schema::hasTable('steama_sms_notified_customers')) { Schema::connection('shard')->create('steama_sms_notified_customers', function (Blueprint $table) { $table->increments('id'); $table->integer('customer_id'); @@ -266,7 +267,7 @@ public function up() }); } - if (!Schema::hasTable('steama_sms_bodies')) { + if (! Schema::hasTable('steama_sms_bodies')) { Schema::connection('shard')->create('steama_sms_bodies', function (Blueprint $table) { $table->increments('id'); $table->string('reference', 50)->unique(); @@ -278,7 +279,7 @@ public function up() }); } - if (!Schema::hasTable('steama_sms_variable_default_values')) { + if (! Schema::hasTable('steama_sms_variable_default_values')) { Schema::connection('shard')->create('steama_sms_variable_default_values', function (Blueprint $table) { $table->id(); $table->string('variable'); @@ -287,7 +288,7 @@ public function up() }); } - if (!Schema::hasTable('steama_sms_feedback_words')) { + if (! Schema::hasTable('steama_sms_feedback_words')) { Schema::connection('shard')->create('steama_sms_feedback_words', function (Blueprint $table) { $table->increments('id'); $table->string('meter_balance')->nullable(); diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090412_create_stron_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090412_create_stron_tables.php index 79e8c5272..2ab765b74 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090412_create_stron_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090412_create_stron_tables.php @@ -4,10 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ public function up() { - if (!Schema::hasTable('stron_api_credentials')) { + if (! Schema::hasTable('stron_api_credentials')) { Schema::connection('shard')->create('stron_api_credentials', static function (Blueprint $table) { $table->increments('id'); $table->string('api_url')->default('http://www.saitecapi.stronpower.com/api'); @@ -19,7 +20,7 @@ public function up() $table->timestamps(); }); } - if (!Schema::hasTable('stron_transactions')) { + if (! Schema::hasTable('stron_transactions')) { Schema::connection('shard')->create('stron_transactions', static function (Blueprint $table) { $table->increments('id'); $table->timestamps(); diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090425_create_swifta_payment_provider_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090425_create_swifta_payment_provider_tables.php index 29f4e75a6..3de0cd45d 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090425_create_swifta_payment_provider_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090425_create_swifta_payment_provider_tables.php @@ -4,10 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ public function up() { - if (!Schema::hasTable('swifta_transactions')) { + if (! Schema::hasTable('swifta_transactions')) { Schema::connection('shard')->create('swifta_transactions', static function (Blueprint $table) { $table->increments('id'); $table->string('transaction_reference')->nullable(); @@ -20,7 +21,7 @@ public function up() $table->timestamps(); }); } - if (!Schema::hasTable('swifta_authentication')) { + if (! Schema::hasTable('swifta_authentication')) { Schema::connection('shard')->create('swifta_authentication', static function (Blueprint $table) { $table->increments('id'); $table->string('token')->nullable(); diff --git a/src/backend/database/migrations/micropowermanager/2022_07_05_092948_create_registration_tail_table.php b/src/backend/database/migrations/micropowermanager/2022_07_05_092948_create_registration_tail_table.php index 23ed77cb3..4cc517288 100644 --- a/src/backend/database/migrations/micropowermanager/2022_07_05_092948_create_registration_tail_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_07_05_092948_create_registration_tail_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_09_20_0000000_create_bulk_registration_tables.php b/src/backend/database/migrations/micropowermanager/2022_09_20_0000000_create_bulk_registration_tables.php index 64343bacf..9a983957d 100644 --- a/src/backend/database/migrations/micropowermanager/2022_09_20_0000000_create_bulk_registration_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_09_20_0000000_create_bulk_registration_tables.php @@ -4,10 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ public function up() { - if (!Schema::connection('shard')->hasTable('bulk_registration_csv_datas')) { + if (! Schema::connection('shard')->hasTable('bulk_registration_csv_datas')) { Schema::connection('shard')->create('bulk_registration_csv_datas', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('user_id'); diff --git a/src/backend/database/migrations/micropowermanager/2022_10_27_130327_add_direction_column_to_sms_table.php b/src/backend/database/migrations/micropowermanager/2022_10_27_130327_add_direction_column_to_sms_table.php index 889e28ca2..39090d2f8 100644 --- a/src/backend/database/migrations/micropowermanager/2022_10_27_130327_add_direction_column_to_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_10_27_130327_add_direction_column_to_sms_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_10_27_140945_add_gateway_id_column_to_sms_table.php b/src/backend/database/migrations/micropowermanager/2022_10_27_140945_add_gateway_id_column_to_sms_table.php index 52967fea1..046d67475 100644 --- a/src/backend/database/migrations/micropowermanager/2022_10_27_140945_add_gateway_id_column_to_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_10_27_140945_add_gateway_id_column_to_sms_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_10_27_142123_add_dispatched_column_to_sms_table.php b/src/backend/database/migrations/micropowermanager/2022_10_27_142123_add_dispatched_column_to_sms_table.php index fd0890489..78f0df3f2 100644 --- a/src/backend/database/migrations/micropowermanager/2022_10_27_142123_add_dispatched_column_to_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_10_27_142123_add_dispatched_column_to_sms_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_10_27_142319_add_attempts_column_to_sms_table.php b/src/backend/database/migrations/micropowermanager/2022_10_27_142319_add_attempts_column_to_sms_table.php index 3ddc6c9fd..2012b010c 100644 --- a/src/backend/database/migrations/micropowermanager/2022_10_27_142319_add_attempts_column_to_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_10_27_142319_add_attempts_column_to_sms_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_11_08_0000000_create_viber_messaging_tables.php b/src/backend/database/migrations/micropowermanager/2022_11_08_0000000_create_viber_messaging_tables.php index 02bf8c402..d5a1927ee 100644 --- a/src/backend/database/migrations/micropowermanager/2022_11_08_0000000_create_viber_messaging_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_11_08_0000000_create_viber_messaging_tables.php @@ -4,10 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ public function up() { - if (!Schema::hasTable('viber_credentials')) { + if (! Schema::hasTable('viber_credentials')) { Schema::connection('shard')->create('viber_credentials', static function (Blueprint $table) { $table->increments('id'); $table->string('api_token')->nullable(); @@ -17,14 +18,14 @@ public function up() $table->timestamps(); }); } - if (!Schema::hasTable('viber_messages')) { + if (! Schema::hasTable('viber_messages')) { Schema::connection('shard')->create('viber_messages', static function (Blueprint $table) { $table->increments('id'); $table->integer('sms_id'); $table->timestamps(); }); } - if (!Schema::hasTable('viber_contacts')) { + if (! Schema::hasTable('viber_contacts')) { Schema::connection('shard')->create('viber_contacts', static function (Blueprint $table) { $table->increments('id'); $table->integer('person_id'); diff --git a/src/backend/database/migrations/micropowermanager/2022_11_14_101338_add_minimum_purchase_amount_to_meter_tariffs_table.php b/src/backend/database/migrations/micropowermanager/2022_11_14_101338_add_minimum_purchase_amount_to_meter_tariffs_table.php index 29f89dbb0..4cc20ef87 100644 --- a/src/backend/database/migrations/micropowermanager/2022_11_14_101338_add_minimum_purchase_amount_to_meter_tariffs_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_11_14_101338_add_minimum_purchase_amount_to_meter_tariffs_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_11_21_000000_create_wave_money_payment_provider_tables.php b/src/backend/database/migrations/micropowermanager/2022_11_21_000000_create_wave_money_payment_provider_tables.php index 25b74cbc7..88a5b16ae 100644 --- a/src/backend/database/migrations/micropowermanager/2022_11_21_000000_create_wave_money_payment_provider_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_11_21_000000_create_wave_money_payment_provider_tables.php @@ -4,10 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ public function up() { - if (!Schema::hasTable('wave_money_transactions')) { + if (! Schema::hasTable('wave_money_transactions')) { Schema::connection('shard')->create('wave_money_transactions', static function (Blueprint $table) { $table->increments('id'); $table->integer('status')->default(-2); @@ -22,7 +23,7 @@ public function up() $table->timestamps(); }); } - if (!Schema::hasTable('wave_money_credentials')) { + if (! Schema::hasTable('wave_money_credentials')) { Schema::connection('shard')->create('wave_money_credentials', static function (Blueprint $table) { $table->increments('id'); $table->string('merchant_id')->nullable(); diff --git a/src/backend/database/migrations/micropowermanager/2022_11_29_000000_create_micro_star_tables.php b/src/backend/database/migrations/micropowermanager/2022_11_29_000000_create_micro_star_tables.php index ea148540d..d705ebab3 100644 --- a/src/backend/database/migrations/micropowermanager/2022_11_29_000000_create_micro_star_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_11_29_000000_create_micro_star_tables.php @@ -4,10 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ public function up() { - if (!Schema::hasTable('micro_star_api_credentials')) { + if (! Schema::hasTable('micro_star_api_credentials')) { Schema::connection('shard')->create('micro_star_api_credentials', static function (Blueprint $table) { $table->increments('id'); $table->string('api_url')->nullable(); @@ -18,7 +19,7 @@ public function up() $table->timestamps(); }); } - if (!Schema::hasTable('micro_star_transactions')) { + if (! Schema::hasTable('micro_star_transactions')) { Schema::connection('shard')->create('micro_star_transactions', static function (Blueprint $table) { $table->increments('id'); $table->timestamps(); diff --git a/src/backend/database/migrations/micropowermanager/2022_12_11_000000_update_swifta_authentication_table.php b/src/backend/database/migrations/micropowermanager/2022_12_11_000000_update_swifta_authentication_table.php index f3bfff520..a94907ebb 100644 --- a/src/backend/database/migrations/micropowermanager/2022_12_11_000000_update_swifta_authentication_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_12_11_000000_update_swifta_authentication_table.php @@ -6,7 +6,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * @@ -14,7 +15,7 @@ */ public function up() { - if (!Type::hasType('token')) { + if (! Type::hasType('token')) { Type::addType('token', FloatType::class); } Schema::connection('shard')->table('swifta_authentication', function (Blueprint $table) { @@ -29,7 +30,6 @@ public function up() */ public function down() { - Schema::connection('shard')->table('swifta_authentication', function (Blueprint $table) { - }); + Schema::connection('shard')->table('swifta_authentication', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2022_14_12_create_sun_king_tables.php b/src/backend/database/migrations/micropowermanager/2022_14_12_create_sun_king_tables.php index 498fc3d19..95de7d467 100644 --- a/src/backend/database/migrations/micropowermanager/2022_14_12_create_sun_king_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_14_12_create_sun_king_tables.php @@ -4,10 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ public function up() { - if (!Schema::connection('shard')->hasTable('sun_king_api_credentials')) { + if (! Schema::connection('shard')->hasTable('sun_king_api_credentials')) { Schema::connection('shard')->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'); @@ -19,7 +20,7 @@ public function up() $table->timestamps(); }); } - if (!Schema::connection('shard')->hasTable('sun_king_transactions')) { + if (! Schema::connection('shard')->hasTable('sun_king_transactions')) { Schema::connection('shard')->create('sun_king_transactions', static function (Blueprint $table) { $table->increments('id'); $table->timestamps(); diff --git a/src/backend/database/migrations/micropowermanager/2023_03_15_092048_add_colums_to_solars_table.php b/src/backend/database/migrations/micropowermanager/2023_03_15_092048_add_colums_to_solars_table.php index 6190e2f5b..63b866391 100644 --- a/src/backend/database/migrations/micropowermanager/2023_03_15_092048_add_colums_to_solars_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_03_15_092048_add_colums_to_solars_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_03_16_105024_update_solars_table.php b/src/backend/database/migrations/micropowermanager/2023_03_16_105024_update_solars_table.php index bdfbdf2ff..97bf3c0b2 100644 --- a/src/backend/database/migrations/micropowermanager/2023_03_16_105024_update_solars_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_03_16_105024_update_solars_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_03_17_234630_update_data_type_values_energies_table.php b/src/backend/database/migrations/micropowermanager/2023_03_17_234630_update_data_type_values_energies_table.php index 9a4c7c1fd..126a819e8 100644 --- a/src/backend/database/migrations/micropowermanager/2023_03_17_234630_update_data_type_values_energies_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_03_17_234630_update_data_type_values_energies_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * @@ -26,7 +27,6 @@ public function up() */ public function down() { - Schema::connection('shard')->table('energies', function (Blueprint $table) { - }); + Schema::connection('shard')->table('energies', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2023_03_18_014305_update_data_type_values_energies_table.php b/src/backend/database/migrations/micropowermanager/2023_03_18_014305_update_data_type_values_energies_table.php index 98c3e5568..8bdd6eb47 100644 --- a/src/backend/database/migrations/micropowermanager/2023_03_18_014305_update_data_type_values_energies_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_03_18_014305_update_data_type_values_energies_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * @@ -26,7 +27,6 @@ public function up() */ public function down() { - Schema::connection('shard')->table('energies', function (Blueprint $table) { - }); + Schema::connection('shard')->table('energies', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2023_04_02_121811_create_wavecom_tables.php b/src/backend/database/migrations/micropowermanager/2023_04_02_121811_create_wavecom_tables.php index 023e3d172..72c7fd038 100644 --- a/src/backend/database/migrations/micropowermanager/2023_04_02_121811_create_wavecom_tables.php +++ b/src/backend/database/migrations/micropowermanager/2023_04_02_121811_create_wavecom_tables.php @@ -4,12 +4,13 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ private const TABLE_NAME = 'wavecom_transactions'; public function up() { - if (!Schema::hasTable(self::TABLE_NAME)) { + if (! Schema::hasTable(self::TABLE_NAME)) { Schema::create(self::TABLE_NAME, function (Blueprint $table) { $table->increments('id'); $table->string('transaction_id')->unique(); diff --git a/src/backend/database/migrations/micropowermanager/2023_04_04_211421_add_api_type_to_table_transactions.php b/src/backend/database/migrations/micropowermanager/2023_04_04_211421_add_api_type_to_table_transactions.php index 292b015af..7ca8075c7 100644 --- a/src/backend/database/migrations/micropowermanager/2023_04_04_211421_add_api_type_to_table_transactions.php +++ b/src/backend/database/migrations/micropowermanager/2023_04_04_211421_add_api_type_to_table_transactions.php @@ -3,7 +3,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_04_26_223352_update_sms_table.php b/src/backend/database/migrations/micropowermanager/2023_04_26_223352_update_sms_table.php index 5abf3c936..01caba803 100644 --- a/src/backend/database/migrations/micropowermanager/2023_04_26_223352_update_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_04_26_223352_update_sms_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_06_02_create_gome_long_tables.php b/src/backend/database/migrations/micropowermanager/2023_06_02_create_gome_long_tables.php index 14e6718ad..ecad98b0e 100644 --- a/src/backend/database/migrations/micropowermanager/2023_06_02_create_gome_long_tables.php +++ b/src/backend/database/migrations/micropowermanager/2023_06_02_create_gome_long_tables.php @@ -6,10 +6,11 @@ // Despite the migration's name, this migration was actually created on Feb 6h // Name should be 2023-02-06 not 2023-06-02... -return new class () extends Migration { +return new class extends Migration +{ public function up() { - if (!Schema::hasTable('gome_long_api_credentials')) { + if (! Schema::hasTable('gome_long_api_credentials')) { Schema::create('gome_long_api_credentials', static function (Blueprint $table) { $table->increments('id'); $table->string('api_url')->default('http://60.205.216.142:8085/api/EKPower'); @@ -19,14 +20,14 @@ public function up() }); } - if (!Schema::hasTable('gome_long_transactions')) { + if (! Schema::hasTable('gome_long_transactions')) { Schema::create('gome_long_transactions', static function (Blueprint $table) { $table->increments('id'); $table->timestamps(); }); } - if (!Schema::hasTable('gome_long_tariffs')) { + if (! Schema::hasTable('gome_long_tariffs')) { Schema::create('gome_long_tariffs', static function (Blueprint $table) { $table->increments('id'); $table->string('tariff_id')->unique(); diff --git a/src/backend/database/migrations/micropowermanager/2023_09_25_232731_update_assets_asset_people_asset_types_tables.php b/src/backend/database/migrations/micropowermanager/2023_09_25_232731_update_assets_asset_people_asset_types_tables.php index 7933fd353..13d716ea9 100644 --- a/src/backend/database/migrations/micropowermanager/2023_09_25_232731_update_assets_asset_people_asset_types_tables.php +++ b/src/backend/database/migrations/micropowermanager/2023_09_25_232731_update_assets_asset_people_asset_types_tables.php @@ -6,7 +6,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * @@ -46,7 +47,7 @@ public function down() $table->renameColumn('price', 'default_price'); $table->integer('default_rate'); }); - if (!Type::hasType('double')) { + if (! Type::hasType('double')) { Type::addType('double', FloatType::class); } Schema::connection('shard')->table('asset_types', function (Blueprint $table) { diff --git a/src/backend/database/migrations/micropowermanager/2023_09_28_130619_update_sms_appliance_remind_rates_table.php b/src/backend/database/migrations/micropowermanager/2023_09_28_130619_update_sms_appliance_remind_rates_table.php index 41c4217a1..6033a7e53 100644 --- a/src/backend/database/migrations/micropowermanager/2023_09_28_130619_update_sms_appliance_remind_rates_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_09_28_130619_update_sms_appliance_remind_rates_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * @@ -22,7 +23,5 @@ public function up() * * @return void */ - public function down() - { - } + public function down() {} }; diff --git a/src/backend/database/migrations/micropowermanager/2023_10_25_074114_update_wavecom_wavemoney_tables.php b/src/backend/database/migrations/micropowermanager/2023_10_25_074114_update_wavecom_wavemoney_tables.php index 07ef68f96..7b7a06e40 100644 --- a/src/backend/database/migrations/micropowermanager/2023_10_25_074114_update_wavecom_wavemoney_tables.php +++ b/src/backend/database/migrations/micropowermanager/2023_10_25_074114_update_wavecom_wavemoney_tables.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * @@ -28,7 +29,5 @@ public function up() * * @return void */ - public function down() - { - } + public function down() {} }; diff --git a/src/backend/database/migrations/micropowermanager/2023_11_03_112202_create_devices_table.php b/src/backend/database/migrations/micropowermanager/2023_11_03_112202_create_devices_table.php index 8b0b749cb..3b59a43a4 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_03_112202_create_devices_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_03_112202_create_devices_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_03_120614_create_solar_home_systems_table.php b/src/backend/database/migrations/micropowermanager/2023_11_03_120614_create_solar_home_systems_table.php index f85c3ac57..c363e96f0 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_03_120614_create_solar_home_systems_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_03_120614_create_solar_home_systems_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_03_121740_add_configuration_columns_to_meters_table.php b/src/backend/database/migrations/micropowermanager/2023_11_03_121740_add_configuration_columns_to_meters_table.php index 60f31da52..5047074de 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_03_121740_add_configuration_columns_to_meters_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_03_121740_add_configuration_columns_to_meters_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_11_142307_update_action_field_type_logs_table.php b/src/backend/database/migrations/micropowermanager/2023_11_11_142307_update_action_field_type_logs_table.php index f3598f212..9ccfeb12d 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_11_142307_update_action_field_type_logs_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_11_142307_update_action_field_type_logs_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * @@ -22,7 +23,5 @@ public function up() * * @return void */ - public function down() - { - } + public function down() {} }; diff --git a/src/backend/database/migrations/micropowermanager/2023_11_14_160711_drop_geo_id_column_from_address_table.php b/src/backend/database/migrations/micropowermanager/2023_11_14_160711_drop_geo_id_column_from_address_table.php index 6ac069628..0ce54ad0e 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_14_160711_drop_geo_id_column_from_address_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_14_160711_drop_geo_id_column_from_address_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_16_175649_add_type_column_to_manufacturers_table.php b/src/backend/database/migrations/micropowermanager/2023_11_16_175649_add_type_column_to_manufacturers_table.php index c5ca997ee..9bedee686 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_16_175649_add_type_column_to_manufacturers_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_16_175649_add_type_column_to_manufacturers_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * @@ -24,7 +25,6 @@ public function up() */ public function down() { - Schema::connection('shard')->table('manufacturers', function (Blueprint $table) { - }); + Schema::connection('shard')->table('manufacturers', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2023_11_16_175940_add_asset_id_column_to_solar_home_systems_table.php b/src/backend/database/migrations/micropowermanager/2023_11_16_175940_add_asset_id_column_to_solar_home_systems_table.php index b8adf1020..7f4e6b598 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_16_175940_add_asset_id_column_to_solar_home_systems_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_16_175940_add_asset_id_column_to_solar_home_systems_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_16_220432_update_person_id_column_in_devices_table.php b/src/backend/database/migrations/micropowermanager/2023_11_16_220432_update_person_id_column_in_devices_table.php index 3493031bb..a8969a9a1 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_16_220432_update_person_id_column_in_devices_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_16_220432_update_person_id_column_in_devices_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * @@ -24,7 +25,6 @@ public function up() */ public function down() { - Schema::connection('shard')->table('devices', function (Blueprint $table) { - }); + Schema::connection('shard')->table('devices', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2023_11_16_220931_update_device_serial_column_in_devices_table.php b/src/backend/database/migrations/micropowermanager/2023_11_16_220931_update_device_serial_column_in_devices_table.php index 8257d4cb9..fd219e566 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_16_220931_update_device_serial_column_in_devices_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_16_220931_update_device_serial_column_in_devices_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * @@ -24,7 +25,6 @@ public function up() */ public function down() { - Schema::connection('shard')->table('devices', function (Blueprint $table) { - }); + Schema::connection('shard')->table('devices', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2023_11_16_221111_update_serial_number_column_in_solar_home_systems_table.php b/src/backend/database/migrations/micropowermanager/2023_11_16_221111_update_serial_number_column_in_solar_home_systems_table.php index d6c41ca57..b56865edb 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_16_221111_update_serial_number_column_in_solar_home_systems_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_16_221111_update_serial_number_column_in_solar_home_systems_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * @@ -24,7 +25,6 @@ public function up() */ public function down() { - Schema::connection('shard')->table('solar_home_systems', function (Blueprint $table) { - }); + Schema::connection('shard')->table('solar_home_systems', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2023_11_17_095204_create_tokens_table.php b/src/backend/database/migrations/micropowermanager/2023_11_17_095204_create_tokens_table.php index ce82cfa03..e097b6fe2 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_17_095204_create_tokens_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_17_095204_create_tokens_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_18_190332_add_device_serial_column_to_asset_people_table.php b/src/backend/database/migrations/micropowermanager/2023_11_18_190332_add_device_serial_column_to_asset_people_table.php index 3b2d1f914..d5c648761 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_18_190332_add_device_serial_column_to_asset_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_18_190332_add_device_serial_column_to_asset_people_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_21_090129_update_derice_serial_column_in_asset_people_table.php b/src/backend/database/migrations/micropowermanager/2023_11_21_090129_update_derice_serial_column_in_asset_people_table.php index efbc51fed..9a3660519 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_21_090129_update_derice_serial_column_in_asset_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_21_090129_update_derice_serial_column_in_asset_people_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * @@ -24,7 +25,6 @@ public function up() */ public function down() { - Schema::connection('shard')->table('asset_people', function (Blueprint $table) { - }); + Schema::connection('shard')->table('asset_people', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2024_01_01_create_daly_bms_tables.php b/src/backend/database/migrations/micropowermanager/2024_01_01_create_daly_bms_tables.php index c3f4aedc8..5a297829b 100644 --- a/src/backend/database/migrations/micropowermanager/2024_01_01_create_daly_bms_tables.php +++ b/src/backend/database/migrations/micropowermanager/2024_01_01_create_daly_bms_tables.php @@ -4,10 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ public function up() { - if (!Schema::hasTable('daly_bms_api_credentials')) { + if (! Schema::hasTable('daly_bms_api_credentials')) { Schema::create('daly_bms_api_credentials', static function (Blueprint $table) { $table->increments('id'); $table->string('api_url')->default('https://dev.iov18.com/api'); @@ -18,7 +19,7 @@ public function up() $table->timestamps(); }); } - if (!Schema::hasTable('daly_bms_transactions')) { + if (! Schema::hasTable('daly_bms_transactions')) { Schema::create('daly_bms_transactions', static function (Blueprint $table) { $table->increments('id'); $table->timestamps(); diff --git a/src/backend/database/migrations/micropowermanager/2024_01_02_124146_create_e_bikes_table.php b/src/backend/database/migrations/micropowermanager/2024_01_02_124146_create_e_bikes_table.php index 6f8820d3e..242593bd2 100644 --- a/src/backend/database/migrations/micropowermanager/2024_01_02_124146_create_e_bikes_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_01_02_124146_create_e_bikes_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_01_12_create_angaza_tables.php b/src/backend/database/migrations/micropowermanager/2024_01_12_create_angaza_tables.php index 1eaf1b33c..bc73df305 100644 --- a/src/backend/database/migrations/micropowermanager/2024_01_12_create_angaza_tables.php +++ b/src/backend/database/migrations/micropowermanager/2024_01_12_create_angaza_tables.php @@ -4,10 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ public function up() { - if (!Schema::connection('shard')->hasTable('angaza_api_credentials')) { + if (! Schema::connection('shard')->hasTable('angaza_api_credentials')) { Schema::connection('shard')->create('angaza_api_credentials', static function (Blueprint $table) { $table->increments('id'); $table->string('api_url')->default('https://payg.angazadesign.com/nexus/v1'); @@ -16,7 +17,7 @@ public function up() $table->timestamps(); }); } - if (!Schema::connection('shard')->hasTable('angaza_transactions')) { + if (! Schema::connection('shard')->hasTable('angaza_transactions')) { Schema::connection('shard')->create('angaza_transactions', static function (Blueprint $table) { $table->increments('id'); $table->timestamps(); diff --git a/src/backend/database/migrations/micropowermanager/2024_02_07_102305_add_usage_type_column_to_main_settings_table.php b/src/backend/database/migrations/micropowermanager/2024_02_07_102305_add_usage_type_column_to_main_settings_table.php index 48469140d..a9bd8b8b0 100644 --- a/src/backend/database/migrations/micropowermanager/2024_02_07_102305_add_usage_type_column_to_main_settings_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_02_07_102305_add_usage_type_column_to_main_settings_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * @@ -32,7 +33,6 @@ public function up() */ public function down() { - Schema::connection('shard')->table('main_settings', function (Blueprint $table) { - }); + Schema::connection('shard')->table('main_settings', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2024_02_07_113710_add_usage_type_column_to_menu_items_table.php b/src/backend/database/migrations/micropowermanager/2024_02_07_113710_add_usage_type_column_to_menu_items_table.php index 23d3993f9..f7feda450 100644 --- a/src/backend/database/migrations/micropowermanager/2024_02_07_113710_add_usage_type_column_to_menu_items_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_02_07_113710_add_usage_type_column_to_menu_items_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_09_30_113302_remove_siderbar_tables.php b/src/backend/database/migrations/micropowermanager/2024_09_30_113302_remove_siderbar_tables.php index c02aecded..645be6508 100644 --- a/src/backend/database/migrations/micropowermanager/2024_09_30_113302_remove_siderbar_tables.php +++ b/src/backend/database/migrations/micropowermanager/2024_09_30_113302_remove_siderbar_tables.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_23_153042_add_amount_to_agent_charge.php b/src/backend/database/migrations/micropowermanager/2024_10_23_153042_add_amount_to_agent_charge.php index d3b7a9eb6..38494b3ee 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_23_153042_add_amount_to_agent_charge.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_23_153042_add_amount_to_agent_charge.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_30_154625_create_notifications_table.php b/src/backend/database/migrations/micropowermanager/2024_10_30_154625_create_notifications_table.php index 448655043..4357c9efa 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_30_154625_create_notifications_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_30_154625_create_notifications_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180458_remove_batteries_table.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180458_remove_batteries_table.php index 81555990f..123b66ebf 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180458_remove_batteries_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180458_remove_batteries_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180510_remove_energies_table.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180510_remove_energies_table.php index a1bd1f04f..c23bda479 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180510_remove_energies_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180510_remove_energies_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180524_remove_mini_grid_frequencies_table.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180524_remove_mini_grid_frequencies_table.php index a9a158daf..f846005b9 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180524_remove_mini_grid_frequencies_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180524_remove_mini_grid_frequencies_table.php @@ -3,7 +3,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180539_remove_pvs_table.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180539_remove_pvs_table.php index 0957f165e..8e6a5b775 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180539_remove_pvs_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180539_remove_pvs_table.php @@ -5,7 +5,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180546_remove_solars_table.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180546_remove_solars_table.php index 8c2f0b897..bd3bfb684 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180546_remove_solars_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180546_remove_solars_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180605_remove_weather_data_table.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180605_remove_weather_data_table.php index 8e91b068d..65b0af06b 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180605_remove_weather_data_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180605_remove_weather_data_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180852_remove_agent_tickets.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180852_remove_agent_tickets.php index 1aec28c01..c34016eca 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180852_remove_agent_tickets.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180852_remove_agent_tickets.php @@ -3,7 +3,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_181016_remove_city_clusters.php b/src/backend/database/migrations/micropowermanager/2024_10_31_181016_remove_city_clusters.php index 86d7d95d8..24c7e67dc 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_181016_remove_city_clusters.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_181016_remove_city_clusters.php @@ -3,7 +3,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_11_11_130340_drop_data_stream_column_from_mini_grid.php b/src/backend/database/migrations/micropowermanager/2024_11_11_130340_drop_data_stream_column_from_mini_grid.php index 82d0ae3e9..dc7da3881 100644 --- a/src/backend/database/migrations/micropowermanager/2024_11_11_130340_drop_data_stream_column_from_mini_grid.php +++ b/src/backend/database/migrations/micropowermanager/2024_11_11_130340_drop_data_stream_column_from_mini_grid.php @@ -4,7 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ /** * Run the migrations. * diff --git a/src/backend/database/seeders/SolarHomeSystemSeeder.php b/src/backend/database/seeders/SolarHomeSystemSeeder.php index e9505edd5..feb80b5ac 100644 --- a/src/backend/database/seeders/SolarHomeSystemSeeder.php +++ b/src/backend/database/seeders/SolarHomeSystemSeeder.php @@ -58,7 +58,7 @@ public function run() ->create(); // Create not-yet-sold SHS such that we can "sell" them in the Demo - for ($i = 1; $i <= 10; ++$i) { + for ($i = 1; $i <= 10; $i++) { $solarHomeSystem = SolarHomeSystem::factory() ->for(Asset::all()->random(), 'appliance') ->for(Manufacturer::where('type', 'shs')->get()->random()) diff --git a/src/backend/database/seeders/TenantSeeder.php b/src/backend/database/seeders/TenantSeeder.php index 640786320..c8ca30b50 100644 --- a/src/backend/database/seeders/TenantSeeder.php +++ b/src/backend/database/seeders/TenantSeeder.php @@ -38,8 +38,7 @@ public function __construct( private DatabaseProxyManagerService $databaseProxyManagerService, private RegistrationTailService $registrationTailService, private MainSettingsService $mainSettingsService, - ) { - } + ) {} /** * Run the database seeds. diff --git a/src/backend/packages/inensus/angaza-shs/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/angaza-shs/src/Console/Commands/InstallPackage.php index 08d373c9e..6b5219641 100644 --- a/src/backend/packages/inensus/angaza-shs/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/angaza-shs/src/Console/Commands/InstallPackage.php @@ -9,6 +9,7 @@ class InstallPackage extends Command { protected $signature = 'angaza-shs:install'; + protected $description = 'Install AngazaSHS Package'; public function __construct( diff --git a/src/backend/packages/inensus/angaza-shs/src/Http/Controllers/AngazaCredentialController.php b/src/backend/packages/inensus/angaza-shs/src/Http/Controllers/AngazaCredentialController.php index 27228446b..48243d5c8 100644 --- a/src/backend/packages/inensus/angaza-shs/src/Http/Controllers/AngazaCredentialController.php +++ b/src/backend/packages/inensus/angaza-shs/src/Http/Controllers/AngazaCredentialController.php @@ -9,9 +9,7 @@ class AngazaCredentialController extends Controller { - public function __construct(private AngazaCredentialService $credentialService) - { - } + public function __construct(private AngazaCredentialService $credentialService) {} public function show(): AngazaResource { diff --git a/src/backend/packages/inensus/angaza-shs/src/Http/Resources/AngazaResource.php b/src/backend/packages/inensus/angaza-shs/src/Http/Resources/AngazaResource.php index 4cd7c6ade..eaf3510c3 100644 --- a/src/backend/packages/inensus/angaza-shs/src/Http/Resources/AngazaResource.php +++ b/src/backend/packages/inensus/angaza-shs/src/Http/Resources/AngazaResource.php @@ -10,8 +10,7 @@ class AngazaResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request - * + * @param Request $request * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/angaza-shs/src/Modules/Api/AngazaSHSApi.php b/src/backend/packages/inensus/angaza-shs/src/Modules/Api/AngazaSHSApi.php index 90a51e72c..7bd585b55 100644 --- a/src/backend/packages/inensus/angaza-shs/src/Modules/Api/AngazaSHSApi.php +++ b/src/backend/packages/inensus/angaza-shs/src/Modules/Api/AngazaSHSApi.php @@ -20,8 +20,7 @@ public function __construct( private AngazaCredentialService $credentialService, private AngazaTransaction $angazaTransaction, private ApiRequests $apiRequests, - ) { - } + ) {} public function chargeMeter(TransactionDataContainer $transactionContainer): array { @@ -84,8 +83,6 @@ public function chargeMeter(TransactionDataContainer $transactionContainer): arr } /** - * @param Meter $meters - * * @return void * * @throws ApiCallDoesNotSupportedException diff --git a/src/backend/packages/inensus/angaza-shs/src/Modules/Api/ApiRequests.php b/src/backend/packages/inensus/angaza-shs/src/Modules/Api/ApiRequests.php index 438668e60..6f7ded792 100644 --- a/src/backend/packages/inensus/angaza-shs/src/Modules/Api/ApiRequests.php +++ b/src/backend/packages/inensus/angaza-shs/src/Modules/Api/ApiRequests.php @@ -11,8 +11,7 @@ class ApiRequests { public function __construct( private Client $httpClient, - ) { - } + ) {} public function get(AngazaCredential $credentials, array $params, string $slug) { diff --git a/src/backend/packages/inensus/angaza-shs/src/Services/AngazaCredentialService.php b/src/backend/packages/inensus/angaza-shs/src/Services/AngazaCredentialService.php index e63b14d25..9f7ccfafc 100644 --- a/src/backend/packages/inensus/angaza-shs/src/Services/AngazaCredentialService.php +++ b/src/backend/packages/inensus/angaza-shs/src/Services/AngazaCredentialService.php @@ -8,8 +8,7 @@ class AngazaCredentialService { public function __construct( private AngazaCredential $credential, - ) { - } + ) {} /** * This function uses one time on installation of the package. diff --git a/src/backend/packages/inensus/angaza-shs/src/Services/ManufacturerService.php b/src/backend/packages/inensus/angaza-shs/src/Services/ManufacturerService.php index 5b6179c7c..f6eeaeb2b 100644 --- a/src/backend/packages/inensus/angaza-shs/src/Services/ManufacturerService.php +++ b/src/backend/packages/inensus/angaza-shs/src/Services/ManufacturerService.php @@ -6,14 +6,12 @@ class ManufacturerService { - public function __construct(private Manufacturer $manufacturer) - { - } + public function __construct(private Manufacturer $manufacturer) {} public function register() { $api = $this->manufacturer->newQuery()->where('api_name', 'AngazaSHSApi')->first(); - if (!$api) { + if (! $api) { $this->manufacturer->newQuery()->create([ 'name' => 'Angaza SHS', 'type' => 'shs', diff --git a/src/backend/packages/inensus/bulk-registration/database/migrations/create_bulk_registration_tables.php b/src/backend/packages/inensus/bulk-registration/database/migrations/create_bulk_registration_tables.php index d90e4dbb1..4fc06dd89 100644 --- a/src/backend/packages/inensus/bulk-registration/database/migrations/create_bulk_registration_tables.php +++ b/src/backend/packages/inensus/bulk-registration/database/migrations/create_bulk_registration_tables.php @@ -4,10 +4,11 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration +{ public function up() { - if (!Schema::hasTable('bulk_registration_csv_datas')) { + if (! Schema::hasTable('bulk_registration_csv_datas')) { Schema::create('bulk_registration_csv_datas', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('user_id'); diff --git a/src/backend/packages/inensus/bulk-registration/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/bulk-registration/src/Console/Commands/InstallPackage.php index 9d282dce1..a4b803653 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/bulk-registration/src/Console/Commands/InstallPackage.php @@ -8,6 +8,7 @@ class InstallPackage extends Command { protected $signature = 'bulk-registration:install'; + protected $description = 'Install Bulk Registration Package'; public function __construct( diff --git a/src/backend/packages/inensus/bulk-registration/src/Console/Commands/UpdatePackage.php b/src/backend/packages/inensus/bulk-registration/src/Console/Commands/UpdatePackage.php index 6685fbf17..3cabead09 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Console/Commands/UpdatePackage.php +++ b/src/backend/packages/inensus/bulk-registration/src/Console/Commands/UpdatePackage.php @@ -9,6 +9,7 @@ class UpdatePackage extends Command { protected $signature = 'bulk-registration:update'; + protected $description = 'Update Bulk Registration Package'; public function __construct( @@ -58,7 +59,7 @@ private function deleteMigration(Filesystem $filesystem) $migrationFile = $filesystem->glob(database_path().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR.'*_create_bulk-registration_tables.php')[0]; $migration = DB::table('migrations') ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->first(); - if (!$migration) { + if (! $migration) { return false; } diff --git a/src/backend/packages/inensus/bulk-registration/src/Exceptions/ClusterNotFoundException.php b/src/backend/packages/inensus/bulk-registration/src/Exceptions/ClusterNotFoundException.php index 092c0ee75..ad3f1f299 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Exceptions/ClusterNotFoundException.php +++ b/src/backend/packages/inensus/bulk-registration/src/Exceptions/ClusterNotFoundException.php @@ -2,6 +2,4 @@ namespace Inensus\BulkRegistration\Exceptions; -class ClusterNotFoundException extends MissingDataException -{ -} +class ClusterNotFoundException extends MissingDataException {} diff --git a/src/backend/packages/inensus/bulk-registration/src/Exceptions/CsvDataParserException.php b/src/backend/packages/inensus/bulk-registration/src/Exceptions/CsvDataParserException.php index 3a75722a3..e5e8bcf3c 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Exceptions/CsvDataParserException.php +++ b/src/backend/packages/inensus/bulk-registration/src/Exceptions/CsvDataParserException.php @@ -2,6 +2,4 @@ namespace Inensus\BulkRegistration\Exceptions; -class CsvDataParserException extends \Exception -{ -} +class CsvDataParserException extends \Exception {} diff --git a/src/backend/packages/inensus/bulk-registration/src/Exceptions/Handler.php b/src/backend/packages/inensus/bulk-registration/src/Exceptions/Handler.php index 85c8f657e..7cf909713 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Exceptions/Handler.php +++ b/src/backend/packages/inensus/bulk-registration/src/Exceptions/Handler.php @@ -28,7 +28,6 @@ class Handler extends ExceptionHandler /** * Report or log an exception. * - * @param \Throwable $exception * * @return void * @@ -42,9 +41,7 @@ public function report(\Throwable $exception) /** * Render an exception into an HTTP response. * - * @param \Illuminate\Http\Request $request - * @param \Throwable $exception - * + * @param \Illuminate\Http\Request $request * @return \Symfony\Component\HttpFoundation\Response * * @throws \Throwable diff --git a/src/backend/packages/inensus/bulk-registration/src/Exceptions/ManufacturerNotSupportedException.php b/src/backend/packages/inensus/bulk-registration/src/Exceptions/ManufacturerNotSupportedException.php index 96e3416d8..6e1867634 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Exceptions/ManufacturerNotSupportedException.php +++ b/src/backend/packages/inensus/bulk-registration/src/Exceptions/ManufacturerNotSupportedException.php @@ -2,6 +2,4 @@ namespace Inensus\BulkRegistration\Exceptions; -class ManufacturerNotSupportedException extends MissingDataException -{ -} +class ManufacturerNotSupportedException extends MissingDataException {} diff --git a/src/backend/packages/inensus/bulk-registration/src/Exceptions/MiniGridNotFoundException.php b/src/backend/packages/inensus/bulk-registration/src/Exceptions/MiniGridNotFoundException.php index 956684318..1cd8960ed 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Exceptions/MiniGridNotFoundException.php +++ b/src/backend/packages/inensus/bulk-registration/src/Exceptions/MiniGridNotFoundException.php @@ -2,6 +2,4 @@ namespace Inensus\BulkRegistration\Exceptions; -class MiniGridNotFoundException extends MissingDataException -{ -} +class MiniGridNotFoundException extends MissingDataException {} diff --git a/src/backend/packages/inensus/bulk-registration/src/Exceptions/MissingDataException.php b/src/backend/packages/inensus/bulk-registration/src/Exceptions/MissingDataException.php index 7fbfa41f4..b0e06e839 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Exceptions/MissingDataException.php +++ b/src/backend/packages/inensus/bulk-registration/src/Exceptions/MissingDataException.php @@ -2,6 +2,4 @@ namespace Inensus\BulkRegistration\Exceptions; -class MissingDataException extends \Exception -{ -} +class MissingDataException extends \Exception {} diff --git a/src/backend/packages/inensus/bulk-registration/src/Exceptions/VillageNotFoundException.php b/src/backend/packages/inensus/bulk-registration/src/Exceptions/VillageNotFoundException.php index 135be2881..fd7eec95e 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Exceptions/VillageNotFoundException.php +++ b/src/backend/packages/inensus/bulk-registration/src/Exceptions/VillageNotFoundException.php @@ -2,6 +2,4 @@ namespace Inensus\BulkRegistration\Exceptions; -class VillageNotFoundException extends MissingDataException -{ -} +class VillageNotFoundException extends MissingDataException {} diff --git a/src/backend/packages/inensus/bulk-registration/src/Helpers/CsvDataProcessor.php b/src/backend/packages/inensus/bulk-registration/src/Helpers/CsvDataProcessor.php index 3371e87ef..ee7dd2fef 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Helpers/CsvDataProcessor.php +++ b/src/backend/packages/inensus/bulk-registration/src/Helpers/CsvDataProcessor.php @@ -9,8 +9,11 @@ class CsvDataProcessor { public const CONNECTION_GROUP = 1; + private $geographicalLocationFinder; + private $reflections; + private $recentlyCreatedRecords; public function __construct(GeographicalLocationFinder $geographicalLocationFinder) @@ -77,7 +80,7 @@ public function processParsedCsvData($csvData) app()->make($this->reflections['GeographicalInformationService']); $geographicalInformationService->resolveCsvDataFromComingRow($row, $meterParameter); - $address = new Address(); + $address = new Address; $address = $address->newQuery()->create([ 'city_id' => $city->id, ]); @@ -108,7 +111,7 @@ private function createRecordFromCsv($row, $serviceName) private function checkRecordWasRecentlyCreated($record, $type) { if ($record->wasRecentlyCreated) { - ++$this->recentlyCreatedRecords[$type]; + $this->recentlyCreatedRecords[$type]++; } } } diff --git a/src/backend/packages/inensus/bulk-registration/src/Helpers/CsvFileParser.php b/src/backend/packages/inensus/bulk-registration/src/Helpers/CsvFileParser.php index 099f05e88..41dabfd48 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Helpers/CsvFileParser.php +++ b/src/backend/packages/inensus/bulk-registration/src/Helpers/CsvFileParser.php @@ -10,7 +10,7 @@ class CsvFileParser public function __construct() { - $this->csv = new Csv(); + $this->csv = new Csv; } public function parseCsvFromFilePath($path) diff --git a/src/backend/packages/inensus/bulk-registration/src/Helpers/GeographicalLocationFinder.php b/src/backend/packages/inensus/bulk-registration/src/Helpers/GeographicalLocationFinder.php index 0c1d8f3b8..a4e8e0748 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Helpers/GeographicalLocationFinder.php +++ b/src/backend/packages/inensus/bulk-registration/src/Helpers/GeographicalLocationFinder.php @@ -8,7 +8,7 @@ class GeographicalLocationFinder { public function getCoordinatesGivenAddress($address) { - $client = new \GuzzleHttp\Client(); + $client = new \GuzzleHttp\Client; $geocoder = new Geocoder($client); $geocoder->setApiKey(config('bulk-registration.geocoder.key')); $geocoder->setCountry(config('bulk-registration.geocoder.country', 'US')); diff --git a/src/backend/packages/inensus/bulk-registration/src/Http/Requests/ImportCsvRequest.php b/src/backend/packages/inensus/bulk-registration/src/Http/Requests/ImportCsvRequest.php index fb470d0e7..1f71bcb5c 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Http/Requests/ImportCsvRequest.php +++ b/src/backend/packages/inensus/bulk-registration/src/Http/Requests/ImportCsvRequest.php @@ -18,8 +18,6 @@ public function authorize() /** * Get the validation rules that apply to the request. - * - * @return array */ public function rules(): array { diff --git a/src/backend/packages/inensus/bulk-registration/src/Models/BaseModel.php b/src/backend/packages/inensus/bulk-registration/src/Models/BaseModel.php index 7d8e10f56..e2bba09e6 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Models/BaseModel.php +++ b/src/backend/packages/inensus/bulk-registration/src/Models/BaseModel.php @@ -7,6 +7,7 @@ class BaseModel extends Model { protected $guarded = ['id']; + public static $rules = []; public function resolveChildRouteBinding($childType, $value, $field) diff --git a/src/backend/packages/inensus/bulk-registration/src/Services/AddressService.php b/src/backend/packages/inensus/bulk-registration/src/Services/AddressService.php index 066865143..732b77dcf 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Services/AddressService.php +++ b/src/backend/packages/inensus/bulk-registration/src/Services/AddressService.php @@ -45,7 +45,7 @@ public function resolveCsvDataFromComingRow($csvData) public function createForPerson(int $personId, int $cityId, ?string $phone, ?string $email, ?string $street, bool $isPrimary): Address { - $address = new Address(); + $address = new Address; $address->setOwner($personId, 'person'); $address->setCityId($cityId); $address->setPhone($phone); diff --git a/src/backend/packages/inensus/bulk-registration/src/Services/CityService.php b/src/backend/packages/inensus/bulk-registration/src/Services/CityService.php index 690d62dea..f37930099 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Services/CityService.php +++ b/src/backend/packages/inensus/bulk-registration/src/Services/CityService.php @@ -16,12 +16,12 @@ public function resolveCsvDataFromComingRow($csvData) { $cityConfig = config('bulk-registration.csv_fields.city'); - if (!$csvData[$cityConfig['name']]) { + if (! $csvData[$cityConfig['name']]) { throw new VillageNotFoundException('Village Name is required'); } $registeredCity = City::query()->where('name', $csvData[$cityConfig['name']])->first(); - if (!$registeredCity) { + if (! $registeredCity) { $message = 'There is no registered Village for '.$csvData[$cityConfig['name']]. '. Please add the Village first.'; diff --git a/src/backend/packages/inensus/bulk-registration/src/Services/ClusterService.php b/src/backend/packages/inensus/bulk-registration/src/Services/ClusterService.php index bfde714e2..deb89dff2 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Services/ClusterService.php +++ b/src/backend/packages/inensus/bulk-registration/src/Services/ClusterService.php @@ -17,12 +17,12 @@ public function resolveCsvDataFromComingRow($csvData) { $clusterConfig = config('bulk-registration.csv_fields.cluster'); - if (!$csvData[$clusterConfig['name']]) { + if (! $csvData[$clusterConfig['name']]) { throw new ClusterNotFoundException('Cluster Name is required'); } $registeredCluster = Cluster::query()->where('name', $csvData[$clusterConfig['name']])->first(); - if (!$registeredCluster) { + if (! $registeredCluster) { $message = 'There is no cluster registered for '.$csvData[$clusterConfig['name']]. '. Please add the Cluster first.'; diff --git a/src/backend/packages/inensus/bulk-registration/src/Services/CsvDataService.php b/src/backend/packages/inensus/bulk-registration/src/Services/CsvDataService.php index 99040cb63..4c8b23f84 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Services/CsvDataService.php +++ b/src/backend/packages/inensus/bulk-registration/src/Services/CsvDataService.php @@ -10,7 +10,9 @@ class CsvDataService { private $csvData; + private $csvDataProcessor; + private $csvFileParser; public function __construct(CsvData $csvData, CsvFileParser $csvFileParser, CsvDataProcessor $csvDataProcessor) diff --git a/src/backend/packages/inensus/bulk-registration/src/Services/ManufacturerService.php b/src/backend/packages/inensus/bulk-registration/src/Services/ManufacturerService.php index 697f8e7dd..48e557292 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Services/ManufacturerService.php +++ b/src/backend/packages/inensus/bulk-registration/src/Services/ManufacturerService.php @@ -26,7 +26,7 @@ public function resolveCsvDataFromComingRow($csvData) { $manufacturerConfig = config('bulk-registration.csv_fields.manufacturer'); - if (!in_array($csvData[$manufacturerConfig['name']], $this->manufacturers)) { + if (! in_array($csvData[$manufacturerConfig['name']], $this->manufacturers)) { $message = 'Manufacturer '.$csvData[$manufacturerConfig['name']]. ' is not supported. Supported manufacturers are '.implode(', ', $this->manufacturers); throw new ManufacturerNotSupportedException($message); diff --git a/src/backend/packages/inensus/bulk-registration/src/Services/MiniGridService.php b/src/backend/packages/inensus/bulk-registration/src/Services/MiniGridService.php index d6cb31d50..4120044c2 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Services/MiniGridService.php +++ b/src/backend/packages/inensus/bulk-registration/src/Services/MiniGridService.php @@ -16,13 +16,13 @@ public function resolveCsvDataFromComingRow($csvData) { $miniGridConfig = config('bulk-registration.csv_fields.mini_grid'); - if (!$csvData[$miniGridConfig['name']]) { + if (! $csvData[$miniGridConfig['name']]) { throw new MiniGridNotFoundException('Mini Grid Name is required'); } $registeredMiniGrid = MiniGrid::query()->where('name', $csvData[$miniGridConfig['name']])->first(); - if (!$registeredMiniGrid) { + if (! $registeredMiniGrid) { $message = 'There is no registered Mini Grid for '.$csvData[$miniGridConfig['name']]. '. Please add the Mini Grid first.'; throw new MiniGridNotFoundException($message); diff --git a/src/backend/packages/inensus/calin-meter/src/CalinMeterApi.php b/src/backend/packages/inensus/calin-meter/src/CalinMeterApi.php index b25d0e6a8..b83a1cdf2 100644 --- a/src/backend/packages/inensus/calin-meter/src/CalinMeterApi.php +++ b/src/backend/packages/inensus/calin-meter/src/CalinMeterApi.php @@ -15,7 +15,9 @@ class CalinMeterApi implements IManufacturerAPI { public const CREDIT_TOKEN = 'CreditToken'; + protected $api; + private $rootUrl = '/tokennew'; public function __construct( diff --git a/src/backend/packages/inensus/calin-meter/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/calin-meter/src/Console/Commands/InstallPackage.php index 5a0757fa2..5ed7b7a50 100644 --- a/src/backend/packages/inensus/calin-meter/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/calin-meter/src/Console/Commands/InstallPackage.php @@ -9,6 +9,7 @@ class InstallPackage extends Command { protected $signature = 'calin-meter:install'; + protected $description = 'Install CalinMeter Package'; public function __construct( diff --git a/src/backend/packages/inensus/calin-meter/src/Console/Commands/UpdatePackage.php b/src/backend/packages/inensus/calin-meter/src/Console/Commands/UpdatePackage.php index 91bbe18f8..093744721 100644 --- a/src/backend/packages/inensus/calin-meter/src/Console/Commands/UpdatePackage.php +++ b/src/backend/packages/inensus/calin-meter/src/Console/Commands/UpdatePackage.php @@ -11,6 +11,7 @@ class UpdatePackage extends Command { protected $signature = 'calin-meter:update'; + protected $description = 'Update CalinMeter Package'; public function __construct( @@ -51,7 +52,7 @@ private function deleteMigration(Filesystem $filesystem) $migrationFile = $filesystem->glob(database_path().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR.'*_create_calin_tables.php')[0]; $migration = DB::table('migrations') ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->first(); - if (!$migration) { + if (! $migration) { return false; } diff --git a/src/backend/packages/inensus/calin-meter/src/Exceptions/CalinApiResponseException.php b/src/backend/packages/inensus/calin-meter/src/Exceptions/CalinApiResponseException.php index aaaf40e91..feb525cad 100644 --- a/src/backend/packages/inensus/calin-meter/src/Exceptions/CalinApiResponseException.php +++ b/src/backend/packages/inensus/calin-meter/src/Exceptions/CalinApiResponseException.php @@ -2,6 +2,4 @@ namespace Inensus\CalinMeter\Exceptions; -class CalinApiResponseException extends \Exception -{ -} +class CalinApiResponseException extends \Exception {} diff --git a/src/backend/packages/inensus/calin-meter/src/Helpers/ApiHelpers.php b/src/backend/packages/inensus/calin-meter/src/Helpers/ApiHelpers.php index 5443a5b77..a9e6724ba 100644 --- a/src/backend/packages/inensus/calin-meter/src/Helpers/ApiHelpers.php +++ b/src/backend/packages/inensus/calin-meter/src/Helpers/ApiHelpers.php @@ -17,7 +17,7 @@ public function __construct(Manufacturer $manufacturerModel) public function registerCalinMeterManufacturer() { $api = $this->manufacturer->newQuery()->where('api_name', 'CalinMeterApi')->first(); - if (!$api) { + if (! $api) { $this->manufacturer->newQuery()->create([ 'name' => 'Calin Meters', 'website' => 'http://www.calinmeter.com/', diff --git a/src/backend/packages/inensus/calin-meter/src/Http/Requests/CalinMeterApiRequests.php b/src/backend/packages/inensus/calin-meter/src/Http/Requests/CalinMeterApiRequests.php index a99f34292..29f77622d 100644 --- a/src/backend/packages/inensus/calin-meter/src/Http/Requests/CalinMeterApiRequests.php +++ b/src/backend/packages/inensus/calin-meter/src/Http/Requests/CalinMeterApiRequests.php @@ -12,7 +12,9 @@ class CalinMeterApiRequests { private $client; + private $apiHelpers; + private $credential; public function __construct( diff --git a/src/backend/packages/inensus/calin-meter/src/Http/Resources/CalinResource.php b/src/backend/packages/inensus/calin-meter/src/Http/Resources/CalinResource.php index 2c5b6dd4b..34ba97dd2 100644 --- a/src/backend/packages/inensus/calin-meter/src/Http/Resources/CalinResource.php +++ b/src/backend/packages/inensus/calin-meter/src/Http/Resources/CalinResource.php @@ -10,8 +10,7 @@ class CalinResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request - * + * @param Request $request * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/calin-smart-meter/src/CalinSmartMeterApi.php b/src/backend/packages/inensus/calin-smart-meter/src/CalinSmartMeterApi.php index 0e48059c1..7f634a6d5 100644 --- a/src/backend/packages/inensus/calin-smart-meter/src/CalinSmartMeterApi.php +++ b/src/backend/packages/inensus/calin-smart-meter/src/CalinSmartMeterApi.php @@ -17,6 +17,7 @@ class CalinSmartMeterApi implements IManufacturerAPI { protected $api; + private $rootUrl = '/POS_Purchase/'; public function __construct( @@ -72,7 +73,7 @@ public function chargeDevice($transactionContainer): array } /** - * @param Meter $meter + * @param Meter $meter * * @throws GuzzleException * diff --git a/src/backend/packages/inensus/calin-smart-meter/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/calin-smart-meter/src/Console/Commands/InstallPackage.php index 705689792..b51c49f23 100644 --- a/src/backend/packages/inensus/calin-smart-meter/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/calin-smart-meter/src/Console/Commands/InstallPackage.php @@ -9,6 +9,7 @@ class InstallPackage extends Command { protected $signature = 'calin-smart-meter:install'; + protected $description = 'Install CalinSmartMeter Package'; public function __construct( diff --git a/src/backend/packages/inensus/calin-smart-meter/src/Console/Commands/UpdatePackage.php b/src/backend/packages/inensus/calin-smart-meter/src/Console/Commands/UpdatePackage.php index 8c14d8d3b..622aa7db7 100644 --- a/src/backend/packages/inensus/calin-smart-meter/src/Console/Commands/UpdatePackage.php +++ b/src/backend/packages/inensus/calin-smart-meter/src/Console/Commands/UpdatePackage.php @@ -10,6 +10,7 @@ class UpdatePackage extends Command { protected $signature = 'calin-smart-meter:update'; + protected $description = 'Update CalinSmartMeter Package'; public function __construct( @@ -49,7 +50,7 @@ private function deleteMigration(Filesystem $filesystem) $migrationFile = $filesystem->glob(database_path().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR.'*_create_calin_smart_tables.php')[0]; $migration = DB::table('migrations') ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->first(); - if (!$migration) { + if (! $migration) { return false; } diff --git a/src/backend/packages/inensus/calin-smart-meter/src/Exceptions/CalinSmartApiResponseException.php b/src/backend/packages/inensus/calin-smart-meter/src/Exceptions/CalinSmartApiResponseException.php index 8e2bd77cd..ccb1a2365 100644 --- a/src/backend/packages/inensus/calin-smart-meter/src/Exceptions/CalinSmartApiResponseException.php +++ b/src/backend/packages/inensus/calin-smart-meter/src/Exceptions/CalinSmartApiResponseException.php @@ -2,6 +2,4 @@ namespace Inensus\CalinSmartMeter\Exceptions; -class CalinSmartApiResponseException extends \Exception -{ -} +class CalinSmartApiResponseException extends \Exception {} diff --git a/src/backend/packages/inensus/calin-smart-meter/src/Exceptions/CalinSmartCreadentialsNotFoundException.php b/src/backend/packages/inensus/calin-smart-meter/src/Exceptions/CalinSmartCreadentialsNotFoundException.php index 32d3b4a70..05c58899b 100644 --- a/src/backend/packages/inensus/calin-smart-meter/src/Exceptions/CalinSmartCreadentialsNotFoundException.php +++ b/src/backend/packages/inensus/calin-smart-meter/src/Exceptions/CalinSmartCreadentialsNotFoundException.php @@ -2,6 +2,4 @@ namespace Inensus\CalinSmartMeter\Exceptions; -class CalinSmartCreadentialsNotFoundException extends \Exception -{ -} +class CalinSmartCreadentialsNotFoundException extends \Exception {} diff --git a/src/backend/packages/inensus/calin-smart-meter/src/Helpers/ApiHelpers.php b/src/backend/packages/inensus/calin-smart-meter/src/Helpers/ApiHelpers.php index 550b05bbb..a02660b2e 100644 --- a/src/backend/packages/inensus/calin-smart-meter/src/Helpers/ApiHelpers.php +++ b/src/backend/packages/inensus/calin-smart-meter/src/Helpers/ApiHelpers.php @@ -17,7 +17,7 @@ public function __construct(Manufacturer $manufacturerModel) public function registerCalinMeterManufacturer() { $api = $this->manufacturer->newQuery()->where('api_name', 'CalinSmartMeterApi')->first(); - if (!$api) { + if (! $api) { $this->manufacturer->newQuery()->create([ 'name' => 'Calin Smart Meters', 'website' => 'https://ami.calinhost.com/', diff --git a/src/backend/packages/inensus/calin-smart-meter/src/Http/Requests/CalinSmartMeterApiRequests.php b/src/backend/packages/inensus/calin-smart-meter/src/Http/Requests/CalinSmartMeterApiRequests.php index 22fbe73f7..e3a0582a1 100644 --- a/src/backend/packages/inensus/calin-smart-meter/src/Http/Requests/CalinSmartMeterApiRequests.php +++ b/src/backend/packages/inensus/calin-smart-meter/src/Http/Requests/CalinSmartMeterApiRequests.php @@ -12,7 +12,9 @@ class CalinSmartMeterApiRequests { private $client; + private $apiHelpers; + private $credential; public function __construct( diff --git a/src/backend/packages/inensus/calin-smart-meter/src/Http/Resources/CalinSmartResource.php b/src/backend/packages/inensus/calin-smart-meter/src/Http/Resources/CalinSmartResource.php index 0be320896..0045cfc2f 100644 --- a/src/backend/packages/inensus/calin-smart-meter/src/Http/Resources/CalinSmartResource.php +++ b/src/backend/packages/inensus/calin-smart-meter/src/Http/Resources/CalinSmartResource.php @@ -10,8 +10,7 @@ class CalinSmartResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request - * + * @param Request $request * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/daly-bms/src/Console/Commands/CheckPayments.php b/src/backend/packages/inensus/daly-bms/src/Console/Commands/CheckPayments.php index c46363356..4bcc151b8 100644 --- a/src/backend/packages/inensus/daly-bms/src/Console/Commands/CheckPayments.php +++ b/src/backend/packages/inensus/daly-bms/src/Console/Commands/CheckPayments.php @@ -14,11 +14,15 @@ class CheckPayments extends AbstractSharedCommand { use ScheduledPluginCommand; + public const MPM_PLUGIN_ID = 16; + public const E_BIKE = 2; + public const MANUFACTURER_NAME = 'DalyBms'; protected $signature = 'daly-bms:check-payments'; + protected $description = 'Checks payments for e-bikes.'; public function __construct( @@ -33,7 +37,7 @@ public function __construct( public function handle(): void { - if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { + if (! $this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } diff --git a/src/backend/packages/inensus/daly-bms/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/daly-bms/src/Console/Commands/InstallPackage.php index 6b5adedc1..166343643 100644 --- a/src/backend/packages/inensus/daly-bms/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/daly-bms/src/Console/Commands/InstallPackage.php @@ -9,6 +9,7 @@ class InstallPackage extends Command { protected $signature = 'daly-bms:install'; + protected $description = 'Install DalyBms Package'; public function __construct( diff --git a/src/backend/packages/inensus/daly-bms/src/Console/Commands/SyncBikes.php b/src/backend/packages/inensus/daly-bms/src/Console/Commands/SyncBikes.php index 3e09a9561..038262e32 100644 --- a/src/backend/packages/inensus/daly-bms/src/Console/Commands/SyncBikes.php +++ b/src/backend/packages/inensus/daly-bms/src/Console/Commands/SyncBikes.php @@ -12,10 +12,13 @@ class SyncBikes extends AbstractSharedCommand { use ScheduledPluginCommand; + public const MPM_PLUGIN_ID = 16; + public const MANUFACTURER_NAME = 'DalyBms'; protected $signature = 'daly-bms:sync-bikes'; + protected $description = 'Sync bikes from Daly BMS.'; public function __construct( @@ -28,7 +31,7 @@ public function __construct( public function handle(): void { - if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { + if (! $this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } diff --git a/src/backend/packages/inensus/daly-bms/src/Http/Controllers/DalyBmsCredentialController.php b/src/backend/packages/inensus/daly-bms/src/Http/Controllers/DalyBmsCredentialController.php index 371744bf2..d33cbf6e8 100644 --- a/src/backend/packages/inensus/daly-bms/src/Http/Controllers/DalyBmsCredentialController.php +++ b/src/backend/packages/inensus/daly-bms/src/Http/Controllers/DalyBmsCredentialController.php @@ -11,8 +11,7 @@ class DalyBmsCredentialController extends Controller { public function __construct( private DalyBmsCredentialService $credentialService, - ) { - } + ) {} public function show(): DalyBmsResource { diff --git a/src/backend/packages/inensus/daly-bms/src/Http/Resources/DalyBmsResource.php b/src/backend/packages/inensus/daly-bms/src/Http/Resources/DalyBmsResource.php index 0e7cc1363..3894c0ca6 100644 --- a/src/backend/packages/inensus/daly-bms/src/Http/Resources/DalyBmsResource.php +++ b/src/backend/packages/inensus/daly-bms/src/Http/Resources/DalyBmsResource.php @@ -10,8 +10,7 @@ class DalyBmsResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request - * + * @param Request $request * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/daly-bms/src/Modules/Api/ApiRequests.php b/src/backend/packages/inensus/daly-bms/src/Modules/Api/ApiRequests.php index 6b9b21775..67e3e1cf4 100644 --- a/src/backend/packages/inensus/daly-bms/src/Modules/Api/ApiRequests.php +++ b/src/backend/packages/inensus/daly-bms/src/Modules/Api/ApiRequests.php @@ -12,8 +12,7 @@ class ApiRequests { public function __construct( private Client $httpClient, - ) { - } + ) {} public function authentication($credential): array { @@ -64,7 +63,7 @@ public function postWithBodyParams(DalyBmsCredential $credentials, array $params $body = json_decode((string) $response->getBody(), true); $status = $body['status']; - if (($status !== 200 && $status !== 201) || (!is_array($body['response']) && $body['response'] === false)) { + if (($status !== 200 && $status !== 201) || (! is_array($body['response']) && $body['response'] === false)) { throw new DalyBmsApiResponseException($body['msg']); } diff --git a/src/backend/packages/inensus/daly-bms/src/Modules/Api/DalyBmsApi.php b/src/backend/packages/inensus/daly-bms/src/Modules/Api/DalyBmsApi.php index f7cc49c13..ba47e722f 100644 --- a/src/backend/packages/inensus/daly-bms/src/Modules/Api/DalyBmsApi.php +++ b/src/backend/packages/inensus/daly-bms/src/Modules/Api/DalyBmsApi.php @@ -17,8 +17,10 @@ class DalyBmsApi implements IManufacturerAPI { // works with query params public const COMMAND_DEVICES_LIST = '/Monitor/Refresh'; + // works with query params public const COMMAND_DEVICE_DETAIL = '/Monitor/ShowMonitorTips?'; + // works with body params public const COMMAND_SWITCH = '/Monitor/Send'; @@ -27,8 +29,7 @@ public function __construct( private DalyBmsTransaction $dalyBmsTransaction, private EBikeService $eBikeService, private ApiRequests $apiRequests, - ) { - } + ) {} public function getDevices(array $deviceSerials) { @@ -39,7 +40,7 @@ public function getDevices(array $deviceSerials) $credentials = $this->credentialService->getCredentials(); try { - if (!$this->credentialService->isAccessTokenValid($credentials)) { + if (! $this->credentialService->isAccessTokenValid($credentials)) { $authResponse = $this->apiRequests->authentication($credentials); $this->credentialService->updateCredentials($credentials, $authResponse); } @@ -62,7 +63,7 @@ public function getDevice(string $code) $credentials = $this->credentialService->getCredentials(); try { - if (!$this->credentialService->isAccessTokenValid($credentials)) { + if (! $this->credentialService->isAccessTokenValid($credentials)) { $authResponse = $this->apiRequests->authentication($credentials); $this->credentialService->updateCredentials($credentials, $authResponse); } @@ -90,7 +91,7 @@ public function switchDevice(string $code, bool $isOn) $credentials = $this->credentialService->getCredentials(); try { - if (!$this->credentialService->isAccessTokenValid($credentials)) { + if (! $this->credentialService->isAccessTokenValid($credentials)) { $authResponse = $this->apiRequests->authentication($credentials); $this->credentialService->updateCredentials($credentials, $authResponse); } diff --git a/src/backend/packages/inensus/daly-bms/src/Services/DalyBmsCredentialService.php b/src/backend/packages/inensus/daly-bms/src/Services/DalyBmsCredentialService.php index 231cf47d9..d5277ee14 100644 --- a/src/backend/packages/inensus/daly-bms/src/Services/DalyBmsCredentialService.php +++ b/src/backend/packages/inensus/daly-bms/src/Services/DalyBmsCredentialService.php @@ -8,8 +8,7 @@ class DalyBmsCredentialService { public function __construct( private DalyBmsCredential $credential, - ) { - } + ) {} /** * This function uses one time on installation of the package. diff --git a/src/backend/packages/inensus/daly-bms/src/Services/ManufacturerService.php b/src/backend/packages/inensus/daly-bms/src/Services/ManufacturerService.php index f9902e410..5996c25e5 100644 --- a/src/backend/packages/inensus/daly-bms/src/Services/ManufacturerService.php +++ b/src/backend/packages/inensus/daly-bms/src/Services/ManufacturerService.php @@ -6,14 +6,12 @@ class ManufacturerService { - public function __construct(private Manufacturer $manufacturer) - { - } + public function __construct(private Manufacturer $manufacturer) {} public function register() { $api = $this->manufacturer->newQuery()->where('api_name', 'DalyBmsApi')->first(); - if (!$api) { + if (! $api) { $this->manufacturer->newQuery()->create([ 'name' => 'DalyBms', 'type' => 'e-bike', diff --git a/src/backend/packages/inensus/gome-long-meter/src/Console/Commands/GomeLongMeterDataSynchronizer.php b/src/backend/packages/inensus/gome-long-meter/src/Console/Commands/GomeLongMeterDataSynchronizer.php index 802bf3f51..3a10b4c60 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Console/Commands/GomeLongMeterDataSynchronizer.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Console/Commands/GomeLongMeterDataSynchronizer.php @@ -10,6 +10,7 @@ class GomeLongMeterDataSynchronizer extends AbstractSharedCommand { protected $signature = 'gome-long-meter:dataSync'; + protected $description = 'Synchronize data that needs to be updated from GomeLong Meter Meter.'; public function __construct( diff --git a/src/backend/packages/inensus/gome-long-meter/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/gome-long-meter/src/Console/Commands/InstallPackage.php index edc3c4522..c8d3eff31 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Console/Commands/InstallPackage.php @@ -9,6 +9,7 @@ class InstallPackage extends Command { protected $signature = 'gome-long-meter:install'; + protected $description = 'Install GomeLongMeter Package'; public function __construct( diff --git a/src/backend/packages/inensus/gome-long-meter/src/Exceptions/CronJobException.php b/src/backend/packages/inensus/gome-long-meter/src/Exceptions/CronJobException.php index f2eca50cc..2b9a10779 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Exceptions/CronJobException.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Exceptions/CronJobException.php @@ -2,6 +2,4 @@ namespace Inensus\GomeLongMeter\Exceptions; -class CronJobException extends \Exception -{ -} +class CronJobException extends \Exception {} diff --git a/src/backend/packages/inensus/gome-long-meter/src/Http/Controllers/GomeLongCredentialController.php b/src/backend/packages/inensus/gome-long-meter/src/Http/Controllers/GomeLongCredentialController.php index c93d1f52a..7a6da6ff0 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Http/Controllers/GomeLongCredentialController.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Http/Controllers/GomeLongCredentialController.php @@ -11,8 +11,7 @@ class GomeLongCredentialController extends Controller { public function __construct( private GomeLongCredentialService $credentialService, - ) { - } + ) {} public function show(): GomeLongResource { diff --git a/src/backend/packages/inensus/gome-long-meter/src/Http/Resources/GomeLongResource.php b/src/backend/packages/inensus/gome-long-meter/src/Http/Resources/GomeLongResource.php index 2cae87243..2aa0c3563 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Http/Resources/GomeLongResource.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Http/Resources/GomeLongResource.php @@ -10,8 +10,7 @@ class GomeLongResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request - * + * @param Request $request * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/gome-long-meter/src/Modules/Api/ApiRequests.php b/src/backend/packages/inensus/gome-long-meter/src/Modules/Api/ApiRequests.php index 545825988..476a2949d 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Modules/Api/ApiRequests.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Modules/Api/ApiRequests.php @@ -12,8 +12,7 @@ class ApiRequests { public function __construct( private Client $httpClient, - ) { - } + ) {} public function get(GomeLongCredential $credentials, array $params, string $slug) { diff --git a/src/backend/packages/inensus/gome-long-meter/src/Modules/Api/GomeLongMeterApi.php b/src/backend/packages/inensus/gome-long-meter/src/Modules/Api/GomeLongMeterApi.php index 34fcec610..51f515950 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Modules/Api/GomeLongMeterApi.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Modules/Api/GomeLongMeterApi.php @@ -18,8 +18,7 @@ public function __construct( private GomeLongCredentialService $credentialService, private GomeLongTransaction $gomeLongTransaction, private ApiRequests $apiRequests, - ) { - } + ) {} public function chargeDevice(TransactionDataContainer $transactionContainer): array { diff --git a/src/backend/packages/inensus/gome-long-meter/src/Observers/MeterTariffObserver.php b/src/backend/packages/inensus/gome-long-meter/src/Observers/MeterTariffObserver.php index 7db874da3..a41d9e0ac 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Observers/MeterTariffObserver.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Observers/MeterTariffObserver.php @@ -16,12 +16,11 @@ class MeterTariffObserver public function __construct( private GomeLongTariffService $gomeLongTariffService, private GomeLongCredentialService $credentialService, - ) { - } + ) {} public function created(MeterTariff $tariff) { - if (!$this->checkForPluginStatusIsActive(MpmPlugin::GOME_LONG_METERS)) { + if (! $this->checkForPluginStatusIsActive(MpmPlugin::GOME_LONG_METERS)) { return; } $credential = $this->credentialService->getCredentials(); @@ -32,7 +31,7 @@ public function created(MeterTariff $tariff) public function updated(MeterTariff $tariff) { - if (!$this->checkForPluginStatusIsActive(MpmPlugin::GOME_LONG_METERS)) { + if (! $this->checkForPluginStatusIsActive(MpmPlugin::GOME_LONG_METERS)) { return; } $credential = $this->credentialService->getCredentials(); @@ -44,7 +43,7 @@ public function updated(MeterTariff $tariff) public function deleted(MeterTariff $tariff) { - if (!$this->checkForPluginStatusIsActive(MpmPlugin::GOME_LONG_METERS)) { + if (! $this->checkForPluginStatusIsActive(MpmPlugin::GOME_LONG_METERS)) { return; } $credential = $this->credentialService->getCredentials(); diff --git a/src/backend/packages/inensus/gome-long-meter/src/Services/GomeLongCredentialService.php b/src/backend/packages/inensus/gome-long-meter/src/Services/GomeLongCredentialService.php index 64a980d94..4c22c5198 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Services/GomeLongCredentialService.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Services/GomeLongCredentialService.php @@ -8,8 +8,7 @@ class GomeLongCredentialService { public function __construct( private GomeLongCredential $credential, - ) { - } + ) {} /** * This function uses one time on installation of the package. diff --git a/src/backend/packages/inensus/gome-long-meter/src/Services/GomeLongTariffService.php b/src/backend/packages/inensus/gome-long-meter/src/Services/GomeLongTariffService.php index 0e7407e74..1bfab89a7 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Services/GomeLongTariffService.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Services/GomeLongTariffService.php @@ -11,9 +11,13 @@ class GomeLongTariffService { public const API_CALL_TARIFF_LIST = '/UTSearch'; + public const API_CALL_TARIFF_CREATE = '/UTAdd'; + public const API_CALL_TARIFF_UPDATE = '/UTUpdate'; + public const API_CALL_TARIFF_DELETE = '/UTdelete'; + public const ELECTRICITY_TARIFF_TYPE = 1; public function __construct( @@ -22,8 +26,7 @@ public function __construct( private GomeLongTariff $gomeLongTariff, private GomeLongCredentialService $credentialService, private MainSettings $mainSettings, - ) { - } + ) {} public function getByMpmTariffId($mpmTariffId) { @@ -34,7 +37,7 @@ public function createGomeLongTariff($tariff) { $gomeLongTariff = $this->getByMpmTariffId($tariff->id); - if (!$gomeLongTariff) { + if (! $gomeLongTariff) { $credentials = $this->credentialService->getCredentials(); $vatEnergy = $this->mainSettings->newQuery()->first()->vat_energy; $params = [ @@ -61,7 +64,7 @@ public function updateGomeLongTariff($tariff) try { $gomeLongTariff = $this->getByMpmTariffId($tariff->id); - if (!$gomeLongTariff) { + if (! $gomeLongTariff) { return true; } @@ -118,7 +121,7 @@ public function sync() try { $credentials = $this->credentialService->getCredentials(); - if (!$credentials || ($credentials->getUserId() === null + if (! $credentials || ($credentials->getUserId() === null || $credentials->getUserPassword() === null)) { return true; } @@ -153,7 +156,7 @@ public function sync() 'vat' => $gomeLongTariff['FVAT'], ]); } else { - $IncidentModel = new MeterTariff(); + $IncidentModel = new MeterTariff; $IncidentModel->unsetEventDispatcher(); $meterTariff = $IncidentModel->create([ 'name' => $gomeLongTariff['FName'], diff --git a/src/backend/packages/inensus/gome-long-meter/src/Services/ManufacturerService.php b/src/backend/packages/inensus/gome-long-meter/src/Services/ManufacturerService.php index 0ee2502ee..9efecb8b3 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Services/ManufacturerService.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Services/ManufacturerService.php @@ -6,14 +6,12 @@ class ManufacturerService { - public function __construct(private Manufacturer $manufacturer) - { - } + public function __construct(private Manufacturer $manufacturer) {} public function register() { $api = $this->manufacturer->newQuery()->where('api_name', 'GomeLongMeterApi')->first(); - if (!$api) { + if (! $api) { $this->manufacturer->newQuery()->create([ 'name' => 'GomeLong Meters', 'website' => 'https://www.gomelongmeter.com/', diff --git a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/AccessTokenRefresher.php b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/AccessTokenRefresher.php index e0da884d8..123a453f7 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/AccessTokenRefresher.php +++ b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/AccessTokenRefresher.php @@ -10,8 +10,11 @@ class AccessTokenRefresher extends AbstractSharedCommand { use ScheduledPluginCommand; + public const MPM_PLUGIN_ID = 5; + protected $signature = 'kelin-meter:access-token-refresher'; + protected $description = 'Refreshes access token per each one hour.'; public function __construct(private KelinCredentialService $credentialService) @@ -21,7 +24,7 @@ public function __construct(private KelinCredentialService $credentialService) public function handle(): void { - if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { + if (! $this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } diff --git a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/DataSynchronizer.php b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/DataSynchronizer.php index 190c3f1cd..637944975 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/DataSynchronizer.php +++ b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/DataSynchronizer.php @@ -19,9 +19,11 @@ class DataSynchronizer extends AbstractSharedCommand { use ScheduledPluginCommand; + public const MPM_PLUGIN_ID = 5; protected $signature = 'kelin-meter:dataSync'; + protected $description = 'Synchronize data that needs to be updated from Kelin platform.'; public function __construct( @@ -37,7 +39,7 @@ public function __construct( public function handle(): void { - if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { + if (! $this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } @@ -51,18 +53,18 @@ public function handle(): void try { $this->syncSettingService->getSyncSettings()->each(function ($syncSetting) use ($syncActions) { $syncAction = $syncActions->where('sync_setting_id', $syncSetting->id)->first(); - if (!$syncAction) { + if (! $syncAction) { return true; } if ($syncAction->attempts >= $syncSetting->max_attempts) { $nextSync = Carbon::parse($syncAction->next_sync)->addHours(2); $syncAction->next_sync = $nextSync; $cluster = $this->cluster->newQuery()->with('manager')->first(); - if (!$cluster) { + if (! $cluster) { return true; } $adminAddress = $this->address->whereHasMorph('owner', [$cluster->manager])->first(); - if (!$adminAddress) { + if (! $adminAddress) { return true; } $data = [ diff --git a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/InstallPackage.php index 96e140374..908fc8bfe 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/InstallPackage.php @@ -10,6 +10,7 @@ class InstallPackage extends Command { protected $signature = 'kelin-meter:install'; + protected $description = 'Install KelinMeters Package'; public function __construct( diff --git a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/ReadDailyMeterConsumptions.php b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/ReadDailyMeterConsumptions.php index a71a95fb5..43055cf97 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/ReadDailyMeterConsumptions.php +++ b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/ReadDailyMeterConsumptions.php @@ -11,9 +11,11 @@ class ReadDailyMeterConsumptions extends AbstractSharedCommand { use ScheduledPluginCommand; + public const MPM_PLUGIN_ID = 5; protected $signature = 'kelin-meter:read-daily-consumptions'; + protected $description = 'Reads daily meter consumptions.'; public function __construct( @@ -25,7 +27,7 @@ public function __construct( public function handle(): void { - if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { + if (! $this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } diff --git a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/ReadMinutelyMeterConsumptions.php b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/ReadMinutelyMeterConsumptions.php index 3268937d3..95e0fbba5 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/ReadMinutelyMeterConsumptions.php +++ b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/ReadMinutelyMeterConsumptions.php @@ -11,9 +11,11 @@ class ReadMinutelyMeterConsumptions extends AbstractSharedCommand { use ScheduledPluginCommand; + public const MPM_PLUGIN_ID = 5; protected $signature = 'kelin-meter:read-minutely-consumptions'; + protected $description = 'Reads daily meter consumptions.'; public function __construct( @@ -25,7 +27,7 @@ public function __construct( public function handle(): void { - if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { + if (! $this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } diff --git a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/UpdatePackage.php b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/UpdatePackage.php index b2f75d32c..9dc1c908f 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/UpdatePackage.php +++ b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/UpdatePackage.php @@ -12,6 +12,7 @@ class UpdatePackage extends Command { protected $signature = 'kelin-meter:update'; + protected $description = 'Update Kelin Meter Package'; public function __construct( @@ -55,7 +56,7 @@ private function deleteMigration(Filesystem $filesystem) $migrationFile = $filesystem->glob(database_path().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR.'*_create_kelin_tables.php')[0]; $migration = DB::table('migrations') ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->first(); - if (!$migration) { + if (! $migration) { return false; } diff --git a/src/backend/packages/inensus/kelin-meter/src/Exceptions/CronJobException.php b/src/backend/packages/inensus/kelin-meter/src/Exceptions/CronJobException.php index 4db7ad337..dc7168cce 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Exceptions/CronJobException.php +++ b/src/backend/packages/inensus/kelin-meter/src/Exceptions/CronJobException.php @@ -2,6 +2,4 @@ namespace Inensus\KelinMeter\Exceptions; -class CronJobException extends \Exception -{ -} +class CronJobException extends \Exception {} diff --git a/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiAuthenticationException.php b/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiAuthenticationException.php index c05efe0a1..faf39f98e 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiAuthenticationException.php +++ b/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiAuthenticationException.php @@ -2,6 +2,4 @@ namespace Inensus\KelinMeter\Exceptions; -class KelinApiAuthenticationException extends \Exception -{ -} +class KelinApiAuthenticationException extends \Exception {} diff --git a/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiCredentialsNotFoundException.php b/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiCredentialsNotFoundException.php index 2246d9d4c..34301a174 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiCredentialsNotFoundException.php +++ b/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiCredentialsNotFoundException.php @@ -2,6 +2,4 @@ namespace Inensus\KelinMeter\Exceptions; -class KelinApiCredentialsNotFoundException extends \Exception -{ -} +class KelinApiCredentialsNotFoundException extends \Exception {} diff --git a/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiEmtyDataException.php b/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiEmtyDataException.php index 68bd2b579..ff3866d80 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiEmtyDataException.php +++ b/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiEmtyDataException.php @@ -2,6 +2,4 @@ namespace Inensus\KelinMeter\Exceptions; -class KelinApiEmtyDataException extends \Exception -{ -} +class KelinApiEmtyDataException extends \Exception {} diff --git a/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiResponseException.php b/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiResponseException.php index 63919970c..89c16c12d 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiResponseException.php +++ b/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiResponseException.php @@ -2,6 +2,4 @@ namespace Inensus\KelinMeter\Exceptions; -class KelinApiResponseException extends \Exception -{ -} +class KelinApiResponseException extends \Exception {} diff --git a/src/backend/packages/inensus/kelin-meter/src/Helpers/ApiHelpers.php b/src/backend/packages/inensus/kelin-meter/src/Helpers/ApiHelpers.php index d4e2f4c6e..8216dbe75 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Helpers/ApiHelpers.php +++ b/src/backend/packages/inensus/kelin-meter/src/Helpers/ApiHelpers.php @@ -27,7 +27,7 @@ public function registerMeterManufacturer() public function checkApiResult($result) { - if (!$result) { + if (! $result) { throw new KelinApiEmtyDataException('Null result returned.'); } if ($result['status'] == -1) { diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Clients/KelinMeterApiClient.php b/src/backend/packages/inensus/kelin-meter/src/Http/Clients/KelinMeterApiClient.php index 7170a4dea..13be19e58 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Clients/KelinMeterApiClient.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Clients/KelinMeterApiClient.php @@ -13,7 +13,9 @@ class KelinMeterApiClient { private $client; + private $apiHelpers; + private $credential; public function __construct( diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/DailyConsumptionCollection.php b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/DailyConsumptionCollection.php index e3c9b2908..1366fec14 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/DailyConsumptionCollection.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/DailyConsumptionCollection.php @@ -9,8 +9,7 @@ class DailyConsumptionCollection extends ResourceCollection /** * Transform the resource collection into an array. * - * @param \Illuminate\Http\Request $request - * + * @param \Illuminate\Http\Request $request * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinCustomerCollection.php b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinCustomerCollection.php index e5d3baeba..8b9935933 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinCustomerCollection.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinCustomerCollection.php @@ -9,8 +9,7 @@ class KelinCustomerCollection extends ResourceCollection /** * Transform the resource collection into an array. * - * @param \Illuminate\Http\Request $request - * + * @param \Illuminate\Http\Request $request * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinMeterCollection.php b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinMeterCollection.php index ad033f477..e6144951f 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinMeterCollection.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinMeterCollection.php @@ -9,8 +9,7 @@ class KelinMeterCollection extends ResourceCollection /** * Transform the resource collection into an array. * - * @param \Illuminate\Http\Request $request - * + * @param \Illuminate\Http\Request $request * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinResource.php b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinResource.php index 5c5b2694f..013bc8a96 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinResource.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinResource.php @@ -10,8 +10,7 @@ class KelinResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request - * + * @param Request $request * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinSettingCollection.php b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinSettingCollection.php index 560514960..e1bf4d578 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinSettingCollection.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinSettingCollection.php @@ -9,8 +9,7 @@ class KelinSettingCollection extends ResourceCollection /** * Transform the resource collection into an array. * - * @param \Illuminate\Http\Request $request - * + * @param \Illuminate\Http\Request $request * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/MinutelyConsumptionCollection.php b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/MinutelyConsumptionCollection.php index e5f600943..243bd67d4 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/MinutelyConsumptionCollection.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/MinutelyConsumptionCollection.php @@ -9,8 +9,7 @@ class MinutelyConsumptionCollection extends ResourceCollection /** * Transform the resource collection into an array. * - * @param \Illuminate\Http\Request $request - * + * @param \Illuminate\Http\Request $request * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/kelin-meter/src/KelinMeterApi.php b/src/backend/packages/inensus/kelin-meter/src/KelinMeterApi.php index 3d7da8919..7657a5aa2 100644 --- a/src/backend/packages/inensus/kelin-meter/src/KelinMeterApi.php +++ b/src/backend/packages/inensus/kelin-meter/src/KelinMeterApi.php @@ -21,8 +21,7 @@ public function __construct( private KelinMeter $kelinMeter, private KelinTransaction $kelinTransaction, private KelinMeterApiClient $kelinApi, - ) { - } + ) {} public function chargeDevice($transactionContainer): array { @@ -114,7 +113,5 @@ public function chargeDevice($transactionContainer): array } } - public function clearDevice(Device $device) - { - } + public function clearDevice(Device $device) {} } diff --git a/src/backend/packages/inensus/kelin-meter/src/Models/SyncStatus.php b/src/backend/packages/inensus/kelin-meter/src/Models/SyncStatus.php index 4ed55c70b..9a8bf44ed 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Models/SyncStatus.php +++ b/src/backend/packages/inensus/kelin-meter/src/Models/SyncStatus.php @@ -5,7 +5,10 @@ abstract class SyncStatus { public const SYNCED = 1; + public const MODIFIED = 2; + public const NOT_REGISTERED_YET = 3; + public const EARLY_REGISTERED = 4; } diff --git a/src/backend/packages/inensus/kelin-meter/src/Observers/PersonObserver.php b/src/backend/packages/inensus/kelin-meter/src/Observers/PersonObserver.php index 1dc26b6e7..9f192ca82 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Observers/PersonObserver.php +++ b/src/backend/packages/inensus/kelin-meter/src/Observers/PersonObserver.php @@ -10,8 +10,11 @@ class PersonObserver { private $customerService; + private $apiHelpers; + private $person; + private $kelinCustomer; public function __construct( diff --git a/src/backend/packages/inensus/kelin-meter/src/Services/DailyConsumptionService.php b/src/backend/packages/inensus/kelin-meter/src/Services/DailyConsumptionService.php index 5f14d0c36..508839cef 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Services/DailyConsumptionService.php +++ b/src/backend/packages/inensus/kelin-meter/src/Services/DailyConsumptionService.php @@ -10,7 +10,9 @@ class DailyConsumptionService { private $rootUrl = '/getDayData'; + private $kelinApi; + private $kelinMeterDailyData; public function __construct( @@ -65,7 +67,7 @@ public function getDailyDataFromAPI() 'reverted_reactive_total_daily_power' => $data['dlFw'], ]); }); - ++$pageNo; + $pageNo++; } catch (\Exception $exception) { Log::error('Failed on daily data request .', ['message' => $exception->getMessage()]); $result['dataCount'] = 0; diff --git a/src/backend/packages/inensus/kelin-meter/src/Services/KelinCredentialService.php b/src/backend/packages/inensus/kelin-meter/src/Services/KelinCredentialService.php index fdfb14a75..d977fe722 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Services/KelinCredentialService.php +++ b/src/backend/packages/inensus/kelin-meter/src/Services/KelinCredentialService.php @@ -11,7 +11,9 @@ class KelinCredentialService { private $rootUrl = '/login'; + private $credential; + private $kelinApi; public function __construct( @@ -78,7 +80,7 @@ public function updateCredentials($data) public function refreshAccessToken() { $credential = $this->getCredentials(); - if (!$credential->username && !$credential->password) { + if (! $credential->username && ! $credential->password) { Log::debug('KelinMeter credentials is not registered yet.'); return; diff --git a/src/backend/packages/inensus/kelin-meter/src/Services/KelinCustomerService.php b/src/backend/packages/inensus/kelin-meter/src/Services/KelinCustomerService.php index b0a6480ee..d10d9f44f 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Services/KelinCustomerService.php +++ b/src/backend/packages/inensus/kelin-meter/src/Services/KelinCustomerService.php @@ -17,11 +17,17 @@ class KelinCustomerService implements ISynchronizeService { private $rootUrl = '/listCons'; + private $kelinCustomer; + private $person; + private $kelinApiClient; + private $apiHelpers; + private $syncSettingService; + private $syncActionService; public function __construct( diff --git a/src/backend/packages/inensus/kelin-meter/src/Services/KelinMeterService.php b/src/backend/packages/inensus/kelin-meter/src/Services/KelinMeterService.php index ac01b6de1..f68b2efc5 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Services/KelinMeterService.php +++ b/src/backend/packages/inensus/kelin-meter/src/Services/KelinMeterService.php @@ -25,20 +25,33 @@ class KelinMeterService implements ISynchronizeService { private $meter; + private $rootUrl = '/listMeter'; + private $kelinMeter; + private $kelinApiClient; + private $apiHelpers; + private $syncSettingService; + private $syncActionService; + private $kelinCustomer; + private $meterParameter; + private $manufacturer; private $connectionGroup; + private $connectionType; + private $meterTariff; + private $city; + private $earlyRegisteredMeters; public function __construct( @@ -228,14 +241,14 @@ public function createRelatedMeter($kelinMeter) $kelinMeter['consNo'] )->first(); if ($meter === null) { - $meter = new Meter(); - $meterParameter = new MeterParameter(); - $geoLocation = new GeographicalInformation(); + $meter = new Meter; + $meterParameter = new MeterParameter; + $geoLocation = new GeographicalInformation; } else { $meterParameter = $this->meterParameter->newQuery()->where('meter_id', $meter->id)->first(); $geoLocation = $meterParameter->geo()->first(); if ($geoLocation === null) { - $geoLocation = new GeographicalInformation(); + $geoLocation = new GeographicalInformation; } } $meter->serial_number = $meterSerial; @@ -254,13 +267,13 @@ public function createRelatedMeter($kelinMeter) $p = $points == null ? ',' : $kelinCustomer->address; $geoLocation->points = $p; $connectionType = $this->connectionType->newQuery()->first(); - if (!$connectionType) { + if (! $connectionType) { $connectionType = $this->connectionType->newQuery()->create([ 'name' => 'default', ]); } $connectionGroup = $this->connectionGroup->newQuery()->first(); - if (!$connectionGroup) { + if (! $connectionGroup) { $connectionGroup = $this->connectionGroup->newQuery()->create([ 'name' => 'default', ]); @@ -283,7 +296,7 @@ public function createRelatedMeter($kelinMeter) })->first(); $city = $kelinCustomerAddress->addresses[0]->city()->first() ?? null; - $address = new Address(); + $address = new Address; $address = $address->newQuery()->create([ 'city_id' => $city ? $city->id : 1, ]); @@ -327,7 +340,7 @@ public function updateRelatedMeter($kelinMeter, $meter) private function findRegisteredMeter($kelinMeter) { $meter = collect($this->earlyRegisteredMeters)->where('meter_serial', $kelinMeter['meterAddr'])->first(); - if (!$meter) { + if (! $meter) { return $meter; } @@ -352,7 +365,7 @@ private function generateMeterSerialNumberInFormat($meterAddress) { $length = strlen($meterAddress); $newSerial = $meterAddress[0]; - for ($i = 0; $i < $length; ++$i) { + for ($i = 0; $i < $length; $i++) { if ($i != 0) { if ($i % 4 == 0) { $newSerial .= '-'.$meterAddress[$i]; diff --git a/src/backend/packages/inensus/kelin-meter/src/Services/KelinMeterStatusService.php b/src/backend/packages/inensus/kelin-meter/src/Services/KelinMeterStatusService.php index 1506da96b..61f2dca58 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Services/KelinMeterStatusService.php +++ b/src/backend/packages/inensus/kelin-meter/src/Services/KelinMeterStatusService.php @@ -10,6 +10,7 @@ class KelinMeterStatusService { private $rootUrl = '/getMeterStatus'; + private $kelinApiClient; public function __construct(KelinMeterApiClient $kelinApiClient) diff --git a/src/backend/packages/inensus/kelin-meter/src/Services/KelinSyncActionService.php b/src/backend/packages/inensus/kelin-meter/src/Services/KelinSyncActionService.php index 2e192df61..67330e3ca 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Services/KelinSyncActionService.php +++ b/src/backend/packages/inensus/kelin-meter/src/Services/KelinSyncActionService.php @@ -32,7 +32,7 @@ public function getActionsNeedsToSync() public function updateSyncAction($syncAction, $syncSetting, $syncResult) { - if (!$syncResult) { + if (! $syncResult) { return $syncAction->update([ 'attempts' => $syncAction->attempts + 1, 'last_sync' => Carbon::now(), diff --git a/src/backend/packages/inensus/kelin-meter/src/Services/KelinSyncSettingService.php b/src/backend/packages/inensus/kelin-meter/src/Services/KelinSyncSettingService.php index 936c5581f..e6f09f94f 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Services/KelinSyncSettingService.php +++ b/src/backend/packages/inensus/kelin-meter/src/Services/KelinSyncSettingService.php @@ -11,7 +11,9 @@ class KelinSyncSettingService { private $syncSetting; + private $setting; + private $syncActionService; public function __construct( @@ -30,7 +32,7 @@ public function createDefaultSettings() $fiveMinInterval = CarbonInterval::make('5minute'); $syncCustomer = $this->syncSetting->newQuery()->where('action_name', 'Customers')->first(); - if (!$syncCustomer) { + if (! $syncCustomer) { $now = Carbon::now(); $customerSetting = $this->setting->newQuery()->make(); $syncCustomer = $this->syncSetting->newQuery()->create([ @@ -48,7 +50,7 @@ public function createDefaultSettings() } $syncMeter = $this->syncSetting->newQuery()->where('action_name', 'Meters')->first(); - if (!$syncMeter) { + if (! $syncMeter) { $now = Carbon::now(); $meterSetting = $this->setting->newQuery()->make(); $syncMeter = $this->syncSetting->newQuery()->create([ diff --git a/src/backend/packages/inensus/kelin-meter/src/Services/MinutelyConsumptionService.php b/src/backend/packages/inensus/kelin-meter/src/Services/MinutelyConsumptionService.php index 0fc90cb4d..af27f2b7c 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Services/MinutelyConsumptionService.php +++ b/src/backend/packages/inensus/kelin-meter/src/Services/MinutelyConsumptionService.php @@ -10,7 +10,9 @@ class MinutelyConsumptionService { private $rootUrl = '/getMinData'; + private $kelinApi; + private $kelinMeterMinutelyData; public function __construct( @@ -71,7 +73,7 @@ public function getMinutelyDataFromAPI() 'flow_velocity' => $data['sPEED'], ]); }); - ++$pageNo; + $pageNo++; } catch (\Exception $exception) { Log::error('Failed on minutely data request .', ['message' => $exception->getMessage()]); $result['data']['dataCount'] = 0; diff --git a/src/backend/packages/inensus/kelin-meter/src/Services/PackageInstallationService.php b/src/backend/packages/inensus/kelin-meter/src/Services/PackageInstallationService.php index 34ddee422..5b8b8c095 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Services/PackageInstallationService.php +++ b/src/backend/packages/inensus/kelin-meter/src/Services/PackageInstallationService.php @@ -6,8 +6,7 @@ class PackageInstallationService { public function __construct( private KelinSyncSettingService $syncSettingService, - ) { - } + ) {} public function createDefaultSettingRecords() { diff --git a/src/backend/packages/inensus/kelin-meter/src/Tests/Feature/RechargeMeterTest.php b/src/backend/packages/inensus/kelin-meter/src/Tests/Feature/RechargeMeterTest.php index 9cc76b8ce..971a08775 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Tests/Feature/RechargeMeterTest.php +++ b/src/backend/packages/inensus/kelin-meter/src/Tests/Feature/RechargeMeterTest.php @@ -104,7 +104,7 @@ private function initData() 'connection_type_id' => 1, 'connection_group_id' => 1, ]); - $meterParameter = new MeterParameter(); + $meterParameter = new MeterParameter; $meterParameter->tariff()->associate($tariff); $meterParameter->owner_type = 'person'; $meterParameter->owner_id = 1; diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Console/Commands/InstallPackage.php index 067533a60..df2943196 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Console/Commands/InstallPackage.php @@ -7,6 +7,7 @@ class InstallPackage extends Command { protected $signature = 'mesomb-payment-provider:install'; + protected $description = 'Install MesombPaymentProvider Package'; public function __construct() diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Console/Commands/UpdatePackage.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Console/Commands/UpdatePackage.php index 93114c7b1..df729965a 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Console/Commands/UpdatePackage.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Console/Commands/UpdatePackage.php @@ -9,6 +9,7 @@ class UpdatePackage extends Command { protected $signature = 'mesomb-payment-provider:update'; + protected $description = 'Update the Mesomb Payment Provider Integration Package'; public function __construct( @@ -48,7 +49,7 @@ private function deleteMigration(Filesystem $filesystem) $migrationFile = $filesystem->glob(database_path().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR.'*_create_mesomb_payment_provider_tables.php')[0]; $migration = DB::table('migrations') ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->first(); - if (!$migration) { + if (! $migration) { return; } DB::table('migrations') diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombPayerMustHaveOnlyOneConnectedMeterException.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombPayerMustHaveOnlyOneConnectedMeterException.php index a2bf80122..c65894a50 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombPayerMustHaveOnlyOneConnectedMeterException.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombPayerMustHaveOnlyOneConnectedMeterException.php @@ -2,6 +2,4 @@ namespace Inensus\MesombPaymentProvider\Exceptions; -class MesombPayerMustHaveOnlyOneConnectedMeterException extends \Exception -{ -} +class MesombPayerMustHaveOnlyOneConnectedMeterException extends \Exception {} diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombPaymentPhoneNumberNotFoundException.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombPaymentPhoneNumberNotFoundException.php index 86cc53bd9..4e8cb327a 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombPaymentPhoneNumberNotFoundException.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombPaymentPhoneNumberNotFoundException.php @@ -2,6 +2,4 @@ namespace Inensus\MesombPaymentProvider\Exceptions; -class MesombPaymentPhoneNumberNotFoundException extends \Exception -{ -} +class MesombPaymentPhoneNumberNotFoundException extends \Exception {} diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombStatusFailedException.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombStatusFailedException.php index 40dc55a05..d16a9f826 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombStatusFailedException.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombStatusFailedException.php @@ -2,6 +2,4 @@ namespace Inensus\MesombPaymentProvider\Exceptions; -class MesombStatusFailedException extends \Exception -{ -} +class MesombStatusFailedException extends \Exception {} diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Http/Resources/MesombTransactionProcessingResource.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Http/Resources/MesombTransactionProcessingResource.php index ad3fa435c..6cb749f26 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Http/Resources/MesombTransactionProcessingResource.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Http/Resources/MesombTransactionProcessingResource.php @@ -9,8 +9,7 @@ class MesombTransactionProcessingResource extends JsonResource /** * Transform the resource into an array. * - * @param \Illuminate\Http\Request $request - * + * @param \Illuminate\Http\Request $request * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Models/BaseModel.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Models/BaseModel.php index c83529006..4db5bf3d2 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Models/BaseModel.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Models/BaseModel.php @@ -7,6 +7,7 @@ class BaseModel extends Model { protected $guarded = ['id']; + public static $rules = []; public function __construct(array $attributes = []) diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Models/MesombTransaction.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Models/MesombTransaction.php index 3fd108e1c..c7e7d74ee 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Models/MesombTransaction.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Models/MesombTransaction.php @@ -13,9 +13,6 @@ class MesombTransaction extends BaseModel implements IRawTransaction { protected $table = 'mesomb_transactions'; - /** - * @return MorphOne - */ public function transaction(): MorphOne { return $this->morphOne(Transaction::class, 'original_transaction'); diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Providers/MesombTransactionProvider.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Providers/MesombTransactionProvider.php index 1ddb48cdc..3b02aa06e 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Providers/MesombTransactionProvider.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Providers/MesombTransactionProvider.php @@ -20,9 +20,13 @@ class MesombTransactionProvider implements ITransactionProvider { private $transaction; + private $mesombTransaction; + private $mesombTransactionService; + private $validData = []; + private $address; public function __construct( diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Services/MesomTransactionService.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Services/MesomTransactionService.php index 857deb943..7f0297529 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Services/MesomTransactionService.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Services/MesomTransactionService.php @@ -8,6 +8,7 @@ class MesomTransactionService { private $mesombTransaction; + private $transaction; public function __construct( diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Tests/Feature/PaymentTests.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Tests/Feature/PaymentTests.php index 8c0b43933..324cdef54 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Tests/Feature/PaymentTests.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Tests/Feature/PaymentTests.php @@ -19,8 +19,8 @@ class PaymentTests extends TestCase { - use RefreshDatabase; use CreatesApplication; + use RefreshDatabase; public function testOnlySuccessesPaymentsCanBeProcessed() { diff --git a/src/backend/packages/inensus/micro-star-meter/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/micro-star-meter/src/Console/Commands/InstallPackage.php index 99855d3bf..6f0e225f6 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Console/Commands/InstallPackage.php @@ -9,6 +9,7 @@ class InstallPackage extends Command { protected $signature = 'micro-star-meter:install'; + protected $description = 'Install MicroStarMeter Package'; public function __construct( diff --git a/src/backend/packages/inensus/micro-star-meter/src/Console/Commands/UpdatePackage.php b/src/backend/packages/inensus/micro-star-meter/src/Console/Commands/UpdatePackage.php index c1998cbbf..57b656ec4 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Console/Commands/UpdatePackage.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Console/Commands/UpdatePackage.php @@ -9,6 +9,7 @@ class UpdatePackage extends Command { protected $signature = 'micro-star-meter:update'; + protected $description = 'Update MicroStarMeter Package'; public function __construct( @@ -49,7 +50,7 @@ private function deleteMigration(Filesystem $filesystem) .'*_create_micro_star_tables.php')[0]; $migration = DB::table('migrations') ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->first(); - if (!$migration) { + if (! $migration) { return false; } diff --git a/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarCertificateController.php b/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarCertificateController.php index 372a45125..c914f1f6b 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarCertificateController.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarCertificateController.php @@ -14,8 +14,7 @@ class MicroStarCertificateController extends Controller public function __construct( private MicroStarCertificateService $certificateService, private MicroStarCredentialService $credentialService, - ) { - } + ) {} public function store(ImportCertificateRequest $request) { diff --git a/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarCredentialController.php b/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarCredentialController.php index 5d6f60622..87f7db9d2 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarCredentialController.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarCredentialController.php @@ -9,9 +9,7 @@ class MicroStarCredentialController extends Controller { - public function __construct(private MicroStarCredentialService $credentialService) - { - } + public function __construct(private MicroStarCredentialService $credentialService) {} public function show(): MicroStarResource { diff --git a/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarTestController.php b/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarTestController.php index 01d044421..5a7d4b69c 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarTestController.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarTestController.php @@ -7,9 +7,7 @@ class MicroStarTestController extends Controller { - public function __construct(private ApiRequests $apiRequests) - { - } + public function __construct(private ApiRequests $apiRequests) {} public function show() { diff --git a/src/backend/packages/inensus/micro-star-meter/src/Http/Requests/ImportCertificateRequest.php b/src/backend/packages/inensus/micro-star-meter/src/Http/Requests/ImportCertificateRequest.php index e5bb27391..f2c704658 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Http/Requests/ImportCertificateRequest.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Http/Requests/ImportCertificateRequest.php @@ -18,8 +18,6 @@ public function authorize() /** * Get the validation rules that apply to the request. - * - * @return array */ public function rules(): array { diff --git a/src/backend/packages/inensus/micro-star-meter/src/Http/Resources/MicroStarResource.php b/src/backend/packages/inensus/micro-star-meter/src/Http/Resources/MicroStarResource.php index 6450670aa..c6f7202dc 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Http/Resources/MicroStarResource.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Http/Resources/MicroStarResource.php @@ -10,8 +10,7 @@ class MicroStarResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request - * + * @param Request $request * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/micro-star-meter/src/Modules/Api/ApiRequests.php b/src/backend/packages/inensus/micro-star-meter/src/Modules/Api/ApiRequests.php index 9e87dfbeb..70f088723 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Modules/Api/ApiRequests.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Modules/Api/ApiRequests.php @@ -14,8 +14,7 @@ class ApiRequests public function __construct( private Client $httpClient, private ResponseResolver $responseResolver, - ) { - } + ) {} public function get(MicroStarCredential $credentials, array $params, string $slug) { diff --git a/src/backend/packages/inensus/micro-star-meter/src/Modules/Api/MicroStarMeterApi.php b/src/backend/packages/inensus/micro-star-meter/src/Modules/Api/MicroStarMeterApi.php index 7c70656a3..538a30e5d 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Modules/Api/MicroStarMeterApi.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Modules/Api/MicroStarMeterApi.php @@ -18,8 +18,7 @@ public function __construct( private MicroStarCredentialService $credentialService, private MicroStarTransaction $microStarTransaction, private ApiRequests $apiRequests, - ) { - } + ) {} public function chargeDevice(TransactionDataContainer $transactionContainer): array { diff --git a/src/backend/packages/inensus/micro-star-meter/src/Services/ManufacturerService.php b/src/backend/packages/inensus/micro-star-meter/src/Services/ManufacturerService.php index 7915b77aa..2079f4b68 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Services/ManufacturerService.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Services/ManufacturerService.php @@ -6,14 +6,12 @@ class ManufacturerService { - public function __construct(private Manufacturer $manufacturer) - { - } + public function __construct(private Manufacturer $manufacturer) {} public function register() { $api = $this->manufacturer->newQuery()->where('api_name', 'MicroStarMeterApi')->first(); - if (!$api) { + if (! $api) { $this->manufacturer->newQuery()->create([ 'name' => 'MicroStar Meters', 'website' => 'https://www.microstarelectric.com/', diff --git a/src/backend/packages/inensus/micro-star-meter/src/Services/MicroStarCertificateService.php b/src/backend/packages/inensus/micro-star-meter/src/Services/MicroStarCertificateService.php index f25ee9ac5..e0debd7e0 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Services/MicroStarCertificateService.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Services/MicroStarCertificateService.php @@ -13,7 +13,7 @@ public function upload($request, $credentials) $file = $request->file('cert'); $companyId = app()->make(UserService::class)->getCompanyId(); - if (!File::isDirectory(storage_path("/app/certs/companies/$companyId"))) { + if (! File::isDirectory(storage_path("/app/certs/companies/$companyId"))) { File::makeDirectory(storage_path("/app/certs/companies/$companyId"), 0777, true, true); } @@ -30,7 +30,7 @@ public function upload($request, $credentials) public function getUploadedCertificate($credentials) { - if (!$credentials->certificate_path || !$credentials->certificate_file_name) { + if (! $credentials->certificate_path || ! $credentials->certificate_file_name) { return ''; } diff --git a/src/backend/packages/inensus/micro-star-meter/src/Services/MicroStarCredentialService.php b/src/backend/packages/inensus/micro-star-meter/src/Services/MicroStarCredentialService.php index 2cff47f14..c58089477 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Services/MicroStarCredentialService.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Services/MicroStarCredentialService.php @@ -8,8 +8,7 @@ class MicroStarCredentialService { public function __construct( private MicroStarCredential $credential, - ) { - } + ) {} /** * This function uses one time on installation of the package. diff --git a/src/backend/packages/inensus/spark-meter/src/Console/Commands/InstallSparkMeterPackage.php b/src/backend/packages/inensus/spark-meter/src/Console/Commands/InstallSparkMeterPackage.php index 97b96f949..ce840de01 100644 --- a/src/backend/packages/inensus/spark-meter/src/Console/Commands/InstallSparkMeterPackage.php +++ b/src/backend/packages/inensus/spark-meter/src/Console/Commands/InstallSparkMeterPackage.php @@ -18,6 +18,7 @@ class InstallSparkMeterPackage extends Command { protected $signature = 'spark-meter:install'; + protected $description = 'Install the Spark Meter Integration Package'; public function __construct( @@ -44,12 +45,12 @@ public function handle(): void $this->credentialService->createSmCredentials(); $this->info('Package installed successfully..'); $connections = $this->customerService->checkConnectionAvailability(); - if (!$this->siteService->checkLocationAvailability()) { + if (! $this->siteService->checkLocationAvailability()) { $this->warn('------------------------------'); $this->warn('Spark Meter package needs least one registered Cluster.'); $this->warn('If you have no Cluster, please navigate to #Locations# section and register your locations.'); } - if (!$connections['type'] || !$connections['group']) { + if (! $connections['type'] || ! $connections['group']) { $this->warn('------------------------------'); $this->warn('Spark Meter package needs least one Connection Group and one Connection Type.'); $this->warn('Before you get Customers from Spark Meter please check them in #Connection# section.'); diff --git a/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterDataSynchronizer.php b/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterDataSynchronizer.php index 860312fa4..a6aeb0015 100644 --- a/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterDataSynchronizer.php +++ b/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterDataSynchronizer.php @@ -23,9 +23,11 @@ class SparkMeterDataSynchronizer extends AbstractSharedCommand { use ScheduledPluginCommand; + public const MPM_PLUGIN_ID = 2; protected $signature = 'spark-meter:dataSync'; + protected $description = 'Synchronize data that needs to be updated from Spark Meter.'; public function __construct( @@ -44,7 +46,7 @@ public function __construct( public function handle(): void { - if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { + if (! $this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } @@ -58,7 +60,7 @@ public function handle(): void try { $this->smSyncSettingService->getSyncSettings()->each(function ($syncSetting) use ($syncActions) { $syncAction = $syncActions->where('sync_setting_id', $syncSetting->id)->first(); - if (!$syncAction) { + if (! $syncAction) { return true; } if ($syncAction->attempts >= $syncSetting->max_attempts) { @@ -66,7 +68,7 @@ public function handle(): void $syncAction->next_sync = $nextSync; $syncAction->save(); $cluster = $this->cluster->newQuery()->with('manager')->first(); - if (!$cluster) { + if (! $cluster) { return true; } $adminId = $cluster->manager->id; @@ -78,7 +80,7 @@ function ($q) use ($adminId) { } )->first(); - if (!$adminAddress) { + if (! $adminAddress) { return true; } $data = [ diff --git a/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterSmsNotifier.php b/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterSmsNotifier.php index 00c601e36..31e4d01dc 100644 --- a/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterSmsNotifier.php +++ b/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterSmsNotifier.php @@ -20,16 +20,23 @@ class SparkMeterSmsNotifier extends AbstractSharedCommand { use ScheduledPluginCommand; + public const MPM_PLUGIN_ID = 2; protected $signature = 'spark-meter:smsNotifier'; + protected $description = 'Notifies customers on payments and low balance limits'; private $smsSettingsService; + private $sms; + private $smTransactionService; + private $smSmsNotifiedCustomerService; + private $smCustomerService; + private $smsService; public function __construct( @@ -67,11 +74,11 @@ private function sendTransactionNotifySms($transactionMin, $smsNotifiedCustomers return $customer->customer_id == $smTransaction->customer_id; })->first(); - if (!$notifyCustomer) { + if (! $notifyCustomer) { return true; } if ( - !$notifyCustomer->mpmPerson->addresses + ! $notifyCustomer->mpmPerson->addresses || $notifyCustomer->mpmPerson->addresses[0]->phone === null || $notifyCustomer->mpmPerson->addresses[0]->phone === '' ) { @@ -107,7 +114,7 @@ private function sendLowBalanceWarningNotifySms($customers, $smsNotifiedCustomer return true; } if ( - !$customer->mpmPerson->addresses || $customer->mpmPerson->addresses[0]->phone === null + ! $customer->mpmPerson->addresses || $customer->mpmPerson->addresses[0]->phone === null || $customer->mpmPerson->addresses[0]->phone === '' ) { return true; @@ -125,7 +132,7 @@ private function sendLowBalanceWarningNotifySms($customers, $smsNotifiedCustomer public function handle(): void { - if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { + if (! $this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } @@ -138,14 +145,14 @@ public function handle(): void $smsSettings = $this->smsSettingsService->getSmsSettings(); $transactionsSettings = $smsSettings->where('state', 'Transactions')->first(); - if (!$transactionsSettings) { + if (! $transactionsSettings) { throw new CronJobException('Transaction min is not set'); } $transactionMin = $transactionsSettings->not_send_elder_than_mins; $lowBalanceWarningSetting = $smsSettings->where('state', 'Low Balance Warning')->first(); - if (!$lowBalanceWarningSetting) { + if (! $lowBalanceWarningSetting) { throw new CronJobException('Low balance min is not set'); } diff --git a/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterTransactionStatusCheck.php b/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterTransactionStatusCheck.php index 495689299..0eaf207f0 100644 --- a/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterTransactionStatusCheck.php +++ b/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterTransactionStatusCheck.php @@ -13,6 +13,7 @@ class SparkMeterTransactionStatusCheck extends AbstractSharedCommand use ScheduledPluginCommand; protected $signature = 'spark-meter:transactionStatusCheck'; + protected $description = 'Checks status of Spark Meter transactions'; public function __construct( @@ -24,7 +25,7 @@ public function __construct( public function handle(): void { - if (!$this->checkForPluginStatusIsActive(MpmPlugin::SPARK_METER)) { + if (! $this->checkForPluginStatusIsActive(MpmPlugin::SPARK_METER)) { return; } diff --git a/src/backend/packages/inensus/spark-meter/src/Console/Commands/UpdateSparkMeterPackage.php b/src/backend/packages/inensus/spark-meter/src/Console/Commands/UpdateSparkMeterPackage.php index cabc131fd..9a442728a 100644 --- a/src/backend/packages/inensus/spark-meter/src/Console/Commands/UpdateSparkMeterPackage.php +++ b/src/backend/packages/inensus/spark-meter/src/Console/Commands/UpdateSparkMeterPackage.php @@ -20,6 +20,7 @@ class UpdateSparkMeterPackage extends Command { protected $signature = 'spark-meter:update'; + protected $description = 'Update the Spark Meter Integration Package'; public function __construct( @@ -73,7 +74,7 @@ private function deleteMigration(Filesystem $filesystem) $migrationFile = $filesystem->glob(database_path().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR.'*_create_spark_tables.php')[0]; $migration = DB::table('migrations') ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->first(); - if (!$migration) { + if (! $migration) { return false; } diff --git a/src/backend/packages/inensus/spark-meter/src/Exceptions/CredentialsNotFoundException.php b/src/backend/packages/inensus/spark-meter/src/Exceptions/CredentialsNotFoundException.php index 09fc5a8a1..d6c86a011 100644 --- a/src/backend/packages/inensus/spark-meter/src/Exceptions/CredentialsNotFoundException.php +++ b/src/backend/packages/inensus/spark-meter/src/Exceptions/CredentialsNotFoundException.php @@ -2,6 +2,4 @@ namespace Inensus\SparkMeter\Exceptions; -class CredentialsNotFoundException extends \Exception -{ -} +class CredentialsNotFoundException extends \Exception {} diff --git a/src/backend/packages/inensus/spark-meter/src/Exceptions/CredentialsNotUpToDateException.php b/src/backend/packages/inensus/spark-meter/src/Exceptions/CredentialsNotUpToDateException.php index 0f55d90a5..6d18e9962 100644 --- a/src/backend/packages/inensus/spark-meter/src/Exceptions/CredentialsNotUpToDateException.php +++ b/src/backend/packages/inensus/spark-meter/src/Exceptions/CredentialsNotUpToDateException.php @@ -2,6 +2,4 @@ namespace Inensus\SparkMeter\Exceptions; -class CredentialsNotUpToDateException extends \Exception -{ -} +class CredentialsNotUpToDateException extends \Exception {} diff --git a/src/backend/packages/inensus/spark-meter/src/Exceptions/CronJobException.php b/src/backend/packages/inensus/spark-meter/src/Exceptions/CronJobException.php index cd08c1991..5b0686684 100644 --- a/src/backend/packages/inensus/spark-meter/src/Exceptions/CronJobException.php +++ b/src/backend/packages/inensus/spark-meter/src/Exceptions/CronJobException.php @@ -2,6 +2,4 @@ namespace Inensus\SparkMeter\Exceptions; -class CronJobException extends \Exception -{ -} +class CronJobException extends \Exception {} diff --git a/src/backend/packages/inensus/spark-meter/src/Exceptions/NoOnlineSiteRecordException.php b/src/backend/packages/inensus/spark-meter/src/Exceptions/NoOnlineSiteRecordException.php index 8c58c8a07..485b574ee 100644 --- a/src/backend/packages/inensus/spark-meter/src/Exceptions/NoOnlineSiteRecordException.php +++ b/src/backend/packages/inensus/spark-meter/src/Exceptions/NoOnlineSiteRecordException.php @@ -2,6 +2,4 @@ namespace Inensus\SparkMeter\Exceptions; -class NoOnlineSiteRecordException extends \Exception -{ -} +class NoOnlineSiteRecordException extends \Exception {} diff --git a/src/backend/packages/inensus/spark-meter/src/Exceptions/SitesNotUpToDateException.php b/src/backend/packages/inensus/spark-meter/src/Exceptions/SitesNotUpToDateException.php index 26b5d2ea2..9c8404b5c 100644 --- a/src/backend/packages/inensus/spark-meter/src/Exceptions/SitesNotUpToDateException.php +++ b/src/backend/packages/inensus/spark-meter/src/Exceptions/SitesNotUpToDateException.php @@ -2,6 +2,4 @@ namespace Inensus\SparkMeter\Exceptions; -class SitesNotUpToDateException extends \Exception -{ -} +class SitesNotUpToDateException extends \Exception {} diff --git a/src/backend/packages/inensus/spark-meter/src/Exceptions/SparkAPIResponseException.php b/src/backend/packages/inensus/spark-meter/src/Exceptions/SparkAPIResponseException.php index cd22db5b8..595c3a4e2 100644 --- a/src/backend/packages/inensus/spark-meter/src/Exceptions/SparkAPIResponseException.php +++ b/src/backend/packages/inensus/spark-meter/src/Exceptions/SparkAPIResponseException.php @@ -2,6 +2,4 @@ namespace Inensus\SparkMeter\Exceptions; -class SparkAPIResponseException extends \Exception -{ -} +class SparkAPIResponseException extends \Exception {} diff --git a/src/backend/packages/inensus/spark-meter/src/Exceptions/WrongCredentialsException.php b/src/backend/packages/inensus/spark-meter/src/Exceptions/WrongCredentialsException.php index ad5eca5af..06dab1b37 100644 --- a/src/backend/packages/inensus/spark-meter/src/Exceptions/WrongCredentialsException.php +++ b/src/backend/packages/inensus/spark-meter/src/Exceptions/WrongCredentialsException.php @@ -2,6 +2,4 @@ namespace Inensus\SparkMeter\Exceptions; -class WrongCredentialsException extends \Exception -{ -} +class WrongCredentialsException extends \Exception {} diff --git a/src/backend/packages/inensus/spark-meter/src/Helpers/InsertSparkMeterApi.php b/src/backend/packages/inensus/spark-meter/src/Helpers/InsertSparkMeterApi.php index 99bd7fd4e..a5e6db955 100644 --- a/src/backend/packages/inensus/spark-meter/src/Helpers/InsertSparkMeterApi.php +++ b/src/backend/packages/inensus/spark-meter/src/Helpers/InsertSparkMeterApi.php @@ -17,7 +17,7 @@ public function __construct( public function registerSparkMeterManufacturer() { $api = $this->manufacturer->newQuery()->where('api_name', 'SparkMeterApi')->first(); - if (!$api) { + if (! $api) { $this->manufacturer->newQuery()->create([ 'name' => 'Spark Meters', 'website' => 'https://www.sparkmeter.io/', diff --git a/src/backend/packages/inensus/spark-meter/src/Http/Requests/SparkMeterApiRequests.php b/src/backend/packages/inensus/spark-meter/src/Http/Requests/SparkMeterApiRequests.php index d2abb5be8..92cf713c1 100644 --- a/src/backend/packages/inensus/spark-meter/src/Http/Requests/SparkMeterApiRequests.php +++ b/src/backend/packages/inensus/spark-meter/src/Http/Requests/SparkMeterApiRequests.php @@ -12,9 +12,13 @@ class SparkMeterApiRequests { private $client; + private $resultStatusChecker; + private $credential; + private $site; + private $smCredentail; public function __construct( diff --git a/src/backend/packages/inensus/spark-meter/src/Http/Resources/SparkMeterCredentialResource.php b/src/backend/packages/inensus/spark-meter/src/Http/Resources/SparkMeterCredentialResource.php index 891e090a1..acec3b74f 100644 --- a/src/backend/packages/inensus/spark-meter/src/Http/Resources/SparkMeterCredentialResource.php +++ b/src/backend/packages/inensus/spark-meter/src/Http/Resources/SparkMeterCredentialResource.php @@ -16,8 +16,7 @@ public function __construct(SmCredential $smCredential) /** * Transform the resource into an array. * - * @param Request $request - * + * @param Request $request * @return Request */ public function toArray($request) diff --git a/src/backend/packages/inensus/spark-meter/src/Http/Resources/SparkResource.php b/src/backend/packages/inensus/spark-meter/src/Http/Resources/SparkResource.php index d28e1c463..1aeb5b160 100644 --- a/src/backend/packages/inensus/spark-meter/src/Http/Resources/SparkResource.php +++ b/src/backend/packages/inensus/spark-meter/src/Http/Resources/SparkResource.php @@ -10,8 +10,7 @@ class SparkResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request - * + * @param Request $request * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/spark-meter/src/Listeners/MeterParameterListener.php b/src/backend/packages/inensus/spark-meter/src/Listeners/MeterParameterListener.php index a233c4f14..d2e427f0d 100644 --- a/src/backend/packages/inensus/spark-meter/src/Listeners/MeterParameterListener.php +++ b/src/backend/packages/inensus/spark-meter/src/Listeners/MeterParameterListener.php @@ -16,12 +16,19 @@ class MeterParameterListener { private $tariffService; + private $customerService; + private $meterParameter; + private $smTariff; + private $smCustomer; + private $miniGrid; + private $smSite; + private $city; public function __construct( @@ -46,8 +53,6 @@ public function __construct( /** * Sets the in_use to true. - * - * @param int $meter_id */ public function onParameterSaved(int $meter_id) { @@ -72,7 +77,7 @@ public function onParameterSaved(int $meter_id) $smTariff = $this->smTariff->newQuery()->whereHas('mpmTariff', function ($q) use ($tariffId) { $q->where('mpm_tariff_id', $tariffId); })->first(); - if (!$smTariff) { + if (! $smTariff) { $this->tariffService->createSmTariff($meterInfo->tariff, $smSite->site_id); } if ($meterInfo->owner) { @@ -84,7 +89,7 @@ function ($q) use ($customerId) { $q->where('mpm_customer_id', $customerId); } )->first(); - if (!$smCustomer) { + if (! $smCustomer) { $this->customerService->createCustomer($meterInfo, $smSite->site_id); } } diff --git a/src/backend/packages/inensus/spark-meter/src/Listeners/SmsListener.php b/src/backend/packages/inensus/spark-meter/src/Listeners/SmsListener.php index 4d1ab4848..a6046df5a 100644 --- a/src/backend/packages/inensus/spark-meter/src/Listeners/SmsListener.php +++ b/src/backend/packages/inensus/spark-meter/src/Listeners/SmsListener.php @@ -14,8 +14,11 @@ class SmsListener { private $smsFeedbackWordService; + private $customerService; + private $meter; + private $smsService; public function __construct( @@ -33,7 +36,7 @@ public function __construct( public function onSmsStored($sender, $message) { $sparkCustomer = $this->customerService->getSparkCustomerWithPhone($sender); - if (!$sparkCustomer) { + if (! $sparkCustomer) { return; } $smsFeedbackWords = $this->smsFeedbackWordService->getSmsFeedbackWords(); diff --git a/src/backend/packages/inensus/spark-meter/src/Listeners/TransactionListener.php b/src/backend/packages/inensus/spark-meter/src/Listeners/TransactionListener.php index c36fc1adf..2bf390b7d 100644 --- a/src/backend/packages/inensus/spark-meter/src/Listeners/TransactionListener.php +++ b/src/backend/packages/inensus/spark-meter/src/Listeners/TransactionListener.php @@ -10,6 +10,7 @@ class TransactionListener { private $transactionService; + private $smTransaction; public function __construct( @@ -22,8 +23,6 @@ public function __construct( /** * Sets the in_use to true. - * - * @param Transaction $transaction */ public function onTransactionSuccess(Transaction $transaction) { diff --git a/src/backend/packages/inensus/spark-meter/src/Models/BaseModel.php b/src/backend/packages/inensus/spark-meter/src/Models/BaseModel.php index 427cf464a..ef7cdfff0 100644 --- a/src/backend/packages/inensus/spark-meter/src/Models/BaseModel.php +++ b/src/backend/packages/inensus/spark-meter/src/Models/BaseModel.php @@ -7,6 +7,7 @@ class BaseModel extends Model { protected $guarded = ['id']; + public static $rules = []; public function __construct(array $attributes = []) diff --git a/src/backend/packages/inensus/spark-meter/src/Models/SmSetting.php b/src/backend/packages/inensus/spark-meter/src/Models/SmSetting.php index 52f5639c7..22b7a0c70 100644 --- a/src/backend/packages/inensus/spark-meter/src/Models/SmSetting.php +++ b/src/backend/packages/inensus/spark-meter/src/Models/SmSetting.php @@ -16,8 +16,6 @@ public function setting(): MorphTo /** * A work-around for querying the polymorphic relation with whereHas. - * - * @return BelongsToMorph */ public function settingSms(): BelongsToMorph { @@ -26,8 +24,6 @@ public function settingSms(): BelongsToMorph /** * A work-around for querying the polymorphic relation with whereHas. - * - * @return BelongsToMorph */ public function settingSync(): BelongsToMorph { diff --git a/src/backend/packages/inensus/spark-meter/src/Models/SyncStatus.php b/src/backend/packages/inensus/spark-meter/src/Models/SyncStatus.php index 1ab44cace..49bbcdf55 100644 --- a/src/backend/packages/inensus/spark-meter/src/Models/SyncStatus.php +++ b/src/backend/packages/inensus/spark-meter/src/Models/SyncStatus.php @@ -5,6 +5,8 @@ abstract class SyncStatus { public const SYNCED = 1; + public const MODIFIED = 2; + public const NOT_REGISTERED_YET = 3; } diff --git a/src/backend/packages/inensus/spark-meter/src/Observers/GeographicalInformationObserver.php b/src/backend/packages/inensus/spark-meter/src/Observers/GeographicalInformationObserver.php index e0e69db02..b75275113 100644 --- a/src/backend/packages/inensus/spark-meter/src/Observers/GeographicalInformationObserver.php +++ b/src/backend/packages/inensus/spark-meter/src/Observers/GeographicalInformationObserver.php @@ -18,8 +18,7 @@ public function __construct( private Person $person, private SmCustomer $smCustomer, private PluginsService $pluginsService, - ) { - } + ) {} public function updated(GeographicalInformation $geographicalInformation) { diff --git a/src/backend/packages/inensus/spark-meter/src/Observers/MeterTariffObserver.php b/src/backend/packages/inensus/spark-meter/src/Observers/MeterTariffObserver.php index 9403d8743..693bb9f2d 100644 --- a/src/backend/packages/inensus/spark-meter/src/Observers/MeterTariffObserver.php +++ b/src/backend/packages/inensus/spark-meter/src/Observers/MeterTariffObserver.php @@ -11,8 +11,11 @@ class MeterTariffObserver { private $tariffService; + private $smTableEncryption; + private $smTariff; + private $accessRate; public function __construct( @@ -60,7 +63,7 @@ public function updated(MeterTariff $tariff) $updatedTariff = $this->tariffService->updateSparkTariffInfo($tariffData); $modelTouString = ''; foreach ($updatedTariff['tous'] as $item) { - $modelTouString .= $item['start'].$item['end'].doubleval($item['value']); + $modelTouString .= $item['start'].$item['end'].floatval($item['value']); } $modelHash = $this->smTableEncryption->makeHash([ $updatedTariff['name'], diff --git a/src/backend/packages/inensus/spark-meter/src/Observers/PersonObserver.php b/src/backend/packages/inensus/spark-meter/src/Observers/PersonObserver.php index cc44b9a4d..39170acb6 100644 --- a/src/backend/packages/inensus/spark-meter/src/Observers/PersonObserver.php +++ b/src/backend/packages/inensus/spark-meter/src/Observers/PersonObserver.php @@ -10,8 +10,11 @@ class PersonObserver { private $customerService; + private $smTableEncryption; + private $person; + private $smCustomer; public function __construct( diff --git a/src/backend/packages/inensus/spark-meter/src/Services/CredentialService.php b/src/backend/packages/inensus/spark-meter/src/Services/CredentialService.php index 2848cf4e6..098382e78 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/CredentialService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/CredentialService.php @@ -10,9 +10,13 @@ class CredentialService { private $sparkMeterApiRequests; + private $smCredential; + private $smTableEncryption; + private $rootUrl = '/organizations'; + private $organizationService; public function __construct( diff --git a/src/backend/packages/inensus/spark-meter/src/Services/CustomerService.php b/src/backend/packages/inensus/spark-meter/src/Services/CustomerService.php index ee588a77c..4bff64c36 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/CustomerService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/CustomerService.php @@ -29,22 +29,39 @@ class CustomerService implements ISynchronizeService { private $sparkMeterApiRequests; + private $rootUrl = '/customer/'; + private $smTableEncryption; + private $person; + private $smCustomer; + private $smMeterModel; + private $smTariff; + private $smSite; + private $meter; + private $manufacturer; + private $meterParameter; + private $connectionType; + private $connectionGroup; + private $city; + private $cluster; + private $smSyncSettingService; + private $smSyncActionService; + private $smSmsNotifiedCustomerService; public function __construct( @@ -104,7 +121,7 @@ public function createCustomer($meterInfo, $siteId) 'hash' => $smCustomerHash, ]); } - if (!$customerExists) { + if (! $customerExists) { $rootUrl = '/system-info'; $result = $this->sparkMeterApiRequests->get($rootUrl, $siteId); $grid = $result['grids'][0]; @@ -183,14 +200,14 @@ public function createRelatedPerson($customer, $site_id) $meter = $this->meter->newQuery()->where('serial_number', $sparkCustomerMeterSerial)->first(); $person = null; if ($meter === null) { - $meter = new Meter(); - $meterParameter = new MeterParameter(); - $geoLocation = new GeographicalInformation(); + $meter = new Meter; + $meterParameter = new MeterParameter; + $geoLocation = new GeographicalInformation; } else { $meterParameter = $this->meterParameter->newQuery()->where('meter_id', $meter->id)->first(); $geoLocation = $meterParameter->geo()->first(); if ($geoLocation === null) { - $geoLocation = new GeographicalInformation(); + $geoLocation = new GeographicalInformation; } $person = $this->person->newQuery()->whereHas('meters', static function ($q) use ($meterParameter) { return $q->where('id', $meterParameter->id); @@ -244,7 +261,7 @@ function ($q) use ($currentTariffName) { $site = $this->smSite->newQuery()->with('mpmMiniGrid')->where('site_id', $site_id)->firstOrFail(); $sparkCity = $site->mpmMiniGrid->cities[0]; - $address = new Address(); + $address = new Address; $address = $address->newQuery()->create([ 'city_id' => request()->input('city_id') ?? $sparkCity->id, ]); diff --git a/src/backend/packages/inensus/spark-meter/src/Services/MeterModelService.php b/src/backend/packages/inensus/spark-meter/src/Services/MeterModelService.php index a75cb8734..ba825c973 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/MeterModelService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/MeterModelService.php @@ -14,12 +14,19 @@ class MeterModelService implements ISynchronizeService { private $sparkMeterApiRequests; + private $rootUrl = '/meters'; + private $smTableEncryption; + private $smMeterModel; + private $smSite; + private $meterType; + private $smSyncSettingService; + private $smSyncActionService; public function __construct( diff --git a/src/backend/packages/inensus/spark-meter/src/Services/OrganizationService.php b/src/backend/packages/inensus/spark-meter/src/Services/OrganizationService.php index 8cdaa098c..821a1a415 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/OrganizationService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/OrganizationService.php @@ -22,7 +22,7 @@ public function getOrganizations() public function createOrganization($organizationData) { $organization = $this->organization->newQuery()->first(); - if (!$organization) { + if (! $organization) { return $this->organization->newQuery()->create([ 'organization_id' => $organizationData['id'], 'code' => $organizationData['code'], diff --git a/src/backend/packages/inensus/spark-meter/src/Services/PackageInstallationService.php b/src/backend/packages/inensus/spark-meter/src/Services/PackageInstallationService.php index 8c513d2f5..72747c74b 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/PackageInstallationService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/PackageInstallationService.php @@ -5,9 +5,13 @@ class PackageInstallationService { private $smsSettingService; + private $syncSettingService; + private $smsBodyService; + private $defaultValueService; + private $smSmsFeedbackWordService; public function __construct( diff --git a/src/backend/packages/inensus/spark-meter/src/Services/SiteService.php b/src/backend/packages/inensus/spark-meter/src/Services/SiteService.php index cfda00541..8914a98c3 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/SiteService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/SiteService.php @@ -17,15 +17,25 @@ class SiteService implements ISynchronizeService { private $site; + private $sparkMeterApiRequests; + private $rootUrl = '/organizations'; + private $smTableEncryption; + private $organizationService; + private $cluster; + private $miniGrid; + private $city; + private $geographicalInformation; + private $smSyncSettingService; + private $smSyncActionService; public function __construct( @@ -102,8 +112,8 @@ static function ($q) use ($miniGridId) { } )->first(); $points = explode(',', config('spark.geoLocation')); - $latitude = strval(doubleval($points[0]) + (mt_rand(10, 10000) / 10000)); - $longitude = strval(doubleval($points[1]) + (mt_rand(10, 10000) / 10000)); + $latitude = strval(floatval($points[0]) + (mt_rand(10, 10000) / 10000)); + $longitude = strval(floatval($points[1]) + (mt_rand(10, 10000) / 10000)); $points = $latitude.','.$longitude; $geographicalInformation->update([ 'points' => $points, @@ -132,8 +142,8 @@ public function update($siteId, $data) $site->is_authenticated = true; $site->is_online = Carbon::parse($system['last_sync_date']) - ->toDateTimeString() > Carbon::now()->utc() - ->subMinutes(15)->toDateTimeString(); + ->toDateTimeString() > Carbon::now()->utc() + ->subMinutes(15)->toDateTimeString(); } catch (\Exception $e) { $site->is_authenticated = false; $site->is_online = false; diff --git a/src/backend/packages/inensus/spark-meter/src/Services/SmSalesAccoutService.php b/src/backend/packages/inensus/spark-meter/src/Services/SmSalesAccoutService.php index 5574d7cce..cb8b2cc07 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/SmSalesAccoutService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/SmSalesAccoutService.php @@ -13,11 +13,17 @@ class SmSalesAccoutService implements ISynchronizeService { private $sparkMeterApiRequests; + private $rootUrl = '/sales-accounts'; + private $smTableEncryption; + private $smSalesAccount; + private $smSite; + private $smSyncSettingService; + private $smSyncActionService; public function __construct( diff --git a/src/backend/packages/inensus/spark-meter/src/Services/SmSmsSettingService.php b/src/backend/packages/inensus/spark-meter/src/Services/SmSmsSettingService.php index 1544f1401..2e512e137 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/SmSmsSettingService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/SmSmsSettingService.php @@ -8,6 +8,7 @@ class SmSmsSettingService { private $smsSetting; + private $setting; public function __construct(SmSmsSetting $smsSetting, SmSetting $setting) @@ -19,7 +20,7 @@ public function __construct(SmSmsSetting $smsSetting, SmSetting $setting) public function createDefaultSettings() { $smsTransaction = $this->smsSetting->newQuery()->where('state', 'Transactions')->first(); - if (!$smsTransaction) { + if (! $smsTransaction) { $smsSetting = $this->setting->newQuery()->make(); $smsTransaction = $this->smsSetting->newQuery()->create([ 'state' => 'Transactions', @@ -29,7 +30,7 @@ public function createDefaultSettings() $smsSetting->save(); } $smsLowBalanceWarning = $this->smsSetting->newQuery()->where('state', 'Low Balance Warning')->first(); - if (!$smsLowBalanceWarning) { + if (! $smsLowBalanceWarning) { $balanceSetting = $this->setting->newQuery()->make(); $smsLowBalanceWarning = $this->smsSetting->newQuery()->create([ 'state' => 'Low Balance Warning', diff --git a/src/backend/packages/inensus/spark-meter/src/Services/SmSyncActionService.php b/src/backend/packages/inensus/spark-meter/src/Services/SmSyncActionService.php index f2de4658a..37a7a0399 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/SmSyncActionService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/SmSyncActionService.php @@ -32,7 +32,7 @@ public function getActionsNeedsToSync() public function updateSyncAction($syncAction, $syncSetting, $syncResult) { - if (!$syncResult) { + if (! $syncResult) { return $syncAction->update([ 'attempts' => $syncAction->attempts + 1, 'last_sync' => Carbon::now(), diff --git a/src/backend/packages/inensus/spark-meter/src/Services/SmSyncSettingService.php b/src/backend/packages/inensus/spark-meter/src/Services/SmSyncSettingService.php index 8858a20ab..42cae03d1 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/SmSyncSettingService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/SmSyncSettingService.php @@ -11,7 +11,9 @@ class SmSyncSettingService { private $syncSetting; + private $setting; + private $syncActionService; public function __construct(SmSyncSetting $syncSetting, SmSetting $setting, SmSyncActionService $syncActionService) @@ -28,7 +30,7 @@ public function createDefaultSettings() $syncSite = $this->syncSetting->newQuery()->where('action_name', 'Sites')->first(); - if (!$syncSite) { + if (! $syncSite) { $now = Carbon::now(); $siteSetting = $this->setting->newQuery()->make(); $syncSite = $this->syncSetting->newQuery()->create([ @@ -46,7 +48,7 @@ public function createDefaultSettings() } $syncMeterMotel = $this->syncSetting->newQuery()->where('action_name', 'MeterModels')->first(); - if (!$syncMeterMotel) { + if (! $syncMeterMotel) { $now = Carbon::now(); $meterModelSetting = $this->setting->newQuery()->make(); $syncMeterMotel = $this->syncSetting->newQuery()->create([ @@ -64,7 +66,7 @@ public function createDefaultSettings() } $syncTariff = $this->syncSetting->newQuery()->where('action_name', 'Tariffs')->first(); - if (!$syncTariff) { + if (! $syncTariff) { $now = Carbon::now(); $tariffSetting = $this->setting->newQuery()->make(); $syncTariff = $this->syncSetting->newQuery()->create([ @@ -82,7 +84,7 @@ public function createDefaultSettings() } $syncCustomer = $this->syncSetting->newQuery()->where('action_name', 'Customers')->first(); - if (!$syncCustomer) { + if (! $syncCustomer) { $now = Carbon::now(); $customerSetting = $this->setting->newQuery()->make(); $syncCustomer = $this->syncSetting->newQuery()->create([ @@ -100,7 +102,7 @@ public function createDefaultSettings() } $syncTransaction = $this->syncSetting->newQuery()->where('action_name', 'Transactions')->first(); - if (!$syncTransaction) { + if (! $syncTransaction) { $now = Carbon::now(); $transactionSetting = $this->setting->newQuery()->make(); $syncTransaction = $this->syncSetting->newQuery()->create([ @@ -118,7 +120,7 @@ public function createDefaultSettings() } $syncSalesAccount = $this->syncSetting->newQuery()->where('action_name', 'SalesAccounts')->first(); - if (!$syncSalesAccount) { + if (! $syncSalesAccount) { $now = Carbon::now(); $salesAccountSetting = $this->setting->newQuery()->make(); $syncSalesAccount = $this->syncSetting->newQuery()->create([ diff --git a/src/backend/packages/inensus/spark-meter/src/Services/TariffService.php b/src/backend/packages/inensus/spark-meter/src/Services/TariffService.php index 19c98b9f2..479851ffe 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/TariffService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/TariffService.php @@ -17,15 +17,25 @@ class TariffService implements ISynchronizeService { private $sparkMeterApiRequests; + private $rootUrl = '/tariffs'; + private $smTableEncryption; + private $smMeterModel; + private $smSite; + private $smTariff; + private $meterTariff; + private $timeOfUsage; + private $accessRate; + private $smSyncSettingService; + private $smSyncActionService; public function __construct( @@ -85,10 +95,10 @@ public function createSmTariff($tariff, $siteId) break; } } - if (!$tariffExists) { + if (! $tariffExists) { $modelTouString = ''; foreach ($tariff->tou as $key => $value) { - $modelTouString .= $value->start.$value->end.doubleval($value->value); + $modelTouString .= $value->start.$value->end.floatval($value->value); $tous[$key] = [ 'start' => $value->start, 'end' => $value->end, @@ -152,7 +162,7 @@ public function createRelatedTariff($tariff) 'tariff_id' => $meterTariff->id, 'start' => $tou['start'], 'end' => $tou['end'], - 'value' => doubleval($tou['value']), + 'value' => floatval($tou['value']), ]); } if ($tariff['plan_enabled'] && $tariff['plan_fixed_fee'] > 0) { @@ -168,7 +178,7 @@ public function updateRelatedTariff($model, $tariff) foreach ($model['tous'] as $key => $tou) { $tariff->tou[$key]->start = $tou['start']; $tariff->tou[$key]->end = $tou['end']; - $tariff->tou[$key]->value = doubleval($tou['value']); + $tariff->tou[$key]->value = floatval($tou['value']); $tariff->tou[$key]->update(); } } else { @@ -180,7 +190,7 @@ public function updateRelatedTariff($model, $tariff) 'tariff_id' => $tariff->id, 'start' => $tou['start'], 'end' => $tou['end'], - 'value' => doubleval($tou['value']), + 'value' => floatval($tou['value']), ]); } } @@ -452,7 +462,7 @@ public function modelHasher($model, ...$params): string { $modelTouString = ''; foreach ($model['tous'] as $item) { - $modelTouString .= $item['start'].$item['end'].doubleval($item['value']); + $modelTouString .= $item['start'].$item['end'].floatval($item['value']); } return $this->smTableEncryption->makeHash([ diff --git a/src/backend/packages/inensus/spark-meter/src/Services/TransactionService.php b/src/backend/packages/inensus/spark-meter/src/Services/TransactionService.php index 835d6c211..a6524b450 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/TransactionService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/TransactionService.php @@ -22,21 +22,37 @@ class TransactionService { private $sparkMeterApiRequests; + private $sparkOrganization; + private $sparkCredentialService; + private $sparkSiteService; + private $sparkCustomerService; + private $sparkMeterModelService; + private $sparkTariffService; + private $sparkTransaction; + private $sparkTariff; + private $thirdPartyTransaction; + private $transaction; + private $meterToken; + private $sparkSite; + private $smCustomer; + private $rootUrl = '/transaction/'; + private $smSyncSettingService; + private $smSyncActionService; public function __construct( @@ -158,7 +174,7 @@ public function sync() 'desc' )->first(); $organization = $this->sparkOrganization->newQuery()->first(); - if (!$organization) { + if (! $organization) { Log::info('Organization not found for Koios API'); return; @@ -192,14 +208,14 @@ public function sync() if ($count === 1) { break; } - if (!count($syncCheck)) { + if (! count($syncCheck)) { break; } collect($transactions)->filter(function ($transaction) { return $transaction['type'] === 'transaction'; })->each(function ($transaction) use ($syncCheck, $sparkCustomers, $sparkTariffs) { $siteTransaction = $syncCheck->firstWhere('site_id', $transaction['site']); - if (!$siteTransaction) { + if (! $siteTransaction) { return true; } switch ($transaction['state']) { @@ -221,12 +237,12 @@ public function sync() $transaction['transaction_id'] )->first(); - if (!$transactionRecord) { - if (!array_key_exists('customer', $transaction['to'])) { + if (! $transactionRecord) { + if (! array_key_exists('customer', $transaction['to'])) { return true; } $sparkTransaction = $this->createSparkTransaction($transaction); - if (!$transaction['reference_id']) { + if (! $transaction['reference_id']) { $thirdPartyTransaction = $this->createThirdPartyTransaction( $transaction, $sparkTransaction, @@ -238,7 +254,7 @@ public function sync() $sparkTransaction->customer_id ); - if (!$sparkCustomer) { + if (! $sparkCustomer) { return true; } $meterParameter = $sparkCustomer->mpmPerson->meters[0]; @@ -300,7 +316,7 @@ public function syncCheck() $credentials = $this->sparkCredentialService->getCredentials(); $sparkSites = $this->sparkSite->newQuery()->where('is_authenticated', 1)->where('is_online', 1)->get(); - if (!$credentials) { + if (! $credentials) { $message = 'No Credentials record found.'; throw new CredentialsNotFoundException($message); } @@ -310,12 +326,12 @@ public function syncCheck() } $siteSynchronized = $this->sparkSiteService->syncCheck(); - if (!$siteSynchronized['result']) { + if (! $siteSynchronized['result']) { $message = 'Site records are not up to date.'; throw new SitesNotUpToDateException($message); } - if (!$sparkSites->count()) { + if (! $sparkSites->count()) { $message = 'No online Site record found.'; throw new NoOnlineSiteRecordException($message); } diff --git a/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsBalanceFeedbackBody.php b/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsBalanceFeedbackBody.php index d13e3821f..44a9dc17a 100644 --- a/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsBalanceFeedbackBody.php +++ b/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsBalanceFeedbackBody.php @@ -8,6 +8,7 @@ class SparkSmsBalanceFeedbackBody extends SmsBodyParser { protected $variables = ['credit_balance']; + protected $sparkCustomer; public function __construct(SmCustomer $sparkCustomer) diff --git a/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsBalanceFeedbackHeader.php b/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsBalanceFeedbackHeader.php index d6d651e1c..8a53d051a 100644 --- a/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsBalanceFeedbackHeader.php +++ b/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsBalanceFeedbackHeader.php @@ -8,6 +8,7 @@ class SparkSmsBalanceFeedbackHeader extends SmsBodyParser { protected $variables = ['name', 'surname']; + protected $sparkCustomer; public function __construct(SmCustomer $sparkCustomer) diff --git a/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsLowBalanceBody.php b/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsLowBalanceBody.php index ee283e93d..b46cd453e 100644 --- a/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsLowBalanceBody.php +++ b/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsLowBalanceBody.php @@ -8,6 +8,7 @@ class SparkSmsLowBalanceBody extends SmsBodyParser { protected $variables = ['low_balance_limit', 'credit_balance']; + protected $sparkCustomer; public function __construct(SmCustomer $sparkCustomer) diff --git a/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsLowBalanceHeader.php b/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsLowBalanceHeader.php index a22b495c0..525c42d45 100644 --- a/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsLowBalanceHeader.php +++ b/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsLowBalanceHeader.php @@ -8,6 +8,7 @@ class SparkSmsLowBalanceHeader extends SmsBodyParser { protected $variables = ['name', 'surname']; + protected $sparkCustomer; public function __construct(SmCustomer $sparkCustomer) diff --git a/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsMeterResetFailedFeedbackBody.php b/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsMeterResetFailedFeedbackBody.php index fad4ff32a..5f9a92c6c 100644 --- a/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsMeterResetFailedFeedbackBody.php +++ b/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsMeterResetFailedFeedbackBody.php @@ -7,6 +7,7 @@ class SparkSmsMeterResetFailedFeedbackBody extends SmsBodyParser { protected $variables = ['meter_serial']; + protected $data; public function __construct($data) diff --git a/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsMeterResetFeedbackBody.php b/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsMeterResetFeedbackBody.php index 26bb60b8a..0aafc8076 100644 --- a/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsMeterResetFeedbackBody.php +++ b/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsMeterResetFeedbackBody.php @@ -7,6 +7,7 @@ class SparkSmsMeterResetFeedbackBody extends SmsBodyParser { protected $variables = ['meter_serial']; + protected $meter; public function __construct($meter) diff --git a/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsMeterResetFeedbackHeader.php b/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsMeterResetFeedbackHeader.php index 0b086cdd5..8724b2c94 100644 --- a/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsMeterResetFeedbackHeader.php +++ b/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsMeterResetFeedbackHeader.php @@ -8,6 +8,7 @@ class SparkSmsMeterResetFeedbackHeader extends SmsBodyParser { protected $variables = ['name', 'surname']; + protected $data; public function __construct($data) @@ -17,7 +18,7 @@ public function __construct($data) protected function getVariableValue($variable) { - if (!is_array($this->data)) { + if (! is_array($this->data)) { $person = $this->data->meterParameter->whereHasMorph('owner', [Person::class])->first()->owner()->first(); } else { try { diff --git a/src/backend/packages/inensus/spark-meter/src/Sms/Senders/MeterResetFeedback.php b/src/backend/packages/inensus/spark-meter/src/Sms/Senders/MeterResetFeedback.php index 8d94e29f6..aecf2bad5 100644 --- a/src/backend/packages/inensus/spark-meter/src/Sms/Senders/MeterResetFeedback.php +++ b/src/backend/packages/inensus/spark-meter/src/Sms/Senders/MeterResetFeedback.php @@ -12,7 +12,9 @@ class MeterResetFeedback extends SmsSender { protected $data; + public $body = ''; + protected $references = [ 'header' => 'SparkSmsMeterResetFeedbackHeader', 'body' => 'SparkSmsMeterResetFeedbackBody', @@ -21,7 +23,7 @@ class MeterResetFeedback extends SmsSender public function prepareBody() { - if (!is_array($this->data)) { + if (! is_array($this->data)) { try { $smsBody = $this->smsBodyService->getSmsBodyByReference('SparkSmsMeterResetFeedbackBody'); } catch (ModelNotFoundException $exception) { diff --git a/src/backend/packages/inensus/spark-meter/src/Sms/Senders/SparkSmsConfig.php b/src/backend/packages/inensus/spark-meter/src/Sms/Senders/SparkSmsConfig.php index e7ee3cad9..364af9af9 100644 --- a/src/backend/packages/inensus/spark-meter/src/Sms/Senders/SparkSmsConfig.php +++ b/src/backend/packages/inensus/spark-meter/src/Sms/Senders/SparkSmsConfig.php @@ -12,6 +12,8 @@ class SparkSmsConfig extends SmsConfigsCore SparkSmsTypes::BALANCE_FEEDBACK => 'Inensus\SparkMeter\Sms\Senders\BalanceFeedback', SparkSmsTypes::METER_RESET_FEEDBACK => 'Inensus\SparkMeter\Sms\Senders\MeterResetFeedback', ]; + public $bodyParsersPath = 'Inensus\\SparkMeter\\Sms\\BodyParsers\\'; + public $servicePath = 'Inensus\SparkMeter\Services\SmSmsBodyService'; } diff --git a/src/backend/packages/inensus/spark-meter/src/Sms/SparkSmsTypes.php b/src/backend/packages/inensus/spark-meter/src/Sms/SparkSmsTypes.php index c7b1a1fd1..46372c37a 100644 --- a/src/backend/packages/inensus/spark-meter/src/Sms/SparkSmsTypes.php +++ b/src/backend/packages/inensus/spark-meter/src/Sms/SparkSmsTypes.php @@ -5,6 +5,8 @@ class SparkSmsTypes { public const LOW_BALANCE_LIMIT_NOTIFIER = 1; + public const BALANCE_FEEDBACK = 2; + public const METER_RESET_FEEDBACK = 3; } diff --git a/src/backend/packages/inensus/spark-meter/src/SparkMeterApi.php b/src/backend/packages/inensus/spark-meter/src/SparkMeterApi.php index 24fa81a6a..7fbc2d248 100644 --- a/src/backend/packages/inensus/spark-meter/src/SparkMeterApi.php +++ b/src/backend/packages/inensus/spark-meter/src/SparkMeterApi.php @@ -17,6 +17,7 @@ class SparkMeterApi implements IManufacturerAPI { protected $api; + private $rootUrl = '/transaction/'; public function __construct( diff --git a/src/backend/packages/inensus/spark-meter/src/Tests/Unit/SmsNotifyTest.php b/src/backend/packages/inensus/spark-meter/src/Tests/Unit/SmsNotifyTest.php index 81eb04602..518286fe2 100644 --- a/src/backend/packages/inensus/spark-meter/src/Tests/Unit/SmsNotifyTest.php +++ b/src/backend/packages/inensus/spark-meter/src/Tests/Unit/SmsNotifyTest.php @@ -72,7 +72,7 @@ public function isLowBalanceNotifySend() return true; } if ( - !$customer->mpmPerson->addresses || $customer->mpmPerson->addresses[0]->phone === null + ! $customer->mpmPerson->addresses || $customer->mpmPerson->addresses[0]->phone === null || $customer->mpmPerson->addresses[0]->phone === '' ) { return true; @@ -124,11 +124,11 @@ public function isTransactionNotifySend() $notifyCustomer = $customers->filter(function ($customer) use ($sparkTransaction) { return $customer->customer_id == $sparkTransaction->customer_id; })->first(); - if (!$notifyCustomer) { + if (! $notifyCustomer) { return true; } if ( - !$notifyCustomer->mpmPerson->addresses || $notifyCustomer->mpmPerson->addresses[0]->phone === null + ! $notifyCustomer->mpmPerson->addresses || $notifyCustomer->mpmPerson->addresses[0]->phone === null || $notifyCustomer->mpmPerson->addresses[0]->phone === '' ) { return true; @@ -160,7 +160,7 @@ public function isMaxAttemptNotifySend() SmSyncSetting::query()->get()->each(function ($syncSetting) use ($syncActions) { $syncAction = $syncActions->where('sync_setting_id', $syncSetting->id)->first(); - if (!$syncAction) { + if (! $syncAction) { return true; } if ($syncAction->attempts >= $syncSetting->max_attempts) { @@ -170,7 +170,7 @@ public function isMaxAttemptNotifySend() 'owner', [User::class] )->first(); - if (!$adminAddress) { + if (! $adminAddress) { return true; } $data = [ diff --git a/src/backend/packages/inensus/steama-meter/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/steama-meter/src/Console/Commands/InstallPackage.php index eaab478b6..707cd7ced 100644 --- a/src/backend/packages/inensus/steama-meter/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/steama-meter/src/Console/Commands/InstallPackage.php @@ -20,6 +20,7 @@ class InstallPackage extends Command { protected $signature = 'steama-meter:install'; + protected $description = 'Install Steamaco Meter Package'; public function __construct( @@ -58,7 +59,7 @@ public function handle(): void // $this->call('routes:generate'); // $this->call('sidebar:generate'); // $this->info('Package installed successfully..'); - if (!$this->siteService->checkLocationAvailability()) { + if (! $this->siteService->checkLocationAvailability()) { $this->warn('------------------------------'); $this->warn('Steamaco Meter package needs least one registered Cluster.'); $this->warn('If you have no Cluster, please navigate to #Locations# section and register your locations.'); diff --git a/src/backend/packages/inensus/steama-meter/src/Console/Commands/ReadHourlyMeterReadings.php b/src/backend/packages/inensus/steama-meter/src/Console/Commands/ReadHourlyMeterReadings.php index 84eb8a00a..3a644d039 100644 --- a/src/backend/packages/inensus/steama-meter/src/Console/Commands/ReadHourlyMeterReadings.php +++ b/src/backend/packages/inensus/steama-meter/src/Console/Commands/ReadHourlyMeterReadings.php @@ -10,9 +10,11 @@ class ReadHourlyMeterReadings extends AbstractSharedCommand { use ScheduledPluginCommand; + public const MPM_PLUGIN_ID = 2; protected $signature = 'steama-meter:hourlyReadings'; + protected $description = 'Reads hourly meter readings.'; public function __construct(private SteamaMeterReadingService $steamaMeterReadingService) @@ -22,7 +24,7 @@ public function __construct(private SteamaMeterReadingService $steamaMeterReadin public function handle(): void { - if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { + if (! $this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } diff --git a/src/backend/packages/inensus/steama-meter/src/Console/Commands/SteamaMeterDataSynchronizer.php b/src/backend/packages/inensus/steama-meter/src/Console/Commands/SteamaMeterDataSynchronizer.php index 9577305fa..a7977a769 100644 --- a/src/backend/packages/inensus/steama-meter/src/Console/Commands/SteamaMeterDataSynchronizer.php +++ b/src/backend/packages/inensus/steama-meter/src/Console/Commands/SteamaMeterDataSynchronizer.php @@ -23,19 +23,29 @@ class SteamaMeterDataSynchronizer extends AbstractSharedCommand { use ScheduledPluginCommand; + public const MPM_PLUGIN_ID = 2; protected $signature = 'steama-meter:dataSync'; + protected $description = 'Synchronize data that needs to be updated from Steamaco Meter.'; private $steamaTransactionsService; + private $steamaSyncSettingservice; + private $stemaMeterService; + private $steamaCustomerService; + private $steamaSiteService; + private $steamaAgentService; + private $steamaSyncActionService; + private $address; + private $cluster; public function __construct( @@ -63,7 +73,7 @@ public function __construct( public function handle(): void { - if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { + if (! $this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } @@ -77,7 +87,7 @@ public function handle(): void try { $this->steamaSyncSettingservice->getSyncSettings()->each(function ($syncSetting) use ($syncActions) { $syncAction = $syncActions->where('sync_setting_id', $syncSetting->id)->first(); - if (!$syncAction) { + if (! $syncAction) { return true; } if ($syncAction->attempts >= $syncSetting->max_attempts) { @@ -85,7 +95,7 @@ public function handle(): void $syncAction->next_sync = $nextSync; $syncAction->save(); $cluster = $this->cluster->newQuery()->with('manager')->first(); - if (!$cluster) { + if (! $cluster) { return true; } $adminId = $cluster->manager->id; @@ -96,7 +106,7 @@ function ($q) use ($adminId) { $q->where('id', $adminId); } )->first(); - if (!$adminAddress) { + if (! $adminAddress) { return true; } $data = [ diff --git a/src/backend/packages/inensus/steama-meter/src/Console/Commands/SteamaSmsNotifier.php b/src/backend/packages/inensus/steama-meter/src/Console/Commands/SteamaSmsNotifier.php index 2dfdef747..8a32c85a3 100644 --- a/src/backend/packages/inensus/steama-meter/src/Console/Commands/SteamaSmsNotifier.php +++ b/src/backend/packages/inensus/steama-meter/src/Console/Commands/SteamaSmsNotifier.php @@ -20,16 +20,23 @@ class SteamaSmsNotifier extends AbstractSharedCommand { use ScheduledPluginCommand; + public const MPM_PLUGIN_ID = 2; protected $signature = 'steama-meter:smsNotifier'; + protected $description = ''; private $smsSettingsService; + private $sms; + private $steamaTransactionService; + private $steamaSmsNotifiedCustomerService; + private $steamaCustomerService; + private $smsService; public function __construct( @@ -64,12 +71,12 @@ private function sendTransactionNotifySms($transactionMin, $smsNotifiedCustomers return $customer->customer_id == $steamaTransaction->customer_id; })->first(); - if (!$notifyCustomer) { + if (! $notifyCustomer) { return true; } if ( - !$notifyCustomer->mpmPerson->addresses + ! $notifyCustomer->mpmPerson->addresses || $notifyCustomer->mpmPerson->addresses[0]->phone === null || $notifyCustomer->mpmPerson->addresses[0]->phone === '' ) { @@ -106,7 +113,7 @@ private function sendLowBalanceWarningNotifySms($customers, $smsNotifiedCustomer return true; } if ( - !$customer->mpmPerson->addresses || $customer->mpmPerson->addresses[0]->phone === null + ! $customer->mpmPerson->addresses || $customer->mpmPerson->addresses[0]->phone === null || $customer->mpmPerson->addresses[0]->phone === '' ) { return true; @@ -125,7 +132,7 @@ private function sendLowBalanceWarningNotifySms($customers, $smsNotifiedCustomer public function handle(): void { - if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { + if (! $this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } diff --git a/src/backend/packages/inensus/steama-meter/src/Console/Commands/UpdatePackage.php b/src/backend/packages/inensus/steama-meter/src/Console/Commands/UpdatePackage.php index e6a2a4f99..d06626907 100644 --- a/src/backend/packages/inensus/steama-meter/src/Console/Commands/UpdatePackage.php +++ b/src/backend/packages/inensus/steama-meter/src/Console/Commands/UpdatePackage.php @@ -22,6 +22,7 @@ class UpdatePackage extends Command { protected $signature = 'steama-meter:update'; + protected $description = 'Install Steamaco Meter Package'; public function __construct( @@ -75,7 +76,7 @@ private function deleteMigration(Filesystem $filesystem) $migrationFile = $filesystem->glob(database_path().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR.'*_create_steama_tables.php')[0]; $migration = DB::table('migrations') ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->first(); - if (!$migration) { + if (! $migration) { return false; } diff --git a/src/backend/packages/inensus/steama-meter/src/Exceptions/CronJobException.php b/src/backend/packages/inensus/steama-meter/src/Exceptions/CronJobException.php index 4ef8e9804..b64feba19 100644 --- a/src/backend/packages/inensus/steama-meter/src/Exceptions/CronJobException.php +++ b/src/backend/packages/inensus/steama-meter/src/Exceptions/CronJobException.php @@ -2,6 +2,4 @@ namespace Inensus\SteamaMeter\Exceptions; -class CronJobException extends \Exception -{ -} +class CronJobException extends \Exception {} diff --git a/src/backend/packages/inensus/steama-meter/src/Exceptions/ModelNotFoundException.php b/src/backend/packages/inensus/steama-meter/src/Exceptions/ModelNotFoundException.php index 609220536..2a743e2f9 100644 --- a/src/backend/packages/inensus/steama-meter/src/Exceptions/ModelNotFoundException.php +++ b/src/backend/packages/inensus/steama-meter/src/Exceptions/ModelNotFoundException.php @@ -2,6 +2,4 @@ namespace Inensus\SteamaMeter\Exceptions; -class ModelNotFoundException extends \Exception -{ -} +class ModelNotFoundException extends \Exception {} diff --git a/src/backend/packages/inensus/steama-meter/src/Exceptions/SteamaApiResponseException.php b/src/backend/packages/inensus/steama-meter/src/Exceptions/SteamaApiResponseException.php index 409427086..219f7d6c7 100644 --- a/src/backend/packages/inensus/steama-meter/src/Exceptions/SteamaApiResponseException.php +++ b/src/backend/packages/inensus/steama-meter/src/Exceptions/SteamaApiResponseException.php @@ -2,6 +2,4 @@ namespace Inensus\SteamaMeter\Exceptions; -class SteamaApiResponseException extends \Exception -{ -} +class SteamaApiResponseException extends \Exception {} diff --git a/src/backend/packages/inensus/steama-meter/src/Exceptions/WrongCredentialsException.php b/src/backend/packages/inensus/steama-meter/src/Exceptions/WrongCredentialsException.php index 8d4b366a8..c77d42a6c 100644 --- a/src/backend/packages/inensus/steama-meter/src/Exceptions/WrongCredentialsException.php +++ b/src/backend/packages/inensus/steama-meter/src/Exceptions/WrongCredentialsException.php @@ -2,6 +2,4 @@ namespace Inensus\SteamaMeter\Exceptions; -class WrongCredentialsException extends \Exception -{ -} +class WrongCredentialsException extends \Exception {} diff --git a/src/backend/packages/inensus/steama-meter/src/Helpers/ApiHelpers.php b/src/backend/packages/inensus/steama-meter/src/Helpers/ApiHelpers.php index 82fdd6d3d..442e20fea 100644 --- a/src/backend/packages/inensus/steama-meter/src/Helpers/ApiHelpers.php +++ b/src/backend/packages/inensus/steama-meter/src/Helpers/ApiHelpers.php @@ -17,7 +17,7 @@ public function __construct(Manufacturer $manufacturerModel) public function registerSparkMeterManufacturer() { $api = $this->manufacturer->newQuery()->where('api_name', 'SteamaMeterApi')->first(); - if (!$api) { + if (! $api) { $this->manufacturer->newQuery()->create([ 'name' => 'Steama Meters', 'website' => 'https://steama.co/', diff --git a/src/backend/packages/inensus/steama-meter/src/Http/Clients/SteamaMeterApiClient.php b/src/backend/packages/inensus/steama-meter/src/Http/Clients/SteamaMeterApiClient.php index a001a688a..98524fb1f 100644 --- a/src/backend/packages/inensus/steama-meter/src/Http/Clients/SteamaMeterApiClient.php +++ b/src/backend/packages/inensus/steama-meter/src/Http/Clients/SteamaMeterApiClient.php @@ -12,7 +12,9 @@ class SteamaMeterApiClient { private $client; + private $apiHelpers; + private $credential; public function __construct( diff --git a/src/backend/packages/inensus/steama-meter/src/Http/Resources/SteamaCredentialResource.php b/src/backend/packages/inensus/steama-meter/src/Http/Resources/SteamaCredentialResource.php index ad7259755..4d8f690c2 100644 --- a/src/backend/packages/inensus/steama-meter/src/Http/Resources/SteamaCredentialResource.php +++ b/src/backend/packages/inensus/steama-meter/src/Http/Resources/SteamaCredentialResource.php @@ -16,8 +16,7 @@ public function __construct(SteamaCredential $steamaCredential) /** * Transform the resource into an array. * - * @param Request $request - * + * @param Request $request * @return Request */ public function toArray($request) diff --git a/src/backend/packages/inensus/steama-meter/src/Http/Resources/SteamaResource.php b/src/backend/packages/inensus/steama-meter/src/Http/Resources/SteamaResource.php index 84df4c453..523c789e7 100644 --- a/src/backend/packages/inensus/steama-meter/src/Http/Resources/SteamaResource.php +++ b/src/backend/packages/inensus/steama-meter/src/Http/Resources/SteamaResource.php @@ -10,8 +10,7 @@ class SteamaResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request - * + * @param Request $request * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/steama-meter/src/Listeners/MeterParameterListener.php b/src/backend/packages/inensus/steama-meter/src/Listeners/MeterParameterListener.php index f31d95f11..60aad5c29 100644 --- a/src/backend/packages/inensus/steama-meter/src/Listeners/MeterParameterListener.php +++ b/src/backend/packages/inensus/steama-meter/src/Listeners/MeterParameterListener.php @@ -15,12 +15,19 @@ class MeterParameterListener { private $apiHelpers; + private $stmCustomerService; + private $stmMeterService; + private $person; + private $meterParameter; + private $stmTariff; + private $stmCustomer; + private $stmMeter; public function __construct( @@ -55,7 +62,7 @@ public function onParameterSaved(int $meterId) $steamaTariff = $this->stmTariff->newQuery()->whereHas('mpmTariff', function ($q) use ($tariffId) { $q->where('mpm_tariff_id', $tariffId); })->first(); - if (!$steamaTariff) { + if (! $steamaTariff) { $steamaTariff = $this->stmTariff->newQuery()->with('mpmTariff')->first(); $meterInfo->tariff_id = $steamaTariff->mpmTariff->id; $meterInfo->update(); @@ -67,13 +74,13 @@ public function onParameterSaved(int $meterId) ->whereHas('mpmPerson', function ($q) use ($customerId) { $q->where('id', $customerId); })->first(); - if (!$steamaCustomer) { + if (! $steamaCustomer) { $steamaCustomer = $this->stmCustomerService->createSteamaCustomer($meterInfo); } $steamaMeter = $this->stmMeter->newQuery()->whereHas('mpmMeter', function ($q) use ($meterId) { $q->where('id', $meterId); })->first(); - if (!$steamaMeter) { + if (! $steamaMeter) { $this->stmMeterService->creteSteamaMeter($meterInfo, $steamaCustomer); } $steamaMeter->customer_id = $steamaCustomer->customer_id; diff --git a/src/backend/packages/inensus/steama-meter/src/Listeners/SmsListener.php b/src/backend/packages/inensus/steama-meter/src/Listeners/SmsListener.php index dd591c611..bedc8286c 100644 --- a/src/backend/packages/inensus/steama-meter/src/Listeners/SmsListener.php +++ b/src/backend/packages/inensus/steama-meter/src/Listeners/SmsListener.php @@ -13,8 +13,11 @@ class SmsListener { private $smsFeedbackWordService; + private $customerService; + private $meter; + private $smsService; public function __construct( @@ -32,7 +35,7 @@ public function __construct( public function onSmsStored($sender, $message) { $steamaCustomer = $this->customerService->getSteamaCustomerWithPhone($sender); - if (!$steamaCustomer) { + if (! $steamaCustomer) { return; } $smsFeedbackWords = $this->smsFeedbackWordService->getSmsFeedbackWords(); diff --git a/src/backend/packages/inensus/steama-meter/src/Models/BaseModel.php b/src/backend/packages/inensus/steama-meter/src/Models/BaseModel.php index da4ac23a5..a2eb72506 100644 --- a/src/backend/packages/inensus/steama-meter/src/Models/BaseModel.php +++ b/src/backend/packages/inensus/steama-meter/src/Models/BaseModel.php @@ -7,6 +7,7 @@ class BaseModel extends Model { protected $guarded = ['id']; + public static $rules = []; public function __construct(array $attributes = []) diff --git a/src/backend/packages/inensus/steama-meter/src/Models/SteamaSetting.php b/src/backend/packages/inensus/steama-meter/src/Models/SteamaSetting.php index 86e97f02b..55402f72b 100644 --- a/src/backend/packages/inensus/steama-meter/src/Models/SteamaSetting.php +++ b/src/backend/packages/inensus/steama-meter/src/Models/SteamaSetting.php @@ -17,8 +17,6 @@ public function setting(): MorphTo /** * A work-around for querying the polymorphic relation with whereHas. - * - * @return BelongsToMorph */ public function settingSms(): BelongsToMorph { @@ -27,8 +25,6 @@ public function settingSms(): BelongsToMorph /** * A work-around for querying the polymorphic relation with whereHas. - * - * @return BelongsToMorph */ public function settingSync(): BelongsToMorph { diff --git a/src/backend/packages/inensus/steama-meter/src/Models/SyncStatus.php b/src/backend/packages/inensus/steama-meter/src/Models/SyncStatus.php index 9140e7eb3..a0c4cffac 100644 --- a/src/backend/packages/inensus/steama-meter/src/Models/SyncStatus.php +++ b/src/backend/packages/inensus/steama-meter/src/Models/SyncStatus.php @@ -5,6 +5,8 @@ abstract class SyncStatus { public const SYNCED = 1; + public const MODIFIED = 2; + public const NOT_REGISTERED_YET = 3; } diff --git a/src/backend/packages/inensus/steama-meter/src/Observers/GeographicalInformationObserver.php b/src/backend/packages/inensus/steama-meter/src/Observers/GeographicalInformationObserver.php index bf2d820d7..824f0dec2 100644 --- a/src/backend/packages/inensus/steama-meter/src/Observers/GeographicalInformationObserver.php +++ b/src/backend/packages/inensus/steama-meter/src/Observers/GeographicalInformationObserver.php @@ -12,9 +12,13 @@ class GeographicalInformationObserver { private $stmMeterService; + private $stmMeter; + private $person; + private $stmCustomer; + private $meterParameter; public function __construct( diff --git a/src/backend/packages/inensus/steama-meter/src/Observers/PersonObserver.php b/src/backend/packages/inensus/steama-meter/src/Observers/PersonObserver.php index 397fd2ab6..2e40d9cd6 100644 --- a/src/backend/packages/inensus/steama-meter/src/Observers/PersonObserver.php +++ b/src/backend/packages/inensus/steama-meter/src/Observers/PersonObserver.php @@ -12,10 +12,15 @@ class PersonObserver { private $apiHelpers; + private $stmCustomerService; + private $stmMeterService; + private $stmCustomer; + private $person; + private $steamaApi; public function __construct( diff --git a/src/backend/packages/inensus/steama-meter/src/Providers/SteamaMeterServiceProvider.php b/src/backend/packages/inensus/steama-meter/src/Providers/SteamaMeterServiceProvider.php index 0112a0e5d..eefa571a4 100644 --- a/src/backend/packages/inensus/steama-meter/src/Providers/SteamaMeterServiceProvider.php +++ b/src/backend/packages/inensus/steama-meter/src/Providers/SteamaMeterServiceProvider.php @@ -47,7 +47,7 @@ public function boot(Filesystem $filesystem) $app->make(Schedule::class)->command('steama-meter:smsNotifier')->withoutOverlapping(50) ->appendOutputTo(storage_path('logs/cron.log')); $app->make(Schedule::class)->command('steama-meter:hourlyReadings')->hourlyAt(1)->withoutOverlapping(50) - ->appendOutputTo(storage_path('logs/cron.log')); + ->appendOutputTo(storage_path('logs/cron.log')); }); Relation::morphMap( [ diff --git a/src/backend/packages/inensus/steama-meter/src/Services/PackageInstallationService.php b/src/backend/packages/inensus/steama-meter/src/Services/PackageInstallationService.php index 62cb4f3af..ef48cd23e 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/PackageInstallationService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/PackageInstallationService.php @@ -19,8 +19,7 @@ public function __construct( private SteamaSmsBodyService $smsBodyService, private SteamaSmsVariableDefaultValueService $defaultValueService, private SteamaSmsFeedbackWordService $steamaSmsFeedbackWordService, - ) { - } + ) {} public function createDefaultSettingRecords() { diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaAgentService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaAgentService.php index 1be7e4499..7794c8b80 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaAgentService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaAgentService.php @@ -19,16 +19,27 @@ class SteamaAgentService implements ISynchronizeService { private $agentCommission; + private $agent; + private $stmAgent; + private $steamaApi; + private $apiHelpers; + private $rootUrl = '/agents'; + private $person; + private $addressService; + private $site; + private $address; + private $steamaSyncSettingService; + private $steamaSyncActionService; public function __construct( @@ -75,7 +86,7 @@ public function getAgentsCount() public function createSteamaAgentCommission() { $agentCommission = $this->agentCommission->newQuery()->where('name', 'Steama Agent Comission')->first(); - if (!$agentCommission) { + if (! $agentCommission) { $agentCommission = $this->agentCommission->newQuery()->create([ 'name' => 'Steama Agent Comission', 'energy_commission' => 0, diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaBitharvesterService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaBitharvesterService.php index 09f1dbea9..90cd3f6d6 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaBitharvesterService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaBitharvesterService.php @@ -7,6 +7,7 @@ class SteamaBitharvesterService { private $steamaApi; + private $rootUrl = '/bitharvesters'; public function __construct( diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaCredentialService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaCredentialService.php index d828bcbd0..77fa5c876 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaCredentialService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaCredentialService.php @@ -10,7 +10,9 @@ class SteamaCredentialService { private $rootUrl = '/get-token/'; + private $credential; + private $steamaApi; public function __construct( diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaCustomerService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaCustomerService.php index 842154b38..8c9770d6b 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaCustomerService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaCustomerService.php @@ -26,24 +26,43 @@ class SteamaCustomerService implements ISynchronizeService { private $customer; + private $steamaApi; + private $apiHelpers; + private $rootUrl = '/customers'; + private $person; + private $customerBasisPaymentPlan; + private $flatRatePaymentPlan; + private $subscriptionPaymentPlan; + private $hybridPaymentPlan; + private $minimumTopUpPaymentPlan; + private $perKwhPaymentPlan; + private $userType; + private $connectionType; + private $steamaSite; + private $bitharvesterService; + private $stmSite; + private $city; + private $steamaSyncSettingService; + private $steamaSyncActionService; + private $steamaSmsNotifiedCustomerService; public function __construct( diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaMeterReadingService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaMeterReadingService.php index effeb9d4a..09611874f 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaMeterReadingService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaMeterReadingService.php @@ -12,7 +12,9 @@ class SteamaMeterReadingService { private $steamaMeter; + private $steamaApi; + private $meterConsumtion; public function __construct( diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaMeterService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaMeterService.php index 993a7c394..7edc31d86 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaMeterService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaMeterService.php @@ -43,8 +43,7 @@ public function __construct( private SteamaTariff $tariff, private SteamaSyncSettingService $steamaSyncSettingService, private StemaSyncActionService $steamaSyncActionService, - ) { - } + ) {} public function getMeters($request) { @@ -167,14 +166,14 @@ public function createRelatedMeter($stmMeter) $stmMeter['customer'] )->first(); if ($meter === null) { - $meter = new Meter(); - $meterParameter = new MeterParameter(); - $geoLocation = new GeographicalInformation(); + $meter = new Meter; + $meterParameter = new MeterParameter; + $geoLocation = new GeographicalInformation; } else { $meterParameter = $this->meterParameter->newQuery()->where('meter_id', $meter->id)->first(); $geoLocation = $meterParameter->geo()->first(); if ($geoLocation === null) { - $geoLocation = new GeographicalInformation(); + $geoLocation = new GeographicalInformation; } } $meter->serial_number = $meterSerial; @@ -188,8 +187,8 @@ public function createRelatedMeter($stmMeter) $points = $stmMeter['latitude'].','.$stmMeter['longitude']; } else { $points = explode(',', config('steama.geoLocation')); - $latitude = strval(doubleval($points[0]) - (mt_rand(10, 1000) / 10000)); - $longitude = strval(doubleval($points[1]) - (mt_rand(10, 1000) / 10000)); + $latitude = strval(floatval($points[0]) - (mt_rand(10, 1000) / 10000)); + $longitude = strval(floatval($points[1]) - (mt_rand(10, 1000) / 10000)); $points = $latitude.','.$longitude; } @@ -197,7 +196,7 @@ public function createRelatedMeter($stmMeter) $connectionType = $stmCustomer->userType->mpmConnectionType; $connectionGroup = $this->connectionGroup->newQuery()->first(); - if (!$connectionGroup) { + if (! $connectionGroup) { $connectionGroup = $this->connectionGroup->newQuery()->create([ 'name' => 'default', ]); @@ -218,7 +217,7 @@ public function createRelatedMeter($stmMeter) $cityName = $stmCustomerAddress->addresses[0]->city->name; $steamaCity = $this->city->newQuery()->with('miniGrid')->where('name', $cityName)->first(); - $address = new Address(); + $address = new Address; $address = $address->newQuery()->create([ 'city_id' => request()->input('city_id') ?? $steamaCity->id, ]); diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSiteLevelPaymentPlanTypeService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSiteLevelPaymentPlanTypeService.php index b93ee0489..8458dcd00 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSiteLevelPaymentPlanTypeService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSiteLevelPaymentPlanTypeService.php @@ -26,7 +26,7 @@ public function createPaymentPlans() ]; foreach ($paymentPlans as $value) { $paymentPlanType = $this->paymentPlanType->newQuery()->where('name', $value)->first(); - if (!$paymentPlanType) { + if (! $paymentPlanType) { $this->paymentPlanType->newQuery()->create([ 'name' => $value, ]); diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSiteService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSiteService.php index 538ebf33a..b4453b028 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSiteService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSiteService.php @@ -16,14 +16,23 @@ class SteamaSiteService implements ISynchronizeService { private $site; + private $steamaApi; + private $apiHelpers; + private $rootUrl = '/sites'; + private $miniGrid; + private $cluster; + private $geographicalInformation; + private $city; + private $steamaSyncSettingService; + private $steamaSyncActionService; public function __construct( diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSmsSettingService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSmsSettingService.php index a74545a2d..9a863585c 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSmsSettingService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSmsSettingService.php @@ -8,6 +8,7 @@ class SteamaSmsSettingService { private $smsSetting; + private $setting; public function __construct(SteamaSmsSetting $smsSetting, SteamaSetting $setting) @@ -19,7 +20,7 @@ public function __construct(SteamaSmsSetting $smsSetting, SteamaSetting $setting public function createDefaultSettings() { $smsTransaction = $this->smsSetting->newQuery()->where('state', 'Transactions')->first(); - if (!$smsTransaction) { + if (! $smsTransaction) { $smsSetting = $this->setting->newQuery()->make(); $smsTransaction = $this->smsSetting->newQuery()->create([ 'state' => 'Transactions', @@ -29,7 +30,7 @@ public function createDefaultSettings() $smsSetting->save(); } $smsLowBalanceWarning = $this->smsSetting->newQuery()->where('state', 'Low Balance Warning')->first(); - if (!$smsLowBalanceWarning) { + if (! $smsLowBalanceWarning) { $balanceSetting = $this->setting->newQuery()->make(); $smsLowBalanceWarning = $this->smsSetting->newQuery()->create([ 'state' => 'Low Balance Warning', diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSyncSettingService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSyncSettingService.php index d109c6153..0c056270a 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSyncSettingService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSyncSettingService.php @@ -11,7 +11,9 @@ class SteamaSyncSettingService { private $syncSetting; + private $setting; + private $syncActionService; public function __construct( @@ -31,7 +33,7 @@ public function createDefaultSettings() $syncSite = $this->syncSetting->newQuery()->where('action_name', 'Sites')->first(); - if (!$syncSite) { + if (! $syncSite) { $now = Carbon::now(); $siteSetting = $this->setting->newQuery()->make(); $syncSite = $this->syncSetting->newQuery()->create([ @@ -49,7 +51,7 @@ public function createDefaultSettings() } $syncCustomer = $this->syncSetting->newQuery()->where('action_name', 'Customers')->first(); - if (!$syncCustomer) { + if (! $syncCustomer) { $now = Carbon::now(); $customerSetting = $this->setting->newQuery()->make(); $syncCustomer = $this->syncSetting->newQuery()->create([ @@ -67,7 +69,7 @@ public function createDefaultSettings() } $syncMeter = $this->syncSetting->newQuery()->where('action_name', 'Meters')->first(); - if (!$syncMeter) { + if (! $syncMeter) { $now = Carbon::now(); $meterSetting = $this->setting->newQuery()->make(); $syncMeter = $this->syncSetting->newQuery()->create([ @@ -85,7 +87,7 @@ public function createDefaultSettings() } $syncAgent = $this->syncSetting->newQuery()->where('action_name', 'Agents')->first(); - if (!$syncAgent) { + if (! $syncAgent) { $now = Carbon::now(); $agentSetting = $this->setting->newQuery()->make(); $syncAgent = $this->syncSetting->newQuery()->create([ @@ -103,7 +105,7 @@ public function createDefaultSettings() } $syncTransaction = $this->syncSetting->newQuery()->where('action_name', 'Transactions')->first(); - if (!$syncTransaction) { + if (! $syncTransaction) { $now = Carbon::now(); $transactionSetting = $this->setting->newQuery()->make(); $syncTransaction = $this->syncSetting->newQuery()->create([ diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaTariffService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaTariffService.php index e0341571f..cfdc5031c 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaTariffService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaTariffService.php @@ -7,9 +7,7 @@ class SteamaTariffService { - public function __construct(private readonly SteamaTariff $tariff, private readonly MeterTariff $meterTariff) - { - } + public function __construct(private readonly SteamaTariff $tariff, private readonly MeterTariff $meterTariff) {} /** * This function uses one time on installation of the package. @@ -17,7 +15,7 @@ public function __construct(private readonly SteamaTariff $tariff, private reado public function createTariff() { $meterTariff = $this->meterTariff->newQuery()->where('name', 'Steama External Tariff')->first(); - if (!$meterTariff) { + if (! $meterTariff) { $meterTariff = $this->meterTariff->newQuery()->create([ 'name' => 'Steama External Tariff', 'price' => 0, diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaTransactionsService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaTransactionsService.php index bd5824944..db04efcbf 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaTransactionsService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaTransactionsService.php @@ -16,19 +16,33 @@ class SteamaTransactionsService implements ISynchronizeService { private $stemaMeterService; + private $steamaCustomerService; + private $steamaCredentialService; + private $steamaSiteService; + private $steamaAgentService; + private $steamaTransaction; + private $steamaMeter; + private $steamaApi; + private $thirdPartyTransaction; + private $rootUrl = '/transactions'; + private $transaction; + private $meterToken; + private $steamaCustomer; + private $steamaSyncSettingService; + private $steamaSyncActionService; public function __construct( diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaUserTypeService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaUserTypeService.php index 539c0edd5..5d1fad63f 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaUserTypeService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaUserTypeService.php @@ -9,7 +9,9 @@ class SteamaUserTypeService { private $connectionType; + private $userType; + private $subConnectionType; public function __construct( @@ -36,14 +38,14 @@ public function createUserTypes($tariff) foreach ($connectionTypes as $key => $value) { $connectionType = $this->connectionType->newQuery()->where('name', $value)->first(); - if (!$connectionType) { + if (! $connectionType) { $connectionType = $this->connectionType->newQuery()->create([ 'name' => $value, ]); } $userType = $this->userType->newQuery()->where('name', $value)->first(); - if (!$userType) { + if (! $userType) { $this->userType->newQuery()->create([ 'mpm_connection_type_id' => $connectionType->id, 'name' => $value, @@ -52,7 +54,7 @@ public function createUserTypes($tariff) } $subConnectionType = $this->subConnectionType->newQuery()->where('name', $value)->first(); - if (!$subConnectionType) { + if (! $subConnectionType) { $this->subConnectionType->newQuery()->create([ 'name' => $value, 'connection_type_id' => $connectionType->id, diff --git a/src/backend/packages/inensus/steama-meter/src/Services/StemaSyncActionService.php b/src/backend/packages/inensus/steama-meter/src/Services/StemaSyncActionService.php index f298b6146..f409f80fa 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/StemaSyncActionService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/StemaSyncActionService.php @@ -32,7 +32,7 @@ public function getActionsNeedsToSync() public function updateSyncAction($syncAction, $syncSetting, $syncResult) { - if (!$syncResult) { + if (! $syncResult) { return $syncAction->update([ 'attempts' => $syncAction->attempts + 1, 'last_sync' => Carbon::now(), diff --git a/src/backend/packages/inensus/steama-meter/src/Sms/BodyParsers/SteamaSmsBalanceFeedbackBody.php b/src/backend/packages/inensus/steama-meter/src/Sms/BodyParsers/SteamaSmsBalanceFeedbackBody.php index f15d7939d..e9bf50d0e 100644 --- a/src/backend/packages/inensus/steama-meter/src/Sms/BodyParsers/SteamaSmsBalanceFeedbackBody.php +++ b/src/backend/packages/inensus/steama-meter/src/Sms/BodyParsers/SteamaSmsBalanceFeedbackBody.php @@ -8,6 +8,7 @@ class SteamaSmsBalanceFeedbackBody extends SmsBodyParser { protected $variables = ['account_balance']; + protected $steamaCustomer; public function __construct(SteamaCustomer $steamaCustomer) diff --git a/src/backend/packages/inensus/steama-meter/src/Sms/BodyParsers/SteamaSmsBalanceFeedbackHeader.php b/src/backend/packages/inensus/steama-meter/src/Sms/BodyParsers/SteamaSmsBalanceFeedbackHeader.php index 961ca39f6..46ec42a10 100644 --- a/src/backend/packages/inensus/steama-meter/src/Sms/BodyParsers/SteamaSmsBalanceFeedbackHeader.php +++ b/src/backend/packages/inensus/steama-meter/src/Sms/BodyParsers/SteamaSmsBalanceFeedbackHeader.php @@ -8,6 +8,7 @@ class SteamaSmsBalanceFeedbackHeader extends SmsBodyParser { protected $variables = ['name', 'surname']; + protected $steamaCustomer; public function __construct(SteamaCustomer $steamaCustomer) diff --git a/src/backend/packages/inensus/steama-meter/src/Sms/BodyParsers/SteamaSmsLowBalanceBody.php b/src/backend/packages/inensus/steama-meter/src/Sms/BodyParsers/SteamaSmsLowBalanceBody.php index 9c02dfcd0..7ed48ac7b 100644 --- a/src/backend/packages/inensus/steama-meter/src/Sms/BodyParsers/SteamaSmsLowBalanceBody.php +++ b/src/backend/packages/inensus/steama-meter/src/Sms/BodyParsers/SteamaSmsLowBalanceBody.php @@ -8,6 +8,7 @@ class SteamaSmsLowBalanceBody extends SmsBodyParser { protected $variables = ['low_balance_warning', 'account_balance']; + protected $steamaCustomer; public function __construct(SteamaCustomer $steamaCustomer) diff --git a/src/backend/packages/inensus/steama-meter/src/Sms/BodyParsers/SteamaSmsLowBalanceHeader.php b/src/backend/packages/inensus/steama-meter/src/Sms/BodyParsers/SteamaSmsLowBalanceHeader.php index 5c5fc5de3..4a0fb5d1d 100644 --- a/src/backend/packages/inensus/steama-meter/src/Sms/BodyParsers/SteamaSmsLowBalanceHeader.php +++ b/src/backend/packages/inensus/steama-meter/src/Sms/BodyParsers/SteamaSmsLowBalanceHeader.php @@ -8,6 +8,7 @@ class SteamaSmsLowBalanceHeader extends SmsBodyParser { protected $variables = ['name', 'surname']; + protected $steamaCustomer; public function __construct(SteamaCustomer $steamaCustomer) diff --git a/src/backend/packages/inensus/steama-meter/src/Sms/Senders/SteamaSmsConfig.php b/src/backend/packages/inensus/steama-meter/src/Sms/Senders/SteamaSmsConfig.php index 74bc11cae..d0b402651 100644 --- a/src/backend/packages/inensus/steama-meter/src/Sms/Senders/SteamaSmsConfig.php +++ b/src/backend/packages/inensus/steama-meter/src/Sms/Senders/SteamaSmsConfig.php @@ -11,6 +11,8 @@ class SteamaSmsConfig extends SmsConfigsCore SteamaSmsTypes::LOW_BALANCE_LIMIT_NOTIFIER => 'Inensus\SteamaMeter\Sms\Senders\LowBalanceLimitNotifier', SteamaSmsTypes::BALANCE_FEEDBACK => 'Inensus\SteamaMeter\Sms\Senders\BalanceFeedback', ]; + public $bodyParsersPath = 'Inensus\\SteamaMeter\\Sms\\BodyParsers\\'; + public $servicePath = 'Inensus\SteamaMeter\Services\SteamaSmsBodyService'; } diff --git a/src/backend/packages/inensus/steama-meter/src/Sms/SteamaSmsTypes.php b/src/backend/packages/inensus/steama-meter/src/Sms/SteamaSmsTypes.php index 27daf9c8a..de0250024 100644 --- a/src/backend/packages/inensus/steama-meter/src/Sms/SteamaSmsTypes.php +++ b/src/backend/packages/inensus/steama-meter/src/Sms/SteamaSmsTypes.php @@ -5,5 +5,6 @@ class SteamaSmsTypes { public const LOW_BALANCE_LIMIT_NOTIFIER = 1; + public const BALANCE_FEEDBACK = 2; } diff --git a/src/backend/packages/inensus/steama-meter/src/SteamaMeterApi.php b/src/backend/packages/inensus/steama-meter/src/SteamaMeterApi.php index 0eca704df..afafe565e 100644 --- a/src/backend/packages/inensus/steama-meter/src/SteamaMeterApi.php +++ b/src/backend/packages/inensus/steama-meter/src/SteamaMeterApi.php @@ -107,7 +107,5 @@ public function chargeDevice(TransactionDataContainer $transactionContainer): ar } } - public function clearDevice(Device $device) - { - } + public function clearDevice(Device $device) {} } diff --git a/src/backend/packages/inensus/steama-meter/src/Tests/Unit/SmsNotifyTest.php b/src/backend/packages/inensus/steama-meter/src/Tests/Unit/SmsNotifyTest.php index 04413f28d..63dc36fc8 100644 --- a/src/backend/packages/inensus/steama-meter/src/Tests/Unit/SmsNotifyTest.php +++ b/src/backend/packages/inensus/steama-meter/src/Tests/Unit/SmsNotifyTest.php @@ -73,7 +73,7 @@ public function isLowBalanceNotifySend() return true; } if ( - !$customer->mpmPerson->addresses || $customer->mpmPerson->addresses[0]->phone === null + ! $customer->mpmPerson->addresses || $customer->mpmPerson->addresses[0]->phone === null || $customer->mpmPerson->addresses[0]->phone === '' ) { return true; @@ -125,11 +125,11 @@ public function isTransactionNotifySend() $notifyCustomer = $customers->filter(function ($customer) use ($steamaTransaction) { return $customer->customer_id == $steamaTransaction->customer_id; })->first(); - if (!$notifyCustomer) { + if (! $notifyCustomer) { return true; } if ( - !$notifyCustomer->mpmPerson->addresses || $notifyCustomer->mpmPerson->addresses[0]->phone === null + ! $notifyCustomer->mpmPerson->addresses || $notifyCustomer->mpmPerson->addresses[0]->phone === null || $notifyCustomer->mpmPerson->addresses[0]->phone === '' ) { return true; @@ -160,7 +160,7 @@ public function isMaxAttemptNotifySend() SteamaSyncSetting::query()->get()->each(function ($syncSetting) use ($syncActions, $newNextSync) { $syncAction = $syncActions->where('sync_setting_id', $syncSetting->id)->first(); - if (!$syncAction) { + if (! $syncAction) { return true; } if ($syncAction->attempts >= $syncSetting->max_attempts) { @@ -171,7 +171,7 @@ public function isMaxAttemptNotifySend() 'owner', [User::class] )->first(); - if (!$adminAddress) { + if (! $adminAddress) { return true; } $data = [ diff --git a/src/backend/packages/inensus/stron-meter/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/stron-meter/src/Console/Commands/InstallPackage.php index c4f510335..8179d344d 100644 --- a/src/backend/packages/inensus/stron-meter/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/stron-meter/src/Console/Commands/InstallPackage.php @@ -9,6 +9,7 @@ class InstallPackage extends Command { protected $signature = 'stron-meter:install'; + protected $description = 'Install StronMeter Package'; public function __construct( diff --git a/src/backend/packages/inensus/stron-meter/src/Console/Commands/UpdatePackage.php b/src/backend/packages/inensus/stron-meter/src/Console/Commands/UpdatePackage.php index 2769774e6..678cd37fe 100644 --- a/src/backend/packages/inensus/stron-meter/src/Console/Commands/UpdatePackage.php +++ b/src/backend/packages/inensus/stron-meter/src/Console/Commands/UpdatePackage.php @@ -10,6 +10,7 @@ class UpdatePackage extends Command { protected $signature = 'stron-meter:update'; + protected $description = 'Update StronMeter Package'; public function __construct( @@ -49,7 +50,7 @@ private function deleteMigration(Filesystem $filesystem) $migrationFile = $filesystem->glob(database_path().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR.'*_create_calin_smart_tables.php')[0]; $migration = DB::table('migrations') ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->first(); - if (!$migration) { + if (! $migration) { return false; } diff --git a/src/backend/packages/inensus/stron-meter/src/Exceptions/StronApiResponseException.php b/src/backend/packages/inensus/stron-meter/src/Exceptions/StronApiResponseException.php index 22007d2aa..37808a756 100644 --- a/src/backend/packages/inensus/stron-meter/src/Exceptions/StronApiResponseException.php +++ b/src/backend/packages/inensus/stron-meter/src/Exceptions/StronApiResponseException.php @@ -2,6 +2,4 @@ namespace Inensus\StronMeter\Exceptions; -class StronApiResponseException extends \Exception -{ -} +class StronApiResponseException extends \Exception {} diff --git a/src/backend/packages/inensus/stron-meter/src/Helpers/ApiHelpers.php b/src/backend/packages/inensus/stron-meter/src/Helpers/ApiHelpers.php index 8592ca5db..466c78210 100644 --- a/src/backend/packages/inensus/stron-meter/src/Helpers/ApiHelpers.php +++ b/src/backend/packages/inensus/stron-meter/src/Helpers/ApiHelpers.php @@ -17,7 +17,7 @@ public function __construct(Manufacturer $manufacturerModel) public function registerStronMeterManufacturer() { $api = $this->manufacturer->newQuery()->where('api_name', 'StronMeterApi')->first(); - if (!$api) { + if (! $api) { $this->manufacturer->newQuery()->create([ 'name' => 'Stron Meters', 'website' => 'http://www.stronsmart.com/', diff --git a/src/backend/packages/inensus/stron-meter/src/Http/Requests/StronMeterApiRequests.php b/src/backend/packages/inensus/stron-meter/src/Http/Requests/StronMeterApiRequests.php index 09e0ca0c7..6257f62b6 100644 --- a/src/backend/packages/inensus/stron-meter/src/Http/Requests/StronMeterApiRequests.php +++ b/src/backend/packages/inensus/stron-meter/src/Http/Requests/StronMeterApiRequests.php @@ -10,7 +10,9 @@ class StronMeterApiRequests { private $client; + private $apiHelpers; + private $credential; public function __construct( diff --git a/src/backend/packages/inensus/stron-meter/src/Http/Resources/StronCredentialResource.php b/src/backend/packages/inensus/stron-meter/src/Http/Resources/StronCredentialResource.php index 9dcee0599..cbb1a6911 100644 --- a/src/backend/packages/inensus/stron-meter/src/Http/Resources/StronCredentialResource.php +++ b/src/backend/packages/inensus/stron-meter/src/Http/Resources/StronCredentialResource.php @@ -16,8 +16,7 @@ public function __construct(StronCredential $stronCredential) /** * Transform the resource into an array. * - * @param Request $request - * + * @param Request $request * @return Request */ public function toArray($request) diff --git a/src/backend/packages/inensus/stron-meter/src/Http/Resources/StronResource.php b/src/backend/packages/inensus/stron-meter/src/Http/Resources/StronResource.php index ccacc4bc8..132b88a68 100644 --- a/src/backend/packages/inensus/stron-meter/src/Http/Resources/StronResource.php +++ b/src/backend/packages/inensus/stron-meter/src/Http/Resources/StronResource.php @@ -10,8 +10,7 @@ class StronResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request - * + * @param Request $request * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/stron-meter/src/Services/StronCredentialService.php b/src/backend/packages/inensus/stron-meter/src/Services/StronCredentialService.php index 0f2968ae7..8868225ed 100644 --- a/src/backend/packages/inensus/stron-meter/src/Services/StronCredentialService.php +++ b/src/backend/packages/inensus/stron-meter/src/Services/StronCredentialService.php @@ -10,7 +10,9 @@ class StronCredentialService { private $rootUrl = '/login/'; + private $credential; + private $stronApi; public function __construct( diff --git a/src/backend/packages/inensus/stron-meter/src/StronMeterApi.php b/src/backend/packages/inensus/stron-meter/src/StronMeterApi.php index 978b4d8e1..4616a9a17 100644 --- a/src/backend/packages/inensus/stron-meter/src/StronMeterApi.php +++ b/src/backend/packages/inensus/stron-meter/src/StronMeterApi.php @@ -16,6 +16,7 @@ class StronMeterApi implements IManufacturerAPI { protected $api; + private $rootUrl = '/vending/'; public function __construct( diff --git a/src/backend/packages/inensus/sun-king-shs/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/sun-king-shs/src/Console/Commands/InstallPackage.php index e45cade62..1042209f8 100644 --- a/src/backend/packages/inensus/sun-king-shs/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/sun-king-shs/src/Console/Commands/InstallPackage.php @@ -9,6 +9,7 @@ class InstallPackage extends Command { protected $signature = 'sun-king-shs:install'; + protected $description = 'Install SunKingSHS Package'; public function __construct( diff --git a/src/backend/packages/inensus/sun-king-shs/src/Http/Controllers/SunKingCredentialController.php b/src/backend/packages/inensus/sun-king-shs/src/Http/Controllers/SunKingCredentialController.php index 8dea71db2..3c39f7035 100644 --- a/src/backend/packages/inensus/sun-king-shs/src/Http/Controllers/SunKingCredentialController.php +++ b/src/backend/packages/inensus/sun-king-shs/src/Http/Controllers/SunKingCredentialController.php @@ -9,9 +9,7 @@ class SunKingCredentialController extends Controller { - public function __construct(private SunKingCredentialService $credentialService) - { - } + public function __construct(private SunKingCredentialService $credentialService) {} public function show(): SunKingResource { diff --git a/src/backend/packages/inensus/sun-king-shs/src/Http/Resources/SunKingResource.php b/src/backend/packages/inensus/sun-king-shs/src/Http/Resources/SunKingResource.php index e7a541476..a5360b8bf 100644 --- a/src/backend/packages/inensus/sun-king-shs/src/Http/Resources/SunKingResource.php +++ b/src/backend/packages/inensus/sun-king-shs/src/Http/Resources/SunKingResource.php @@ -10,8 +10,7 @@ class SunKingResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request - * + * @param Request $request * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/sun-king-shs/src/Modules/Api/ApiRequests.php b/src/backend/packages/inensus/sun-king-shs/src/Modules/Api/ApiRequests.php index 905cb022c..b064711f9 100644 --- a/src/backend/packages/inensus/sun-king-shs/src/Modules/Api/ApiRequests.php +++ b/src/backend/packages/inensus/sun-king-shs/src/Modules/Api/ApiRequests.php @@ -12,8 +12,7 @@ class ApiRequests { public function __construct( private Client $httpClient, - ) { - } + ) {} public function authentication($credential): array { diff --git a/src/backend/packages/inensus/sun-king-shs/src/Modules/Api/SunKingSHSApi.php b/src/backend/packages/inensus/sun-king-shs/src/Modules/Api/SunKingSHSApi.php index 1d4e63e6c..6931622c8 100644 --- a/src/backend/packages/inensus/sun-king-shs/src/Modules/Api/SunKingSHSApi.php +++ b/src/backend/packages/inensus/sun-king-shs/src/Modules/Api/SunKingSHSApi.php @@ -14,14 +14,14 @@ class SunKingSHSApi implements IManufacturerAPI { public const API_CALL_TOKEN_GENERATION = '/token'; + public const COMMAND_ADD_CREDIT = 'add_credit'; public function __construct( private SunKingCredentialService $credentialService, private SunKingTransaction $sunKingTransaction, private ApiRequests $apiRequests, - ) { - } + ) {} public function chargeDevice(TransactionDataContainer $transactionContainer): array { diff --git a/src/backend/packages/inensus/sun-king-shs/src/Services/ManufacturerService.php b/src/backend/packages/inensus/sun-king-shs/src/Services/ManufacturerService.php index 0948e4470..99baae766 100644 --- a/src/backend/packages/inensus/sun-king-shs/src/Services/ManufacturerService.php +++ b/src/backend/packages/inensus/sun-king-shs/src/Services/ManufacturerService.php @@ -6,14 +6,12 @@ class ManufacturerService { - public function __construct(private Manufacturer $manufacturer) - { - } + public function __construct(private Manufacturer $manufacturer) {} public function register() { $api = $this->manufacturer->newQuery()->where('api_name', 'SunKingSHSApi')->first(); - if (!$api) { + if (! $api) { $this->manufacturer->newQuery()->create([ 'name' => 'SunKing SHS', 'type' => 'shs', diff --git a/src/backend/packages/inensus/sun-king-shs/src/Services/SunKingCredentialService.php b/src/backend/packages/inensus/sun-king-shs/src/Services/SunKingCredentialService.php index bc416a9b6..0a08a1357 100644 --- a/src/backend/packages/inensus/sun-king-shs/src/Services/SunKingCredentialService.php +++ b/src/backend/packages/inensus/sun-king-shs/src/Services/SunKingCredentialService.php @@ -8,8 +8,7 @@ class SunKingCredentialService { public function __construct( private SunKingCredential $credential, - ) { - } + ) {} /** * This function uses one time on installation of the package. diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/InstallPackage.php index 178326aea..4d10d5c9b 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/InstallPackage.php @@ -15,6 +15,7 @@ class InstallPackage extends Command { protected $signature = 'swifta-payment-provider:install'; + protected $description = 'Install SwiftaPaymentProvider Package'; public function __construct( @@ -102,7 +103,7 @@ private function generateRandomNumber(): string { $length = random_int(1, 10); $number = ''; - for ($i = 0; $i < $length; ++$i) { + for ($i = 0; $i < $length; $i++) { $number .= random_int(0, 9); } $number = ltrim($number, '0'); diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/TransactionStatusChecker.php b/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/TransactionStatusChecker.php index bb4e74a9a..84dab3d47 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/TransactionStatusChecker.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/TransactionStatusChecker.php @@ -10,9 +10,11 @@ class TransactionStatusChecker extends AbstractSharedCommand { use ScheduledPluginCommand; + public const MPM_PLUGIN_ID = 7; protected $signature = 'swifta-payment-provider:transactionStatusCheck'; + protected $description = 'Update the Swifta Transaction status if still REQUESTED at 00:00'; public function __construct(private SwiftaTransactionService $swiftaTransactionService) @@ -22,7 +24,7 @@ public function __construct(private SwiftaTransactionService $swiftaTransactionS public function handle(): void { - if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { + if (! $this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/UpdatePackage.php b/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/UpdatePackage.php index 093dda50f..e8a1b6b2e 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/UpdatePackage.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/UpdatePackage.php @@ -13,6 +13,7 @@ class UpdatePackage extends Command { protected $signature = 'swifta-payment-provider:update'; + protected $description = 'Update the Swifta Payment Provider Integration Package'; public function __construct( @@ -66,7 +67,7 @@ private function deleteMigration(Filesystem $filesystem) $migrationFile = $filesystem->glob(database_path().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR.'*_create_swifta_payment_provider_tables.php')[0]; $migration = DB::table('migrations') ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->first(); - if (!$migration) { + if (! $migration) { return; } DB::table('migrations') @@ -115,7 +116,7 @@ private function generateRandomNumber(): string { $length = random_int(1, 10); $number = ''; - for ($i = 0; $i < $length; ++$i) { + for ($i = 0; $i < $length; $i++) { $number .= random_int(0, 9); } $number = ltrim($number, '0'); diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/CipherNotValidException.php b/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/CipherNotValidException.php index 954e9fd40..9e0bbbcd3 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/CipherNotValidException.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/CipherNotValidException.php @@ -2,6 +2,4 @@ namespace Inensus\SwiftaPaymentProvider\Exceptions; -class CipherNotValidException extends \Exception -{ -} +class CipherNotValidException extends \Exception {} diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/CustomerAddressNotFoundException.php b/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/CustomerAddressNotFoundException.php index 8c548c73f..36e415f33 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/CustomerAddressNotFoundException.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/CustomerAddressNotFoundException.php @@ -2,6 +2,4 @@ namespace Inensus\SwiftaPaymentProvider\Exceptions; -class CustomerAddressNotFoundException extends \Exception -{ -} +class CustomerAddressNotFoundException extends \Exception {} diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/SwiftaValidationFailedException.php b/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/SwiftaValidationFailedException.php index 1220242ac..ae16b3fb1 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/SwiftaValidationFailedException.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/SwiftaValidationFailedException.php @@ -2,6 +2,4 @@ namespace Inensus\SwiftaPaymentProvider\Exceptions; -class SwiftaValidationFailedException extends \Exception -{ -} +class SwiftaValidationFailedException extends \Exception {} diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/TransactionAmountDifferentException.php b/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/TransactionAmountDifferentException.php index 1b958300b..5ac2ad6a1 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/TransactionAmountDifferentException.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/TransactionAmountDifferentException.php @@ -2,6 +2,4 @@ namespace Inensus\SwiftaPaymentProvider\Exceptions; -class TransactionAmountDifferentException extends \Exception -{ -} +class TransactionAmountDifferentException extends \Exception {} diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/TransactionNotExistsException.php b/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/TransactionNotExistsException.php index 5be8a2415..6f45bda5f 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/TransactionNotExistsException.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/TransactionNotExistsException.php @@ -2,6 +2,4 @@ namespace Inensus\SwiftaPaymentProvider\Exceptions; -class TransactionNotExistsException extends \Exception -{ -} +class TransactionNotExistsException extends \Exception {} diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Http/Controllers/SwiftaAuthenticationController.php b/src/backend/packages/inensus/swifta-payment-provider/src/Http/Controllers/SwiftaAuthenticationController.php index 99fee28a5..f4e1915e4 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Http/Controllers/SwiftaAuthenticationController.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Http/Controllers/SwiftaAuthenticationController.php @@ -8,9 +8,7 @@ class SwiftaAuthenticationController extends Controller { - public function __construct(private SwiftaAuthenticationService $swiftaAuthenticationService) - { - } + public function __construct(private SwiftaAuthenticationService $swiftaAuthenticationService) {} public function show(): ApiResource { diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Http/Controllers/SwiftaPaymentProviderController.php b/src/backend/packages/inensus/swifta-payment-provider/src/Http/Controllers/SwiftaPaymentProviderController.php index 300d77513..0bfdbb2fd 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Http/Controllers/SwiftaPaymentProviderController.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Http/Controllers/SwiftaPaymentProviderController.php @@ -11,9 +11,7 @@ class SwiftaPaymentProviderController extends Controller { - public function __construct(private SwiftaTransactionService $swiftaTransactionService) - { - } + public function __construct(private SwiftaTransactionService $swiftaTransactionService) {} public function validation(SwiftaValidationRequest $request) { diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Http/Middleware/SwiftaTransactionCallbackMiddleware.php b/src/backend/packages/inensus/swifta-payment-provider/src/Http/Middleware/SwiftaTransactionCallbackMiddleware.php index ad9af1208..487ed2ea9 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Http/Middleware/SwiftaTransactionCallbackMiddleware.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Http/Middleware/SwiftaTransactionCallbackMiddleware.php @@ -9,9 +9,7 @@ class SwiftaTransactionCallbackMiddleware { - public function __construct(private SwiftaTransactionService $swiftaTransactionService) - { - } + public function __construct(private SwiftaTransactionService $swiftaTransactionService) {} public function handle(Request $request, \Closure $next) { diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Models/SwiftaTransaction.php b/src/backend/packages/inensus/swifta-payment-provider/src/Models/SwiftaTransaction.php index 4fd09e6f7..4ef0a210f 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Models/SwiftaTransaction.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Models/SwiftaTransaction.php @@ -11,12 +11,16 @@ use Illuminate\Database\Eloquent\Relations\MorphTo; use MPM\Transaction\FullySupportedTransactionInterface; -class SwiftaTransaction extends BaseModel implements IRawTransaction, FullySupportedTransactionInterface +class SwiftaTransaction extends BaseModel implements FullySupportedTransactionInterface, IRawTransaction { public const RELATION_NAME = 'swifta_transaction'; + public const STATUS_SUCCESS = 1; + public const STATUS_PENDING = 0; + public const STATUS_FAILED = -1; + public const STATUS_REQUESTED = -2; protected $table = 'swifta_transactions'; @@ -26,9 +30,6 @@ public function getAmount(): int return $this->amount; } - /** - * @return MorphOne - */ public function transaction(): MorphOne { return $this->morphOne(Transaction::class, 'original_transaction'); diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Providers/SwiftaTransactionProvider.php b/src/backend/packages/inensus/swifta-payment-provider/src/Providers/SwiftaTransactionProvider.php index e1e58b33c..5bc17517e 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Providers/SwiftaTransactionProvider.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Providers/SwiftaTransactionProvider.php @@ -22,8 +22,7 @@ public function __construct( private Transaction $transaction, private SwiftaTransactionService $swiftaTransactionService, private TransactionConflicts $transactionConflicts, - ) { - } + ) {} public function validateRequest($request) { diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Services/SwiftaAuthenticationService.php b/src/backend/packages/inensus/swifta-payment-provider/src/Services/SwiftaAuthenticationService.php index ced42711f..be89b3d58 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Services/SwiftaAuthenticationService.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Services/SwiftaAuthenticationService.php @@ -6,9 +6,7 @@ class SwiftaAuthenticationService { - public function __construct(private SwiftaAuthentication $swiftaAuthentication) - { - } + public function __construct(private SwiftaAuthentication $swiftaAuthentication) {} public function getSwiftaAuthentication() { diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Services/SwiftaTransactionService.php b/src/backend/packages/inensus/swifta-payment-provider/src/Services/SwiftaTransactionService.php index 85970670c..4594a42a2 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Services/SwiftaTransactionService.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Services/SwiftaTransactionService.php @@ -53,7 +53,7 @@ public function setRequestedTransactionsStatusFailed() 'status' => SwiftaTransaction::STATUS_FAILED, ]); $message = 'The transaction that stayed as Unprocessed more than 24 hours, updated to canceled.'; - $conflict = new TransactionConflicts(); + $conflict = new TransactionConflicts; $conflict->state = $message; $conflict->transaction()->associate($transaction); $conflict->save(); diff --git a/src/backend/packages/inensus/ticket/src/Exceptions/ApiUserNotFound.php b/src/backend/packages/inensus/ticket/src/Exceptions/ApiUserNotFound.php index 081ae012e..28f351359 100644 --- a/src/backend/packages/inensus/ticket/src/Exceptions/ApiUserNotFound.php +++ b/src/backend/packages/inensus/ticket/src/Exceptions/ApiUserNotFound.php @@ -2,6 +2,4 @@ namespace Inensus\Ticket\Exceptions; -class ApiUserNotFound extends \Exception -{ -} +class ApiUserNotFound extends \Exception {} diff --git a/src/backend/packages/inensus/ticket/src/Exceptions/TicketOwnerNotFoundException.php b/src/backend/packages/inensus/ticket/src/Exceptions/TicketOwnerNotFoundException.php index 0cb518af5..c6ff994c0 100644 --- a/src/backend/packages/inensus/ticket/src/Exceptions/TicketOwnerNotFoundException.php +++ b/src/backend/packages/inensus/ticket/src/Exceptions/TicketOwnerNotFoundException.php @@ -2,6 +2,4 @@ namespace Inensus\Ticket\Exceptions; -class TicketOwnerNotFoundException extends \Exception -{ -} +class TicketOwnerNotFoundException extends \Exception {} diff --git a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketAgentController.php b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketAgentController.php index 52003b9f8..dc496183a 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketAgentController.php +++ b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketAgentController.php @@ -8,9 +8,7 @@ class TicketAgentController extends Controller { - public function __construct(private TicketService $ticketService) - { - } + public function __construct(private TicketService $ticketService) {} public function index($agentId, Request $request): TicketResource { diff --git a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCategoryController.php b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCategoryController.php index 44e9c6f1d..921a55471 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCategoryController.php +++ b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCategoryController.php @@ -9,9 +9,7 @@ class TicketCategoryController extends Controller { - public function __construct(private TicketCategoryService $ticketCategoryService) - { - } + public function __construct(private TicketCategoryService $ticketCategoryService) {} /** * A list of all stored labels/categories. diff --git a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCommentController.php b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCommentController.php index f144a1a1b..af9b38648 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCommentController.php +++ b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCommentController.php @@ -10,9 +10,7 @@ class TicketCommentController extends Controller { - public function __construct(private TicketCommentService $ticketCommentService, private TicketUserService $ticketUserService) - { - } + public function __construct(private TicketCommentService $ticketCommentService, private TicketUserService $ticketUserService) {} public function store(Request $request) { diff --git a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketController.php b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketController.php index de5d0e833..d84a6d724 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketController.php +++ b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketController.php @@ -10,9 +10,7 @@ class TicketController extends Controller { public const FOR_APP = false; - public function __construct(private TicketService $ticketService) - { - } + public function __construct(private TicketService $ticketService) {} public function index(Request $request): TicketResource { diff --git a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCustomerController.php b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCustomerController.php index 48eec9212..0fd612d8f 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCustomerController.php +++ b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCustomerController.php @@ -25,8 +25,7 @@ public function __construct( private TicketOutSourceService $ticketOutSourceService, private MaintenanceUserService $maintenanceUserService, private MaintenanceUserTicketService $maintenanceUserTicketService, - ) { - } + ) {} public function store(UserTicketCreateRequest $request): TicketResource { diff --git a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketExportController.php b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketExportController.php index 99f72b25e..6b9ba8d6a 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketExportController.php +++ b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketExportController.php @@ -13,13 +13,10 @@ class TicketExportController public function __construct( private TicketOutsourceReportService $ticketOutsourceReportService, private TicketService $ticketService, - ) { - } + ) {} /** * A list of stored book keeping data. - * - * @return TicketResource */ public function index(Request $request): TicketResource { @@ -31,9 +28,7 @@ public function index(Request $request): TicketResource /** * Generates a book keeping file and stores it. * - * @param Request $request * - * @return TicketResource * * @throws \PhpOffice\PhpSpreadsheet\Exception */ diff --git a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketUserController.php b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketUserController.php index bd23a2f21..a6383213f 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketUserController.php +++ b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketUserController.php @@ -14,8 +14,7 @@ class TicketUserController extends Controller public function __construct( private TicketUserService $ticketUserService, private UserService $userService, - ) { - } + ) {} public function index(Request $request): TicketResource { diff --git a/src/backend/packages/inensus/ticket/src/Http/Controllers/WatcherController.php b/src/backend/packages/inensus/ticket/src/Http/Controllers/WatcherController.php index af2efce66..7532d8230 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Controllers/WatcherController.php +++ b/src/backend/packages/inensus/ticket/src/Http/Controllers/WatcherController.php @@ -21,6 +21,7 @@ class WatcherController * The Trello action codes which are logged in our system. */ public const INTERESTING_ACTIONS = ['createCard', 'addMemberToCard', 'commentCard', 'updateCard']; + /** * @var Ticket */ @@ -28,8 +29,6 @@ class WatcherController /** * WatcherController constructor. - * - * @param Ticket $ticket */ public function __construct(Ticket $ticket) { @@ -49,7 +48,7 @@ public function store(): void $action = $content['action']; $actionType = $action['type']; - if (!$this->filterRequest($actionType)) { // there is no interest for that action + if (! $this->filterRequest($actionType)) { // there is no interest for that action Log::debug('action is not interesting'); return; @@ -61,9 +60,7 @@ public function store(): void /** * Checks if the request type is interesting or not. * - * @param string $type the request type - * - * @return bool + * @param string $type the request type */ private function filterRequest($type): bool { @@ -74,9 +71,7 @@ private function filterRequest($type): bool * Tries to match the given ticket id with an entry in the database * it should prevent, that any new ticket created directly in Trello. * - * @param string $ticketId * - * @return Ticket * * @throws ModelNotFoundException */ diff --git a/src/backend/packages/inensus/ticket/src/Http/Requests/TicketingUserExternalRequest.php b/src/backend/packages/inensus/ticket/src/Http/Requests/TicketingUserExternalRequest.php index 1b99f2914..a3577727e 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Requests/TicketingUserExternalRequest.php +++ b/src/backend/packages/inensus/ticket/src/Http/Requests/TicketingUserExternalRequest.php @@ -8,8 +8,6 @@ class TicketingUserExternalRequest extends FormRequest { /** * Describes the rules which should be fulfilled by the request. - * - * @return array */ public function rules(): array { diff --git a/src/backend/packages/inensus/ticket/src/Http/Requests/TicketingUserRequest.php b/src/backend/packages/inensus/ticket/src/Http/Requests/TicketingUserRequest.php index 1a726cf21..3c7cebe31 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Requests/TicketingUserRequest.php +++ b/src/backend/packages/inensus/ticket/src/Http/Requests/TicketingUserRequest.php @@ -8,8 +8,6 @@ class TicketingUserRequest extends FormRequest { /** * Describes the rules which should be fulfilled by the request. - * - * @return array */ public function rules(): array { diff --git a/src/backend/packages/inensus/ticket/src/Http/Resources/TicketResource.php b/src/backend/packages/inensus/ticket/src/Http/Resources/TicketResource.php index 024d08f73..e2d7878be 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Resources/TicketResource.php +++ b/src/backend/packages/inensus/ticket/src/Http/Resources/TicketResource.php @@ -10,8 +10,7 @@ class TicketResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request - * + * @param Request $request * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/ticket/src/Jobs/OutputJob.php b/src/backend/packages/inensus/ticket/src/Jobs/OutputJob.php index 5dc8e3234..cde2c6a3e 100644 --- a/src/backend/packages/inensus/ticket/src/Jobs/OutputJob.php +++ b/src/backend/packages/inensus/ticket/src/Jobs/OutputJob.php @@ -15,6 +15,7 @@ class OutputJob implements ShouldQueue use InteractsWithQueue; use Queueable; use SerializesModels; + /** * @var integert */ diff --git a/src/backend/packages/inensus/ticket/src/Models/BaseModel.php b/src/backend/packages/inensus/ticket/src/Models/BaseModel.php index 3097d4d06..c49f487c9 100644 --- a/src/backend/packages/inensus/ticket/src/Models/BaseModel.php +++ b/src/backend/packages/inensus/ticket/src/Models/BaseModel.php @@ -2,6 +2,4 @@ namespace Inensus\Ticket\Models; -class BaseModel extends \App\Models\Base\BaseModel -{ -} +class BaseModel extends \App\Models\Base\BaseModel {} diff --git a/src/backend/packages/inensus/ticket/src/Models/TicketOutsourceReport.php b/src/backend/packages/inensus/ticket/src/Models/TicketOutsourceReport.php index 18f04c596..bab763f8a 100644 --- a/src/backend/packages/inensus/ticket/src/Models/TicketOutsourceReport.php +++ b/src/backend/packages/inensus/ticket/src/Models/TicketOutsourceReport.php @@ -5,7 +5,7 @@ /** * Class OutsourceReport. * - * @property int $id + * @property int $id * @property string $date * @property string $path */ diff --git a/src/backend/packages/inensus/ticket/src/Models/TicketUser.php b/src/backend/packages/inensus/ticket/src/Models/TicketUser.php index d82fba2d3..956e5d649 100644 --- a/src/backend/packages/inensus/ticket/src/Models/TicketUser.php +++ b/src/backend/packages/inensus/ticket/src/Models/TicketUser.php @@ -7,13 +7,15 @@ * * @property string $user_name * @property string $user_tag - * @property int $out_source - * @property int $id + * @property int $out_source + * @property int $id */ class TicketUser extends BaseModel { public const TABLE_NAME = 'ticket_users'; + public const COL_USER_ID = 'user_id'; + protected $table = self::TABLE_NAME; public function getId(): int diff --git a/src/backend/packages/inensus/ticket/src/Providers/TicketServiceProvider.php b/src/backend/packages/inensus/ticket/src/Providers/TicketServiceProvider.php index f2fbd7e73..e357cc666 100644 --- a/src/backend/packages/inensus/ticket/src/Providers/TicketServiceProvider.php +++ b/src/backend/packages/inensus/ticket/src/Providers/TicketServiceProvider.php @@ -32,7 +32,7 @@ public function publishConfigFiles() public function publishMigrations() { - if (!class_exists('CreateTicketingTables')) { + if (! class_exists('CreateTicketingTables')) { $timestamp = date('Y_m_d_His', time()); $this->publishes([ diff --git a/src/backend/packages/inensus/ticket/src/Services/TicketCategoryService.php b/src/backend/packages/inensus/ticket/src/Services/TicketCategoryService.php index 11278724c..36213d666 100644 --- a/src/backend/packages/inensus/ticket/src/Services/TicketCategoryService.php +++ b/src/backend/packages/inensus/ticket/src/Services/TicketCategoryService.php @@ -14,8 +14,7 @@ class TicketCategoryService implements IBaseService { public function __construct( private TicketCategory $ticketCategory, - ) { - } + ) {} public function getById(int $categoryId): TicketCategory { diff --git a/src/backend/packages/inensus/ticket/src/Services/TicketCommentService.php b/src/backend/packages/inensus/ticket/src/Services/TicketCommentService.php index afce1ca6b..75a17d774 100644 --- a/src/backend/packages/inensus/ticket/src/Services/TicketCommentService.php +++ b/src/backend/packages/inensus/ticket/src/Services/TicketCommentService.php @@ -11,8 +11,7 @@ public function __construct( private Person $person, private TicketComment $ticketComment, private TicketUserService $ticketUserService - ) { - } + ) {} public function createComment(int $ticketId, string $comment, int $ticketUserId): TicketComment { @@ -46,7 +45,7 @@ static function ($q) use ($sender) { ->where('is_customer', 0) ->first(); - if ($person && !$person->tickets->isEmpty()) { + if ($person && ! $person->tickets->isEmpty()) { $ticketUser = $this->ticketUserService->findByPhone($sender); $this->createComment($person->tickets[0]->ticket_id, 'Sms Comment'.$message, $ticketUser->getId()); } diff --git a/src/backend/packages/inensus/ticket/src/Services/TicketOutSourceService.php b/src/backend/packages/inensus/ticket/src/Services/TicketOutSourceService.php index e70bcb414..1bd2b21c7 100644 --- a/src/backend/packages/inensus/ticket/src/Services/TicketOutSourceService.php +++ b/src/backend/packages/inensus/ticket/src/Services/TicketOutSourceService.php @@ -13,8 +13,7 @@ class TicketOutSourceService implements IBaseService { public function __construct( private TicketOutsource $ticketOutsource, - ) { - } + ) {} public function getById(int $ticketOutsourceId): TicketOutsource { diff --git a/src/backend/packages/inensus/ticket/src/Services/TicketOutsourceReportService.php b/src/backend/packages/inensus/ticket/src/Services/TicketOutsourceReportService.php index 35e575208..f365c7514 100644 --- a/src/backend/packages/inensus/ticket/src/Services/TicketOutsourceReportService.php +++ b/src/backend/packages/inensus/ticket/src/Services/TicketOutsourceReportService.php @@ -18,8 +18,7 @@ class TicketOutsourceReportService implements IBaseService public function __construct( private TicketOutsourceReport $ticketOutsourceReport, private Spreadsheet $spreadsheet - ) { - } + ) {} public function getAll(?int $limit = null): Collection|LengthAwarePaginator { @@ -51,7 +50,7 @@ public function createExcelSheet($startDate, $endDate, $tickets) } $writer = new Xlsx($this->spreadsheet); $dirPath = storage_path('./outsourcing'); - if (!file_exists($dirPath)) { + if (! file_exists($dirPath)) { mkdir($dirPath, 0774, true); } try { diff --git a/src/backend/packages/inensus/ticket/src/Services/TicketService.php b/src/backend/packages/inensus/ticket/src/Services/TicketService.php index 9bba24c0f..3314de769 100644 --- a/src/backend/packages/inensus/ticket/src/Services/TicketService.php +++ b/src/backend/packages/inensus/ticket/src/Services/TicketService.php @@ -14,8 +14,7 @@ class TicketService implements IAssociative { public function __construct( private Ticket $ticket, - ) { - } + ) {} public function create( string $title, diff --git a/src/backend/packages/inensus/ticket/src/Services/TicketUserService.php b/src/backend/packages/inensus/ticket/src/Services/TicketUserService.php index 14f6c8153..40e7c669f 100644 --- a/src/backend/packages/inensus/ticket/src/Services/TicketUserService.php +++ b/src/backend/packages/inensus/ticket/src/Services/TicketUserService.php @@ -16,8 +16,7 @@ class TicketUserService implements IBaseService public function __construct( private TicketUser $ticketUser, private User $user, - ) { - } + ) {} public function getAll(?int $limit = null, ?bool $outsource = null): Collection|LengthAwarePaginator { diff --git a/src/backend/packages/inensus/viber-messaging/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/viber-messaging/src/Console/Commands/InstallPackage.php index 90e344df2..d1263bc34 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/viber-messaging/src/Console/Commands/InstallPackage.php @@ -8,6 +8,7 @@ class InstallPackage extends Command { protected $signature = 'viber-messaging:install'; + protected $description = 'Install ViberMessaging Package'; public function __construct( diff --git a/src/backend/packages/inensus/viber-messaging/src/Console/Commands/UpdatePackage.php b/src/backend/packages/inensus/viber-messaging/src/Console/Commands/UpdatePackage.php index 1c398b3e0..62341a540 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Console/Commands/UpdatePackage.php +++ b/src/backend/packages/inensus/viber-messaging/src/Console/Commands/UpdatePackage.php @@ -10,6 +10,7 @@ class UpdatePackage extends Command { protected $signature = 'viber-messaging:update'; + protected $description = 'Update ViberMessaging Package'; public function __construct( @@ -51,7 +52,7 @@ private function deleteMigration(Filesystem $filesystem) '*_create_viber_tables.php')[0]; $migration = DB::table('migrations') ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->first(); - if (!$migration) { + if (! $migration) { return false; } diff --git a/src/backend/packages/inensus/viber-messaging/src/Exceptions/MessageNotSentException.php b/src/backend/packages/inensus/viber-messaging/src/Exceptions/MessageNotSentException.php index 774de2d69..6b51cfa7c 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Exceptions/MessageNotSentException.php +++ b/src/backend/packages/inensus/viber-messaging/src/Exceptions/MessageNotSentException.php @@ -2,6 +2,4 @@ namespace Inensus\ViberMessaging\Exceptions; -class MessageNotSentException extends \Exception -{ -} +class MessageNotSentException extends \Exception {} diff --git a/src/backend/packages/inensus/viber-messaging/src/Exceptions/WebhookNotCreatedException.php b/src/backend/packages/inensus/viber-messaging/src/Exceptions/WebhookNotCreatedException.php index 4837bd754..4522049ec 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Exceptions/WebhookNotCreatedException.php +++ b/src/backend/packages/inensus/viber-messaging/src/Exceptions/WebhookNotCreatedException.php @@ -2,6 +2,4 @@ namespace Inensus\ViberMessaging\Exceptions; -class WebhookNotCreatedException extends \Exception -{ -} +class WebhookNotCreatedException extends \Exception {} diff --git a/src/backend/packages/inensus/viber-messaging/src/Http/Controllers/ViberCredentialController.php b/src/backend/packages/inensus/viber-messaging/src/Http/Controllers/ViberCredentialController.php index 0dcde78ae..67bd8cde5 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Http/Controllers/ViberCredentialController.php +++ b/src/backend/packages/inensus/viber-messaging/src/Http/Controllers/ViberCredentialController.php @@ -14,8 +14,7 @@ class ViberCredentialController extends Controller public function __construct( private ViberCredentialService $credentialService, private DatabaseProxyManagerService $databaseProxyManagerService, - ) { - } + ) {} public function show(): ViberResource { diff --git a/src/backend/packages/inensus/viber-messaging/src/Http/Controllers/WebhookController.php b/src/backend/packages/inensus/viber-messaging/src/Http/Controllers/WebhookController.php index 17f54170c..67d1ac553 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Http/Controllers/WebhookController.php +++ b/src/backend/packages/inensus/viber-messaging/src/Http/Controllers/WebhookController.php @@ -18,6 +18,7 @@ class WebhookController extends Controller { private $bot; + private $botSender; public function __construct( @@ -44,7 +45,7 @@ public function index(string $slug) $resendInformationKey = $this->smsResendInformationKeyService->getResendInformationKeys()->first()->key; $this->bot ->onConversation(function ($event) { - return (new \Viber\Api\Message\Text())->setSender($this->botSender)->setText('Can I help you?'); + return (new \Viber\Api\Message\Text)->setSender($this->botSender)->setText('Can I help you?'); }) ->onText('|register+.*|si', function ($event) use ($bot, $botSender) { $message = $event->getMessage()->getText(); @@ -60,7 +61,7 @@ public function index(string $slug) $meter = Meter::query()->where('serial_number', $meterSerialNumber)->first(); - if (!$meter) { + if (! $meter) { $this->answerToCustomer($bot, $botSender, $event, $this->setMeterNotFoundMessage()); return; @@ -94,13 +95,13 @@ public function index(string $slug) } }) ->onText("|$resendInformationKey.*|si", function ($event) use ($bot, $botSender, $resendInformationKey) { - if (!$resendInformationKey) { + if (! $resendInformationKey) { return; } $meterSerial = $this->viberContactService->getByViberId($event->getSender() ->getId())->registered_meter_serial_number; - if (!$meterSerial) { + if (! $meterSerial) { $this->answerToCustomer($bot, $botSender, $event, $this->setNotRegisteredMessage()); return; @@ -108,7 +109,7 @@ public function index(string $slug) $transaction = Transaction::with('paymentHistories') ->where('message', $meterSerial)->latest()->first(); - if (!$transaction) { + if (! $transaction) { $this->answerToCustomer($bot, $botSender, $event, $this->setNoTransactionMessage($meterSerial)); return; @@ -156,7 +157,7 @@ private function setNoTransactionMessage($meterSerial) private function answerToCustomer($bot, $botSender, $event, $message) { $bot->getClient()->sendMessage( - (new \Viber\Api\Message\Text()) + (new \Viber\Api\Message\Text) ->setSender($botSender) ->setReceiver($event->getSender()->getId()) ->setText("Hello, {$event->getSender()->getName()}! {$message}") diff --git a/src/backend/packages/inensus/viber-messaging/src/Http/Resources/ViberResource.php b/src/backend/packages/inensus/viber-messaging/src/Http/Resources/ViberResource.php index 1f204d92d..c7dd9d8bf 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Http/Resources/ViberResource.php +++ b/src/backend/packages/inensus/viber-messaging/src/Http/Resources/ViberResource.php @@ -10,8 +10,7 @@ class ViberResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request - * + * @param Request $request * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/viber-messaging/src/Services/ViberContactService.php b/src/backend/packages/inensus/viber-messaging/src/Services/ViberContactService.php index bbeb6998c..e46d979d7 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Services/ViberContactService.php +++ b/src/backend/packages/inensus/viber-messaging/src/Services/ViberContactService.php @@ -15,8 +15,7 @@ class ViberContactService implements IBaseService public function __construct( private ViberContact $viberContact, private Person $person, - ) { - } + ) {} public function createContact($personId, $viberId) { diff --git a/src/backend/packages/inensus/viber-messaging/src/Services/ViberCredentialService.php b/src/backend/packages/inensus/viber-messaging/src/Services/ViberCredentialService.php index f4995c7fa..2bccbdd0f 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Services/ViberCredentialService.php +++ b/src/backend/packages/inensus/viber-messaging/src/Services/ViberCredentialService.php @@ -10,8 +10,7 @@ public function __construct( private ViberCredential $credential, private WebhookService $webhookService, private AccountService $accountService, - ) { - } + ) {} /** * This function uses one time on installation of the package. @@ -44,11 +43,11 @@ public function updateCredentials($data) ]); $credential->save(); - if (!$credential->has_webhook_created) { + if (! $credential->has_webhook_created) { $this->webhookService->createWebHook($credential); } - if (!$credential->deep_link) { + if (! $credential->deep_link) { $uri = $this->accountService->getAccountInfo($credential); $credential->deep_link = "viber://pa?chatURI=$uri&text=register+change_this_with_your_meter_serial_number"; $credential->save(); diff --git a/src/backend/packages/inensus/viber-messaging/src/Services/ViberMessageService.php b/src/backend/packages/inensus/viber-messaging/src/Services/ViberMessageService.php index c480c60c9..0b2848501 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Services/ViberMessageService.php +++ b/src/backend/packages/inensus/viber-messaging/src/Services/ViberMessageService.php @@ -13,8 +13,7 @@ class ViberMessageService implements IBaseService { public function __construct( private ViberMessage $viberMessage, - ) { - } + ) {} public function getById(int $id): ViberMessage { diff --git a/src/backend/packages/inensus/viber-messaging/src/ViberGateway.php b/src/backend/packages/inensus/viber-messaging/src/ViberGateway.php index 0c338fa62..c6f45421c 100644 --- a/src/backend/packages/inensus/viber-messaging/src/ViberGateway.php +++ b/src/backend/packages/inensus/viber-messaging/src/ViberGateway.php @@ -13,6 +13,7 @@ class ViberGateway { private $bot; + private $botSender; public function __construct( @@ -35,7 +36,7 @@ public function sendSms( ) { try { $this->bot->getClient()->sendMessage( - (new \Viber\Api\Message\Text()) + (new \Viber\Api\Message\Text) ->setSender($this->botSender) ->setReceiver($viberId) ->setText($body) diff --git a/src/backend/packages/inensus/wave-money-payment-provider/database/migrations/create_wave_money_payment_provider_tables.php b/src/backend/packages/inensus/wave-money-payment-provider/database/migrations/create_wave_money_payment_provider_tables.php index 8cc6bc9e2..90104de84 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/database/migrations/create_wave_money_payment_provider_tables.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/database/migrations/create_wave_money_payment_provider_tables.php @@ -8,7 +8,7 @@ class CreateWaveMoneyPaymentProviderTables extends Migration { public function up() { - if (!Schema::hasTable('wave_money_transactions')) { + if (! Schema::hasTable('wave_money_transactions')) { Schema::create('wave_money_transactions', static function (Blueprint $table) { $table->increments('id'); $table->integer('status')->default(-2); @@ -23,7 +23,7 @@ public function up() $table->timestamps(); }); } - if (!Schema::hasTable('wave_money_credentials')) { + if (! Schema::hasTable('wave_money_credentials')) { Schema::create('wave_money_credentials', static function (Blueprint $table) { $table->increments('id'); $table->string('merchant_id')->nullable(); diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Console/Commands/InstallPackage.php index 6b209a65e..a64e17127 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Console/Commands/InstallPackage.php @@ -8,6 +8,7 @@ class InstallPackage extends Command { protected $signature = 'wave-money-payment-provider:install'; + protected $description = 'Install WaveMoneyPaymentProvider Package'; public function __construct( diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Console/Commands/UpdatePackage.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Console/Commands/UpdatePackage.php index f44b7c9b7..48c5bca78 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Console/Commands/UpdatePackage.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Console/Commands/UpdatePackage.php @@ -10,6 +10,7 @@ class UpdatePackage extends Command { protected $signature = 'wave-money-payment-provider:update'; + protected $description = 'Update WaveMoney Package'; public function __construct( @@ -51,7 +52,7 @@ private function deleteMigration(Filesystem $filesystem) '*_create_wave_money_payment_provider_tables.php')[0]; $migration = DB::table('migrations') ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->first(); - if (!$migration) { + if (! $migration) { return false; } diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Controllers/WaveMoneyController.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Controllers/WaveMoneyController.php index 3add2dc85..f0f2b3db4 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Controllers/WaveMoneyController.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Controllers/WaveMoneyController.php @@ -16,8 +16,7 @@ class WaveMoneyController extends Controller public function __construct( private WaveMoneyTransactionService $transactionService, private WaveMoneyApiService $apiService, - ) { - } + ) {} public function startTransaction(TransactionInitializeRequest $request): WaveMoneyResource { diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Controllers/WaveMoneyCredentialController.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Controllers/WaveMoneyCredentialController.php index a0fa27144..f7df5bdbd 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Controllers/WaveMoneyCredentialController.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Controllers/WaveMoneyCredentialController.php @@ -16,8 +16,7 @@ public function __construct( private WaveMoneyCredentialService $credentialService, private DatabaseProxyManagerService $databaseProxyManagerService, private CompanyService $companyService, - ) { - } + ) {} public function show(): WaveMoneyResource { diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Middleware/WaveMoneyTransactionCallbackMiddleware.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Middleware/WaveMoneyTransactionCallbackMiddleware.php index 1a500b31f..a4e62afc9 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Middleware/WaveMoneyTransactionCallbackMiddleware.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Middleware/WaveMoneyTransactionCallbackMiddleware.php @@ -13,13 +13,11 @@ class WaveMoneyTransactionCallbackMiddleware { - public function __construct(private WaveMoneyTransactionService $transactionService) - { - } + public function __construct(private WaveMoneyTransactionService $transactionService) {} public function handle(Request $request, \Closure $next) { - $mapper = new TransactionCallbackRequestMapper(); + $mapper = new TransactionCallbackRequestMapper; $callbackData = $mapper->getMappedObject($request); try { $waveMoneyTransaction = $this->transactionService->getByOrderId($callbackData->getOrderId()); diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Requests/TransactionCallbackRequestMapper.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Requests/TransactionCallbackRequestMapper.php index 4ae30b3ab..799201462 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Requests/TransactionCallbackRequestMapper.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Requests/TransactionCallbackRequestMapper.php @@ -10,24 +10,43 @@ class TransactionCallbackRequestMapper { private const BODY_PARAM_STATUS = 'status'; + private const BODY_PARAM_MERCHANT_ID = 'merchantId'; + private const BODY_PARAM_ORDER_ID = 'orderId'; + private const BODY_PARAM_MERCHANT_REFERENCE_ID = 'merchantReferenceId'; + private const BODY_PARAM_FRONTEND_RESULT_URL = 'frontendResultUrl'; + private const BODY_PARAM_BACKEND_RESULT_URL = 'backendResultUrl'; + private const BODY_PARAM_INITIATOR_MSISDN = 'initiatorMsisdn'; + private const BODY_PARAM_AMOUNT = 'amount'; + private const BODY_PARAM_TIME_TO_LIVE_SECONDS = 'timeToLiveSeconds'; + private const BODY_PARAM_PAYMENT_DESCRIPTION = 'paymentDescription'; + private const BODY_PARAM_CURRENCY = 'currency'; + private const BODY_PARAM_HASH_VALUE = 'hashValue'; + private const BODY_PARAM_TRANSACTION_ID = 'transactionId'; + private const BODY_PARAM_PAYMENT_REQUEST_ID = 'paymentRequestId'; + private const BODY_PARAM_REQUEST_TIME = 'requestTime'; + private const BODY_PARAM_ADDITIONAL_FIELD_1 = 'additionalField1'; + private const BODY_PARAM_ADDITIONAL_FIELD_2 = 'additionalField2'; + private const BODY_PARAM_ADDITIONAL_FIELD_3 = 'additionalField3'; + private const BODY_PARAM_ADDITIONAL_FIELD_4 = 'additionalField4'; + private const BODY_PARAM_ADDITIONAL_FIELD_5 = 'additionalField5'; public function getMappedObject(Request $request): TransactionCallbackData diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Requests/TransactionInitializeRequest.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Requests/TransactionInitializeRequest.php index a8c51292a..822aac7f1 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Requests/TransactionInitializeRequest.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Requests/TransactionInitializeRequest.php @@ -9,6 +9,7 @@ class TransactionInitializeRequest extends FormRequest { private const BODY_PARAM_METER_SERIAL = 'meterSerial'; + private const BODY_PARAM_AMOUNT = 'amount'; public function rules(): array diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Resources/WaveMoneyResource.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Resources/WaveMoneyResource.php index c66114fea..3a8849a99 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Resources/WaveMoneyResource.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Resources/WaveMoneyResource.php @@ -10,8 +10,7 @@ class WaveMoneyResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request - * + * @param Request $request * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Models/WaveMoneyTransaction.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Models/WaveMoneyTransaction.php index 92d204f8c..6f743a15c 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Models/WaveMoneyTransaction.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Models/WaveMoneyTransaction.php @@ -19,14 +19,18 @@ * @property int customer_id * @property string|null meter_serial */ -class WaveMoneyTransaction extends BaseModel implements IRawTransaction, FullySupportedTransactionInterface +class WaveMoneyTransaction extends BaseModel implements FullySupportedTransactionInterface, IRawTransaction { public const RELATION_NAME = 'wave_money_transaction'; public const STATUS_REQUESTED = 0; + public const STATUS_FAILED = -1; + public const STATUS_SUCCESS = 1; + public const STATUS_COMPLETED_BY_WAVE_MONEY = 2; + public const MAX_ATTEMPTS = 5; protected $table = 'wave_money_transactions'; diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/AbstractApi.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/AbstractApi.php index b59f46d74..c0ab9c998 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/AbstractApi.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/AbstractApi.php @@ -10,9 +10,7 @@ abstract class AbstractApi { - public function __construct(private Client $client) - { - } + public function __construct(private Client $client) {} public function doRequest(AbstractApiResource $resource): AbstractApiResource { diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Data/TransactionCallbackData.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Data/TransactionCallbackData.php index 0119f0e25..993ce7f93 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Data/TransactionCallbackData.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Data/TransactionCallbackData.php @@ -7,11 +7,17 @@ class TransactionCallbackData { public const STATUS_PAYMENT_CONFIRMED = 'PAYMENT_CONFIRMED'; + public const STATUS_BILL_COLLECTION_FAILED = 'BILL_COLLECTION_FAILED'; + public const STATUS_INSUFFICIENT_BALANCE = 'INSUFFICIENT_BALANCE'; + public const STATUS_ACCOUNT_LOCKED = 'ACCOUNT_LOCKED'; + public const STATUS_SCHEDULER_TRANSACTION_TIMED_OUT = 'SCHEDULER_TRANSACTION_TIMED_OUT'; + public const STATUS_SUCCESS = 1; + public const STATUS_FAILURE = -1; public function __construct( @@ -35,8 +41,7 @@ public function __construct( private ?string $additional3, private ?string $additional4, private ?string $additional5, - ) { - } + ) {} public function getStatus(): string { diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/RequestMethod.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/RequestMethod.php index a675638c8..f8f07cbd7 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/RequestMethod.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/RequestMethod.php @@ -5,7 +5,10 @@ class RequestMethod { public const POST = 'post'; + public const GET = 'get'; + public const PUT = 'put'; + public const DELETE = 'delete'; } diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Resources/AbstractApiResource.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Resources/AbstractApiResource.php index d98842b70..8953d5dd1 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Resources/AbstractApiResource.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Resources/AbstractApiResource.php @@ -7,6 +7,7 @@ abstract class AbstractApiResource { protected string $body; + protected const REQUEST_TIME_TO_LIVE_IN_SECS = 120; abstract public function getRequestMethod(): string; diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Resources/StartTransactionResource.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Resources/StartTransactionResource.php index f25f1fd62..3caa3c01b 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Resources/StartTransactionResource.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Resources/StartTransactionResource.php @@ -9,14 +9,15 @@ class StartTransactionResource extends AbstractApiResource { public const RESPONSE_SUCCESS = 'success'; + public const RESPONSE_KEY_MESSAGE = 'transaction_id'; + public const RESPONSE_KEY_TRANSACTION_ID = 'transaction_id'; public function __construct( private WaveMoneyCredential $waveMoneyCredential, private WaveMoneyTransaction $waveMoneyTransaction, - ) { - } + ) {} public function getRequestMethod(): string { diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/WaveMoneyApi.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/WaveMoneyApi.php index 37694efca..7e9d95d30 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/WaveMoneyApi.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/WaveMoneyApi.php @@ -2,6 +2,4 @@ namespace Inensus\WaveMoneyPaymentProvider\Modules\Api; -class WaveMoneyApi extends AbstractApi -{ -} +class WaveMoneyApi extends AbstractApi {} diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/WaveMoneyApiService.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/WaveMoneyApiService.php index 68db1b9e7..e8cb78df8 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/WaveMoneyApiService.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/WaveMoneyApiService.php @@ -13,8 +13,7 @@ class WaveMoneyApiService public function __construct( private WaveMoneyApi $api, private WaveMoneyCredentialService $credentialService, - ) { - } + ) {} public function requestPayment(WaveMoneyTransaction $transaction): array { diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Transaction/WaveMoneyTransactionService.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Transaction/WaveMoneyTransactionService.php index 03e4b487e..344f56378 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Transaction/WaveMoneyTransactionService.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Transaction/WaveMoneyTransactionService.php @@ -22,9 +22,13 @@ class WaveMoneyTransactionService extends AbstractPaymentAggregatorTransactionService implements IBaseService { private Meter $meter; + private Address $address; + private Transaction $transaction; + private MeterParameter $meterParameter; + private WaveMoneyTransaction $waveMoneyTransaction; public function __construct( diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/WaveMoneyTransactionProvider.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/WaveMoneyTransactionProvider.php index cccac46c3..f98ce18be 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/WaveMoneyTransactionProvider.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/WaveMoneyTransactionProvider.php @@ -22,8 +22,7 @@ public function __construct( private Transaction $transaction, private WaveMoneyTransactionService $waveMoneyTransactionService, private TransactionConflicts $transactionConflicts, - ) { - } + ) {} public function validateRequest($request) { diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Services/WaveMoneyCredentialService.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Services/WaveMoneyCredentialService.php index be608a888..ba83541e8 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Services/WaveMoneyCredentialService.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Services/WaveMoneyCredentialService.php @@ -8,8 +8,7 @@ class WaveMoneyCredentialService { public function __construct( private WaveMoneyCredential $credential, - ) { - } + ) {} /** * This function uses one time on installation of the package. diff --git a/src/backend/packages/inensus/wavecom-payment-provider/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/wavecom-payment-provider/src/Console/Commands/InstallPackage.php index fb1cba887..0cd6ce25a 100644 --- a/src/backend/packages/inensus/wavecom-payment-provider/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/wavecom-payment-provider/src/Console/Commands/InstallPackage.php @@ -7,6 +7,7 @@ class InstallPackage extends Command { protected $signature = 'wavecom-payment-provider:install'; + protected $description = 'Install wavecom-money-payment-provider Package'; public function handle(): void diff --git a/src/backend/packages/inensus/wavecom-payment-provider/src/Http/Controllers/WaveComTransactionController.php b/src/backend/packages/inensus/wavecom-payment-provider/src/Http/Controllers/WaveComTransactionController.php index 72eb7e2a5..0727b297e 100644 --- a/src/backend/packages/inensus/wavecom-payment-provider/src/Http/Controllers/WaveComTransactionController.php +++ b/src/backend/packages/inensus/wavecom-payment-provider/src/Http/Controllers/WaveComTransactionController.php @@ -11,9 +11,7 @@ class WaveComTransactionController extends Controller { - public function __construct(private TransactionService $transactionService) - { - } + public function __construct(private TransactionService $transactionService) {} public function uploadTransaction(UploadTransactionRequest $request): ApiResource { diff --git a/src/backend/packages/inensus/wavecom-payment-provider/src/Models/WaveComTransaction.php b/src/backend/packages/inensus/wavecom-payment-provider/src/Models/WaveComTransaction.php index 685735003..3ee90a069 100644 --- a/src/backend/packages/inensus/wavecom-payment-provider/src/Models/WaveComTransaction.php +++ b/src/backend/packages/inensus/wavecom-payment-provider/src/Models/WaveComTransaction.php @@ -14,17 +14,20 @@ use MPM\Transaction\FullySupportedTransactionInterface; /** - * @property int $id + * @property int $id * @property string $transaction_id * @property string $sender * @property string $message - * @property int $amount + * @property int $amount */ -class WaveComTransaction extends BaseModel implements IRawTransaction, FullySupportedTransactionInterface +class WaveComTransaction extends BaseModel implements FullySupportedTransactionInterface, IRawTransaction { protected $table = 'wavecom_transactions'; + public const RELATION_NAME = 'wavecom_transaction'; + public const STATUS_SUCCESS = 1; + public const STATUS_CANCELLED = -1; public function getTransactionId(): string diff --git a/src/backend/packages/inensus/wavecom-payment-provider/src/Providers/WaveComTransactionProvider.php b/src/backend/packages/inensus/wavecom-payment-provider/src/Providers/WaveComTransactionProvider.php index d23449afa..945a4c907 100644 --- a/src/backend/packages/inensus/wavecom-payment-provider/src/Providers/WaveComTransactionProvider.php +++ b/src/backend/packages/inensus/wavecom-payment-provider/src/Providers/WaveComTransactionProvider.php @@ -24,8 +24,7 @@ public function __construct( private SmsService $smsService, private TransactionConflicts $transactionConflicts, private WaveComTransaction $waveComTransaction, - ) { - } + ) {} public function saveTransaction() { diff --git a/src/backend/packages/inensus/wavecom-payment-provider/src/Services/TransactionService.php b/src/backend/packages/inensus/wavecom-payment-provider/src/Services/TransactionService.php index 794a6501c..2a4916f92 100644 --- a/src/backend/packages/inensus/wavecom-payment-provider/src/Services/TransactionService.php +++ b/src/backend/packages/inensus/wavecom-payment-provider/src/Services/TransactionService.php @@ -17,9 +17,7 @@ class TransactionService extends AbstractPaymentAggregatorTransactionService { - public function __construct(private Csv $csv) - { - } + public function __construct(private Csv $csv) {} public function createTransactionsFromFile(UploadedFile $file): array { @@ -30,7 +28,7 @@ public function createTransactionsFromFile(UploadedFile $file): array foreach ($this->csv->data as $transactionData) { try { $this->validateTransaction($transactionData); - $transaction = new WaveComTransaction(); + $transaction = new WaveComTransaction; $transaction->setTransactionId($transactionData['transaction_id']); $transaction->setSender($transactionData['sender']); @@ -46,10 +44,11 @@ public function createTransactionsFromFile(UploadedFile $file): array } else { $skippedTransactions[] = $transactionData['transaction_id'].' unkown reason'; } + continue; } - $baseTransaction = new Transaction(); + $baseTransaction = new Transaction; $baseTransaction->setAmount($transaction->getAmount()); $baseTransaction->setSender($transaction->getSender()); $baseTransaction->setMessage($transaction->getMessage()); @@ -60,8 +59,8 @@ public function createTransactionsFromFile(UploadedFile $file): array TransactionDataContainer::initialize($baseTransaction); ProcessPayment::dispatch($transaction->getId()) - ->allOnConnection('redis') - ->onQueue(config('services.queues.payment')); + ->allOnConnection('redis') + ->onQueue(config('services.queues.payment')); } return $skippedTransactions; diff --git a/src/backend/tests/Feature/CityTest.php b/src/backend/tests/Feature/CityTest.php index 8e696c3ef..fde6cb1f7 100644 --- a/src/backend/tests/Feature/CityTest.php +++ b/src/backend/tests/Feature/CityTest.php @@ -21,11 +21,17 @@ class CityTest extends TestCase use WithFaker; private $user; + private $company; + private $companyDatabase; + private $person; + private $clusterIds = []; + private $miniGridIds = []; + private $cityIds = []; public function testUserGetsCities() @@ -112,16 +118,16 @@ protected function createTestData($clusterCount = 1, $miniGridCount = 1, $cityCo 'cluster_id' => $cluster->id, ]); array_push($this->cityIds, $city->id); - --$cityCount; + $cityCount--; } $geographicalInformation->owner()->associate($miniGrid); $geographicalInformation->save(); array_push($this->miniGridIds, $miniGrid->id); - --$miniGridCount; + $miniGridCount--; } - --$clusterCount; + $clusterCount--; } } diff --git a/src/backend/tests/Feature/ClusterDashboardCacheTest.php b/src/backend/tests/Feature/ClusterDashboardCacheTest.php index b0b3988dd..9a1e1c778 100644 --- a/src/backend/tests/Feature/ClusterDashboardCacheTest.php +++ b/src/backend/tests/Feature/ClusterDashboardCacheTest.php @@ -34,17 +34,29 @@ class ClusterDashboardCacheTest extends TestCase use WithFaker; private $user; + private $company; + private $city; + private $connectionType; + private $manufacturer; + private $meterType; + private $meter; + private $meterParameter; + private $meterTariff; + private $person; + private $token; + private $transaction; + private $clusterIds = []; public function testUserUpdatesClusterDataInCache() @@ -98,7 +110,7 @@ protected function createTestData($clusterCount = 1, $meterCount = 1, $transacti 'mini_grid_id' => $miniGrid->id, 'cluster_id' => $cluster->id, ]); - --$clusterCount; + $clusterCount--; while ($meterCount > 0) { $meter = MeterFactory::new()->create([ @@ -144,7 +156,7 @@ protected function createTestData($clusterCount = 1, $meterCount = 1, $transacti ]); $personAddress->owner()->associate($person); $personAddress->save(); - --$meterCount; + $meterCount--; while ($transactionCount > 0) { $vodacomTransaction = @@ -182,7 +194,7 @@ protected function createTestData($clusterCount = 1, $meterCount = 1, $transacti 'payer_type' => 'person', 'payer_id' => $person->id, ]); - --$transactionCount; + $transactionCount--; } } } diff --git a/src/backend/tests/Feature/ClusterRevenueTest.php b/src/backend/tests/Feature/ClusterRevenueTest.php index 598f06385..6e23659ee 100644 --- a/src/backend/tests/Feature/ClusterRevenueTest.php +++ b/src/backend/tests/Feature/ClusterRevenueTest.php @@ -34,17 +34,29 @@ class ClusterRevenueTest extends TestCase use WithFaker; private $user; + private $company; + private $city; + private $connectionType; + private $manufacturer; + private $meterType; + private $meter; + private $meterParameter; + private $meterTariff; + private $person; + private $token; + private $transaction; + private $clusterIds = []; public function testUserGetsClustersRevenueMonthly() @@ -190,7 +202,7 @@ protected function createTestData($clusterCount = 1, $meterCount = 1, $transacti 'mini_grid_id' => $miniGrid->id, 'cluster_id' => $cluster->id, ]); - --$clusterCount; + $clusterCount--; while ($meterCount > 0) { $meter = MeterFactory::new()->create([ @@ -236,7 +248,7 @@ protected function createTestData($clusterCount = 1, $meterCount = 1, $transacti ]); $personAddress->owner()->associate($person); $personAddress->save(); - --$meterCount; + $meterCount--; while ($transactionCount > 0) { $vodacomTransaction = @@ -274,7 +286,7 @@ protected function createTestData($clusterCount = 1, $meterCount = 1, $transacti 'payer_type' => 'person', 'payer_id' => $person->id, ]); - --$transactionCount; + $transactionCount--; } } } diff --git a/src/backend/tests/Feature/ClusterTest.php b/src/backend/tests/Feature/ClusterTest.php index 1e94c9606..d63c35d53 100644 --- a/src/backend/tests/Feature/ClusterTest.php +++ b/src/backend/tests/Feature/ClusterTest.php @@ -34,17 +34,29 @@ class ClusterTest extends TestCase use WithFaker; private $user; + private $company; + private $city; + private $connectionType; + private $manufacturer; + private $meterType; + private $meter; + private $meterParameter; + private $meterTariff; + private $person; + private $token; + private $transaction; + private $clusterIds = []; public function testUserGetsClusterListForDashboard() @@ -121,7 +133,7 @@ protected function createTestData($clusterCount = 1, $meterCount = 1, $transacti 'mini_grid_id' => $miniGrid->id, 'cluster_id' => $cluster->id, ]); - --$clusterCount; + $clusterCount--; while ($meterCount > 0) { $meter = MeterFactory::new()->create([ @@ -167,7 +179,7 @@ protected function createTestData($clusterCount = 1, $meterCount = 1, $transacti ]); $personAddress->owner()->associate($person); $personAddress->save(); - --$meterCount; + $meterCount--; while ($transactionCount > 0) { $vodacomTransaction = @@ -205,7 +217,7 @@ protected function createTestData($clusterCount = 1, $meterCount = 1, $transacti 'payer_type' => 'person', 'payer_id' => $person->id, ]); - --$transactionCount; + $transactionCount--; } } } diff --git a/src/backend/tests/Feature/ConnectionGroupTest.php b/src/backend/tests/Feature/ConnectionGroupTest.php index a1fbfdd70..307d64cb1 100644 --- a/src/backend/tests/Feature/ConnectionGroupTest.php +++ b/src/backend/tests/Feature/ConnectionGroupTest.php @@ -17,9 +17,13 @@ class ConnectionGroupTest extends TestCase use WithFaker; private $user; + private $company; + private $companyDatabase; + private $person; + private $connectonGroupIds = []; public function testUserGetsConnectionGroupList() @@ -81,7 +85,7 @@ protected function createTestData($connectionGroupCount = 1) while ($connectionGroupCount > 0) { $connectionGroup = ConnectionGroupFactory::new()->create(); array_push($this->connectonGroupIds, $connectionGroup->id); - --$connectionGroupCount; + $connectionGroupCount--; } } } diff --git a/src/backend/tests/Feature/ConnectionTypeTest.php b/src/backend/tests/Feature/ConnectionTypeTest.php index 0eddd1829..ef63b6cb7 100644 --- a/src/backend/tests/Feature/ConnectionTypeTest.php +++ b/src/backend/tests/Feature/ConnectionTypeTest.php @@ -17,9 +17,13 @@ class ConnectionTypeTest extends TestCase use WithFaker; private $user; + private $company; + private $companyDatabase; + private $person; + private $connectonTypeIds = []; public function testUserGetsConnectionTypeList() @@ -81,7 +85,7 @@ protected function createTestData($connectionTypeCount = 1) while ($connectionTypeCount > 0) { $connectionType = ConnectionTypeFactory::new()->create(); array_push($this->connectonTypeIds, $connectionType->id); - --$connectionTypeCount; + $connectionTypeCount--; } } } diff --git a/src/backend/tests/Feature/CreateEnvironments.php b/src/backend/tests/Feature/CreateEnvironments.php index b94d88cd0..688474c3e 100644 --- a/src/backend/tests/Feature/CreateEnvironments.php +++ b/src/backend/tests/Feature/CreateEnvironments.php @@ -50,69 +50,131 @@ trait CreateEnvironments use WithFaker; private $user; + private $company; + private $city; + private $cluster; + private $miniGrid; + private $connectionType; + private $manufacturer; + private $meterType; + private $meter; + private $meterParameter; + private $meterTariff; + private $person; + private $token; + private $transaction; + private $connectionGroup; + private $connectonType; + private $subConnectionType; + private $target; + private $subTarget; + private $agent; + private $agentCommission; + private $address; + private $timeOfUsage; + private $companyDatabase; + private $meterToken; + private $paymentHistory; + private $assetType; + private $assignedAppliance; + private $soldAppliance; + private $agentReceipt; + private $agentTransaction; + private $agentBalanceHistory; + private $ticketCategory; + private $ticketUser; + private $ticketBoard; + private $ticketCard; + private $ticket; private $clusters = []; + private $miniGrids = []; + private $connectionGroups = []; + private $connectonTypes = []; + private $subConnectionTypes = []; + private $meterTypes = []; + private $manufacturers = []; + private $cities = []; + private $meterTariffs = []; + private $targets = []; + private $subTargets = []; + private $people = []; + private $assignedAppliances = []; + private $addresses = []; + private $agents = []; + private $agentCommissions = []; + private $transactions = []; + private $paymentHistories = []; + private $meters = []; + private $assetTypes = []; + private $soldAppliances = []; + private $agentReceipts = []; + private $agentTransactions = []; + private $agentBalanceHistories = []; + private $ticketCategories = []; + private $ticketUsers = []; + private $tickets = []; protected function createTestData() @@ -130,7 +192,7 @@ protected function createCluster($clusterCount = 1) 'manager_id' => $this->user->id, ]); $this->clusters[] = $cluster; - --$clusterCount; + $clusterCount--; } if (count($this->clusters) > 0) { @@ -146,7 +208,7 @@ protected function createMiniGrid($miniGridCount = 1) 'name' => $this->faker->unique()->companySuffix, ]); $this->miniGrids[] = $miniGrid; - --$miniGridCount; + $miniGridCount--; } if (count($this->miniGrids) > 0) { @@ -164,7 +226,7 @@ protected function createCity($cityCount = 1) 'cluster_id' => $this->getRandomIdFromList($this->clusters), ]); $this->cities[] = $city; - --$cityCount; + $cityCount--; } if (count($this->cities) > 0) { @@ -230,7 +292,7 @@ protected function createMeterWithGeo(): void ]); $address->owner()->associate($meterParameter)->save(); $geographicalInformation->owner()->associate($meterParameter)->save(); - --$meterCunt; + $meterCunt--; } } @@ -285,9 +347,9 @@ protected function createMetersWithDifferentMeterTypes($meterCountPerMeterType = 'connection_type_id' => $this->connectionType->id, 'connection_group_id' => $this->connectionGroup->id, ]); - --$meterCountPerMeterType; + $meterCountPerMeterType--; } - --$meterTypeCount; + $meterTypeCount--; } } @@ -306,7 +368,7 @@ protected function createMeterManufacturer($manufacturerCount = 1): void $this->manufacturers[] = $manufacturer; - --$manufacturerCount; + $manufacturerCount--; } if (count($this->manufacturers) > 0) { $this->manufacturer = $this->manufacturers[0]; @@ -328,7 +390,7 @@ protected function createMeterTariff($meterTariffCount = 1, $withTimeOfUsage = f ]); } - --$meterTariffCount; + $meterTariffCount--; } if (count($this->meterTariffs) > 0) { $this->meterTariff = $this->meterTariffs[0]; @@ -349,12 +411,12 @@ protected function createConnectionType($connectionTypeCount = 1, $subConnection ]); $this->subConnectionTypes[] = $subConnectionType; - --$subConnectionTypeCount; + $subConnectionTypeCount--; } if (count($this->subConnectionTypes) > 0) { $this->subConnectionType = $this->subConnectionTypes[0]; } - --$connectionTypeCount; + $connectionTypeCount--; } if (count($this->connectonTypes) > 0) { $this->connectionType = $this->connectonTypes[0]; @@ -366,7 +428,7 @@ protected function createConnectionGroup($connectionGroupCount = 1): void while ($connectionGroupCount > 0) { $connectionGroup = ConnectionGroupFactory::new()->create(); $this->connectionGroups[] = $connectionGroup; - --$connectionGroupCount; + $connectionGroupCount--; } if (count($this->connectionGroups) > 0) { $this->connectionGroup = $this->connectionGroups[0]; @@ -379,7 +441,7 @@ protected function createMeterType($meterTypeCount = 1): void $meterType = MeterTypeFactory::new()->create(); $this->meterTypes[] = $meterType; - --$meterTypeCount; + $meterTypeCount--; } if (count($this->meterTypes) > 0) { @@ -421,7 +483,7 @@ protected function createMeter($meterCount = 1): void $address->owner()->associate($meterParameter)->save(); $geographicalInformation->owner()->associate($meterParameter)->save(); - --$meterCount; + $meterCount--; } } @@ -430,7 +492,7 @@ protected function createTarget($targetCount = 1): void while ($targetCount > 0) { $target = TargetFactory::new()->create(); $this->targets[] = $target; - --$targetCount; + $targetCount--; } if (count($this->targets) > 0) { $this->target = $this->targets[0]; @@ -445,7 +507,7 @@ protected function createSubTarget($subTargetCount = 1): void 'connection_id' => $this->getRandomIdFromList($this->connectionGroups), ]); $this->subTargets[] = $subTarget; - --$subTargetCount; + $subTargetCount--; } if (count($this->subTargets) > 0) { $this->subTarget = $this->subTargets[0]; @@ -468,7 +530,7 @@ protected function createPerson($personCount = 1, $isCustomer = 1) $address->owner()->associate($person)->save(); $address->save(); - --$personCount; + $personCount--; } if (count($this->people) > 0) { $this->person = $this->people[0]; @@ -500,7 +562,7 @@ protected function createAgentCommission($agentCommissionCount = 1) $agentCommission = AgentCommissionFactory::new()->create(); $this->agentCommissions[] = $agentCommission; - --$agentCommissionCount; + $agentCommissionCount--; } if (count($this->agentCommissions) > 0) { $this->agentCommission = $this->agentCommissions[0]; @@ -513,7 +575,7 @@ protected function createAssetType($assetTypeCount = 1) $assetType = AssetTypeFactory::new()->create(); $this->assetTypes[] = $assetType; - --$assetTypeCount; + $assetTypeCount--; } if (count($this->assetTypes) > 0) { $this->assetType = $this->assetTypes[0]; @@ -532,7 +594,7 @@ protected function createAssignedAppliances($applianceCount = 1) ]); $this->assignedAppliances[] = $assignedAppliance; - --$applianceCount; + $applianceCount--; } if (count($this->assignedAppliances) > 0) { $this->assignedAppliance = $this->assignedAppliances[0]; @@ -562,7 +624,7 @@ protected function createAgentSoldAppliance($soldApplianceCount = 1) 'creator_id' => $assignedAppliance->agent_id, ]); - --$soldApplianceCount; + $soldApplianceCount--; } if (count($this->soldAppliances) > 0) { $this->soldAppliance = $this->soldAppliances[0]; @@ -580,7 +642,7 @@ protected function createAgentReceipt($agentReceiptCount = 1, $amount = 50) ]); $this->agentReceipts[] = $agentReceipt; - --$agentReceiptCount; + $agentReceiptCount--; } if (count($this->agentReceipts) > 0) { $this->agentReceipt = $this->agentReceipts[0]; @@ -601,7 +663,7 @@ protected function createAgentBalanceHistory($agentBalanceHistoryCount = 1) ]); $this->agentBalanceHistories[] = $agentBalanceHistory; - --$agentBalanceHistoryCount; + $agentBalanceHistoryCount--; } if (count($this->agentBalanceHistories) > 0) { $this->agentBalanceHistory = $this->agentBalanceHistories[0]; @@ -619,7 +681,7 @@ protected function createAgentTransaction($agentTransactionCount = 1, $amount = 'message' => $meter->serial_number, ]); - if (!$agentId) { + if (! $agentId) { $agentId = $this->getRandomIdFromList($this->agents); } @@ -681,7 +743,7 @@ protected function createAgentTransaction($agentTransactionCount = 1, $amount = ]); $this->agentBalanceHistories[] = $agentBalanceHistory; - --$agentTransactionCount; + $agentTransactionCount--; } if (count($this->agentTransactions) > 0) { $this->agentTransaction = $this->agentTransactions[0]; @@ -704,7 +766,7 @@ protected function createPaymentHistory($paymentHistoryCount = 1, $amount = 100, 'payment_type' => $this->faker->randomElement(['appliance', 'energy', 'installment', 'access rate']), ]); - if (!$agentId) { + if (! $agentId) { $agentId = $this->getRandomIdFromList($this->agents); } @@ -723,7 +785,7 @@ protected function createPaymentHistory($paymentHistoryCount = 1, $amount = 100, ]); $this->agentBalanceHistories[] = $agentBalanceHistory; - --$paymentHistoryCount; + $paymentHistoryCount--; } if (count($this->paymentHistories) > 0) { $this->paymentHistory = $this->paymentHistories[0]; @@ -736,7 +798,7 @@ protected function createTicketCategory($ticketCategoryCount = 1) $ticketCategory = TicketCategoryFactory::new()->create(); $this->ticketCategories[] = $ticketCategory; - --$ticketCategoryCount; + $ticketCategoryCount--; } if (count($this->ticketCategories) > 0) { $this->ticketCategory = $this->ticketCategories[0]; @@ -769,7 +831,7 @@ protected function createTicket($ticketCount = 1, $status = 0, $customerId = nul ]); $this->tickets[] = $ticket; - --$ticketCount; + $ticketCount--; } if (count($this->tickets) > 0) { $this->ticket = $this->tickets[0]; @@ -806,7 +868,7 @@ protected function createTicketUser($ticketUserCount = 1, $tag = 'inensusinensus ]); $this->ticketUsers[] = $ticketUser; - --$ticketUserCount; + $ticketUserCount--; } if (count($this->ticketUsers) > 0) { $this->ticketUser = $this->ticketUsers[0]; diff --git a/src/backend/tests/Feature/MeterTest.php b/src/backend/tests/Feature/MeterTest.php index 248ef1204..96ff0e9d4 100644 --- a/src/backend/tests/Feature/MeterTest.php +++ b/src/backend/tests/Feature/MeterTest.php @@ -32,16 +32,27 @@ class MeterTest extends TestCase use WithFaker; private $user; + private $company; + private $city; + private $connectionType; + private $manufacturer; + private $meterType; + private $meter; + private $meterParameter; + private $meterTariff; + private $person; + private $token; + private $transaction; public function testUserGetsMeterList() @@ -64,7 +75,7 @@ public function testUserGetsMeterList() 'connection_type_id' => $this->connectionType->id, 'connection_group_id' => $this->connectionGroup->id, ]); - --$meterCunt; + $meterCunt--; } $response = $this->actingAs($this->user)->get('/api/meters'); $response->assertStatus(200); @@ -263,7 +274,7 @@ protected function createMeterWithGeo(): void ]); $address->owner()->associate($meterParameter)->save(); $geographicalInformation->owner()->associate($meterParameter)->save(); - --$meterCunt; + $meterCunt--; } } diff --git a/src/backend/tests/Feature/MiniGridRevenueTest.php b/src/backend/tests/Feature/MiniGridRevenueTest.php index d21e3b296..1778d89e4 100644 --- a/src/backend/tests/Feature/MiniGridRevenueTest.php +++ b/src/backend/tests/Feature/MiniGridRevenueTest.php @@ -35,19 +35,33 @@ class MiniGridRevenueTest extends TestCase use WithFaker; private $user; + private $company; + private $city; + private $connectionType; + private $manufacturer; + private $meterType; + private $meter; + private $meterParameter; + private $meterTariff; + private $person; + private $token; + private $transaction; + private $clusterIds = []; + private $miniGridIds = []; + private $soldEnergy; public function testUserGetsSoldEnergyOfAMiniGridWithDefaultPeriod() @@ -180,7 +194,7 @@ protected function createTestData($clusterCount = 1, $meterCount = 1, $transacti 'mini_grid_id' => $miniGrid->id, 'cluster_id' => $cluster->id, ]); - --$clusterCount; + $clusterCount--; while ($meterCount > 0) { $meter = MeterFactory::new()->create([ @@ -226,7 +240,7 @@ protected function createTestData($clusterCount = 1, $meterCount = 1, $transacti ]); $personAddress->owner()->associate($person); $personAddress->save(); - --$meterCount; + $meterCount--; while ($transactionCount > 0) { $vodacomTransaction = @@ -265,7 +279,7 @@ protected function createTestData($clusterCount = 1, $meterCount = 1, $transacti 'payer_type' => 'person', 'payer_id' => $person->id, ]); - --$transactionCount; + $transactionCount--; } } } diff --git a/src/backend/tests/Feature/MiniGridTest.php b/src/backend/tests/Feature/MiniGridTest.php index 425d5489d..c6a7d7458 100644 --- a/src/backend/tests/Feature/MiniGridTest.php +++ b/src/backend/tests/Feature/MiniGridTest.php @@ -21,10 +21,15 @@ class MiniGridTest extends TestCase use WithFaker; private $user; + private $company; + private $companyDatabase; + private $person; + private $clusterIds = []; + private $miniGridIds = []; public function testUserGetsMiniGridList() @@ -119,9 +124,9 @@ protected function createTestData($clusterCount = 1, $miniGridCount = 1) 'cluster_id' => $cluster->id, ]); array_push($this->miniGridIds, $miniGrid->id); - --$miniGridCount; + $miniGridCount--; } - --$clusterCount; + $clusterCount--; } } diff --git a/src/backend/tests/Feature/SocialTariffPiggyBankTest.php b/src/backend/tests/Feature/SocialTariffPiggyBankTest.php index 92d1d5767..aa410eaf3 100644 --- a/src/backend/tests/Feature/SocialTariffPiggyBankTest.php +++ b/src/backend/tests/Feature/SocialTariffPiggyBankTest.php @@ -44,11 +44,11 @@ public function testAddPiggyBankBalance() $createPiggyBankJob = new CreatePiggyBankEntry(Person::first()->meters()->first()); $createPiggyBankJob->handle(); - $job = new SocialTariffPiggyBankManager(); + $job = new SocialTariffPiggyBankManager; $socialTariff = SocialTariff::first(); $socialBank = SocialTariffPiggyBank::first(); $savings = $socialBank->savings; - for ($i = 1; $i <= $socialTariff->maximum_stacked_energy / $socialTariff->daily_allowance; ++$i) { + for ($i = 1; $i <= $socialTariff->maximum_stacked_energy / $socialTariff->daily_allowance; $i++) { $job->handle(); if ($i % ($socialTariff->maximum_stacked_energy / $socialTariff->daily_allowance)) { $this->assertEquals($savings + ($socialTariff->daily_allowance * $i), $socialBank->fresh()->savings); diff --git a/src/backend/tests/RefreshMultipleDatabases.php b/src/backend/tests/RefreshMultipleDatabases.php index 049c2b129..cd2d5b1e0 100644 --- a/src/backend/tests/RefreshMultipleDatabases.php +++ b/src/backend/tests/RefreshMultipleDatabases.php @@ -27,7 +27,7 @@ protected function refreshInMemoryDatabase() protected function refreshTestDatabase() { - if (!RefreshDatabaseState::$migrated) { + if (! RefreshDatabaseState::$migrated) { Artisan::call( 'migrate:fresh', ['--database' => 'micro_power_manager', '--path' => '/database/migrations/base'] diff --git a/src/backend/tests/TestCase.php b/src/backend/tests/TestCase.php index 61dd33b7b..8b6becf84 100644 --- a/src/backend/tests/TestCase.php +++ b/src/backend/tests/TestCase.php @@ -16,7 +16,7 @@ abstract class TestCase extends BaseTestCase */ protected function headers(?User $user = null) { - if (!$user) { + if (! $user) { $user = User::create([ 'name' => 'John Doe', 'email' => 'johndoe@example.com', diff --git a/src/backend/tests/Unit/Exports/DailyTransactions.php b/src/backend/tests/Unit/Exports/DailyTransactions.php index 7e6d6aefe..d2b04d1d3 100644 --- a/src/backend/tests/Unit/Exports/DailyTransactions.php +++ b/src/backend/tests/Unit/Exports/DailyTransactions.php @@ -7,7 +7,5 @@ class DailyTransactions extends TestCase /** * Get all transactions from the database (Seeder) and gets only the confirmed ones. */ - public function testGetDailyTransactions() - { - } + public function testGetDailyTransactions() {} } diff --git a/src/backend/tests/Unit/Transaction/AccessRateTest.php b/src/backend/tests/Unit/Transaction/AccessRateTest.php index 794a46dd5..da7562253 100644 --- a/src/backend/tests/Unit/Transaction/AccessRateTest.php +++ b/src/backend/tests/Unit/Transaction/AccessRateTest.php @@ -33,7 +33,7 @@ private function initApplication(): void $meterType = MeterTypeFactory::new()->create(); $connectionType = ConnectionTypeFactory::new()->create(); $connectionGroup = ConnectionGroupFactory::new()->create(); - $meter = new Meter(); + $meter = new Meter; $meter->serial_number = '47000268748'; $meter->meterType()->associate($meterType); $meter->manufacturer()->associate($manufacturer); @@ -43,7 +43,7 @@ private function initApplication(): void $accessRate = AccessRateFactory::new()->make(); $tariff->accessRate()->save($accessRate); $customer = PersonFactory::new()->create(); - $meterParameter = new MeterParameter(); + $meterParameter = new MeterParameter; $meterParameter->tariff()->associate($tariff); $meterParameter->meter()->associate($meter); $meterParameter->connectionGroup()->associate($connectionGroup); diff --git a/src/backend/tests/Unit/Transaction/VodacomTransactionTest.php b/src/backend/tests/Unit/Transaction/VodacomTransactionTest.php index a8b2fcf36..68593a224 100644 --- a/src/backend/tests/Unit/Transaction/VodacomTransactionTest.php +++ b/src/backend/tests/Unit/Transaction/VodacomTransactionTest.php @@ -29,10 +29,9 @@ public function testTransactionSentFromUnknownIpAddress(): void [], ['REMOTE_ADDR' => '127.0.0.2'] ); - $middleWare = new Transaction(); + $middleWare = new Transaction; - $response = $middleWare->handle($request, function () { - }); + $response = $middleWare->handle($request, function () {}); self::assertEquals(401, $response->status()); } @@ -48,7 +47,7 @@ public function testTransactionSentFromWhiteListedIpAddress(): void ['REMOTE_ADDR' => config('services.vodacom.ips')[0]] ); - $middleWare = new Transaction(); + $middleWare = new Transaction; $middleWare->handle($request, function ($x) { $this->assertInstanceOf(VodacomTransactionProvider::class, $x->attributes->get('transactionProcessor')); From 4f4725fae4dc0820d9f7518a27ce677177f1806f Mon Sep 17 00:00:00 2001 From: mark8-1 Date: Wed, 20 Nov 2024 10:12:50 +0200 Subject: [PATCH 3/8] fix lint --- .github/workflows/lint.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index d966c4d89..afd0b3d74 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -23,9 +23,11 @@ jobs: - name: Install Pint run: composer global require laravel/pint + working-directory: ./src/backend - name: Run Pint run: pint + working-directory: ./src/backend - name: Commit linted files uses: stefanzweifel/git-auto-commit-action@v5 From e9335d428025c0de0023d78a5d74ffc45c65bc12 Mon Sep 17 00:00:00 2001 From: munyanezaarmel Date: Wed, 20 Nov 2024 08:13:29 +0000 Subject: [PATCH 4/8] Fixes coding style --- src/backend/app/Events/HistoryEvent.php | 4 ++- .../AccessRates/NoAccessRateFound.php | 4 ++- .../ActiveSheetNotCreatedException.php | 4 ++- .../Exceptions/AgentRiskBalanceExceeded.php | 4 ++- .../CustomerGroup/CustomerGroupNotFound.php | 4 ++- .../Device/DeviceIsNotAssignedToCustomer.php | 4 ++- .../DownPaymentBiggerThanAmountException.php | 4 ++- ...ymentBiggerThanAppliancePriceException.php | 4 ++- .../DownPaymentNotFoundException.php | 4 ++- .../app/Exceptions/GeoFormatException.php | 4 ++- .../Exceptions/InvalidBingApiKeyException.php | 4 ++- .../app/Exceptions/MailNotSentException.php | 4 ++- .../ApiCallDoesNotSupportedException.php | 4 ++- .../Manufacturer/MeterIsNotReadable.php | 4 ++- .../MeterParameter/MeterParameterNotFound.php | 4 ++- .../Meters/MeterIsNotAssignedToCustomer.php | 4 ++- .../app/Exceptions/Meters/MeterIsNotInUse.php | 4 ++- .../MissingSmsReferencesException.php | 4 ++- .../NotificationSendFailedException.php | 4 ++- ...ntAmountBiggerThanTotalRemainingAmount.php | 4 ++- .../PaymentAmountSmallerThanZero.php | 4 ++- .../PaymentProviderNotIdentified.php | 4 ++- .../app/Exceptions/PurchaseNotProcessable.php | 4 ++- .../SmsAndroidSettingNotExistingException.php | 4 ++- .../SmsBodyParserNotExtendedException.php | 4 ++- .../Exceptions/SmsTypeNotFoundException.php | 4 ++- .../SpreadSheetNotCreatedException.php | 4 ++- .../SpreadSheetNotSavedException.php | 4 ++- .../app/Exceptions/Tariffs/TariffNotFound.php | 4 ++- .../TransactionAmountNotEnoughException.php | 4 ++- .../TransactionAmountNotFoundException.php | 4 ++- .../TransactionFetchingException.php | 4 ++- ...dForProcessingIncomingRequestException.php | 4 ++- .../TransactionNotInitializedException.php | 4 ++- .../app/Exceptions/TrelloAPIException.php | 4 ++- .../UserAddressNorFoundException.php | 4 ++- .../app/Exceptions/ValidationException.php | 4 ++- .../Exceptions/VodacomHeartBeatException.php | 4 ++- .../Exceptions/WeatherParametersMissing.php | 4 ++- .../Exceptions/WeatherProviderUnreachable.php | 4 ++- src/backend/app/Helpers/MailHelperMock.php | 8 +++-- .../Http/Controllers/AddressController.php | 3 +- .../AgentAssignedApplianceWebController.php | 3 +- .../AgentAssignedAppliancesController.php | 3 +- .../Controllers/AgentBalanceController.php | 3 +- .../AgentBalanceHistoryController.php | 12 +++++-- .../AgentBalanceHistoryWebController.php | 4 ++- .../Controllers/AgentChargeWebController.php | 3 +- .../AgentCommissionWebController.php | 4 ++- .../Controllers/AgentCustomerController.php | 3 +- .../AgentCustomerTicketController.php | 4 ++- ...AgentCustomersPaymentHistoryController.php | 3 +- ...AgentDashboardBalanceHistoryController.php | 3 +- .../AgentDashboardBoxesController.php | 3 +- .../AgentDashboardRevenueController.php | 3 +- .../Controllers/AgentFirebaseController.php | 3 +- .../AgentReceiptDetailController.php | 4 ++- .../Controllers/AgentReceiptWebController.php | 3 +- .../AgentSoldApplianceController.php | 3 +- .../AgentSoldApplianceWebController.php | 4 ++- .../AgentTransactionWebController.php | 4 ++- .../AgentTransactionsController.php | 3 +- .../Http/Controllers/AgentWebController.php | 3 +- .../AppliancePaymentController.php | 4 ++- .../app/Http/Controllers/AssetController.php | 4 ++- .../Controllers/AssetPersonController.php | 3 +- .../app/Http/Controllers/CityController.php | 3 +- .../Http/Controllers/ClusterController.php | 3 +- .../ClusterMiniGridRevenueController.php | 3 +- .../ClusterRevenueAnalysisController.php | 3 +- .../Controllers/ClusterRevenueController.php | 3 +- .../ClustersDashboardCacheDataController.php | 3 +- .../Http/Controllers/CompanyController.php | 3 +- .../Controllers/ConnectionGroupController.php | 3 +- .../Controllers/ConnectionTypeController.php | 4 ++- .../CustomerRegistrationAppController.php | 4 ++- .../Controllers/DeviceAddressController.php | 3 +- .../app/Http/Controllers/DeviceController.php | 4 ++- .../app/Http/Controllers/EBikeController.php | 3 +- .../app/Http/Controllers/HomeController.php | 4 ++- .../Controllers/MainSettingsController.php | 4 ++- .../Controllers/MaintenanceUserController.php | 3 +- .../Controllers/ManufacturerController.php | 3 +- .../MeterConsumptionController.php | 3 +- .../app/Http/Controllers/MeterController.php | 3 +- ...MeterGeographicalInformationController.php | 3 +- .../MeterPaymentHistoryController.php | 3 +- .../Controllers/MeterRevenueController.php | 3 +- .../Controllers/MeterTariffController.php | 3 +- .../MeterTariffMeterParameterController.php | 3 +- .../Http/Controllers/MeterTypeController.php | 4 ++- .../Controllers/MeterTypeMeterController.php | 4 ++- .../Http/Controllers/MiniGridController.php | 3 +- .../MiniGridDashboardCacheController.php | 4 ++- .../Controllers/MiniGridDeviceController.php | 3 +- .../Controllers/MiniGridRevenueController.php | 3 +- .../Http/Controllers/MpmPluginController.php | 4 ++- .../OutstandingDebtsExportController.php | 3 +- .../Controllers/PersonAddressesController.php | 3 +- .../app/Http/Controllers/PersonController.php | 3 +- .../Controllers/PersonDocumentController.php | 4 ++- .../Controllers/PersonMeterController.php | 3 +- .../app/Http/Controllers/PluginController.php | 3 +- .../RegistrationTailController.php | 4 ++- src/backend/app/Http/Controllers/Reports.php | 9 ++--- .../Http/Controllers/RevenueController.php | 5 +-- .../app/Http/Controllers/SmsController.php | 3 +- .../Controllers/SolarHomeSystemController.php | 3 +- .../SubConnectionTypeController.php | 4 ++- .../app/Http/Controllers/TargetController.php | 3 +- .../Controllers/TicketSettingsController.php | 4 ++- .../Controllers/TimeOfUsageController.php | 3 +- .../TransactionAdvancedController.php | 3 +- .../Controllers/TransactionController.php | 3 +- .../TransactionExportController.php | 3 +- .../Http/Controllers/UsageTypeController.php | 4 ++- .../app/Http/Controllers/UserController.php | 3 +- .../Middleware/AgentBalanceMiddleware.php | 3 +- .../Http/Middleware/RestrictionMiddleware.php | 3 +- ...serDefaultDatabaseConnectionMiddleware.php | 3 +- src/backend/app/Http/Requests/CityRequest.php | 2 +- .../Http/Requests/StoreMiniGridRequest.php | 2 +- src/backend/app/Jobs/HearthBeat.php | 4 ++- src/backend/app/Jobs/SmsLoadBalancer.php | 2 +- .../app/Listeners/AccessRateListener.php | 2 +- src/backend/app/Listeners/PaymentListener.php | 7 ++-- .../app/Listeners/SoldApplianceListener.php | 3 +- .../app/ManufacturerApi/CalinReadMeter.php | 4 ++- .../app/Misc/SoldApplianceDataContainer.php | 3 +- src/backend/app/Models/Admin.php | 4 ++- src/backend/app/Models/MailSettings.php | 4 ++- src/backend/app/Models/MainSettings.php | 4 ++- src/backend/app/Models/MapSettings.php | 4 ++- .../app/Models/Payment/PaymentProfile.php | 4 ++- src/backend/app/Models/Report.php | 4 ++- src/backend/app/Models/TicketSettings.php | 4 ++- .../Observers/AgentBalanceHistoryObserver.php | 3 +- .../app/Observers/AgentChargeObserver.php | 3 +- src/backend/app/Observers/AgentObserver.php | 4 ++- .../app/Observers/AgentReceiptObserver.php | 3 +- .../Observers/AgentSoldApplianceObserver.php | 3 +- .../app/Observers/MeterParameterObserver.php | 4 ++- src/backend/app/PaymentHandler/AccessRate.php | 10 +++--- .../app/PaymentHandler/EnergyPayment.php | 4 ++- .../app/Providers/VodacomServiceProvider.php | 8 +++-- src/backend/app/Relations/BelongsToMorph.php | 2 +- ...actPaymentAggregatorTransactionService.php | 3 +- .../app/Services/AccessRatePaymentService.php | 3 +- .../app/Services/AccessRateService.php | 3 +- src/backend/app/Services/AddressesService.php | 3 +- .../AgentAssignedApplianceService.php | 3 +- .../Services/AgentBalanceHistoryService.php | 5 +-- .../app/Services/AgentChargeService.php | 3 +- .../app/Services/AgentCommissionService.php | 3 +- .../app/Services/AgentCustomerService.php | 4 ++- .../AgentCustomersPaymentHistoryService.php | 3 +- .../Services/AgentReceiptDetailService.php | 3 +- .../app/Services/AgentReceiptService.php | 3 +- src/backend/app/Services/AgentService.php | 3 +- .../Services/AgentSoldApplianceService.php | 3 +- .../app/Services/AgentTransactionService.php | 3 +- .../app/Services/AppliancePaymentService.php | 3 +- .../app/Services/AppliancePersonService.php | 3 +- .../app/Services/ApplianceRateService.php | 3 +- src/backend/app/Services/AssetService.php | 4 ++- src/backend/app/Services/CityService.php | 3 +- .../app/Services/ClusterMeterService.php | 4 ++- .../app/Services/ClusterMiniGridService.php | 4 ++- .../app/Services/ClusterPopulationService.php | 4 ++- .../app/Services/ClusterRevenueService.php | 5 +-- src/backend/app/Services/ClusterService.php | 5 +-- .../Services/ClusterTransactionService.php | 4 ++- .../app/Services/CompanyDatabaseService.php | 3 +- src/backend/app/Services/CompanyService.php | 3 +- .../app/Services/ConnectionGroupService.php | 3 +- .../app/Services/ConnectionTypeService.php | 3 +- src/backend/app/Services/CountryService.php | 3 +- .../app/Services/DatabaseProxyService.php | 6 ++-- src/backend/app/Services/FirebaseService.php | 2 +- .../GeographicalInformationService.php | 3 +- .../app/Services/MainSettingsService.php | 7 ++-- .../app/Services/MaintenanceUserService.php | 3 +- .../app/Services/ManufacturerService.php | 3 +- .../app/Services/MeterConsumptionService.php | 3 +- .../MeterGeographicalInformationService.php | 3 +- .../app/Services/MeterParameterService.php | 3 +- .../app/Services/MeterRevenueService.php | 3 +- src/backend/app/Services/MeterService.php | 3 +- .../MeterTariffMeterParameterService.php | 3 +- .../app/Services/MeterTariffService.php | 3 +- .../app/Services/MeterTypeMeterService.php | 4 ++- src/backend/app/Services/MeterTypeService.php | 4 ++- .../app/Services/MiniGridEnergyService.php | 4 ++- .../app/Services/MiniGridRevenueService.php | 3 +- src/backend/app/Services/MiniGridService.php | 3 +- src/backend/app/Services/MpmPluginService.php | 3 +- .../app/Services/PaymentHistoryService.php | 3 +- .../app/Services/PersonMeterService.php | 3 +- src/backend/app/Services/PersonService.php | 3 +- src/backend/app/Services/PluginsService.php | 3 +- .../app/Services/RegistrationTailService.php | 3 +- .../app/Services/RestrictionService.php | 3 +- .../SmsApplianceRemindRateService.php | 3 +- src/backend/app/Services/SmsService.php | 3 +- .../app/Services/SocialTariffService.php | 3 +- .../app/Services/SubConnectionTypeService.php | 3 +- src/backend/app/Services/SubTargetService.php | 7 ++-- src/backend/app/Services/TargetService.php | 4 ++- .../TariffPricingComponentService.php | 3 +- .../app/Services/TicketSettingsService.php | 3 +- .../app/Services/TimeOfUsageService.php | 3 +- src/backend/app/Services/TokenService.php | 5 +-- src/backend/app/Services/UsageTypeService.php | 9 ++--- src/backend/app/Services/UserService.php | 4 ++- src/backend/app/Sms/Senders/SmsConfigs.php | 4 ++- src/backend/app/Sms/Senders/SmsSender.php | 2 +- .../app/Utils/ApplianceInstallmentPayer.php | 3 +- .../app/Utils/TariffPriceCalculator.php | 3 +- .../CustomerRegistrationAppService.php | 3 +- .../Ecosys/CustomerDatabaseParser.php | 2 +- .../DatabaseProxyManagerService.php | 3 +- .../modules/Device/ClusterDeviceService.php | 4 ++- .../app/modules/Device/DeviceService.php | 7 ++-- .../modules/Device/MiniGridDeviceService.php | 4 ++- .../app/modules/EBike/EBikeService.php | 3 +- .../OutstandingDebtsExportService.php | 3 +- .../Sharding/ApiCompanyResolverService.php | 4 ++- .../ApiResolvers/DataExportResolver.php | 4 ++- .../SolarHomeSystemService.php | 4 ++- .../app/modules/Target/TargetAssignable.php | 4 ++- .../ApplianceTransactionService.php | 4 ++- .../Transaction/EBikeTransactionService.php | 4 ++- .../Transaction/MeterTransactionService.php | 4 ++- .../Provider/AgentTransactionProvider.php | 9 ++--- .../Provider/AirtelTransactionProvider.php | 12 ++++--- .../Provider/AirtelVoltTerraProvider.php | 11 +++--- .../Provider/CashTransactionProvider.php | 9 ++--- .../Provider/VodacomTransactionProvider.php | 8 ++--- .../SolarHomeSystemTransactionService.php | 4 ++- .../Transaction/TransactionService.php | 35 ++++++++++--------- .../modules/User/Events/UserCreatedEvent.php | 4 ++- src/backend/app/modules/User/UserListener.php | 3 +- ...22_03_10_120408_create_companies_table.php | 3 +- ..._134450_create_company_databases_table.php | 3 +- ...8_204649_create_database_proxies_table.php | 3 +- ..._06_21_102121_create_mpm_plugins_table.php | 3 +- ...21_122032_add_email_to_companies_table.php | 3 +- ...3903_add_tail_tag_to_mpm_plugins_table.php | 3 +- ...tallation_command_to_mpm_plugins_table.php | 3 +- ..._bulk_registration_to_mpm_plugin_table.php | 3 +- ...dd_viber_messaging_to_mpm_plugin_table.php | 3 +- ...email_field_for_database_proxies_table.php | 3 +- ...wave_money_payment_to_mpm_plugin_table.php | 3 +- .../2022_11_25_091725_create_company_jobs.php | 3 +- ...000_add_micro_star_to_mpm_plugin_table.php | 3 +- ...00_add_root_class_to_mpm_plugins_table.php | 3 +- ...00000_add_sun_king_to_mpm_plugin_table.php | 3 +- ...24_110414_create_protected_pages_table.php | 3 +- ...ected_page_password_to_companies_table.php | 3 +- ...0000_add_gome_long_to_mpm_plugin_table.php | 3 +- ...121811_add_wavecom_to_mpm_plugin_table.php | 3 +- ...escription_column_in_mpm_plugins_table.php | 3 +- ...00000_add_daly_bms_to_mpm_plugin_table.php | 3 +- ..._000000_add_angaza_to_mpm_plugin_table.php | 3 +- ..._02_07_100345_create_usage_types_table.php | 3 +- ...usage_type_column_to_mpm_plugins_table.php | 3 +- ...nd_trace_columns_to_company_jobs_table.php | 3 +- .../2014_10_12_000000_create_users_table.php | 3 +- ...12_100000_create_password_resets_table.php | 3 +- ...5615_create_vodacom_transactions_table.php | 3 +- ...05_24_201051_create_transactions_table.php | 3 +- ...13335_create_airtel_transactions_table.php | 3 +- ..._131106_create_payment_histories_table.php | 3 +- ...5_25_131119_create_meter_tariffs_table.php | 3 +- ...18_05_29_071453_create_addresses_table.php | 3 +- ...create_geographical_informations_table.php | 3 +- ..._05_29_140926_create_meter_types_table.php | 3 +- .../2018_05_30_124521_create_meters_table.php | 3 +- ...5_31_071601_create_manufacturers_table.php | 3 +- .../2018_05_31_075346_create_cities_table.php | 3 +- ...18_05_31_075353_create_countries_table.php | 3 +- .../2018_06_01_141845_create_people_table.php | 3 +- .../2018_06_04_124637_create__roles_table.php | 3 +- ...06_07_155444_create_meter_tokens_table.php | 3 +- ...8_102610_create_meter_parameters_table.php | 3 +- .../2018_06_11_131951_create_sms_table.php | 3 +- ...352_create_transaction_conflicts_table.php | 3 +- ...06_28_080905_create_access_rates_table.php | 3 +- ...0914_create_access_rate_payments_table.php | 3 +- ..._07_11_075002_create_permission_tables.php | 3 +- .../2018_07_12_133700_create_loans_table.php | 3 +- ...18_07_12_134253_create_customers_table.php | 3 +- ...18_10_04_195503_create_histories_table.php | 3 +- ...110924_create_meter_consumptions_table.php | 3 +- ...2_123911_create_payment_profiles_table.php | 3 +- ...018_11_29_090603_create_clusters_table.php | 3 +- ...018_12_05_144906_create_revenues_table.php | 3 +- ...1_083717_create_connection_types_table.php | 3 +- ...2018_12_13_083722_create_targets_table.php | 3 +- ..._12_13_100738_create_sub_targets_table.php | 3 +- .../2019_04_19_083645_customer_group.php | 3 +- ...2438_create_sub_connection_types_table.php | 3 +- ..._103123_create_connection_groups_table.php | 3 +- .../2019_05_15_122118_reports.php | 3 +- ...9_06_24_160040_create_mini_grids_table.php | 3 +- ..._133655_create_maintenance_users_table.php | 3 +- ...019_11_06_121116_create_energies_table.php | 3 +- .../2019_11_15_102431_create_solars_table.php | 3 +- ...19_11_26_063009_create_batteries_table.php | 3 +- .../2019_12_16_090907_create_assets_table.php | 3 +- ..._12_16_091934_create_asset_types_table.php | 3 +- ...12_16_092044_create_asset_people_table.php | 3 +- ..._12_16_093223_create_asset_rates_table.php | 3 +- .../2020_01_27_135206_create_logs_table.php | 3 +- .../2020_04_05_233604_create_p_v_s_table.php | 3 +- ...04_19_234527_create_restrictions_table.php | 3 +- ...020_04_19_235421_create_upgrades_table.php | 3 +- ...4_20_001454_create_subscriptions_table.php | 3 +- .../2020_06_20_085555_weather_data.php | 3 +- ...create_tariff_pricing_components_table.php | 3 +- ..._21_194542_create_social_tariffs_table.php | 3 +- ...create_social_tariff_piggy_banks_table.php | 3 +- ...15405_add_total_price_to_meter_tariffs.php | 3 +- .../2020_07_12_192802_create_agents_table.php | 3 +- ...130601_create_agent_transactions_table.php | 3 +- ...6_create_agent_balance_histories_table.php | 3 +- ...create_agent_assigned_appliances_table.php | 3 +- ...811_create_agent_sold_appliances_table.php | 3 +- ..._083600_create_agent_commissions_table.php | 3 +- ..._25_155837_create_agent_receipts_table.php | 3 +- ...8_03_081836_create_agent_charges_table.php | 3 +- ...748_create_agent_receipt_details_table.php | 3 +- ..._02_072509_create_time_of_usages_table.php | 3 +- ..._19_122517_create_sub_menu_items_table.php | 3 +- ...0_10_19_122649_create_menu_items_table.php | 3 +- ...2020_10_29_170007_create_plugins_table.php | 3 +- ...2_17_144527_create_main_settings_table.php | 3 +- ...12_23_165814_create_map_settings_table.php | 3 +- ...ransaction_to_agent_transactions_table.php | 3 +- ...130412_create_third_party_transactions.php | 3 +- ...nsaction_to_vodacom_transactions_table.php | 3 +- ...ansaction_to_airtel_transactions_table.php | 3 +- ...05_234039_create_ticket_settings_table.php | 3 +- ..._122556_add_columns_to_batteries_table.php | 3 +- ...1_18_123245_add_columns_to_p_v_s_table.php | 3 +- .../2021_02_18_153556_create_sms_bodies.php | 3 +- ...556_create_sms_resend_information_keys.php | 3 +- ...6421_create_sms_appliance_remind_rates.php | 3 +- ..._03_140758_create_sms_android_settings.php | 3 +- ...706_create_sms_variable_default_values.php | 3 +- .../2021_03_2_1561251_update_sms_table.php | 3 +- ...8_add_additional_json_column_to_people.php | 3 +- ...8_104840_create_person_documents_table.php | 3 +- ...085817_update_meter_consumptions_table.php | 3 +- ...add_down_payment_to_asset_people_table.php | 3 +- ...rst_payment_date_to_asset_people_table.php | 3 +- ..._092522_create_cash_transactions_table.php | 3 +- ...2021_10_18_220817_create_mail_settings.php | 3 +- ...5_10_093215_update_meter_tariffs_table.php | 3 +- ..._10_101348_update_social_tariffs_table.php | 3 +- ...update_tariff_pricing_components_table.php | 3 +- ...update_social_tariff_piggy_banks_table.php | 3 +- ...05_10_102047_update_access_rates_table.php | 3 +- ...2214_update_access_rate_payments_table.php | 3 +- ...05_10_102507_update_asset_people_table.php | 3 +- ...05_10_102649_update_transactions_table.php | 3 +- ..._102805_update_payment_histories_table.php | 3 +- ..._05_19_102938_update_asset_types_table.php | 3 +- ..._add_connection_column_to_agents_table.php | 3 +- .../2022_06_21_090125_create_calin_tables.php | 3 +- ...06_21_090327_create_calin_smart_tables.php | 3 +- .../2022_06_21_090338_create_kelin_tables.php | 3 +- ..._create_mesomb_payment_provider_tables.php | 3 +- .../2022_06_21_090351_create_spark_tables.php | 3 +- ...2022_06_21_090402_create_steama_tables.php | 3 +- .../2022_06_21_090412_create_stron_tables.php | 3 +- ..._create_swifta_payment_provider_tables.php | 3 +- ..._092948_create_registration_tail_table.php | 3 +- ...000000_create_bulk_registration_tables.php | 3 +- ...0327_add_direction_column_to_sms_table.php | 3 +- ...945_add_gateway_id_column_to_sms_table.php | 3 +- ...123_add_dispatched_column_to_sms_table.php | 3 +- ...42319_add_attempts_column_to_sms_table.php | 3 +- ..._0000000_create_viber_messaging_tables.php | 3 +- ...purchase_amount_to_meter_tariffs_table.php | 3 +- ...ate_wave_money_payment_provider_tables.php | 3 +- ..._11_29_000000_create_micro_star_tables.php | 3 +- ...000_update_swifta_authentication_table.php | 3 +- .../2022_14_12_create_sun_king_tables.php | 3 +- ...3_15_092048_add_colums_to_solars_table.php | 3 +- .../2023_03_16_105024_update_solars_table.php | 3 +- ...update_data_type_values_energies_table.php | 3 +- ...update_data_type_values_energies_table.php | 3 +- ...023_04_02_121811_create_wavecom_tables.php | 3 +- ...421_add_api_type_to_table_transactions.php | 3 +- .../2023_04_26_223352_update_sms_table.php | 3 +- .../2023_06_02_create_gome_long_tables.php | 3 +- ...assets_asset_people_asset_types_tables.php | 3 +- ...pdate_sms_appliance_remind_rates_table.php | 7 ++-- ...074114_update_wavecom_wavemoney_tables.php | 7 ++-- ...2023_11_03_112202_create_devices_table.php | 3 +- ...120614_create_solar_home_systems_table.php | 3 +- ..._configuration_columns_to_meters_table.php | 3 +- ...07_update_action_field_type_logs_table.php | 7 ++-- ..._drop_geo_id_column_from_address_table.php | 3 +- ...add_type_column_to_manufacturers_table.php | 3 +- ..._id_column_to_solar_home_systems_table.php | 3 +- ...date_person_id_column_in_devices_table.php | 3 +- ..._device_serial_column_in_devices_table.php | 3 +- ...ber_column_in_solar_home_systems_table.php | 3 +- .../2023_11_17_095204_create_tokens_table.php | 3 +- ...ce_serial_column_to_asset_people_table.php | 3 +- ...ce_serial_column_in_asset_people_table.php | 3 +- .../2024_01_01_create_daly_bms_tables.php | 3 +- ...2024_01_02_124146_create_e_bikes_table.php | 3 +- .../2024_01_12_create_angaza_tables.php | 3 +- ...age_type_column_to_main_settings_table.php | 3 +- ..._usage_type_column_to_menu_items_table.php | 3 +- ...24_09_30_113302_remove_siderbar_tables.php | 3 +- ...0_23_153042_add_amount_to_agent_charge.php | 3 +- ...0_30_154625_create_notifications_table.php | 3 +- ...24_10_31_180458_remove_batteries_table.php | 3 +- ...024_10_31_180510_remove_energies_table.php | 3 +- ...524_remove_mini_grid_frequencies_table.php | 3 +- .../2024_10_31_180539_remove_pvs_table.php | 3 +- .../2024_10_31_180546_remove_solars_table.php | 3 +- ...10_31_180605_remove_weather_data_table.php | 3 +- ...2024_10_31_180852_remove_agent_tickets.php | 3 +- ...2024_10_31_181016_remove_city_clusters.php | 3 +- ...drop_data_stream_column_from_mini_grid.php | 3 +- src/backend/database/seeders/TenantSeeder.php | 3 +- .../AngazaCredentialController.php | 4 ++- .../src/Modules/Api/AngazaSHSApi.php | 3 +- .../src/Modules/Api/ApiRequests.php | 3 +- .../src/Services/AngazaCredentialService.php | 3 +- .../src/Services/ManufacturerService.php | 4 ++- .../create_bulk_registration_tables.php | 3 +- .../Exceptions/ClusterNotFoundException.php | 4 ++- .../src/Exceptions/CsvDataParserException.php | 4 ++- .../ManufacturerNotSupportedException.php | 4 ++- .../Exceptions/MiniGridNotFoundException.php | 4 ++- .../src/Exceptions/MissingDataException.php | 4 ++- .../Exceptions/VillageNotFoundException.php | 4 ++- .../src/Helpers/CsvDataProcessor.php | 2 +- .../src/Helpers/CsvFileParser.php | 2 +- .../Helpers/GeographicalLocationFinder.php | 2 +- .../src/Services/AddressService.php | 2 +- .../Exceptions/CalinApiResponseException.php | 4 ++- .../CalinSmartApiResponseException.php | 4 ++- ...alinSmartCreadentialsNotFoundException.php | 4 ++- .../DalyBmsCredentialController.php | 3 +- .../daly-bms/src/Modules/Api/ApiRequests.php | 3 +- .../daly-bms/src/Modules/Api/DalyBmsApi.php | 3 +- .../src/Services/DalyBmsCredentialService.php | 3 +- .../src/Services/ManufacturerService.php | 4 ++- .../src/Exceptions/CronJobException.php | 4 ++- .../GomeLongCredentialController.php | 3 +- .../src/Modules/Api/ApiRequests.php | 3 +- .../src/Modules/Api/GomeLongMeterApi.php | 3 +- .../src/Observers/MeterTariffObserver.php | 3 +- .../Services/GomeLongCredentialService.php | 3 +- .../src/Services/GomeLongTariffService.php | 5 +-- .../src/Services/ManufacturerService.php | 4 ++- .../src/Exceptions/CronJobException.php | 4 ++- .../KelinApiAuthenticationException.php | 4 ++- .../KelinApiCredentialsNotFoundException.php | 4 ++- .../Exceptions/KelinApiEmtyDataException.php | 4 ++- .../Exceptions/KelinApiResponseException.php | 4 ++- .../inensus/kelin-meter/src/KelinMeterApi.php | 7 ++-- .../src/Services/KelinMeterService.php | 10 +++--- .../Services/PackageInstallationService.php | 3 +- .../src/Tests/Feature/RechargeMeterTest.php | 2 +- ...MustHaveOnlyOneConnectedMeterException.php | 4 ++- ...ombPaymentPhoneNumberNotFoundException.php | 4 ++- .../MesombStatusFailedException.php | 4 ++- .../MicroStarCertificateController.php | 3 +- .../MicroStarCredentialController.php | 4 ++- .../Controllers/MicroStarTestController.php | 4 ++- .../src/Modules/Api/ApiRequests.php | 3 +- .../src/Modules/Api/MicroStarMeterApi.php | 3 +- .../src/Services/ManufacturerService.php | 4 ++- .../Services/MicroStarCredentialService.php | 3 +- .../CredentialsNotFoundException.php | 4 ++- .../CredentialsNotUpToDateException.php | 4 ++- .../src/Exceptions/CronJobException.php | 4 ++- .../NoOnlineSiteRecordException.php | 4 ++- .../Exceptions/SitesNotUpToDateException.php | 4 ++- .../Exceptions/SparkAPIResponseException.php | 4 ++- .../Exceptions/WrongCredentialsException.php | 4 ++- .../GeographicalInformationObserver.php | 3 +- .../src/Services/CustomerService.php | 10 +++--- .../src/Exceptions/CronJobException.php | 4 ++- .../src/Exceptions/ModelNotFoundException.php | 4 ++- .../Exceptions/SteamaApiResponseException.php | 4 ++- .../Exceptions/WrongCredentialsException.php | 4 ++- .../Services/PackageInstallationService.php | 3 +- .../src/Services/SteamaMeterService.php | 13 +++---- .../src/Services/SteamaTariffService.php | 4 ++- .../steama-meter/src/SteamaMeterApi.php | 4 ++- .../Exceptions/StronApiResponseException.php | 4 ++- .../SunKingCredentialController.php | 4 ++- .../src/Modules/Api/ApiRequests.php | 3 +- .../src/Modules/Api/SunKingSHSApi.php | 3 +- .../src/Services/ManufacturerService.php | 4 ++- .../src/Services/SunKingCredentialService.php | 3 +- .../Exceptions/CipherNotValidException.php | 4 ++- .../CustomerAddressNotFoundException.php | 4 ++- .../SwiftaValidationFailedException.php | 4 ++- .../TransactionAmountDifferentException.php | 4 ++- .../TransactionNotExistsException.php | 4 ++- .../SwiftaAuthenticationController.php | 4 ++- .../SwiftaPaymentProviderController.php | 4 ++- .../SwiftaTransactionCallbackMiddleware.php | 4 ++- .../Providers/SwiftaTransactionProvider.php | 3 +- .../Services/SwiftaAuthenticationService.php | 4 ++- .../src/Services/SwiftaTransactionService.php | 2 +- .../ticket/src/Exceptions/ApiUserNotFound.php | 4 ++- .../TicketOwnerNotFoundException.php | 4 ++- .../Controllers/TicketAgentController.php | 4 ++- .../Controllers/TicketCategoryController.php | 4 ++- .../Controllers/TicketCommentController.php | 4 ++- .../src/Http/Controllers/TicketController.php | 4 ++- .../Controllers/TicketCustomerController.php | 3 +- .../Controllers/TicketExportController.php | 3 +- .../Http/Controllers/TicketUserController.php | 3 +- .../inensus/ticket/src/Models/BaseModel.php | 4 ++- .../src/Services/TicketCategoryService.php | 3 +- .../src/Services/TicketCommentService.php | 3 +- .../src/Services/TicketOutSourceService.php | 3 +- .../Services/TicketOutsourceReportService.php | 3 +- .../ticket/src/Services/TicketService.php | 3 +- .../ticket/src/Services/TicketUserService.php | 3 +- .../Exceptions/MessageNotSentException.php | 4 ++- .../Exceptions/WebhookNotCreatedException.php | 4 ++- .../Controllers/ViberCredentialController.php | 3 +- .../Http/Controllers/WebhookController.php | 4 +-- .../src/Services/ViberContactService.php | 3 +- .../src/Services/ViberCredentialService.php | 3 +- .../src/Services/ViberMessageService.php | 3 +- .../viber-messaging/src/ViberGateway.php | 2 +- .../Http/Controllers/WaveMoneyController.php | 3 +- .../WaveMoneyCredentialController.php | 3 +- ...WaveMoneyTransactionCallbackMiddleware.php | 6 ++-- .../src/Modules/Api/AbstractApi.php | 4 ++- .../Api/Data/TransactionCallbackData.php | 3 +- .../Resources/StartTransactionResource.php | 3 +- .../src/Modules/Api/WaveMoneyApi.php | 4 ++- .../src/Modules/Api/WaveMoneyApiService.php | 3 +- .../WaveMoneyTransactionProvider.php | 3 +- .../Services/WaveMoneyCredentialService.php | 3 +- .../WaveComTransactionController.php | 4 ++- .../Providers/WaveComTransactionProvider.php | 3 +- .../src/Services/TransactionService.php | 8 +++-- .../Feature/SocialTariffPiggyBankTest.php | 2 +- .../tests/Unit/Exports/DailyTransactions.php | 4 ++- .../tests/Unit/Transaction/AccessRateTest.php | 4 +-- .../Transaction/VodacomTransactionTest.php | 4 +-- 557 files changed, 1172 insertions(+), 829 deletions(-) diff --git a/src/backend/app/Events/HistoryEvent.php b/src/backend/app/Events/HistoryEvent.php index fe407fe3b..554c286f0 100644 --- a/src/backend/app/Events/HistoryEvent.php +++ b/src/backend/app/Events/HistoryEvent.php @@ -18,7 +18,9 @@ class HistoryEvent implements ShouldBroadcast /** * Create a new event instance. */ - public function __construct(private readonly History $historyModel) {} + public function __construct(private readonly History $historyModel) + { + } /** * Get the channels the event should broadcast on. diff --git a/src/backend/app/Exceptions/AccessRates/NoAccessRateFound.php b/src/backend/app/Exceptions/AccessRates/NoAccessRateFound.php index e2ee7b607..d6235e778 100644 --- a/src/backend/app/Exceptions/AccessRates/NoAccessRateFound.php +++ b/src/backend/app/Exceptions/AccessRates/NoAccessRateFound.php @@ -2,4 +2,6 @@ namespace App\Exceptions\AccessRates; -class NoAccessRateFound extends \Exception {} +class NoAccessRateFound extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/ActiveSheetNotCreatedException.php b/src/backend/app/Exceptions/ActiveSheetNotCreatedException.php index 00ab89f41..15050ae28 100644 --- a/src/backend/app/Exceptions/ActiveSheetNotCreatedException.php +++ b/src/backend/app/Exceptions/ActiveSheetNotCreatedException.php @@ -2,4 +2,6 @@ namespace App\Exceptions; -class ActiveSheetNotCreatedException extends \Exception {} +class ActiveSheetNotCreatedException extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/AgentRiskBalanceExceeded.php b/src/backend/app/Exceptions/AgentRiskBalanceExceeded.php index ab293d85d..0d3dabe95 100644 --- a/src/backend/app/Exceptions/AgentRiskBalanceExceeded.php +++ b/src/backend/app/Exceptions/AgentRiskBalanceExceeded.php @@ -2,4 +2,6 @@ namespace App\Exceptions; -class AgentRiskBalanceExceeded extends \Exception {} +class AgentRiskBalanceExceeded extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/CustomerGroup/CustomerGroupNotFound.php b/src/backend/app/Exceptions/CustomerGroup/CustomerGroupNotFound.php index 42aa2753a..ad4f23d0f 100644 --- a/src/backend/app/Exceptions/CustomerGroup/CustomerGroupNotFound.php +++ b/src/backend/app/Exceptions/CustomerGroup/CustomerGroupNotFound.php @@ -2,4 +2,6 @@ namespace App\Exceptions\CustomerGroup; -class CustomerGroupNotFound extends \Exception {} +class CustomerGroupNotFound extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/Device/DeviceIsNotAssignedToCustomer.php b/src/backend/app/Exceptions/Device/DeviceIsNotAssignedToCustomer.php index f84ec75f0..2bc75c1b8 100644 --- a/src/backend/app/Exceptions/Device/DeviceIsNotAssignedToCustomer.php +++ b/src/backend/app/Exceptions/Device/DeviceIsNotAssignedToCustomer.php @@ -2,4 +2,6 @@ namespace App\Exceptions\Device; -class DeviceIsNotAssignedToCustomer extends \Exception {} +class DeviceIsNotAssignedToCustomer extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/DownPaymentBiggerThanAmountException.php b/src/backend/app/Exceptions/DownPaymentBiggerThanAmountException.php index 8d61ef9e9..27781ada7 100644 --- a/src/backend/app/Exceptions/DownPaymentBiggerThanAmountException.php +++ b/src/backend/app/Exceptions/DownPaymentBiggerThanAmountException.php @@ -2,4 +2,6 @@ namespace App\Exceptions; -class DownPaymentBiggerThanAmountException extends \Exception {} +class DownPaymentBiggerThanAmountException extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/DownPaymentBiggerThanAppliancePriceException.php b/src/backend/app/Exceptions/DownPaymentBiggerThanAppliancePriceException.php index 7841d0b5b..390707fee 100644 --- a/src/backend/app/Exceptions/DownPaymentBiggerThanAppliancePriceException.php +++ b/src/backend/app/Exceptions/DownPaymentBiggerThanAppliancePriceException.php @@ -2,4 +2,6 @@ namespace App\Exceptions; -class DownPaymentBiggerThanAppliancePriceException extends \Exception {} +class DownPaymentBiggerThanAppliancePriceException extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/DownPaymentNotFoundException.php b/src/backend/app/Exceptions/DownPaymentNotFoundException.php index ad5558551..40aca906f 100644 --- a/src/backend/app/Exceptions/DownPaymentNotFoundException.php +++ b/src/backend/app/Exceptions/DownPaymentNotFoundException.php @@ -2,4 +2,6 @@ namespace App\Exceptions; -class DownPaymentNotFoundException extends \Exception {} +class DownPaymentNotFoundException extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/GeoFormatException.php b/src/backend/app/Exceptions/GeoFormatException.php index 97898c940..983c839ff 100644 --- a/src/backend/app/Exceptions/GeoFormatException.php +++ b/src/backend/app/Exceptions/GeoFormatException.php @@ -2,4 +2,6 @@ namespace App\Exceptions; -class GeoFormatException extends \Exception {} +class GeoFormatException extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/InvalidBingApiKeyException.php b/src/backend/app/Exceptions/InvalidBingApiKeyException.php index 76a1e6db7..1de422650 100644 --- a/src/backend/app/Exceptions/InvalidBingApiKeyException.php +++ b/src/backend/app/Exceptions/InvalidBingApiKeyException.php @@ -2,4 +2,6 @@ namespace App\Exceptions; -class InvalidBingApiKeyException extends \Exception {} +class InvalidBingApiKeyException extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/MailNotSentException.php b/src/backend/app/Exceptions/MailNotSentException.php index 44dac52ea..3d1906639 100644 --- a/src/backend/app/Exceptions/MailNotSentException.php +++ b/src/backend/app/Exceptions/MailNotSentException.php @@ -2,4 +2,6 @@ namespace App\Exceptions; -class MailNotSentException extends \Exception {} +class MailNotSentException extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/Manufacturer/ApiCallDoesNotSupportedException.php b/src/backend/app/Exceptions/Manufacturer/ApiCallDoesNotSupportedException.php index 4e40fbc1b..545df482e 100644 --- a/src/backend/app/Exceptions/Manufacturer/ApiCallDoesNotSupportedException.php +++ b/src/backend/app/Exceptions/Manufacturer/ApiCallDoesNotSupportedException.php @@ -2,4 +2,6 @@ namespace App\Exceptions\Manufacturer; -class ApiCallDoesNotSupportedException extends \Exception {} +class ApiCallDoesNotSupportedException extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/Manufacturer/MeterIsNotReadable.php b/src/backend/app/Exceptions/Manufacturer/MeterIsNotReadable.php index fc34249d1..0ba7e64fc 100644 --- a/src/backend/app/Exceptions/Manufacturer/MeterIsNotReadable.php +++ b/src/backend/app/Exceptions/Manufacturer/MeterIsNotReadable.php @@ -2,4 +2,6 @@ namespace App\Exceptions\Manufacturer; -class MeterIsNotReadable extends \Exception {} +class MeterIsNotReadable extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/MeterParameter/MeterParameterNotFound.php b/src/backend/app/Exceptions/MeterParameter/MeterParameterNotFound.php index c1aaa2541..e6626356f 100644 --- a/src/backend/app/Exceptions/MeterParameter/MeterParameterNotFound.php +++ b/src/backend/app/Exceptions/MeterParameter/MeterParameterNotFound.php @@ -2,4 +2,6 @@ namespace App\Exceptions\MeterParameter; -class MeterParameterNotFound extends \Exception {} +class MeterParameterNotFound extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/Meters/MeterIsNotAssignedToCustomer.php b/src/backend/app/Exceptions/Meters/MeterIsNotAssignedToCustomer.php index a4eac9638..654c62302 100644 --- a/src/backend/app/Exceptions/Meters/MeterIsNotAssignedToCustomer.php +++ b/src/backend/app/Exceptions/Meters/MeterIsNotAssignedToCustomer.php @@ -2,4 +2,6 @@ namespace App\Exceptions\Meters; -class MeterIsNotAssignedToCustomer extends \Exception {} +class MeterIsNotAssignedToCustomer extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/Meters/MeterIsNotInUse.php b/src/backend/app/Exceptions/Meters/MeterIsNotInUse.php index f5889877f..07b393f18 100644 --- a/src/backend/app/Exceptions/Meters/MeterIsNotInUse.php +++ b/src/backend/app/Exceptions/Meters/MeterIsNotInUse.php @@ -2,4 +2,6 @@ namespace App\Exceptions\Meters; -class MeterIsNotInUse extends \Exception {} +class MeterIsNotInUse extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/MissingSmsReferencesException.php b/src/backend/app/Exceptions/MissingSmsReferencesException.php index 194b81871..1d8433f92 100644 --- a/src/backend/app/Exceptions/MissingSmsReferencesException.php +++ b/src/backend/app/Exceptions/MissingSmsReferencesException.php @@ -2,4 +2,6 @@ namespace App\Exceptions; -class MissingSmsReferencesException extends \Exception {} +class MissingSmsReferencesException extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/NotificationSendFailedException.php b/src/backend/app/Exceptions/NotificationSendFailedException.php index 51c61ae21..92a565e89 100644 --- a/src/backend/app/Exceptions/NotificationSendFailedException.php +++ b/src/backend/app/Exceptions/NotificationSendFailedException.php @@ -2,4 +2,6 @@ namespace App\Exceptions; -class NotificationSendFailedException extends \Exception {} +class NotificationSendFailedException extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/PaymentAmountBiggerThanTotalRemainingAmount.php b/src/backend/app/Exceptions/PaymentAmountBiggerThanTotalRemainingAmount.php index 677de17a8..cb54ff880 100644 --- a/src/backend/app/Exceptions/PaymentAmountBiggerThanTotalRemainingAmount.php +++ b/src/backend/app/Exceptions/PaymentAmountBiggerThanTotalRemainingAmount.php @@ -2,4 +2,6 @@ namespace App\Exceptions; -class PaymentAmountBiggerThanTotalRemainingAmount extends \Exception {} +class PaymentAmountBiggerThanTotalRemainingAmount extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/PaymentAmountSmallerThanZero.php b/src/backend/app/Exceptions/PaymentAmountSmallerThanZero.php index df6a1a9f0..24ac1608b 100644 --- a/src/backend/app/Exceptions/PaymentAmountSmallerThanZero.php +++ b/src/backend/app/Exceptions/PaymentAmountSmallerThanZero.php @@ -2,4 +2,6 @@ namespace App\Exceptions; -class PaymentAmountSmallerThanZero extends \Exception {} +class PaymentAmountSmallerThanZero extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/PaymentProviderNotIdentified.php b/src/backend/app/Exceptions/PaymentProviderNotIdentified.php index dfe162a50..2329b28cf 100644 --- a/src/backend/app/Exceptions/PaymentProviderNotIdentified.php +++ b/src/backend/app/Exceptions/PaymentProviderNotIdentified.php @@ -2,4 +2,6 @@ namespace App\Exceptions; -class PaymentProviderNotIdentified extends \Exception {} +class PaymentProviderNotIdentified extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/PurchaseNotProcessable.php b/src/backend/app/Exceptions/PurchaseNotProcessable.php index 616376ab8..532d80829 100644 --- a/src/backend/app/Exceptions/PurchaseNotProcessable.php +++ b/src/backend/app/Exceptions/PurchaseNotProcessable.php @@ -2,4 +2,6 @@ namespace App\Exceptions; -class PurchaseNotProcessable extends \Exception {} +class PurchaseNotProcessable extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/SmsAndroidSettingNotExistingException.php b/src/backend/app/Exceptions/SmsAndroidSettingNotExistingException.php index 2255ebfa2..68734f748 100644 --- a/src/backend/app/Exceptions/SmsAndroidSettingNotExistingException.php +++ b/src/backend/app/Exceptions/SmsAndroidSettingNotExistingException.php @@ -2,4 +2,6 @@ namespace App\Exceptions; -class SmsAndroidSettingNotExistingException extends \Exception {} +class SmsAndroidSettingNotExistingException extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/SmsBodyParserNotExtendedException.php b/src/backend/app/Exceptions/SmsBodyParserNotExtendedException.php index 6c51bbf00..d1d728b80 100644 --- a/src/backend/app/Exceptions/SmsBodyParserNotExtendedException.php +++ b/src/backend/app/Exceptions/SmsBodyParserNotExtendedException.php @@ -2,4 +2,6 @@ namespace App\Exceptions; -class SmsBodyParserNotExtendedException extends \Exception {} +class SmsBodyParserNotExtendedException extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/SmsTypeNotFoundException.php b/src/backend/app/Exceptions/SmsTypeNotFoundException.php index 72bf5e6e6..af2112275 100644 --- a/src/backend/app/Exceptions/SmsTypeNotFoundException.php +++ b/src/backend/app/Exceptions/SmsTypeNotFoundException.php @@ -2,4 +2,6 @@ namespace App\Exceptions; -class SmsTypeNotFoundException extends \Exception {} +class SmsTypeNotFoundException extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/SpreadSheetNotCreatedException.php b/src/backend/app/Exceptions/SpreadSheetNotCreatedException.php index 03bf69994..4d2144d5d 100644 --- a/src/backend/app/Exceptions/SpreadSheetNotCreatedException.php +++ b/src/backend/app/Exceptions/SpreadSheetNotCreatedException.php @@ -2,4 +2,6 @@ namespace App\Exceptions; -class SpreadSheetNotCreatedException extends \Exception {} +class SpreadSheetNotCreatedException extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/SpreadSheetNotSavedException.php b/src/backend/app/Exceptions/SpreadSheetNotSavedException.php index 4cd121be1..a2e4d6bdf 100644 --- a/src/backend/app/Exceptions/SpreadSheetNotSavedException.php +++ b/src/backend/app/Exceptions/SpreadSheetNotSavedException.php @@ -2,4 +2,6 @@ namespace App\Exceptions; -class SpreadSheetNotSavedException extends \Exception {} +class SpreadSheetNotSavedException extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/Tariffs/TariffNotFound.php b/src/backend/app/Exceptions/Tariffs/TariffNotFound.php index 3bdb79c3d..361c1168a 100644 --- a/src/backend/app/Exceptions/Tariffs/TariffNotFound.php +++ b/src/backend/app/Exceptions/Tariffs/TariffNotFound.php @@ -2,4 +2,6 @@ namespace App\Exceptions\Tariffs; -class TariffNotFound extends \Exception {} +class TariffNotFound extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/TransactionAmountNotEnoughException.php b/src/backend/app/Exceptions/TransactionAmountNotEnoughException.php index a73731e7b..539125a97 100644 --- a/src/backend/app/Exceptions/TransactionAmountNotEnoughException.php +++ b/src/backend/app/Exceptions/TransactionAmountNotEnoughException.php @@ -2,4 +2,6 @@ namespace App\Exceptions; -class TransactionAmountNotEnoughException extends \Exception {} +class TransactionAmountNotEnoughException extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/TransactionAmountNotFoundException.php b/src/backend/app/Exceptions/TransactionAmountNotFoundException.php index c1e3e959b..c8d2dcb1f 100644 --- a/src/backend/app/Exceptions/TransactionAmountNotFoundException.php +++ b/src/backend/app/Exceptions/TransactionAmountNotFoundException.php @@ -2,4 +2,6 @@ namespace App\Exceptions; -class TransactionAmountNotFoundException extends \Exception {} +class TransactionAmountNotFoundException extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/TransactionFetchingException.php b/src/backend/app/Exceptions/TransactionFetchingException.php index 1342ac6b5..04e2b11d1 100644 --- a/src/backend/app/Exceptions/TransactionFetchingException.php +++ b/src/backend/app/Exceptions/TransactionFetchingException.php @@ -2,4 +2,6 @@ namespace App\Exceptions; -class TransactionFetchingException extends \Exception {} +class TransactionFetchingException extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/TransactionIsInvalidForProcessingIncomingRequestException.php b/src/backend/app/Exceptions/TransactionIsInvalidForProcessingIncomingRequestException.php index c3072f9d0..7e676b2f7 100644 --- a/src/backend/app/Exceptions/TransactionIsInvalidForProcessingIncomingRequestException.php +++ b/src/backend/app/Exceptions/TransactionIsInvalidForProcessingIncomingRequestException.php @@ -2,4 +2,6 @@ namespace App\Exceptions; -class TransactionIsInvalidForProcessingIncomingRequestException extends \Exception {} +class TransactionIsInvalidForProcessingIncomingRequestException extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/TransactionNotInitializedException.php b/src/backend/app/Exceptions/TransactionNotInitializedException.php index 4f1a18b22..72bb1fb9a 100644 --- a/src/backend/app/Exceptions/TransactionNotInitializedException.php +++ b/src/backend/app/Exceptions/TransactionNotInitializedException.php @@ -2,4 +2,6 @@ namespace App\Exceptions; -class TransactionNotInitializedException extends \Exception {} +class TransactionNotInitializedException extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/TrelloAPIException.php b/src/backend/app/Exceptions/TrelloAPIException.php index 0d4efe486..7ef91cb43 100644 --- a/src/backend/app/Exceptions/TrelloAPIException.php +++ b/src/backend/app/Exceptions/TrelloAPIException.php @@ -2,4 +2,6 @@ namespace App\Exceptions; -class TrelloAPIException extends \Exception {} +class TrelloAPIException extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/UserAddressNorFoundException.php b/src/backend/app/Exceptions/UserAddressNorFoundException.php index ab0988f00..719bcbecc 100644 --- a/src/backend/app/Exceptions/UserAddressNorFoundException.php +++ b/src/backend/app/Exceptions/UserAddressNorFoundException.php @@ -2,4 +2,6 @@ namespace App\Exceptions; -class UserAddressNorFoundException extends \Exception {} +class UserAddressNorFoundException extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/ValidationException.php b/src/backend/app/Exceptions/ValidationException.php index 3fdeb2d7a..f71d1829e 100644 --- a/src/backend/app/Exceptions/ValidationException.php +++ b/src/backend/app/Exceptions/ValidationException.php @@ -2,4 +2,6 @@ namespace App\Exceptions; -class ValidationException extends \Exception {} +class ValidationException extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/VodacomHeartBeatException.php b/src/backend/app/Exceptions/VodacomHeartBeatException.php index 0eb591ca4..11b8f4871 100644 --- a/src/backend/app/Exceptions/VodacomHeartBeatException.php +++ b/src/backend/app/Exceptions/VodacomHeartBeatException.php @@ -2,4 +2,6 @@ namespace App\Exceptions; -class VodacomHeartBeatException extends \Exception {} +class VodacomHeartBeatException extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/WeatherParametersMissing.php b/src/backend/app/Exceptions/WeatherParametersMissing.php index 7dbd55f3d..872494fcc 100644 --- a/src/backend/app/Exceptions/WeatherParametersMissing.php +++ b/src/backend/app/Exceptions/WeatherParametersMissing.php @@ -2,4 +2,6 @@ namespace App\Exceptions; -class WeatherParametersMissing extends \Exception {} +class WeatherParametersMissing extends \Exception +{ +} diff --git a/src/backend/app/Exceptions/WeatherProviderUnreachable.php b/src/backend/app/Exceptions/WeatherProviderUnreachable.php index ca2e60999..06f5e6c76 100644 --- a/src/backend/app/Exceptions/WeatherProviderUnreachable.php +++ b/src/backend/app/Exceptions/WeatherProviderUnreachable.php @@ -2,4 +2,6 @@ namespace App\Exceptions; -class WeatherProviderUnreachable extends \Exception {} +class WeatherProviderUnreachable extends \Exception +{ +} diff --git a/src/backend/app/Helpers/MailHelperMock.php b/src/backend/app/Helpers/MailHelperMock.php index 313fd2256..53ef2b8cf 100644 --- a/src/backend/app/Helpers/MailHelperMock.php +++ b/src/backend/app/Helpers/MailHelperMock.php @@ -13,7 +13,11 @@ class MailHelperMock implements MailHelperInterface * @throws MailNotSentException * @throws PHPMailerException */ - public function sendPlain($to, $title, $body, $attachment = null): void {} + public function sendPlain($to, $title, $body, $attachment = null): void + { + } - public function sendViaTemplate(string $to, string $title, string $templatePath, ?array $variables = null, ?string $attachmentPath = null): void {} + public function sendViaTemplate(string $to, string $title, string $templatePath, ?array $variables = null, ?string $attachmentPath = null): void + { + } } diff --git a/src/backend/app/Http/Controllers/AddressController.php b/src/backend/app/Http/Controllers/AddressController.php index ea52ce4f7..fa76d322e 100644 --- a/src/backend/app/Http/Controllers/AddressController.php +++ b/src/backend/app/Http/Controllers/AddressController.php @@ -13,7 +13,8 @@ public function __construct( private AddressesService $addressService, private PersonService $personService, private PersonAddressService $personAddressService, - ) {} + ) { + } public function index(): ApiResource { diff --git a/src/backend/app/Http/Controllers/AgentAssignedApplianceWebController.php b/src/backend/app/Http/Controllers/AgentAssignedApplianceWebController.php index cf7466cfb..8478fe623 100644 --- a/src/backend/app/Http/Controllers/AgentAssignedApplianceWebController.php +++ b/src/backend/app/Http/Controllers/AgentAssignedApplianceWebController.php @@ -12,7 +12,8 @@ class AgentAssignedApplianceWebController extends Controller { public function __construct( private AgentAssignedApplianceService $agentAssignedApplianceService, - ) {} + ) { + } /** * Store a newly created resource in storage. diff --git a/src/backend/app/Http/Controllers/AgentAssignedAppliancesController.php b/src/backend/app/Http/Controllers/AgentAssignedAppliancesController.php index 0d15523e9..924aa762b 100644 --- a/src/backend/app/Http/Controllers/AgentAssignedAppliancesController.php +++ b/src/backend/app/Http/Controllers/AgentAssignedAppliancesController.php @@ -17,7 +17,8 @@ class AgentAssignedAppliancesController extends Controller public function __construct( private AgentAssignedApplianceService $agentAssignedApplianceService, private AgentService $agentService, - ) {} + ) { + } /** * List for Android-APP. diff --git a/src/backend/app/Http/Controllers/AgentBalanceController.php b/src/backend/app/Http/Controllers/AgentBalanceController.php index 69fff4b0d..6725fb5e5 100644 --- a/src/backend/app/Http/Controllers/AgentBalanceController.php +++ b/src/backend/app/Http/Controllers/AgentBalanceController.php @@ -9,7 +9,8 @@ class AgentBalanceController extends Controller { public function __construct( private AgentService $agentService, - ) {} + ) { + } public function show(Request $request) { diff --git a/src/backend/app/Http/Controllers/AgentBalanceHistoryController.php b/src/backend/app/Http/Controllers/AgentBalanceHistoryController.php index 11cf9551b..1c4400264 100644 --- a/src/backend/app/Http/Controllers/AgentBalanceHistoryController.php +++ b/src/backend/app/Http/Controllers/AgentBalanceHistoryController.php @@ -41,7 +41,9 @@ public function store(Agent $agent, CreateAgentBalanceHistoryRequest $request): * * @return void */ - public function show(AgentBalanceHistory $agent_balance_history) {} + public function show(AgentBalanceHistory $agent_balance_history) + { + } /** * Update the specified resource in storage. @@ -49,7 +51,9 @@ public function show(AgentBalanceHistory $agent_balance_history) {} * * @return void */ - public function update(Request $request, AgentBalanceHistory $agent_balance_history) {} + public function update(Request $request, AgentBalanceHistory $agent_balance_history) + { + } /** * Remove the specified resource from storage. @@ -57,5 +61,7 @@ public function update(Request $request, AgentBalanceHistory $agent_balance_hist * * @return void */ - public function destroy(AgentBalanceHistory $agent_balance_history) {} + public function destroy(AgentBalanceHistory $agent_balance_history) + { + } } diff --git a/src/backend/app/Http/Controllers/AgentBalanceHistoryWebController.php b/src/backend/app/Http/Controllers/AgentBalanceHistoryWebController.php index 2f2ed550c..e943a7ec4 100644 --- a/src/backend/app/Http/Controllers/AgentBalanceHistoryWebController.php +++ b/src/backend/app/Http/Controllers/AgentBalanceHistoryWebController.php @@ -8,7 +8,9 @@ class AgentBalanceHistoryWebController extends Controller { - public function __construct(private AgentBalanceHistoryService $agentBalanceHistoryService) {} + public function __construct(private AgentBalanceHistoryService $agentBalanceHistoryService) + { + } public function index($agentId, Request $request) { diff --git a/src/backend/app/Http/Controllers/AgentChargeWebController.php b/src/backend/app/Http/Controllers/AgentChargeWebController.php index 2333cbdb8..15de11c83 100644 --- a/src/backend/app/Http/Controllers/AgentChargeWebController.php +++ b/src/backend/app/Http/Controllers/AgentChargeWebController.php @@ -10,7 +10,8 @@ class AgentChargeWebController extends Controller { public function __construct( private AgentChargeService $agentChargeService, - ) {} + ) { + } public function store(CreateAgentChargeRequest $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/AgentCommissionWebController.php b/src/backend/app/Http/Controllers/AgentCommissionWebController.php index 06d24f184..fccd99376 100644 --- a/src/backend/app/Http/Controllers/AgentCommissionWebController.php +++ b/src/backend/app/Http/Controllers/AgentCommissionWebController.php @@ -9,7 +9,9 @@ class AgentCommissionWebController extends Controller { - public function __construct(private AgentCommissionService $agentCommissionService) {} + public function __construct(private AgentCommissionService $agentCommissionService) + { + } /** * Display a listing of the resource. diff --git a/src/backend/app/Http/Controllers/AgentCustomerController.php b/src/backend/app/Http/Controllers/AgentCustomerController.php index 140803377..e2561aa7e 100644 --- a/src/backend/app/Http/Controllers/AgentCustomerController.php +++ b/src/backend/app/Http/Controllers/AgentCustomerController.php @@ -12,7 +12,8 @@ class AgentCustomerController extends Controller public function __construct( private AgentCustomerService $agentCustomerService, private AgentService $agentService, - ) {} + ) { + } /** * Display a listing of the resource. diff --git a/src/backend/app/Http/Controllers/AgentCustomerTicketController.php b/src/backend/app/Http/Controllers/AgentCustomerTicketController.php index fba58192e..d10413907 100644 --- a/src/backend/app/Http/Controllers/AgentCustomerTicketController.php +++ b/src/backend/app/Http/Controllers/AgentCustomerTicketController.php @@ -9,7 +9,9 @@ class AgentCustomerTicketController extends Controller { - public function __construct(private AgentService $agentService, private TicketService $ticketService) {} + public function __construct(private AgentService $agentService, private TicketService $ticketService) + { + } public function show($customerId, Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/AgentCustomersPaymentHistoryController.php b/src/backend/app/Http/Controllers/AgentCustomersPaymentHistoryController.php index 758d19b61..da8dcd519 100644 --- a/src/backend/app/Http/Controllers/AgentCustomersPaymentHistoryController.php +++ b/src/backend/app/Http/Controllers/AgentCustomersPaymentHistoryController.php @@ -10,7 +10,8 @@ class AgentCustomersPaymentHistoryController extends Controller public function __construct( private AgentService $agentService, private AgentCustomersPaymentHistoryService $agentCustomersPaymentHistoryService, - ) {} + ) { + } public function show(int $customerId, string $period, $limit = null, $order = 'ASC') { diff --git a/src/backend/app/Http/Controllers/AgentDashboardBalanceHistoryController.php b/src/backend/app/Http/Controllers/AgentDashboardBalanceHistoryController.php index a2cba7b39..434d4de10 100644 --- a/src/backend/app/Http/Controllers/AgentDashboardBalanceHistoryController.php +++ b/src/backend/app/Http/Controllers/AgentDashboardBalanceHistoryController.php @@ -14,7 +14,8 @@ public function __construct( private AgentService $agentService, private AgentBalanceHistoryService $agentBalanceHistoryService, private AgentReceiptService $agentReceiptService, - ) {} + ) { + } public function show(Request $request, Response $response) { diff --git a/src/backend/app/Http/Controllers/AgentDashboardBoxesController.php b/src/backend/app/Http/Controllers/AgentDashboardBoxesController.php index 3c1af77d7..00ce9eec1 100644 --- a/src/backend/app/Http/Controllers/AgentDashboardBoxesController.php +++ b/src/backend/app/Http/Controllers/AgentDashboardBoxesController.php @@ -14,7 +14,8 @@ public function __construct( private AgentService $agentService, private AgentBalanceHistoryService $agentBalanceHistoryService, private AgentReceiptService $agentReceiptService, - ) {} + ) { + } public function show(Request $request, Response $response) { diff --git a/src/backend/app/Http/Controllers/AgentDashboardRevenueController.php b/src/backend/app/Http/Controllers/AgentDashboardRevenueController.php index e9036adb9..a6f16fee1 100644 --- a/src/backend/app/Http/Controllers/AgentDashboardRevenueController.php +++ b/src/backend/app/Http/Controllers/AgentDashboardRevenueController.php @@ -12,7 +12,8 @@ class AgentDashboardRevenueController extends Controller public function __construct( private AgentService $agentService, private AgentBalanceHistoryService $agentBalanceHistoryService, - ) {} + ) { + } public function show(Request $request, Response $response) { diff --git a/src/backend/app/Http/Controllers/AgentFirebaseController.php b/src/backend/app/Http/Controllers/AgentFirebaseController.php index f84d55303..0a14c5b57 100644 --- a/src/backend/app/Http/Controllers/AgentFirebaseController.php +++ b/src/backend/app/Http/Controllers/AgentFirebaseController.php @@ -10,7 +10,8 @@ class AgentFirebaseController extends Controller { public function __construct( private AgentService $agentService, - ) {} + ) { + } public function update(Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/AgentReceiptDetailController.php b/src/backend/app/Http/Controllers/AgentReceiptDetailController.php index 6b4f26a3b..26a7d1a51 100644 --- a/src/backend/app/Http/Controllers/AgentReceiptDetailController.php +++ b/src/backend/app/Http/Controllers/AgentReceiptDetailController.php @@ -2,4 +2,6 @@ namespace App\Http\Controllers; -class AgentReceiptDetailController extends Controller {} +class AgentReceiptDetailController extends Controller +{ +} diff --git a/src/backend/app/Http/Controllers/AgentReceiptWebController.php b/src/backend/app/Http/Controllers/AgentReceiptWebController.php index c4e79c4d0..58b324cd6 100644 --- a/src/backend/app/Http/Controllers/AgentReceiptWebController.php +++ b/src/backend/app/Http/Controllers/AgentReceiptWebController.php @@ -13,7 +13,8 @@ class AgentReceiptWebController extends Controller public function __construct( private AgentReceiptService $agentReceiptService, private AgentBalanceHistoryService $agentBalanceHistoryService, - ) {} + ) { + } /** * Display a listing of the resource. diff --git a/src/backend/app/Http/Controllers/AgentSoldApplianceController.php b/src/backend/app/Http/Controllers/AgentSoldApplianceController.php index 35d2efd73..fe1f28e18 100644 --- a/src/backend/app/Http/Controllers/AgentSoldApplianceController.php +++ b/src/backend/app/Http/Controllers/AgentSoldApplianceController.php @@ -15,7 +15,8 @@ class AgentSoldApplianceController extends Controller public function __construct( private AgentSoldApplianceService $agentSoldApplianceService, private AgentService $agentService, - ) {} + ) { + } public function index(Request $request) { diff --git a/src/backend/app/Http/Controllers/AgentSoldApplianceWebController.php b/src/backend/app/Http/Controllers/AgentSoldApplianceWebController.php index cc365bd52..2ca847494 100644 --- a/src/backend/app/Http/Controllers/AgentSoldApplianceWebController.php +++ b/src/backend/app/Http/Controllers/AgentSoldApplianceWebController.php @@ -8,7 +8,9 @@ class AgentSoldApplianceWebController extends Controller { - public function __construct(private AgentSoldApplianceService $agentSoldApplianceService) {} + public function __construct(private AgentSoldApplianceService $agentSoldApplianceService) + { + } public function index($agentId, Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/AgentTransactionWebController.php b/src/backend/app/Http/Controllers/AgentTransactionWebController.php index a4ca9ebcf..34fa60bf9 100644 --- a/src/backend/app/Http/Controllers/AgentTransactionWebController.php +++ b/src/backend/app/Http/Controllers/AgentTransactionWebController.php @@ -8,7 +8,9 @@ class AgentTransactionWebController extends Controller { - public function __construct(private AgentTransactionService $agentTransactionService) {} + public function __construct(private AgentTransactionService $agentTransactionService) + { + } public function index($agentId, Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/AgentTransactionsController.php b/src/backend/app/Http/Controllers/AgentTransactionsController.php index e99f6ad2c..f4c747da3 100644 --- a/src/backend/app/Http/Controllers/AgentTransactionsController.php +++ b/src/backend/app/Http/Controllers/AgentTransactionsController.php @@ -14,7 +14,8 @@ class AgentTransactionsController extends Controller public function __construct( private AgentTransactionService $agentTransactionService, private AgentService $agentService, - ) {} + ) { + } public function index(Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/AgentWebController.php b/src/backend/app/Http/Controllers/AgentWebController.php index 1dc258e28..5554868ba 100644 --- a/src/backend/app/Http/Controllers/AgentWebController.php +++ b/src/backend/app/Http/Controllers/AgentWebController.php @@ -25,7 +25,8 @@ public function __construct( private CountryService $countryService, private CompanyDatabaseService $companyDatabaseService, private DatabaseProxyService $databaseProxyService, - ) {} + ) { + } public function index(Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/AppliancePaymentController.php b/src/backend/app/Http/Controllers/AppliancePaymentController.php index 891a925c2..b134182ef 100644 --- a/src/backend/app/Http/Controllers/AppliancePaymentController.php +++ b/src/backend/app/Http/Controllers/AppliancePaymentController.php @@ -10,7 +10,9 @@ class AppliancePaymentController extends Controller { - public function __construct(private AppliancePaymentService $appliancePaymentService) {} + public function __construct(private AppliancePaymentService $appliancePaymentService) + { + } public function store(AssetPerson $appliancePerson, Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/AssetController.php b/src/backend/app/Http/Controllers/AssetController.php index 6d8c0843a..43e25f463 100644 --- a/src/backend/app/Http/Controllers/AssetController.php +++ b/src/backend/app/Http/Controllers/AssetController.php @@ -11,7 +11,9 @@ class AssetController extends Controller { - public function __construct(private AssetService $assetService) {} + public function __construct(private AssetService $assetService) + { + } /** * Display a listing of the resource. diff --git a/src/backend/app/Http/Controllers/AssetPersonController.php b/src/backend/app/Http/Controllers/AssetPersonController.php index 3d56abe02..61d8a9975 100644 --- a/src/backend/app/Http/Controllers/AssetPersonController.php +++ b/src/backend/app/Http/Controllers/AssetPersonController.php @@ -36,7 +36,8 @@ public function __construct( private CashTransactionService $cashTransactionService, private AssetService $applianceService, private ApplianceRateService $applianceRateService, - ) {} + ) { + } /** * Store a newly created resource in storage. diff --git a/src/backend/app/Http/Controllers/CityController.php b/src/backend/app/Http/Controllers/CityController.php index bc68110cc..e2be57a09 100644 --- a/src/backend/app/Http/Controllers/CityController.php +++ b/src/backend/app/Http/Controllers/CityController.php @@ -15,7 +15,8 @@ public function __construct( private CityService $cityService, private GeographicalInformationService $geographicalInformationService, private CityGeographicalInformationService $cityGeographicalInformationService, - ) {} + ) { + } public function index(Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/ClusterController.php b/src/backend/app/Http/Controllers/ClusterController.php index f442d02b6..aa968b833 100644 --- a/src/backend/app/Http/Controllers/ClusterController.php +++ b/src/backend/app/Http/Controllers/ClusterController.php @@ -17,7 +17,8 @@ public function __construct( private ClusterMeterService $clusterMetersService, private ClusterTransactionService $clusterTransactionsService, private ClusterPopulationService $clusterPopulationService, - ) {} + ) { + } /** * @throws \Exception diff --git a/src/backend/app/Http/Controllers/ClusterMiniGridRevenueController.php b/src/backend/app/Http/Controllers/ClusterMiniGridRevenueController.php index e0d047afe..cc58a8509 100644 --- a/src/backend/app/Http/Controllers/ClusterMiniGridRevenueController.php +++ b/src/backend/app/Http/Controllers/ClusterMiniGridRevenueController.php @@ -10,7 +10,8 @@ class ClusterMiniGridRevenueController extends Controller { public function __construct( private ClusterRevenueService $clusterRevenueService, - ) {} + ) { + } public function show($clusterId, Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/ClusterRevenueAnalysisController.php b/src/backend/app/Http/Controllers/ClusterRevenueAnalysisController.php index d6e04d075..648ce6866 100644 --- a/src/backend/app/Http/Controllers/ClusterRevenueAnalysisController.php +++ b/src/backend/app/Http/Controllers/ClusterRevenueAnalysisController.php @@ -14,7 +14,8 @@ public function __construct( private ClusterService $clusterService, private ClusterRevenueService $clusterRevenueService, private ConnectionTypeService $connectionTypeService, - ) {} + ) { + } public function show($clusterId, Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/ClusterRevenueController.php b/src/backend/app/Http/Controllers/ClusterRevenueController.php index c1cc227ba..c17d2cbaa 100644 --- a/src/backend/app/Http/Controllers/ClusterRevenueController.php +++ b/src/backend/app/Http/Controllers/ClusterRevenueController.php @@ -22,7 +22,8 @@ public function __construct( private ClusterTransactionService $clusterTransactionService, private ClusterPopulationService $clusterPopulationService, private PeriodService $periodService, - ) {} + ) { + } public function index(Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/ClustersDashboardCacheDataController.php b/src/backend/app/Http/Controllers/ClustersDashboardCacheDataController.php index 51b3eb7b0..fe1b2b170 100644 --- a/src/backend/app/Http/Controllers/ClustersDashboardCacheDataController.php +++ b/src/backend/app/Http/Controllers/ClustersDashboardCacheDataController.php @@ -10,7 +10,8 @@ class ClustersDashboardCacheDataController extends Controller { public function __construct( private ClustersDashboardCacheDataService $clustersDashboardCacheDataService, - ) {} + ) { + } public function index() { diff --git a/src/backend/app/Http/Controllers/CompanyController.php b/src/backend/app/Http/Controllers/CompanyController.php index 4b36b46a5..a86f98e32 100644 --- a/src/backend/app/Http/Controllers/CompanyController.php +++ b/src/backend/app/Http/Controllers/CompanyController.php @@ -27,7 +27,8 @@ public function __construct( private MpmPluginService $mpmPluginService, private RegistrationTailService $registrationTailService, private MainSettingsService $mainSettingsService, - ) {} + ) { + } public function store(CompanyRegistrationRequest $request): JsonResponse { diff --git a/src/backend/app/Http/Controllers/ConnectionGroupController.php b/src/backend/app/Http/Controllers/ConnectionGroupController.php index 16a2f482f..66694b28b 100644 --- a/src/backend/app/Http/Controllers/ConnectionGroupController.php +++ b/src/backend/app/Http/Controllers/ConnectionGroupController.php @@ -11,7 +11,8 @@ class ConnectionGroupController { public function __construct( private ConnectionGroupService $connectionGroupService, - ) {} + ) { + } public function index(Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/ConnectionTypeController.php b/src/backend/app/Http/Controllers/ConnectionTypeController.php index d03a924c5..105d13fa1 100644 --- a/src/backend/app/Http/Controllers/ConnectionTypeController.php +++ b/src/backend/app/Http/Controllers/ConnectionTypeController.php @@ -8,7 +8,9 @@ class ConnectionTypeController extends Controller { - public function __construct(private ConnectionTypeService $connectionTypeService) {} + public function __construct(private ConnectionTypeService $connectionTypeService) + { + } public function index(Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/CustomerRegistrationAppController.php b/src/backend/app/Http/Controllers/CustomerRegistrationAppController.php index 7e35fa10a..29039e8ff 100644 --- a/src/backend/app/Http/Controllers/CustomerRegistrationAppController.php +++ b/src/backend/app/Http/Controllers/CustomerRegistrationAppController.php @@ -10,7 +10,9 @@ class CustomerRegistrationAppController extends Controller { - public function __construct(private CustomerRegistrationAppService $customerRegistrationAppService) {} + public function __construct(private CustomerRegistrationAppService $customerRegistrationAppService) + { + } public function store(AndroidAppRequest $request) { diff --git a/src/backend/app/Http/Controllers/DeviceAddressController.php b/src/backend/app/Http/Controllers/DeviceAddressController.php index 9867b276a..d608d1f36 100644 --- a/src/backend/app/Http/Controllers/DeviceAddressController.php +++ b/src/backend/app/Http/Controllers/DeviceAddressController.php @@ -12,7 +12,8 @@ class DeviceAddressController extends Controller public function __construct( private DeviceAddressService $deviceAddressService, private DeviceService $deviceService, - ) {} + ) { + } public function update(Request $request) { diff --git a/src/backend/app/Http/Controllers/DeviceController.php b/src/backend/app/Http/Controllers/DeviceController.php index d041771f1..f51150283 100644 --- a/src/backend/app/Http/Controllers/DeviceController.php +++ b/src/backend/app/Http/Controllers/DeviceController.php @@ -9,7 +9,9 @@ class DeviceController extends Controller { - public function __construct(private DeviceService $deviceService) {} + public function __construct(private DeviceService $deviceService) + { + } public function index() { diff --git a/src/backend/app/Http/Controllers/EBikeController.php b/src/backend/app/Http/Controllers/EBikeController.php index 898fe2803..893e7c334 100644 --- a/src/backend/app/Http/Controllers/EBikeController.php +++ b/src/backend/app/Http/Controllers/EBikeController.php @@ -19,7 +19,8 @@ public function __construct( private EBikeDeviceService $eBikeDeviceService, private ManufacturerService $manufacturerService, private AppliancePersonService $appliancePersonService, - ) {} + ) { + } public function index(Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/HomeController.php b/src/backend/app/Http/Controllers/HomeController.php index 9ecceed21..9a0fbe2ab 100644 --- a/src/backend/app/Http/Controllers/HomeController.php +++ b/src/backend/app/Http/Controllers/HomeController.php @@ -9,7 +9,9 @@ class HomeController extends Controller * * @return void */ - public function __construct() {} + public function __construct() + { + } /** * Show the application dashboard. diff --git a/src/backend/app/Http/Controllers/MainSettingsController.php b/src/backend/app/Http/Controllers/MainSettingsController.php index 1222c64df..7147e3728 100644 --- a/src/backend/app/Http/Controllers/MainSettingsController.php +++ b/src/backend/app/Http/Controllers/MainSettingsController.php @@ -9,7 +9,9 @@ class MainSettingsController extends Controller { - public function __construct(private MainSettingsService $mainSettingsService) {} + public function __construct(private MainSettingsService $mainSettingsService) + { + } public function index(): ApiResource { diff --git a/src/backend/app/Http/Controllers/MaintenanceUserController.php b/src/backend/app/Http/Controllers/MaintenanceUserController.php index 497723cf1..84ef0def0 100644 --- a/src/backend/app/Http/Controllers/MaintenanceUserController.php +++ b/src/backend/app/Http/Controllers/MaintenanceUserController.php @@ -20,7 +20,8 @@ public function __construct( private Person $person, private PersonService $personService, private AddressService $addressService, - ) {} + ) { + } public function index(): ApiResource { diff --git a/src/backend/app/Http/Controllers/ManufacturerController.php b/src/backend/app/Http/Controllers/ManufacturerController.php index ca09b5a25..2d4fa4597 100644 --- a/src/backend/app/Http/Controllers/ManufacturerController.php +++ b/src/backend/app/Http/Controllers/ManufacturerController.php @@ -16,7 +16,8 @@ public function __construct( private ManufacturerService $manufacturerService, private ManufacturerAddressService $manufacturerAddressService, private AddressesService $addressService, - ) {} + ) { + } /** * Display a listing of the resource. diff --git a/src/backend/app/Http/Controllers/MeterConsumptionController.php b/src/backend/app/Http/Controllers/MeterConsumptionController.php index 455543a16..feea6e282 100644 --- a/src/backend/app/Http/Controllers/MeterConsumptionController.php +++ b/src/backend/app/Http/Controllers/MeterConsumptionController.php @@ -11,7 +11,8 @@ class MeterConsumptionController extends Controller public function __construct( private MeterService $meterService, private MeterConsumptionService $meterConsumptionService, - ) {} + ) { + } /** * Consumption List diff --git a/src/backend/app/Http/Controllers/MeterController.php b/src/backend/app/Http/Controllers/MeterController.php index d692200b5..a4d685ffb 100644 --- a/src/backend/app/Http/Controllers/MeterController.php +++ b/src/backend/app/Http/Controllers/MeterController.php @@ -15,7 +15,8 @@ class MeterController extends Controller { public function __construct( private MeterService $meterService, - ) {} + ) { + } /** * List diff --git a/src/backend/app/Http/Controllers/MeterGeographicalInformationController.php b/src/backend/app/Http/Controllers/MeterGeographicalInformationController.php index c20d95a12..03ccaacba 100644 --- a/src/backend/app/Http/Controllers/MeterGeographicalInformationController.php +++ b/src/backend/app/Http/Controllers/MeterGeographicalInformationController.php @@ -17,7 +17,8 @@ public function __construct( private PersonMeterService $personMeterService, private CityService $cityService, private MeterService $meterService, - ) {} + ) { + } /** * List with geo and access rate diff --git a/src/backend/app/Http/Controllers/MeterPaymentHistoryController.php b/src/backend/app/Http/Controllers/MeterPaymentHistoryController.php index 96cbf524d..59a7c453c 100644 --- a/src/backend/app/Http/Controllers/MeterPaymentHistoryController.php +++ b/src/backend/app/Http/Controllers/MeterPaymentHistoryController.php @@ -9,7 +9,8 @@ class MeterPaymentHistoryController { public function __construct( private PaymentHistoryService $paymentHistoryService, - ) {} + ) { + } public function show(string $serialNumber) { diff --git a/src/backend/app/Http/Controllers/MeterRevenueController.php b/src/backend/app/Http/Controllers/MeterRevenueController.php index b9b7c312a..d9029a988 100644 --- a/src/backend/app/Http/Controllers/MeterRevenueController.php +++ b/src/backend/app/Http/Controllers/MeterRevenueController.php @@ -9,7 +9,8 @@ class MeterRevenueController extends Controller { public function __construct( private MeterRevenueService $meterRevenueService, - ) {} + ) { + } /** * Revenue diff --git a/src/backend/app/Http/Controllers/MeterTariffController.php b/src/backend/app/Http/Controllers/MeterTariffController.php index 041aeeccf..7680a3e1f 100644 --- a/src/backend/app/Http/Controllers/MeterTariffController.php +++ b/src/backend/app/Http/Controllers/MeterTariffController.php @@ -13,7 +13,8 @@ class MeterTariffController extends Controller { public function __construct( private MeterTariffService $meterTariffService, - ) {} + ) { + } /** * List diff --git a/src/backend/app/Http/Controllers/MeterTariffMeterParameterController.php b/src/backend/app/Http/Controllers/MeterTariffMeterParameterController.php index 964568bba..35fd15a9e 100644 --- a/src/backend/app/Http/Controllers/MeterTariffMeterParameterController.php +++ b/src/backend/app/Http/Controllers/MeterTariffMeterParameterController.php @@ -9,7 +9,8 @@ class MeterTariffMeterParameterController extends Controller { public function __construct( private MeterTariffMeterParameterService $meterTariffMeterParameterService, - ) {} + ) { + } /** * Display a list of meters which using a particular tariff. diff --git a/src/backend/app/Http/Controllers/MeterTypeController.php b/src/backend/app/Http/Controllers/MeterTypeController.php index a602a7d5d..80ba04c9c 100644 --- a/src/backend/app/Http/Controllers/MeterTypeController.php +++ b/src/backend/app/Http/Controllers/MeterTypeController.php @@ -17,7 +17,9 @@ class MeterTypeController extends Controller { use SoftDeletes; - public function __construct(private MeterTypeService $meterTypeService) {} + public function __construct(private MeterTypeService $meterTypeService) + { + } /** * List. diff --git a/src/backend/app/Http/Controllers/MeterTypeMeterController.php b/src/backend/app/Http/Controllers/MeterTypeMeterController.php index 7839b0074..62a4130df 100644 --- a/src/backend/app/Http/Controllers/MeterTypeMeterController.php +++ b/src/backend/app/Http/Controllers/MeterTypeMeterController.php @@ -8,7 +8,9 @@ class MeterTypeMeterController extends Controller { - public function __construct(private MeterTypeMeterService $meterTypeMeterService) {} + public function __construct(private MeterTypeMeterService $meterTypeMeterService) + { + } /** * List with Meters diff --git a/src/backend/app/Http/Controllers/MiniGridController.php b/src/backend/app/Http/Controllers/MiniGridController.php index ef70e2cbe..d0d7dac55 100644 --- a/src/backend/app/Http/Controllers/MiniGridController.php +++ b/src/backend/app/Http/Controllers/MiniGridController.php @@ -17,7 +17,8 @@ public function __construct( private MiniGridService $miniGridService, private GeographicalInformationService $geographicalInformationService, private MiniGridGeographicalInformationService $miniGridGeographicalInformationService, - ) {} + ) { + } /** * List. diff --git a/src/backend/app/Http/Controllers/MiniGridDashboardCacheController.php b/src/backend/app/Http/Controllers/MiniGridDashboardCacheController.php index 1907feb40..b3747c48b 100644 --- a/src/backend/app/Http/Controllers/MiniGridDashboardCacheController.php +++ b/src/backend/app/Http/Controllers/MiniGridDashboardCacheController.php @@ -8,7 +8,9 @@ class MiniGridDashboardCacheController extends Controller { - public function __construct(private MiniGridDashboardCacheDataService $miniGridDashboardCacheDataService) {} + public function __construct(private MiniGridDashboardCacheDataService $miniGridDashboardCacheDataService) + { + } public function index(): ApiResource { diff --git a/src/backend/app/Http/Controllers/MiniGridDeviceController.php b/src/backend/app/Http/Controllers/MiniGridDeviceController.php index f197bb3b6..0b5f2d485 100644 --- a/src/backend/app/Http/Controllers/MiniGridDeviceController.php +++ b/src/backend/app/Http/Controllers/MiniGridDeviceController.php @@ -10,7 +10,8 @@ class MiniGridDeviceController extends Controller { public function __construct( private MiniGridDeviceService $miniGridDeviceService, - ) {} + ) { + } public function index(Request $request, $miniGridId): ApiResource { diff --git a/src/backend/app/Http/Controllers/MiniGridRevenueController.php b/src/backend/app/Http/Controllers/MiniGridRevenueController.php index 55105a86e..ae683213f 100644 --- a/src/backend/app/Http/Controllers/MiniGridRevenueController.php +++ b/src/backend/app/Http/Controllers/MiniGridRevenueController.php @@ -12,7 +12,8 @@ class MiniGridRevenueController public function __construct( private MeterService $meterService, private MiniGridRevenueService $miniGridRevenueService, - ) {} + ) { + } public function show($miniGridId, Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/MpmPluginController.php b/src/backend/app/Http/Controllers/MpmPluginController.php index cce654445..7581190d5 100644 --- a/src/backend/app/Http/Controllers/MpmPluginController.php +++ b/src/backend/app/Http/Controllers/MpmPluginController.php @@ -8,7 +8,9 @@ class MpmPluginController extends Controller { - public function __construct(private MpmPluginService $mpmPluginService) {} + public function __construct(private MpmPluginService $mpmPluginService) + { + } public function index(Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/OutstandingDebtsExportController.php b/src/backend/app/Http/Controllers/OutstandingDebtsExportController.php index b9930bf96..8191980f0 100644 --- a/src/backend/app/Http/Controllers/OutstandingDebtsExportController.php +++ b/src/backend/app/Http/Controllers/OutstandingDebtsExportController.php @@ -12,7 +12,8 @@ class OutstandingDebtsExportController { public function __construct( private OutstandingDebtsExportService $outstandingDebtsExportService, - ) {} + ) { + } public function download(): BinaryFileResponse { diff --git a/src/backend/app/Http/Controllers/PersonAddressesController.php b/src/backend/app/Http/Controllers/PersonAddressesController.php index 9dfe08e45..0735a8215 100644 --- a/src/backend/app/Http/Controllers/PersonAddressesController.php +++ b/src/backend/app/Http/Controllers/PersonAddressesController.php @@ -15,7 +15,8 @@ public function __construct( private AddressesService $addressService, private PersonService $personService, private PersonAddressService $personAddressService, - ) {} + ) { + } /** * Addresses diff --git a/src/backend/app/Http/Controllers/PersonController.php b/src/backend/app/Http/Controllers/PersonController.php index 21a0775ab..b25a23aa7 100644 --- a/src/backend/app/Http/Controllers/PersonController.php +++ b/src/backend/app/Http/Controllers/PersonController.php @@ -27,7 +27,8 @@ public function __construct( private PersonAddressService $personAddressService, private MaintenanceUserService $maintenanceUserService, private CountryService $countryService, - ) {} + ) { + } /** * List customer/other diff --git a/src/backend/app/Http/Controllers/PersonDocumentController.php b/src/backend/app/Http/Controllers/PersonDocumentController.php index 7a8c8d23d..3b029547a 100644 --- a/src/backend/app/Http/Controllers/PersonDocumentController.php +++ b/src/backend/app/Http/Controllers/PersonDocumentController.php @@ -2,4 +2,6 @@ namespace App\Http\Controllers; -class PersonDocumentController extends Controller {} +class PersonDocumentController extends Controller +{ +} diff --git a/src/backend/app/Http/Controllers/PersonMeterController.php b/src/backend/app/Http/Controllers/PersonMeterController.php index 715718a4e..30c2e6e24 100644 --- a/src/backend/app/Http/Controllers/PersonMeterController.php +++ b/src/backend/app/Http/Controllers/PersonMeterController.php @@ -9,7 +9,8 @@ class PersonMeterController { public function __construct( private PersonMeterService $personMeterService, - ) {} + ) { + } /** * @group People diff --git a/src/backend/app/Http/Controllers/PluginController.php b/src/backend/app/Http/Controllers/PluginController.php index 15c09d0c9..d797c1d6b 100644 --- a/src/backend/app/Http/Controllers/PluginController.php +++ b/src/backend/app/Http/Controllers/PluginController.php @@ -17,7 +17,8 @@ public function __construct( private MpmPluginService $mpmPluginService, private CompanyDatabaseService $companyDatabaseService, private RegistrationTailService $registrationTailService, - ) {} + ) { + } public function index(Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/RegistrationTailController.php b/src/backend/app/Http/Controllers/RegistrationTailController.php index 74f9e66da..aa753aa42 100644 --- a/src/backend/app/Http/Controllers/RegistrationTailController.php +++ b/src/backend/app/Http/Controllers/RegistrationTailController.php @@ -9,7 +9,9 @@ class RegistrationTailController extends Controller { - public function __construct(private RegistrationTailService $registrationTailService) {} + public function __construct(private RegistrationTailService $registrationTailService) + { + } public function index(): ApiResource { diff --git a/src/backend/app/Http/Controllers/Reports.php b/src/backend/app/Http/Controllers/Reports.php index 26b5dc1d9..70c12f799 100644 --- a/src/backend/app/Http/Controllers/Reports.php +++ b/src/backend/app/Http/Controllers/Reports.php @@ -49,7 +49,8 @@ public function __construct( private City $city, private Target $target, private Report $report, - ) {} + ) { + } private function monthlyTargetRibbon(Worksheet $sheet): void { @@ -141,7 +142,7 @@ private function addTargetConnectionGroups(Worksheet $sheet): void */ private function initSheet(): void { - $this->spreadsheet = new Spreadsheet; + $this->spreadsheet = new Spreadsheet(); $this->totalSold = []; } @@ -538,14 +539,14 @@ static function ($q) { $this->generateXls($sheet, $dateRange, $transactions); if ($reportType === 'weekly') { - $sheet2 = new Worksheet; + $sheet2 = new Worksheet(); $sheet2 = $this->spreadsheet->addSheet($sheet2); $this->addStaticText($sheet2, $dateRange); $sheet2->setTitle($dateRange); // Add transactions, customer name, balances to the sheet $this->addTransactions($sheet2, $transactions, false); } elseif ($reportType === 'monthly') { - $sheet2 = new Worksheet; + $sheet2 = new Worksheet(); $sheet2 = $this->spreadsheet->addSheet($sheet2); $sheet2->setTitle('monthly'); // Add targets diff --git a/src/backend/app/Http/Controllers/RevenueController.php b/src/backend/app/Http/Controllers/RevenueController.php index 72c1d42f8..7528ab541 100644 --- a/src/backend/app/Http/Controllers/RevenueController.php +++ b/src/backend/app/Http/Controllers/RevenueController.php @@ -27,7 +27,8 @@ public function __construct( private RevenueService $revenueService, private MeterRevenueService $meterRevenueService, private Target $target, - ) {} + ) { + } public function ticketData($id): ApiResource { @@ -144,7 +145,7 @@ public function revenueData(Request $request): ApiResource $formattedTarget = []; if ($targets === null) { // no target defined for that mini-grid - $targets = new \stdClass; + $targets = new \stdClass(); $connections = ConnectionGroup::query()->get(); foreach ($connections as $connection) { $formattedTarget[$connection->name] = [ diff --git a/src/backend/app/Http/Controllers/SmsController.php b/src/backend/app/Http/Controllers/SmsController.php index 952c7f5d3..830178a8c 100644 --- a/src/backend/app/Http/Controllers/SmsController.php +++ b/src/backend/app/Http/Controllers/SmsController.php @@ -26,7 +26,8 @@ public function __construct( private MeterParameter $meterParameter, private SmsService $smsService, private TicketCommentService $commentService, - ) {} + ) { + } public function index(): ApiResource { diff --git a/src/backend/app/Http/Controllers/SolarHomeSystemController.php b/src/backend/app/Http/Controllers/SolarHomeSystemController.php index 17583339b..fc09ce18a 100644 --- a/src/backend/app/Http/Controllers/SolarHomeSystemController.php +++ b/src/backend/app/Http/Controllers/SolarHomeSystemController.php @@ -15,7 +15,8 @@ public function __construct( private DeviceService $deviceService, private SolarHomeSystemService $solarHomeSystemService, private SolarHomeSystemDeviceService $solarHomeSystemDeviceService, - ) {} + ) { + } public function index(Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/SubConnectionTypeController.php b/src/backend/app/Http/Controllers/SubConnectionTypeController.php index 9717ffff2..a789a87fb 100644 --- a/src/backend/app/Http/Controllers/SubConnectionTypeController.php +++ b/src/backend/app/Http/Controllers/SubConnectionTypeController.php @@ -10,7 +10,9 @@ class SubConnectionTypeController extends Controller { - public function __construct(private SubConnectionTypeService $subConnectionTypeService) {} + public function __construct(private SubConnectionTypeService $subConnectionTypeService) + { + } public function index(Request $request, $connectionTypeId = null): ApiResource { diff --git a/src/backend/app/Http/Controllers/TargetController.php b/src/backend/app/Http/Controllers/TargetController.php index fca4aa2aa..e2210c432 100644 --- a/src/backend/app/Http/Controllers/TargetController.php +++ b/src/backend/app/Http/Controllers/TargetController.php @@ -17,7 +17,8 @@ public function __construct( private ClusterService $clusterService, private MiniGridService $miniGridService, private SubTargetService $subTargetService, - ) {} + ) { + } public function index(Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/TicketSettingsController.php b/src/backend/app/Http/Controllers/TicketSettingsController.php index 97509f242..f39318abd 100644 --- a/src/backend/app/Http/Controllers/TicketSettingsController.php +++ b/src/backend/app/Http/Controllers/TicketSettingsController.php @@ -8,7 +8,9 @@ class TicketSettingsController extends Controller { - public function __construct(private TicketSettings $ticketSettings) {} + public function __construct(private TicketSettings $ticketSettings) + { + } public function index(): ApiResource { diff --git a/src/backend/app/Http/Controllers/TimeOfUsageController.php b/src/backend/app/Http/Controllers/TimeOfUsageController.php index c44cfb58e..c86a30adc 100644 --- a/src/backend/app/Http/Controllers/TimeOfUsageController.php +++ b/src/backend/app/Http/Controllers/TimeOfUsageController.php @@ -10,7 +10,8 @@ class TimeOfUsageController extends Controller public function __construct( private TimeOfUsageService $timeOfUsageService, private MeterTariffService $meterTariffService, - ) {} + ) { + } public function destroy($timeOfUsageId): ?bool { diff --git a/src/backend/app/Http/Controllers/TransactionAdvancedController.php b/src/backend/app/Http/Controllers/TransactionAdvancedController.php index 4d6fc354d..897c3da39 100644 --- a/src/backend/app/Http/Controllers/TransactionAdvancedController.php +++ b/src/backend/app/Http/Controllers/TransactionAdvancedController.php @@ -10,7 +10,8 @@ class TransactionAdvancedController extends Controller { public function __construct( private TransactionService $transactionService, - ) {} + ) { + } public function searchAdvanced(Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/TransactionController.php b/src/backend/app/Http/Controllers/TransactionController.php index 56c691d92..cd966524f 100644 --- a/src/backend/app/Http/Controllers/TransactionController.php +++ b/src/backend/app/Http/Controllers/TransactionController.php @@ -12,7 +12,8 @@ class TransactionController extends Controller { public function __construct( private TransactionService $transactionService, - ) {} + ) { + } public function index(): ApiResource { diff --git a/src/backend/app/Http/Controllers/TransactionExportController.php b/src/backend/app/Http/Controllers/TransactionExportController.php index fbd294825..96576a19b 100644 --- a/src/backend/app/Http/Controllers/TransactionExportController.php +++ b/src/backend/app/Http/Controllers/TransactionExportController.php @@ -12,7 +12,8 @@ class TransactionExportController public function __construct( private TransactionService $transactionService, private TransactionExportService $transactionExportService, - ) {} + ) { + } public function download( Request $request, diff --git a/src/backend/app/Http/Controllers/UsageTypeController.php b/src/backend/app/Http/Controllers/UsageTypeController.php index 9517abaa6..c1381c68f 100644 --- a/src/backend/app/Http/Controllers/UsageTypeController.php +++ b/src/backend/app/Http/Controllers/UsageTypeController.php @@ -8,7 +8,9 @@ class UsageTypeController extends Controller { - public function __construct(private UsageTypeService $usageTypeService) {} + public function __construct(private UsageTypeService $usageTypeService) + { + } public function index(Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/UserController.php b/src/backend/app/Http/Controllers/UserController.php index fdec54b90..ac6d13a98 100644 --- a/src/backend/app/Http/Controllers/UserController.php +++ b/src/backend/app/Http/Controllers/UserController.php @@ -16,7 +16,8 @@ public function __construct( private UserService $userService, private DatabaseProxyService $databaseProxyService, private CompanyDatabaseService $companyDatabaseService, - ) {} + ) { + } public function index(Request $request): ApiResource { diff --git a/src/backend/app/Http/Middleware/AgentBalanceMiddleware.php b/src/backend/app/Http/Middleware/AgentBalanceMiddleware.php index 15222ba82..862b3f76c 100644 --- a/src/backend/app/Http/Middleware/AgentBalanceMiddleware.php +++ b/src/backend/app/Http/Middleware/AgentBalanceMiddleware.php @@ -17,7 +17,8 @@ public function __construct( private AgentService $agentService, private AgentAssignedApplianceService $agentAssignedApplianceService, private AgentTransactionService $agentTransactionService, - ) {} + ) { + } /** * Handle an incoming request. diff --git a/src/backend/app/Http/Middleware/RestrictionMiddleware.php b/src/backend/app/Http/Middleware/RestrictionMiddleware.php index fd751604d..096a35607 100644 --- a/src/backend/app/Http/Middleware/RestrictionMiddleware.php +++ b/src/backend/app/Http/Middleware/RestrictionMiddleware.php @@ -18,7 +18,8 @@ public function __construct( private RestrictionService $restrictionService, private MaintenanceUserService $maintenanceUserService, private MiniGridService $miniGridService, - ) {} + ) { + } /** * Handle an incoming request. diff --git a/src/backend/app/Http/Middleware/UserDefaultDatabaseConnectionMiddleware.php b/src/backend/app/Http/Middleware/UserDefaultDatabaseConnectionMiddleware.php index 208b992ed..99940c4e0 100644 --- a/src/backend/app/Http/Middleware/UserDefaultDatabaseConnectionMiddleware.php +++ b/src/backend/app/Http/Middleware/UserDefaultDatabaseConnectionMiddleware.php @@ -21,7 +21,8 @@ public function __construct( private DatabaseProxyManagerService $databaseProxyManager, private ApiCompanyResolverService $apiCompanyResolverService, private ApiResolverMap $apiResolverMap, - ) {} + ) { + } public function handle($request, \Closure $next) { diff --git a/src/backend/app/Http/Requests/CityRequest.php b/src/backend/app/Http/Requests/CityRequest.php index 04d9d9e8e..895dab314 100644 --- a/src/backend/app/Http/Requests/CityRequest.php +++ b/src/backend/app/Http/Requests/CityRequest.php @@ -36,7 +36,7 @@ public function rules(): array public function getCity(): City { - $city = new City; + $city = new City(); $city->setName($this->input(self::PARAM_NAME)); $city->setCountryId($this->input(self::PARAM_COUNTRY_ID, 0)); $city->setClusterId($this->input(self::PARAM_CLUSTER_ID)); diff --git a/src/backend/app/Http/Requests/StoreMiniGridRequest.php b/src/backend/app/Http/Requests/StoreMiniGridRequest.php index 79a3f58fa..e8c1ddf71 100644 --- a/src/backend/app/Http/Requests/StoreMiniGridRequest.php +++ b/src/backend/app/Http/Requests/StoreMiniGridRequest.php @@ -37,7 +37,7 @@ public function rules() public function getMiniGrid(): MiniGrid { - $miniGrid = new MiniGrid; + $miniGrid = new MiniGrid(); $miniGrid->setClusterId($this->input(self::PARAM_CLUSTER_ID)); $miniGrid->setName($this->input(self::PARAM_NAME)); diff --git a/src/backend/app/Jobs/HearthBeat.php b/src/backend/app/Jobs/HearthBeat.php index 14237a5f8..fae5b6fd3 100644 --- a/src/backend/app/Jobs/HearthBeat.php +++ b/src/backend/app/Jobs/HearthBeat.php @@ -21,7 +21,9 @@ class HearthBeat implements ShouldQueue * * @return void */ - public function __construct() {} + public function __construct() + { + } /** * Execute the job. diff --git a/src/backend/app/Jobs/SmsLoadBalancer.php b/src/backend/app/Jobs/SmsLoadBalancer.php index e95b9dc7c..724b21531 100644 --- a/src/backend/app/Jobs/SmsLoadBalancer.php +++ b/src/backend/app/Jobs/SmsLoadBalancer.php @@ -48,7 +48,7 @@ private function sendSms($data): string { $smsCollection = collect($data); $smsCollection = $smsCollection->chunk(3); - $httpClient = new Client; + $httpClient = new Client(); $request = $httpClient->post( $smsCollection[1]['setting']['url'], [ diff --git a/src/backend/app/Listeners/AccessRateListener.php b/src/backend/app/Listeners/AccessRateListener.php index 2045546f7..87fcce7aa 100644 --- a/src/backend/app/Listeners/AccessRateListener.php +++ b/src/backend/app/Listeners/AccessRateListener.php @@ -19,7 +19,7 @@ public function initializeAccessRatePayment(Meter $meter): void throw new NoAccessRateFound('Access Rate is not set'); } $nextPaymentDate = Carbon::now()->addDays($accessRate->period)->toDateString(); - $accessRatePayment = new AccessRatePayment; + $accessRatePayment = new AccessRatePayment(); $accessRatePayment->accessRate()->associate($accessRate); $accessRatePayment->meter()->associate($meter); $accessRatePayment->due_date = $nextPaymentDate; diff --git a/src/backend/app/Listeners/PaymentListener.php b/src/backend/app/Listeners/PaymentListener.php index f7fced3e7..0efcefd44 100644 --- a/src/backend/app/Listeners/PaymentListener.php +++ b/src/backend/app/Listeners/PaymentListener.php @@ -25,7 +25,8 @@ public function __construct( private ApplianceRatePaymentHistoryService $applianceRatePaymentHistoryService, private AccessRatePaymentHistoryService $accessRatePaymentHistoryService, private TransactionPaymentHistoryService $transactionPaymentHistoryService, - ) {} + ) { + } public function onEnergyPayment(ITransactionProvider $transactionProvider): void { @@ -39,7 +40,9 @@ public function onEnergyPayment(ITransactionProvider $transactionProvider): void } } - public function onLoanPayment(string $customer_id, int $amount): void {} + public function onLoanPayment(string $customer_id, int $amount): void + { + } public function onPaymentFailed(): void { diff --git a/src/backend/app/Listeners/SoldApplianceListener.php b/src/backend/app/Listeners/SoldApplianceListener.php index c3ee81aaf..3d2b619dd 100644 --- a/src/backend/app/Listeners/SoldApplianceListener.php +++ b/src/backend/app/Listeners/SoldApplianceListener.php @@ -12,7 +12,8 @@ class SoldApplianceListener public function __construct( private ApplianceRateService $applianceRateService, private PersonService $personService, - ) {} + ) { + } public function initializeApplianceRates(SoldApplianceDataContainer $soldAppliance): void { diff --git a/src/backend/app/ManufacturerApi/CalinReadMeter.php b/src/backend/app/ManufacturerApi/CalinReadMeter.php index 095b18789..0d232fdf8 100644 --- a/src/backend/app/ManufacturerApi/CalinReadMeter.php +++ b/src/backend/app/ManufacturerApi/CalinReadMeter.php @@ -62,7 +62,9 @@ public function readDailyData($meterId, $date) * * @return void */ - public function readMeter($meterId, $type) {} + public function readMeter($meterId, $type) + { + } /** * Reads the data for a given meter list. diff --git a/src/backend/app/Misc/SoldApplianceDataContainer.php b/src/backend/app/Misc/SoldApplianceDataContainer.php index 1bac55562..64374b393 100644 --- a/src/backend/app/Misc/SoldApplianceDataContainer.php +++ b/src/backend/app/Misc/SoldApplianceDataContainer.php @@ -14,7 +14,8 @@ public function __construct( private AssetType $assetType, private AssetPerson $assetPerson, private ?Transaction $transaction = null, - ) {} + ) { + } public function getAsset() { diff --git a/src/backend/app/Models/Admin.php b/src/backend/app/Models/Admin.php index 2cf81e2be..3a3bbba45 100644 --- a/src/backend/app/Models/Admin.php +++ b/src/backend/app/Models/Admin.php @@ -2,4 +2,6 @@ namespace App\Models; -class Admin extends BaseModel {} +class Admin extends BaseModel +{ +} diff --git a/src/backend/app/Models/MailSettings.php b/src/backend/app/Models/MailSettings.php index e3e6a16a7..7168b56bd 100644 --- a/src/backend/app/Models/MailSettings.php +++ b/src/backend/app/Models/MailSettings.php @@ -7,4 +7,6 @@ /** * Class MailSettings. */ -class MailSettings extends BaseModel {} +class MailSettings extends BaseModel +{ +} diff --git a/src/backend/app/Models/MainSettings.php b/src/backend/app/Models/MainSettings.php index 07c3406cb..1d0222e43 100644 --- a/src/backend/app/Models/MainSettings.php +++ b/src/backend/app/Models/MainSettings.php @@ -16,4 +16,6 @@ * @property float $vat_energy * @property float $vat_appliance * */ -class MainSettings extends BaseModel {} +class MainSettings extends BaseModel +{ +} diff --git a/src/backend/app/Models/MapSettings.php b/src/backend/app/Models/MapSettings.php index cf47ecc07..6cf816243 100644 --- a/src/backend/app/Models/MapSettings.php +++ b/src/backend/app/Models/MapSettings.php @@ -12,4 +12,6 @@ * @property float $latitude * @property float $longitude */ -class MapSettings extends BaseModel {} +class MapSettings extends BaseModel +{ +} diff --git a/src/backend/app/Models/Payment/PaymentProfile.php b/src/backend/app/Models/Payment/PaymentProfile.php index dc2b491fa..a236f88d4 100644 --- a/src/backend/app/Models/Payment/PaymentProfile.php +++ b/src/backend/app/Models/Payment/PaymentProfile.php @@ -4,4 +4,6 @@ use App\Models\Base\BaseModel; -class PaymentProfile extends BaseModel {} +class PaymentProfile extends BaseModel +{ +} diff --git a/src/backend/app/Models/Report.php b/src/backend/app/Models/Report.php index 0d6aa1498..50fda112c 100644 --- a/src/backend/app/Models/Report.php +++ b/src/backend/app/Models/Report.php @@ -13,4 +13,6 @@ * @property string $path * @property string $type */ -class Report extends BaseModel {} +class Report extends BaseModel +{ +} diff --git a/src/backend/app/Models/TicketSettings.php b/src/backend/app/Models/TicketSettings.php index c52610a27..d7cf76ab8 100644 --- a/src/backend/app/Models/TicketSettings.php +++ b/src/backend/app/Models/TicketSettings.php @@ -13,4 +13,6 @@ * @property string $api_url * @property string $api_key * */ -class TicketSettings extends BaseModel {} +class TicketSettings extends BaseModel +{ +} diff --git a/src/backend/app/Observers/AgentBalanceHistoryObserver.php b/src/backend/app/Observers/AgentBalanceHistoryObserver.php index f42b073e6..acd2814b1 100644 --- a/src/backend/app/Observers/AgentBalanceHistoryObserver.php +++ b/src/backend/app/Observers/AgentBalanceHistoryObserver.php @@ -14,7 +14,8 @@ class AgentBalanceHistoryObserver { public function __construct( private AgentService $agentService, - ) {} + ) { + } /** * Handle the asset person "updated" event. diff --git a/src/backend/app/Observers/AgentChargeObserver.php b/src/backend/app/Observers/AgentChargeObserver.php index d4274204f..fa9d39e67 100644 --- a/src/backend/app/Observers/AgentChargeObserver.php +++ b/src/backend/app/Observers/AgentChargeObserver.php @@ -13,7 +13,8 @@ public function __construct( private AgentChargeHistoryBalanceService $agentChargeHistoryBalanceService, private AgentBalanceHistoryService $agentBalanceHistoryService, private AgentService $agentService, - ) {} + ) { + } public function created(AgentCharge $agentCharge): void { diff --git a/src/backend/app/Observers/AgentObserver.php b/src/backend/app/Observers/AgentObserver.php index 157dfe6bc..d7f4d5b4f 100644 --- a/src/backend/app/Observers/AgentObserver.php +++ b/src/backend/app/Observers/AgentObserver.php @@ -8,7 +8,9 @@ class AgentObserver { - public function created(Agent $agent): void {} + public function created(Agent $agent): void + { + } public function updated(Agent $agent): void { diff --git a/src/backend/app/Observers/AgentReceiptObserver.php b/src/backend/app/Observers/AgentReceiptObserver.php index ae172038c..59c46f608 100644 --- a/src/backend/app/Observers/AgentReceiptObserver.php +++ b/src/backend/app/Observers/AgentReceiptObserver.php @@ -18,7 +18,8 @@ public function __construct( private AgentReceiptService $agentReceiptService, private AgentReceiptDetailService $agentReceiptDetailService, private AgentReceiptHistoryBalanceService $agentReceiptHistoryBalanceService, - ) {} + ) { + } public function created(AgentReceipt $receipt): void { diff --git a/src/backend/app/Observers/AgentSoldApplianceObserver.php b/src/backend/app/Observers/AgentSoldApplianceObserver.php index 41466c0d3..6da696d97 100644 --- a/src/backend/app/Observers/AgentSoldApplianceObserver.php +++ b/src/backend/app/Observers/AgentSoldApplianceObserver.php @@ -29,7 +29,8 @@ public function __construct( private AgentAssignedApplianceHistoryBalanceService $agentAssignedApplianceHistoryBalanceService, private AgentCommissionService $agentCommissionService, private AgentCommissionHistoryBalanceService $agentCommissionHistoryBalanceService, - ) {} + ) { + } public function created(AgentSoldAppliance $agentSoldAppliance): void { diff --git a/src/backend/app/Observers/MeterParameterObserver.php b/src/backend/app/Observers/MeterParameterObserver.php index 6cbecb5dd..5b4cf9f71 100644 --- a/src/backend/app/Observers/MeterParameterObserver.php +++ b/src/backend/app/Observers/MeterParameterObserver.php @@ -10,7 +10,9 @@ class MeterParameterObserver { - public function __construct(private MeterParameterService $meterParameterService) {} + public function __construct(private MeterParameterService $meterParameterService) + { + } /** * Handle "deleted" event. diff --git a/src/backend/app/PaymentHandler/AccessRate.php b/src/backend/app/PaymentHandler/AccessRate.php index 057194973..ede6b64e3 100644 --- a/src/backend/app/PaymentHandler/AccessRate.php +++ b/src/backend/app/PaymentHandler/AccessRate.php @@ -26,7 +26,9 @@ class AccessRate * * @param AccessRate $accessRate */ - public function __construct() {} + public function __construct() + { + } /** * @throws NoAccessRateFound @@ -36,7 +38,7 @@ public static function withMeterParameters(MeterParameter $meterParameter): Acce if ($meterParameter->tariffAccessRate() === null) { throw new NoAccessRateFound('Tariff '.$meterParameter->tariff()->first()->name.' has no access rate'); } - $accessRate = new self; + $accessRate = new self(); $accessRate->accessRate = $meterParameter->tariffAccessRate(); $accessRate->setMeterParameter($meterParameter); @@ -59,7 +61,7 @@ public function initializeAccessRatePayment(): AccessRatePayment // get current date and add AccessRate.period days $nextPaymentDate = Carbon::now()->addDays($this->accessRate->period)->toDateString(); // create accessRatePayment instance and fill with the variables - $accessRatePayment = new AccessRatePayment; + $accessRatePayment = new AccessRatePayment(); $accessRatePayment->accessRate()->associate($this->accessRate); $accessRatePayment->meter()->associate($this->meterParameter->meter()->first()); $accessRatePayment->due_date = $nextPaymentDate; @@ -88,7 +90,7 @@ private function getDebt(Meter $meter): int */ public static function payAccessRate(TransactionDataContainer $transactionData): TransactionDataContainer { - $nonStaticGateway = new self; + $nonStaticGateway = new self(); // get accessRatePayment $accessRatePayment = $nonStaticGateway->getAccessRatePayment($transactionData->meter); try { diff --git a/src/backend/app/PaymentHandler/EnergyPayment.php b/src/backend/app/PaymentHandler/EnergyPayment.php index de76192f4..bc17ecacd 100644 --- a/src/backend/app/PaymentHandler/EnergyPayment.php +++ b/src/backend/app/PaymentHandler/EnergyPayment.php @@ -2,4 +2,6 @@ namespace App\PaymentHandler; -class EnergyPayment {} +class EnergyPayment +{ +} diff --git a/src/backend/app/Providers/VodacomServiceProvider.php b/src/backend/app/Providers/VodacomServiceProvider.php index cdb64ebf1..32bee4568 100644 --- a/src/backend/app/Providers/VodacomServiceProvider.php +++ b/src/backend/app/Providers/VodacomServiceProvider.php @@ -13,12 +13,16 @@ class VodacomServiceProvider extends ServiceProvider * * @return void */ - public function boot() {} + public function boot() + { + } /** * Register services. * * @return void */ - public function register() {} + public function register() + { + } } diff --git a/src/backend/app/Relations/BelongsToMorph.php b/src/backend/app/Relations/BelongsToMorph.php index d1c8073d8..b87cbb6bb 100644 --- a/src/backend/app/Relations/BelongsToMorph.php +++ b/src/backend/app/Relations/BelongsToMorph.php @@ -104,7 +104,7 @@ public static function build( } $morphName = Arr::get(array_flip(Relation::morphMap()), $related, $related); [$type, $id] = self::getMorphs(Str::snake($name), $type, $id); - $instance = new $related; + $instance = new $related(); // Once we have the foreign key names, we'll just create a new Eloquent query // for the related models and returns the relationship instance which will // actually be responsible for retrieving and hydrating every relations. diff --git a/src/backend/app/Services/AbstractPaymentAggregatorTransactionService.php b/src/backend/app/Services/AbstractPaymentAggregatorTransactionService.php index 9f174c163..cb5b9f9b6 100644 --- a/src/backend/app/Services/AbstractPaymentAggregatorTransactionService.php +++ b/src/backend/app/Services/AbstractPaymentAggregatorTransactionService.php @@ -33,7 +33,8 @@ public function __construct( private Transaction $transaction, private MeterParameter $meterParameter, private IRawTransaction $paymentAggregatorTransaction, - ) {} + ) { + } public function validatePaymentOwner(string $meterSerialNumber, float $amount): void { diff --git a/src/backend/app/Services/AccessRatePaymentService.php b/src/backend/app/Services/AccessRatePaymentService.php index cd7a04ba8..395257da0 100644 --- a/src/backend/app/Services/AccessRatePaymentService.php +++ b/src/backend/app/Services/AccessRatePaymentService.php @@ -14,7 +14,8 @@ class AccessRatePaymentService implements IBaseService { public function __construct( private AccessRatePayment $accessRatePayment, - ) {} + ) { + } public function getById(int $id): AccessRatePayment { diff --git a/src/backend/app/Services/AccessRateService.php b/src/backend/app/Services/AccessRateService.php index fc796c5ec..a28e5bc55 100644 --- a/src/backend/app/Services/AccessRateService.php +++ b/src/backend/app/Services/AccessRateService.php @@ -13,7 +13,8 @@ class AccessRateService implements IBaseService { public function __construct( private AccessRate $accessRate, - ) {} + ) { + } public function getById(int $accessRateId): AccessRate { diff --git a/src/backend/app/Services/AddressesService.php b/src/backend/app/Services/AddressesService.php index 52aaabcba..b05a73de8 100644 --- a/src/backend/app/Services/AddressesService.php +++ b/src/backend/app/Services/AddressesService.php @@ -18,7 +18,8 @@ class AddressesService implements IAssociative, IBaseService { public function __construct( private Address $address, - ) {} + ) { + } // fills the object and returns it without saving. public function instantiate(array $params): Address diff --git a/src/backend/app/Services/AgentAssignedApplianceService.php b/src/backend/app/Services/AgentAssignedApplianceService.php index f2ae66afd..b5b4756ec 100644 --- a/src/backend/app/Services/AgentAssignedApplianceService.php +++ b/src/backend/app/Services/AgentAssignedApplianceService.php @@ -14,7 +14,8 @@ class AgentAssignedApplianceService implements IBaseService { public function __construct( private AgentAssignedAppliances $agentAssignedAppliance, - ) {} + ) { + } public function create(array $applianceData): AgentAssignedAppliances { diff --git a/src/backend/app/Services/AgentBalanceHistoryService.php b/src/backend/app/Services/AgentBalanceHistoryService.php index 8d3bed328..19a5c0bed 100644 --- a/src/backend/app/Services/AgentBalanceHistoryService.php +++ b/src/backend/app/Services/AgentBalanceHistoryService.php @@ -18,7 +18,8 @@ class AgentBalanceHistoryService implements IAssociative, IBaseService public function __construct( private AgentBalanceHistory $agentBalanceHistory, private PeriodService $periodService, - ) {} + ) { + } public function getAll(?int $limit = null, ?int $agentId = null): Collection|LengthAwarePaginator { @@ -102,7 +103,7 @@ public function getGraphValues($agent, $lastReceiptDate) $period[$history[0]->date]['balance'] = -1 * ($history[0]->due_to_supplier - $history[0]->amount); $period[$history[0]->date]['due'] = $history[0]->due_to_supplier - $history[0]->amount; } elseif (count($history) === 0) { - $date = new \DateTime; + $date = new \DateTime(); $key = $date->format('Y-m-d'); $period[$key] = [ 'balance' => 0, diff --git a/src/backend/app/Services/AgentChargeService.php b/src/backend/app/Services/AgentChargeService.php index 11a3823af..e05307ee8 100644 --- a/src/backend/app/Services/AgentChargeService.php +++ b/src/backend/app/Services/AgentChargeService.php @@ -13,7 +13,8 @@ class AgentChargeService implements IBaseService { public function __construct( private AgentCharge $agentCharge, - ) {} + ) { + } public function create(array $agentChargeData): AgentCharge { diff --git a/src/backend/app/Services/AgentCommissionService.php b/src/backend/app/Services/AgentCommissionService.php index b041ea685..9c1e5d1af 100644 --- a/src/backend/app/Services/AgentCommissionService.php +++ b/src/backend/app/Services/AgentCommissionService.php @@ -14,7 +14,8 @@ class AgentCommissionService implements IBaseService { public function __construct( private AgentCommission $agentCommission, - ) {} + ) { + } public function create(array $agentCommissiondata): AgentCommission { diff --git a/src/backend/app/Services/AgentCustomerService.php b/src/backend/app/Services/AgentCustomerService.php index 89d7da427..07c79211b 100644 --- a/src/backend/app/Services/AgentCustomerService.php +++ b/src/backend/app/Services/AgentCustomerService.php @@ -8,7 +8,9 @@ class AgentCustomerService { - public function __construct(private Agent $agent, private Person $person) {} + public function __construct(private Agent $agent, private Person $person) + { + } public function list(Agent $agent): LengthAwarePaginator { diff --git a/src/backend/app/Services/AgentCustomersPaymentHistoryService.php b/src/backend/app/Services/AgentCustomersPaymentHistoryService.php index 55cc4b9c4..6982f3169 100644 --- a/src/backend/app/Services/AgentCustomersPaymentHistoryService.php +++ b/src/backend/app/Services/AgentCustomersPaymentHistoryService.php @@ -9,7 +9,8 @@ class AgentCustomersPaymentHistoryService { public function __construct( private PaymentHistory $paymentHistory, - ) {} + ) { + } public function getPaymentFlowByCustomerId($period, $customerId, $limit, $order = 'ASC') { diff --git a/src/backend/app/Services/AgentReceiptDetailService.php b/src/backend/app/Services/AgentReceiptDetailService.php index d6d33a0cb..8612d91b4 100644 --- a/src/backend/app/Services/AgentReceiptDetailService.php +++ b/src/backend/app/Services/AgentReceiptDetailService.php @@ -13,7 +13,8 @@ class AgentReceiptDetailService implements IBaseService { public function __construct( private AgentReceiptDetail $agentReceiptDetail, - ) {} + ) { + } public function getSummary($agentId) { diff --git a/src/backend/app/Services/AgentReceiptService.php b/src/backend/app/Services/AgentReceiptService.php index f8d748c1f..1d86579c3 100644 --- a/src/backend/app/Services/AgentReceiptService.php +++ b/src/backend/app/Services/AgentReceiptService.php @@ -14,7 +14,8 @@ class AgentReceiptService implements IBaseService { public function __construct( private AgentReceipt $agentReceipt, - ) {} + ) { + } public function getAll(?int $limit = null, ?int $agentId = null): Collection|LengthAwarePaginator { diff --git a/src/backend/app/Services/AgentService.php b/src/backend/app/Services/AgentService.php index d70c51f95..67426c1c8 100644 --- a/src/backend/app/Services/AgentService.php +++ b/src/backend/app/Services/AgentService.php @@ -23,7 +23,8 @@ public function __construct( private AgentBalanceHistory $agentBalanceHistory, private PeriodService $periodService, private PersonService $personService, - ) {} + ) { + } public function resetPassword(string $email) { diff --git a/src/backend/app/Services/AgentSoldApplianceService.php b/src/backend/app/Services/AgentSoldApplianceService.php index d01fb83b5..12f5f0f5e 100644 --- a/src/backend/app/Services/AgentSoldApplianceService.php +++ b/src/backend/app/Services/AgentSoldApplianceService.php @@ -17,7 +17,8 @@ class AgentSoldApplianceService implements IBaseService public function __construct( private AgentSoldAppliance $agentSoldAppliance, private AssetPerson $assetPerson, - ) {} + ) { + } public function create($applianceData): AgentSoldAppliance { diff --git a/src/backend/app/Services/AgentTransactionService.php b/src/backend/app/Services/AgentTransactionService.php index c399815c8..4d308fcb2 100644 --- a/src/backend/app/Services/AgentTransactionService.php +++ b/src/backend/app/Services/AgentTransactionService.php @@ -18,7 +18,8 @@ public function __construct( private AgentTransaction $agentTransaction, private Transaction $transaction, private Device $device, - ) {} + ) { + } public function getAll( ?int $limit = null, diff --git a/src/backend/app/Services/AppliancePaymentService.php b/src/backend/app/Services/AppliancePaymentService.php index f763d0667..9eccca948 100644 --- a/src/backend/app/Services/AppliancePaymentService.php +++ b/src/backend/app/Services/AppliancePaymentService.php @@ -21,7 +21,8 @@ public function __construct( private MainSettings $mainSettings, private AppliancePersonService $appliancePersonService, private DeviceService $deviceService, - ) {} + ) { + } public function getPaymentForAppliance($request, $appliancePerson) { diff --git a/src/backend/app/Services/AppliancePersonService.php b/src/backend/app/Services/AppliancePersonService.php index a055f3d97..bb271d902 100644 --- a/src/backend/app/Services/AppliancePersonService.php +++ b/src/backend/app/Services/AppliancePersonService.php @@ -22,7 +22,8 @@ public function __construct( private MainSettings $mainSettings, private AssetPerson $assetPerson, private CashTransactionService $cashTransactionService, - ) {} + ) { + } public function make(array $data): AssetPerson { diff --git a/src/backend/app/Services/ApplianceRateService.php b/src/backend/app/Services/ApplianceRateService.php index 061e5f1cf..7f5fa6820 100644 --- a/src/backend/app/Services/ApplianceRateService.php +++ b/src/backend/app/Services/ApplianceRateService.php @@ -16,7 +16,8 @@ class ApplianceRateService public function __construct( private AssetRate $applianceRate, private MainSettings $mainSettings, - ) {} + ) { + } public function getCurrencyFromMainSettings(): string { diff --git a/src/backend/app/Services/AssetService.php b/src/backend/app/Services/AssetService.php index b791cced3..d4a4c71e1 100644 --- a/src/backend/app/Services/AssetService.php +++ b/src/backend/app/Services/AssetService.php @@ -6,7 +6,9 @@ class AssetService { - public function __construct(private Asset $asset) {} + public function __construct(private Asset $asset) + { + } public function getAssets($request) { diff --git a/src/backend/app/Services/CityService.php b/src/backend/app/Services/CityService.php index 74676a6b8..4690699ce 100644 --- a/src/backend/app/Services/CityService.php +++ b/src/backend/app/Services/CityService.php @@ -14,7 +14,8 @@ class CityService implements IBaseService { public function __construct( private City $city, - ) {} + ) { + } public function getCityIdsByMiniGridId($miniGridId): array { diff --git a/src/backend/app/Services/ClusterMeterService.php b/src/backend/app/Services/ClusterMeterService.php index b68aef756..6929a8091 100644 --- a/src/backend/app/Services/ClusterMeterService.php +++ b/src/backend/app/Services/ClusterMeterService.php @@ -7,7 +7,9 @@ class ClusterMeterService { - public function __construct(private Cluster $cluster, private Meter $meter) {} + public function __construct(private Cluster $cluster, private Meter $meter) + { + } public function getCountById($clusterId): int { diff --git a/src/backend/app/Services/ClusterMiniGridService.php b/src/backend/app/Services/ClusterMiniGridService.php index 6cf1eb84f..896357a6d 100644 --- a/src/backend/app/Services/ClusterMiniGridService.php +++ b/src/backend/app/Services/ClusterMiniGridService.php @@ -7,7 +7,9 @@ class ClusterMiniGridService { - public function __construct(private Cluster $cluster, private MiniGrid $miniGrid) {} + public function __construct(private Cluster $cluster, private MiniGrid $miniGrid) + { + } public function getClustersWithMiniGrids() { diff --git a/src/backend/app/Services/ClusterPopulationService.php b/src/backend/app/Services/ClusterPopulationService.php index 29f38b12e..b686b3a7a 100644 --- a/src/backend/app/Services/ClusterPopulationService.php +++ b/src/backend/app/Services/ClusterPopulationService.php @@ -7,7 +7,9 @@ class ClusterPopulationService { - public function __construct(private Person $person, private Cluster $cluster) {} + public function __construct(private Person $person, private Cluster $cluster) + { + } public function getById($clusterId, $onlyCustomers = true): int { diff --git a/src/backend/app/Services/ClusterRevenueService.php b/src/backend/app/Services/ClusterRevenueService.php index 10d6703ed..cd307aa65 100644 --- a/src/backend/app/Services/ClusterRevenueService.php +++ b/src/backend/app/Services/ClusterRevenueService.php @@ -14,7 +14,8 @@ public function __construct( private PeriodService $periodService, private Cluster $cluster, private Transaction $transaction, - ) {} + ) { + } public function getTransactionsForMonthlyPeriodById( $clusterId, @@ -311,7 +312,7 @@ public function getMiniGridBasedRevenueById( public function setDatesForRequest($startDate, $endDate): array { if (! $startDate) { - $start = new \DateTime; + $start = new \DateTime(); $start->setDate($start->format('Y'), $start->format('n'), 1); // Normalize the day to 1 $start->setTime(0, 0, 0); // Normalize time to midnight $start->sub(new \DateInterval('P12M')); diff --git a/src/backend/app/Services/ClusterService.php b/src/backend/app/Services/ClusterService.php index 3a82b748c..7288bbb2b 100644 --- a/src/backend/app/Services/ClusterService.php +++ b/src/backend/app/Services/ClusterService.php @@ -14,7 +14,8 @@ class ClusterService implements IBaseService { public function __construct( private Cluster $cluster, - ) {} + ) { + } protected function setClusterMeterCount(Cluster $cluster, int $meterCount) { @@ -97,7 +98,7 @@ public function update($model, array $data): Cluster { throw new \Exception('Method update() not yet implemented.'); - return new Cluster; + return new Cluster(); } public function delete($model): ?bool diff --git a/src/backend/app/Services/ClusterTransactionService.php b/src/backend/app/Services/ClusterTransactionService.php index 02387de4b..b64c1cfc0 100644 --- a/src/backend/app/Services/ClusterTransactionService.php +++ b/src/backend/app/Services/ClusterTransactionService.php @@ -7,7 +7,9 @@ class ClusterTransactionService { - public function __construct(private Cluster $cluster, private Transaction $transaction) {} + public function __construct(private Cluster $cluster, private Transaction $transaction) + { + } public function getById($clusterId, array $range) { diff --git a/src/backend/app/Services/CompanyDatabaseService.php b/src/backend/app/Services/CompanyDatabaseService.php index 32e5c1e32..fae0c3f1e 100644 --- a/src/backend/app/Services/CompanyDatabaseService.php +++ b/src/backend/app/Services/CompanyDatabaseService.php @@ -17,7 +17,8 @@ class CompanyDatabaseService implements IBaseService public function __construct( private CompanyDatabase $companyDatabase, private DatabaseProxyManagerService $databaseProxyManagerService, - ) {} + ) { + } public function getById(int $id): CompanyDatabase { diff --git a/src/backend/app/Services/CompanyService.php b/src/backend/app/Services/CompanyService.php index a6b7ece2e..5f978ca7e 100644 --- a/src/backend/app/Services/CompanyService.php +++ b/src/backend/app/Services/CompanyService.php @@ -13,7 +13,8 @@ class CompanyService implements IBaseService { public function __construct( private Company $company, - ) {} + ) { + } public function getByName($name): Company { diff --git a/src/backend/app/Services/ConnectionGroupService.php b/src/backend/app/Services/ConnectionGroupService.php index f5274e3ce..c29f1060e 100644 --- a/src/backend/app/Services/ConnectionGroupService.php +++ b/src/backend/app/Services/ConnectionGroupService.php @@ -13,7 +13,8 @@ { public function __construct( private ConnectionGroup $connectionGroup, - ) {} + ) { + } public function create(array $connectionGroupData): ConnectionGroup { diff --git a/src/backend/app/Services/ConnectionTypeService.php b/src/backend/app/Services/ConnectionTypeService.php index 2473ed677..f8c8bcd5f 100644 --- a/src/backend/app/Services/ConnectionTypeService.php +++ b/src/backend/app/Services/ConnectionTypeService.php @@ -16,7 +16,8 @@ class ConnectionTypeService implements IBaseService { public function __construct( private ConnectionType $connectionType, - ) {} + ) { + } public function getByIdWithMeterCountRelation($connectionTypeId): Model|Builder { diff --git a/src/backend/app/Services/CountryService.php b/src/backend/app/Services/CountryService.php index 41d62e6c0..7be1f06d1 100644 --- a/src/backend/app/Services/CountryService.php +++ b/src/backend/app/Services/CountryService.php @@ -13,7 +13,8 @@ class CountryService implements IBaseService { public function __construct( private Country $country, - ) {} + ) { + } public function getByCode(?string $countryCode) { diff --git a/src/backend/app/Services/DatabaseProxyService.php b/src/backend/app/Services/DatabaseProxyService.php index 3597d39d3..d0d6b558c 100644 --- a/src/backend/app/Services/DatabaseProxyService.php +++ b/src/backend/app/Services/DatabaseProxyService.php @@ -11,13 +11,15 @@ */ class DatabaseProxyService implements IBaseService { - public function __construct(private DatabaseProxy $databaseProxy) {} + public function __construct(private DatabaseProxy $databaseProxy) + { + } public function getById($id): DatabaseProxy { throw new \Exception('Method getById() not yet implemented.'); - return new DatabaseProxy; + return new DatabaseProxy(); } public function create(array $databaseProxyData): DatabaseProxy diff --git a/src/backend/app/Services/FirebaseService.php b/src/backend/app/Services/FirebaseService.php index dcf62670e..22ba42fec 100644 --- a/src/backend/app/Services/FirebaseService.php +++ b/src/backend/app/Services/FirebaseService.php @@ -11,7 +11,7 @@ class FirebaseService public function sendNotify($firebaseToken, $body): string { try { - $httpClient = new Client; + $httpClient = new Client(); $request = $httpClient->post( config()->get('services.sms.android.url'), [ diff --git a/src/backend/app/Services/GeographicalInformationService.php b/src/backend/app/Services/GeographicalInformationService.php index e9615ffdf..e9de7eab9 100644 --- a/src/backend/app/Services/GeographicalInformationService.php +++ b/src/backend/app/Services/GeographicalInformationService.php @@ -16,7 +16,8 @@ class GeographicalInformationService implements IAssociative, IBaseService { public function __construct( private GeographicalInformation $geographicalInformation, - ) {} + ) { + } // This function will be removed until devices feature migration is done public function changeOwnerWithAddress($meterParameter, $addressId) diff --git a/src/backend/app/Services/MainSettingsService.php b/src/backend/app/Services/MainSettingsService.php index 4132f4ee6..ed83749b0 100644 --- a/src/backend/app/Services/MainSettingsService.php +++ b/src/backend/app/Services/MainSettingsService.php @@ -15,20 +15,21 @@ class MainSettingsService implements IBaseService { public function __construct( private MainSettings $mainSettings, - ) {} + ) { + } public function getById(int $id): MainSettings { throw new \Exception('Method getById() not yet implemented.'); - return new MainSettings; + return new MainSettings(); } public function create(array $data): MainSettings { throw new \Exception('Method create() not yet implemented.'); - return new MainSettings; + return new MainSettings(); } public function update($mainSettings, $mainSettingsData): MainSettings diff --git a/src/backend/app/Services/MaintenanceUserService.php b/src/backend/app/Services/MaintenanceUserService.php index 0f30ca0e5..b2d4700a1 100644 --- a/src/backend/app/Services/MaintenanceUserService.php +++ b/src/backend/app/Services/MaintenanceUserService.php @@ -13,7 +13,8 @@ class MaintenanceUserService implements IBaseService { public function __construct( private MaintenanceUsers $maintenanceUser, - ) {} + ) { + } public function getMaintenanceUsersCount() { diff --git a/src/backend/app/Services/ManufacturerService.php b/src/backend/app/Services/ManufacturerService.php index 48fd11aef..3f936b697 100644 --- a/src/backend/app/Services/ManufacturerService.php +++ b/src/backend/app/Services/ManufacturerService.php @@ -15,7 +15,8 @@ class ManufacturerService implements IBaseService { public function __construct( private Manufacturer $manufacturer, - ) {} + ) { + } public function createManufacturerDataFromRequest(Request $request): array { diff --git a/src/backend/app/Services/MeterConsumptionService.php b/src/backend/app/Services/MeterConsumptionService.php index 25556febe..3605922d0 100644 --- a/src/backend/app/Services/MeterConsumptionService.php +++ b/src/backend/app/Services/MeterConsumptionService.php @@ -14,7 +14,8 @@ class MeterConsumptionService implements IBaseService { public function __construct( private MeterConsumption $meterConsumption, - ) {} + ) { + } public function getByMeter(Meter $meter, $start, $end): Collection|array { diff --git a/src/backend/app/Services/MeterGeographicalInformationService.php b/src/backend/app/Services/MeterGeographicalInformationService.php index a37f16f11..aa1c741db 100644 --- a/src/backend/app/Services/MeterGeographicalInformationService.php +++ b/src/backend/app/Services/MeterGeographicalInformationService.php @@ -10,7 +10,8 @@ class MeterGeographicalInformationService public function __construct( private GeographicalInformation $geographicalInformation, private Meter $meter, - ) {} + ) { + } public function updateGeographicalInformation(array $meters): array { diff --git a/src/backend/app/Services/MeterParameterService.php b/src/backend/app/Services/MeterParameterService.php index f3eb2eee3..a724be0c2 100644 --- a/src/backend/app/Services/MeterParameterService.php +++ b/src/backend/app/Services/MeterParameterService.php @@ -10,7 +10,8 @@ class MeterParameterService { public function __construct( private MeterParameter $meterParameter, - ) {} + ) { + } public function createMeterParameter( array $meterParameterData, diff --git a/src/backend/app/Services/MeterRevenueService.php b/src/backend/app/Services/MeterRevenueService.php index 692bb5486..bb1f3aad5 100644 --- a/src/backend/app/Services/MeterRevenueService.php +++ b/src/backend/app/Services/MeterRevenueService.php @@ -14,7 +14,8 @@ class MeterRevenueService public function __construct( private MeterToken $meterToken, private Transaction $transaction, - ) {} + ) { + } public function getBySerialNumber(string $serialNumber) { diff --git a/src/backend/app/Services/MeterService.php b/src/backend/app/Services/MeterService.php index d842405cc..6511d4631 100644 --- a/src/backend/app/Services/MeterService.php +++ b/src/backend/app/Services/MeterService.php @@ -14,7 +14,8 @@ class MeterService implements IBaseService { public function __construct( private Meter $meter, - ) {} + ) { + } public function getBySerialNumber($serialNumber) { diff --git a/src/backend/app/Services/MeterTariffMeterParameterService.php b/src/backend/app/Services/MeterTariffMeterParameterService.php index 40b3c6e1f..290645901 100644 --- a/src/backend/app/Services/MeterTariffMeterParameterService.php +++ b/src/backend/app/Services/MeterTariffMeterParameterService.php @@ -12,7 +12,8 @@ public function __construct( private MeterTariff $meterTariff, private MeterParameter $meterParameter, private Meter $meter, - ) {} + ) { + } public function getCountById($meterTariffId): array { diff --git a/src/backend/app/Services/MeterTariffService.php b/src/backend/app/Services/MeterTariffService.php index 2c07a8145..895cc2e20 100644 --- a/src/backend/app/Services/MeterTariffService.php +++ b/src/backend/app/Services/MeterTariffService.php @@ -14,7 +14,8 @@ class MeterTariffService implements IBaseService { public function __construct( private MeterTariff $meterTariff, - ) {} + ) { + } public function getById(int $meterTariffId): MeterTariff { diff --git a/src/backend/app/Services/MeterTypeMeterService.php b/src/backend/app/Services/MeterTypeMeterService.php index 49dc3dccf..bcc35a1ed 100644 --- a/src/backend/app/Services/MeterTypeMeterService.php +++ b/src/backend/app/Services/MeterTypeMeterService.php @@ -6,7 +6,9 @@ class MeterTypeMeterService { - public function __construct(private MeterType $meterType) {} + public function __construct(private MeterType $meterType) + { + } public function getByIdWithMeters($meterTypeId) { diff --git a/src/backend/app/Services/MeterTypeService.php b/src/backend/app/Services/MeterTypeService.php index bff37bf0d..8fc62632b 100644 --- a/src/backend/app/Services/MeterTypeService.php +++ b/src/backend/app/Services/MeterTypeService.php @@ -12,7 +12,9 @@ */ class MeterTypeService implements IBaseService { - public function __construct(private MeterType $meterType) {} + public function __construct(private MeterType $meterType) + { + } public function create(array $meterTypeData): MeterType { diff --git a/src/backend/app/Services/MiniGridEnergyService.php b/src/backend/app/Services/MiniGridEnergyService.php index d632d5136..c8f756a32 100644 --- a/src/backend/app/Services/MiniGridEnergyService.php +++ b/src/backend/app/Services/MiniGridEnergyService.php @@ -9,7 +9,9 @@ class MiniGridEnergyService { - public function __construct(private MiniGrid $miniGrid, private Energy $energy) {} + public function __construct(private MiniGrid $miniGrid, private Energy $energy) + { + } public function getById($miniGridId, $startDate, $endDate): Collection|array { diff --git a/src/backend/app/Services/MiniGridRevenueService.php b/src/backend/app/Services/MiniGridRevenueService.php index 74be6b79a..12153cec8 100644 --- a/src/backend/app/Services/MiniGridRevenueService.php +++ b/src/backend/app/Services/MiniGridRevenueService.php @@ -11,7 +11,8 @@ class MiniGridRevenueService public function __construct( private Transaction $transaction, private MeterToken $meterToken, - ) {} + ) { + } public function getById($miniGridId, $startDate, $endDate, $miniGridDeviceService) { diff --git a/src/backend/app/Services/MiniGridService.php b/src/backend/app/Services/MiniGridService.php index 114ed077c..c9f9f1aa8 100644 --- a/src/backend/app/Services/MiniGridService.php +++ b/src/backend/app/Services/MiniGridService.php @@ -16,7 +16,8 @@ class MiniGridService implements IBaseService public function __construct( private MiniGrid $miniGrid, private Cluster $cluster, - ) {} + ) { + } public function getByIdWithLocation($miniGridId) { diff --git a/src/backend/app/Services/MpmPluginService.php b/src/backend/app/Services/MpmPluginService.php index c5f9cfe98..78b9c5e53 100644 --- a/src/backend/app/Services/MpmPluginService.php +++ b/src/backend/app/Services/MpmPluginService.php @@ -14,7 +14,8 @@ class MpmPluginService implements IBaseService { public function __construct( private MpmPlugin $mpmPlugin, - ) {} + ) { + } public function getById($id): MpmPlugin { diff --git a/src/backend/app/Services/PaymentHistoryService.php b/src/backend/app/Services/PaymentHistoryService.php index c85fec556..63896d00e 100644 --- a/src/backend/app/Services/PaymentHistoryService.php +++ b/src/backend/app/Services/PaymentHistoryService.php @@ -16,7 +16,8 @@ class PaymentHistoryService implements IAssociative { public function __construct( private PaymentHistory $paymentHistory, - ) {} + ) { + } public function findPayingCustomersInRange( array $customerIds, diff --git a/src/backend/app/Services/PersonMeterService.php b/src/backend/app/Services/PersonMeterService.php index a54e13128..f9d3ddffb 100644 --- a/src/backend/app/Services/PersonMeterService.php +++ b/src/backend/app/Services/PersonMeterService.php @@ -10,7 +10,8 @@ class PersonMeterService public function __construct( private Person $person, private Meter $meter, - ) {} + ) { + } public function getPersonMeters(int $personId) { diff --git a/src/backend/app/Services/PersonService.php b/src/backend/app/Services/PersonService.php index c7c70ec30..cac29a6b5 100644 --- a/src/backend/app/Services/PersonService.php +++ b/src/backend/app/Services/PersonService.php @@ -19,7 +19,8 @@ class PersonService implements IBaseService { public function __construct( private Person $person, - ) {} + ) { + } public function getAllRegisteredPeople(): Collection|array { diff --git a/src/backend/app/Services/PluginsService.php b/src/backend/app/Services/PluginsService.php index 014da24d9..6ecde7a27 100644 --- a/src/backend/app/Services/PluginsService.php +++ b/src/backend/app/Services/PluginsService.php @@ -10,7 +10,8 @@ class PluginsService { public function __construct( private Plugins $plugin, - ) {} + ) { + } public function create(array $pluginData): Plugins { diff --git a/src/backend/app/Services/RegistrationTailService.php b/src/backend/app/Services/RegistrationTailService.php index 53e2ce64f..dcfa68ca1 100644 --- a/src/backend/app/Services/RegistrationTailService.php +++ b/src/backend/app/Services/RegistrationTailService.php @@ -15,7 +15,8 @@ class RegistrationTailService implements IBaseService { public function __construct( private RegistrationTail $registrationTail, - ) {} + ) { + } public function getById(int $id): RegistrationTail { diff --git a/src/backend/app/Services/RestrictionService.php b/src/backend/app/Services/RestrictionService.php index 97def9e89..f9a3220d7 100644 --- a/src/backend/app/Services/RestrictionService.php +++ b/src/backend/app/Services/RestrictionService.php @@ -13,7 +13,8 @@ class RestrictionService implements IBaseService { public function __construct( private Restriction $restriction, - ) {} + ) { + } public function getRestrictionForTarget($target) { diff --git a/src/backend/app/Services/SmsApplianceRemindRateService.php b/src/backend/app/Services/SmsApplianceRemindRateService.php index 878736929..9abc32fe9 100644 --- a/src/backend/app/Services/SmsApplianceRemindRateService.php +++ b/src/backend/app/Services/SmsApplianceRemindRateService.php @@ -11,7 +11,8 @@ class SmsApplianceRemindRateService public function __construct( private SmsApplianceRemindRate $smsApplianceRemindRate, private Asset $appliance, - ) {} + ) { + } public function getApplianceRemindRatesWithAppliances(): Collection { diff --git a/src/backend/app/Services/SmsService.php b/src/backend/app/Services/SmsService.php index a6ea5b582..42d04534f 100644 --- a/src/backend/app/Services/SmsService.php +++ b/src/backend/app/Services/SmsService.php @@ -24,7 +24,8 @@ class SmsService public function __construct( private Sms $sms, - ) {} + ) { + } public function checkMessageType($message) { diff --git a/src/backend/app/Services/SocialTariffService.php b/src/backend/app/Services/SocialTariffService.php index c9cb8c0a5..08b08122d 100644 --- a/src/backend/app/Services/SocialTariffService.php +++ b/src/backend/app/Services/SocialTariffService.php @@ -13,7 +13,8 @@ class SocialTariffService implements IBaseService { public function __construct( private SocialTariff $socialTariff, - ) {} + ) { + } public function create(array $socialTariffData): SocialTariff { diff --git a/src/backend/app/Services/SubConnectionTypeService.php b/src/backend/app/Services/SubConnectionTypeService.php index b756d1479..04cdd9e98 100644 --- a/src/backend/app/Services/SubConnectionTypeService.php +++ b/src/backend/app/Services/SubConnectionTypeService.php @@ -14,7 +14,8 @@ class SubConnectionTypeService implements IBaseService { public function __construct( private SubConnectionType $subConnectionType, - ) {} + ) { + } public function getSubConnectionTypesByConnectionTypeId($connectionTypeId, $limit = null): LengthAwarePaginator|Collection { diff --git a/src/backend/app/Services/SubTargetService.php b/src/backend/app/Services/SubTargetService.php index b174418fb..8177906a2 100644 --- a/src/backend/app/Services/SubTargetService.php +++ b/src/backend/app/Services/SubTargetService.php @@ -13,13 +13,14 @@ class SubTargetService implements IBaseService { public function __construct( private SubTarget $subTarget, - ) {} + ) { + } public function getById(int $id): SubTarget { throw new \Exception('Method getById() not yet implemented.'); - return new SubTarget; + return new SubTarget(); } public function create(array $subTargetData): SubTarget @@ -45,7 +46,7 @@ public function update($model, array $data): SubTarget { throw new \Exception('Method update() not yet implemented.'); - return new SubTarget; + return new SubTarget(); } public function delete($model): ?bool diff --git a/src/backend/app/Services/TargetService.php b/src/backend/app/Services/TargetService.php index c178d8b2e..9cd956c9c 100644 --- a/src/backend/app/Services/TargetService.php +++ b/src/backend/app/Services/TargetService.php @@ -12,7 +12,9 @@ class TargetService { - public function __construct(private Target $target) {} + public function __construct(private Target $target) + { + } public function getById($targetId): Target { diff --git a/src/backend/app/Services/TariffPricingComponentService.php b/src/backend/app/Services/TariffPricingComponentService.php index a774fab3d..0f42ea050 100644 --- a/src/backend/app/Services/TariffPricingComponentService.php +++ b/src/backend/app/Services/TariffPricingComponentService.php @@ -13,7 +13,8 @@ class TariffPricingComponentService implements IBaseService { public function __construct( private TariffPricingComponent $tariffPricingComponent, - ) {} + ) { + } public function make($tariffPricingComponentData) { diff --git a/src/backend/app/Services/TicketSettingsService.php b/src/backend/app/Services/TicketSettingsService.php index 473249021..5bea79434 100644 --- a/src/backend/app/Services/TicketSettingsService.php +++ b/src/backend/app/Services/TicketSettingsService.php @@ -12,7 +12,8 @@ class TicketSettingsService implements ISettingsService { public function __construct( private TicketSettings $ticketSettings, - ) {} + ) { + } public function update($ticketSettings, array $ticketSettingsData): TicketSettings { diff --git a/src/backend/app/Services/TimeOfUsageService.php b/src/backend/app/Services/TimeOfUsageService.php index d03a771f7..348b267c2 100644 --- a/src/backend/app/Services/TimeOfUsageService.php +++ b/src/backend/app/Services/TimeOfUsageService.php @@ -13,7 +13,8 @@ class TimeOfUsageService implements IBaseService { public function __construct( private TimeOfUsage $timeOfUsage, - ) {} + ) { + } public function create(array $timeOfUsageData): TimeOfUsage { diff --git a/src/backend/app/Services/TokenService.php b/src/backend/app/Services/TokenService.php index 03e34fcdd..c71b6485e 100644 --- a/src/backend/app/Services/TokenService.php +++ b/src/backend/app/Services/TokenService.php @@ -14,7 +14,8 @@ class TokenService implements IBaseService { public function __construct( private Token $token, - ) {} + ) { + } public function getById(int $id): Token { @@ -30,7 +31,7 @@ public function update($model, array $data): Token { throw new \Exception('Method update() not yet implemented.'); - return new Token; + return new Token(); } public function delete($model): ?bool diff --git a/src/backend/app/Services/UsageTypeService.php b/src/backend/app/Services/UsageTypeService.php index b6a2b631e..ff76287af 100644 --- a/src/backend/app/Services/UsageTypeService.php +++ b/src/backend/app/Services/UsageTypeService.php @@ -14,7 +14,8 @@ class UsageTypeService implements IBaseService { public function __construct( private UsageType $usageType, - ) {} + ) { + } public function getAll(?int $limit = null): Collection|LengthAwarePaginator { @@ -25,21 +26,21 @@ public function getById(int $id): UsageType { throw new \Exception('Method getById() not yet implemented.'); - return new UsageType; + return new UsageType(); } public function create(array $data): UsageType { throw new \Exception('Method create() not yet implemented.'); - return new UsageType; + return new UsageType(); } public function update($model, array $data): UsageType { throw new \Exception('Method update() not yet implemented.'); - return new UsageType; + return new UsageType(); } public function delete($model): ?bool diff --git a/src/backend/app/Services/UserService.php b/src/backend/app/Services/UserService.php index 47c5890f4..8d0f6ef96 100644 --- a/src/backend/app/Services/UserService.php +++ b/src/backend/app/Services/UserService.php @@ -13,7 +13,9 @@ class UserService { - public function __construct(private User $user, private MailHelperInterface $mailHelper) {} + public function __construct(private User $user, private MailHelperInterface $mailHelper) + { + } public function create(array $userData, ?int $companyId = null): User { diff --git a/src/backend/app/Sms/Senders/SmsConfigs.php b/src/backend/app/Sms/Senders/SmsConfigs.php index f6065199a..5d4993ac3 100644 --- a/src/backend/app/Sms/Senders/SmsConfigs.php +++ b/src/backend/app/Sms/Senders/SmsConfigs.php @@ -2,4 +2,6 @@ namespace App\Sms\Senders; -class SmsConfigs extends SmsConfigsCore {} +class SmsConfigs extends SmsConfigsCore +{ +} diff --git a/src/backend/app/Sms/Senders/SmsSender.php b/src/backend/app/Sms/Senders/SmsSender.php index 8a80a2717..ff5072360 100644 --- a/src/backend/app/Sms/Senders/SmsSender.php +++ b/src/backend/app/Sms/Senders/SmsSender.php @@ -148,7 +148,7 @@ public function validateReferences() $this->prepareFooter(); } } catch (MissingSmsReferencesException $exception) { - throw new $exception; + throw new $exception(); } } diff --git a/src/backend/app/Utils/ApplianceInstallmentPayer.php b/src/backend/app/Utils/ApplianceInstallmentPayer.php index f3d1bae46..156be8fa3 100644 --- a/src/backend/app/Utils/ApplianceInstallmentPayer.php +++ b/src/backend/app/Utils/ApplianceInstallmentPayer.php @@ -30,7 +30,8 @@ public function __construct( private ApplianceRateService $applianceRateService, private AppliancePaymentService $appliancePaymentService, private DeviceService $deviceService, - ) {} + ) { + } public function initialize(TransactionDataContainer $transactionData): void { diff --git a/src/backend/app/Utils/TariffPriceCalculator.php b/src/backend/app/Utils/TariffPriceCalculator.php index 4b6e51efb..b524281ef 100644 --- a/src/backend/app/Utils/TariffPriceCalculator.php +++ b/src/backend/app/Utils/TariffPriceCalculator.php @@ -16,7 +16,8 @@ public function __construct( private SocialTariffService $socialTariffService, private TimeOfUsageService $timeOfUsageService, private TariffPricingComponentService $tariffPricingComponentService, - ) {} + ) { + } public function calculateTotalPrice( MeterTariff $meterTariff, diff --git a/src/backend/app/modules/Apps/CustomerRegistration/CustomerRegistrationAppService.php b/src/backend/app/modules/Apps/CustomerRegistration/CustomerRegistrationAppService.php index 2ab82a083..267370fdb 100644 --- a/src/backend/app/modules/Apps/CustomerRegistration/CustomerRegistrationAppService.php +++ b/src/backend/app/modules/Apps/CustomerRegistration/CustomerRegistrationAppService.php @@ -24,7 +24,8 @@ public function __construct( private DeviceAddressService $deviceAddressService, private GeographicalInformationService $geographicalInformationService, private AddressGeographicalInformationService $addressGeographicalInformationService, - ) {} + ) { + } public function createCustomer(AndroidAppRequest $request): Person { diff --git a/src/backend/app/modules/CustomBulkRegistration/Ecosys/CustomerDatabaseParser.php b/src/backend/app/modules/CustomBulkRegistration/Ecosys/CustomerDatabaseParser.php index 8c903d44a..ce68f6965 100644 --- a/src/backend/app/modules/CustomBulkRegistration/Ecosys/CustomerDatabaseParser.php +++ b/src/backend/app/modules/CustomBulkRegistration/Ecosys/CustomerDatabaseParser.php @@ -106,7 +106,7 @@ public function insertFromCsv() $row['meter_parameter_id'] = $meterParameter->id; $this->createRecordFromCsv($row, GeographicalInformationService::class); - $meterAddress = new Address; + $meterAddress = new Address(); $address = $meterAddress->newQuery()->create([ 'city_id' => $city->id, ]); diff --git a/src/backend/app/modules/DatabaseProxy/DatabaseProxyManagerService.php b/src/backend/app/modules/DatabaseProxy/DatabaseProxyManagerService.php index 5f979d5d3..742bfd7f5 100644 --- a/src/backend/app/modules/DatabaseProxy/DatabaseProxyManagerService.php +++ b/src/backend/app/modules/DatabaseProxy/DatabaseProxyManagerService.php @@ -16,7 +16,8 @@ public function __construct( private DatabaseProxy $databaseProxy, private DatabaseManager $databaseManager, private CompanyDatabase $companyDatabase, - ) {} + ) { + } public function findByEmail(string $email): DatabaseProxy { diff --git a/src/backend/app/modules/Device/ClusterDeviceService.php b/src/backend/app/modules/Device/ClusterDeviceService.php index 7e2a88a3a..70ccbdc6d 100644 --- a/src/backend/app/modules/Device/ClusterDeviceService.php +++ b/src/backend/app/modules/Device/ClusterDeviceService.php @@ -8,7 +8,9 @@ class ClusterDeviceService { - public function __construct(private Cluster $cluster, private Device $device) {} + public function __construct(private Cluster $cluster, private Device $device) + { + } public function getCountByClusterId($clusterId): int { diff --git a/src/backend/app/modules/Device/DeviceService.php b/src/backend/app/modules/Device/DeviceService.php index 8ab691dc2..a5f7debd8 100644 --- a/src/backend/app/modules/Device/DeviceService.php +++ b/src/backend/app/modules/Device/DeviceService.php @@ -16,7 +16,8 @@ class DeviceService implements IAssociative, IBaseService { public function __construct( private Device $device, - ) {} + ) { + } public function make($deviceData): Device { @@ -47,14 +48,14 @@ public function getById(int $id): Device { throw new \Exception('Method getById() not yet implemented.'); - return new Device; + return new Device(); } public function create(array $data): Device { throw new \Exception('Method create() not yet implemented.'); - return new Device; + return new Device(); } public function update($device, array $deviceData): Device diff --git a/src/backend/app/modules/Device/MiniGridDeviceService.php b/src/backend/app/modules/Device/MiniGridDeviceService.php index 8dbcb8af5..7bb80f7ad 100644 --- a/src/backend/app/modules/Device/MiniGridDeviceService.php +++ b/src/backend/app/modules/Device/MiniGridDeviceService.php @@ -9,7 +9,9 @@ class MiniGridDeviceService { - public function __construct(private Device $device, private MiniGrid $miniGrid) {} + public function __construct(private Device $device, private MiniGrid $miniGrid) + { + } public function getMetersByMiniGridId($miniGridId) { diff --git a/src/backend/app/modules/EBike/EBikeService.php b/src/backend/app/modules/EBike/EBikeService.php index f31b3fbab..386017449 100644 --- a/src/backend/app/modules/EBike/EBikeService.php +++ b/src/backend/app/modules/EBike/EBikeService.php @@ -14,7 +14,8 @@ class EBikeService implements IBaseService { public function __construct( private EBike $eBike, - ) {} + ) { + } public function getAll(?int $limit = null): Collection|LengthAwarePaginator { diff --git a/src/backend/app/modules/OutstandingDebts/OutstandingDebtsExportService.php b/src/backend/app/modules/OutstandingDebts/OutstandingDebtsExportService.php index b7d6f3ce8..61ffe009c 100644 --- a/src/backend/app/modules/OutstandingDebts/OutstandingDebtsExportService.php +++ b/src/backend/app/modules/OutstandingDebts/OutstandingDebtsExportService.php @@ -17,7 +17,8 @@ public function __construct( private ApplianceRateService $applianceService, private ApplianceRateService $applianceRateService, private MailHelper $mailHelper, - ) {} + ) { + } private Collection $outstandingDebtsData; diff --git a/src/backend/app/modules/Sharding/ApiCompanyResolverService.php b/src/backend/app/modules/Sharding/ApiCompanyResolverService.php index e37731973..de17e7e3d 100644 --- a/src/backend/app/modules/Sharding/ApiCompanyResolverService.php +++ b/src/backend/app/modules/Sharding/ApiCompanyResolverService.php @@ -12,7 +12,9 @@ class ApiCompanyResolverService { - public function __construct(private ApiResolverMap $apiResolverMap) {} + public function __construct(private ApiResolverMap $apiResolverMap) + { + } public function resolve(Request $request): int { diff --git a/src/backend/app/modules/Sharding/ApiResolvers/DataExportResolver.php b/src/backend/app/modules/Sharding/ApiResolvers/DataExportResolver.php index c434dab90..d9018b46d 100644 --- a/src/backend/app/modules/Sharding/ApiResolvers/DataExportResolver.php +++ b/src/backend/app/modules/Sharding/ApiResolvers/DataExportResolver.php @@ -8,7 +8,9 @@ class DataExportResolver implements ApiResolverInterface { - public function __construct(private DatabaseProxyManagerService $databaseProxyManager) {} + public function __construct(private DatabaseProxyManagerService $databaseProxyManager) + { + } public function resolveCompanyId(Request $request): int { diff --git a/src/backend/app/modules/SolarHomeSystem/SolarHomeSystemService.php b/src/backend/app/modules/SolarHomeSystem/SolarHomeSystemService.php index 24cf18842..b9b9c8c9a 100644 --- a/src/backend/app/modules/SolarHomeSystem/SolarHomeSystemService.php +++ b/src/backend/app/modules/SolarHomeSystem/SolarHomeSystemService.php @@ -12,7 +12,9 @@ */ class SolarHomeSystemService implements IBaseService { - public function __construct(private SolarHomeSystem $solarHomeSystem) {} + public function __construct(private SolarHomeSystem $solarHomeSystem) + { + } public function getAll(?int $limit = null): Collection|LengthAwarePaginator { diff --git a/src/backend/app/modules/Target/TargetAssignable.php b/src/backend/app/modules/Target/TargetAssignable.php index c09a05565..3bdd14d62 100644 --- a/src/backend/app/modules/Target/TargetAssignable.php +++ b/src/backend/app/modules/Target/TargetAssignable.php @@ -2,4 +2,6 @@ namespace MPM\Target; -interface TargetAssignable {} +interface TargetAssignable +{ +} diff --git a/src/backend/app/modules/Transaction/ApplianceTransactionService.php b/src/backend/app/modules/Transaction/ApplianceTransactionService.php index 47a9a38ce..d8e6cbe78 100644 --- a/src/backend/app/modules/Transaction/ApplianceTransactionService.php +++ b/src/backend/app/modules/Transaction/ApplianceTransactionService.php @@ -2,4 +2,6 @@ namespace MPM\Transaction; -class ApplianceTransactionService {} +class ApplianceTransactionService +{ +} diff --git a/src/backend/app/modules/Transaction/EBikeTransactionService.php b/src/backend/app/modules/Transaction/EBikeTransactionService.php index e9d6c4f4d..d2bf4123b 100644 --- a/src/backend/app/modules/Transaction/EBikeTransactionService.php +++ b/src/backend/app/modules/Transaction/EBikeTransactionService.php @@ -7,7 +7,9 @@ class EBikeTransactionService { - public function __construct(private Transaction $transaction) {} + public function __construct(private Transaction $transaction) + { + } public function search( ?string $serialNumber = null, diff --git a/src/backend/app/modules/Transaction/MeterTransactionService.php b/src/backend/app/modules/Transaction/MeterTransactionService.php index b8ac8c2df..b72071e1a 100644 --- a/src/backend/app/modules/Transaction/MeterTransactionService.php +++ b/src/backend/app/modules/Transaction/MeterTransactionService.php @@ -7,7 +7,9 @@ class MeterTransactionService { - public function __construct(private Transaction $transaction) {} + public function __construct(private Transaction $transaction) + { + } public function search( ?string $serialNumber = null, diff --git a/src/backend/app/modules/Transaction/Provider/AgentTransactionProvider.php b/src/backend/app/modules/Transaction/Provider/AgentTransactionProvider.php index 7cb63098b..d55f86afb 100644 --- a/src/backend/app/modules/Transaction/Provider/AgentTransactionProvider.php +++ b/src/backend/app/modules/Transaction/Provider/AgentTransactionProvider.php @@ -20,12 +20,13 @@ public function __construct( private AgentTransactionModel $agentTransaction, private Transaction $transaction, private FirebaseService $fireBaseService, - ) {} + ) { + } public function saveTransaction(): void { - $this->agentTransaction = new AgentTransactionModel; - $this->transaction = new Transaction; + $this->agentTransaction = new AgentTransactionModel(); + $this->transaction = new Transaction(); // assign data $this->assignData($this->validData); // save transaction @@ -183,7 +184,7 @@ public function init($transaction): void public function addConflict(?string $message): void { - $conflict = new TransactionConflicts; + $conflict = new TransactionConflicts(); $conflict->state = $message; $conflict->transaction()->associate($this->agentTransaction); $conflict->save(); diff --git a/src/backend/app/modules/Transaction/Provider/AirtelTransactionProvider.php b/src/backend/app/modules/Transaction/Provider/AirtelTransactionProvider.php index 348aa7c2e..02e5022be 100644 --- a/src/backend/app/modules/Transaction/Provider/AirtelTransactionProvider.php +++ b/src/backend/app/modules/Transaction/Provider/AirtelTransactionProvider.php @@ -17,12 +17,14 @@ class AirtelTransactionProvider implements ITransactionProvider { private \SimpleXMLElement $validData; - public function __construct(private AirtelTransaction $airtelTransaction, private Transaction $transaction) {} + public function __construct(private AirtelTransaction $airtelTransaction, private Transaction $transaction) + { + } public function saveTransaction(): void { - $this->airtelTransaction = new AirtelTransaction; - $this->transaction = new Transaction; + $this->airtelTransaction = new AirtelTransaction(); + $this->transaction = new Transaction(); // assign data $this->assignData($this->validData); @@ -42,7 +44,7 @@ public function sendResult(bool $requestType, Transaction $transaction): void } else { // send cancellation to airtel gateway server and this will send the final request to airtel $requestContent = $this->prepareRequest($this->transaction, $this->airtelTransaction); - $client = new Client; + $client = new Client(); $response = $client->post( config('services.airtel.request_url'), [ @@ -160,7 +162,7 @@ public function saveData(AirtelTransaction $airtelTransaction): void public function addConflict(?string $message): void { - $conflict = new TransactionConflicts; + $conflict = new TransactionConflicts(); $conflict->state = $message; $conflict->transaction()->associate($this->airtelTransaction); $conflict->save(); diff --git a/src/backend/app/modules/Transaction/Provider/AirtelVoltTerraProvider.php b/src/backend/app/modules/Transaction/Provider/AirtelVoltTerraProvider.php index a0f5d0780..2527a5005 100644 --- a/src/backend/app/modules/Transaction/Provider/AirtelVoltTerraProvider.php +++ b/src/backend/app/modules/Transaction/Provider/AirtelVoltTerraProvider.php @@ -26,12 +26,13 @@ class AirtelVoltTerraProvider implements ITransactionProvider public function __construct( private AirtelTransaction $airtelTransaction, private Transaction $transaction, - ) {} + ) { + } public function saveTransaction(): void { - $this->airtelTransaction = new AirtelTransaction; - $this->transaction = new Transaction; + $this->airtelTransaction = new AirtelTransaction(); + $this->transaction = new Transaction(); // assign data $this->assignData(); @@ -73,7 +74,7 @@ public function validateRequest($request): bool throw new \Exception($validator->errors()->first()); } - $meterModel = new Meter; + $meterModel = new Meter(); if (! $meter = $meterModel->findBySerialNumber($meterSerial)) { throw new ModelNotFoundException('Meter not found with serial number you entered'); @@ -164,7 +165,7 @@ public function saveCommonData(): Model public function addConflict(?string $message): void { - $conflict = new TransactionConflicts; + $conflict = new TransactionConflicts(); $conflict->state = $message; $conflict->transaction()->associate($this->airtelTransaction); $conflict->save(); diff --git a/src/backend/app/modules/Transaction/Provider/CashTransactionProvider.php b/src/backend/app/modules/Transaction/Provider/CashTransactionProvider.php index 373a544d8..318ac09a4 100644 --- a/src/backend/app/modules/Transaction/Provider/CashTransactionProvider.php +++ b/src/backend/app/modules/Transaction/Provider/CashTransactionProvider.php @@ -14,12 +14,13 @@ class CashTransactionProvider implements ITransactionProvider public function __construct( private CashTransaction $cashTransaction, private Transaction $transaction, - ) {} + ) { + } public function saveTransaction(): void { - $this->cashTransaction = new CashTransaction; - $this->transaction = new Transaction; + $this->cashTransaction = new CashTransaction(); + $this->transaction = new Transaction(); // assign data $this->assignData($this->validData); @@ -88,7 +89,7 @@ public function init($transaction): void public function addConflict(?string $message): void { - $conflict = new TransactionConflicts; + $conflict = new TransactionConflicts(); $conflict->state = $message; $conflict->transaction()->associate($this->cashTransaction); $conflict->save(); diff --git a/src/backend/app/modules/Transaction/Provider/VodacomTransactionProvider.php b/src/backend/app/modules/Transaction/Provider/VodacomTransactionProvider.php index 25fe9064b..223007895 100644 --- a/src/backend/app/modules/Transaction/Provider/VodacomTransactionProvider.php +++ b/src/backend/app/modules/Transaction/Provider/VodacomTransactionProvider.php @@ -29,9 +29,9 @@ class VodacomTransactionProvider implements ITransactionProvider public function saveTransaction(): void { // initializes needed model - $this->vodacomTransaction = new VodacomTransaction; + $this->vodacomTransaction = new VodacomTransaction(); - $this->transaction = new Transaction; + $this->transaction = new Transaction(); // assign data $this->assignData($this->valid_data); @@ -49,7 +49,7 @@ public function sendResult(bool $requestType, Transaction $transaction): void } $requestContent = $this->prepareRequest($requestType); - $request = new Client; + $request = new Client(); try { $response = $request->post( @@ -347,7 +347,7 @@ public function init($transaction): void public function addConflict(?string $message): void { - $conflict = new TransactionConflicts; + $conflict = new TransactionConflicts(); $conflict->state = $message; $conflict->transaction()->associate($this->vodacomTransaction); $conflict->save(); diff --git a/src/backend/app/modules/Transaction/SolarHomeSystemTransactionService.php b/src/backend/app/modules/Transaction/SolarHomeSystemTransactionService.php index 4d27b2493..14f01472f 100644 --- a/src/backend/app/modules/Transaction/SolarHomeSystemTransactionService.php +++ b/src/backend/app/modules/Transaction/SolarHomeSystemTransactionService.php @@ -7,7 +7,9 @@ class SolarHomeSystemTransactionService { - public function __construct(private Transaction $transaction) {} + public function __construct(private Transaction $transaction) + { + } public function search( ?string $serialNumber = null, diff --git a/src/backend/app/modules/Transaction/TransactionService.php b/src/backend/app/modules/Transaction/TransactionService.php index 95d72e253..73ab67246 100644 --- a/src/backend/app/modules/Transaction/TransactionService.php +++ b/src/backend/app/modules/Transaction/TransactionService.php @@ -33,7 +33,8 @@ public function __construct( private SolarHomeSystemTransactionService $solarHomeSystemTransactionService, private ApplianceTransactionService $applianceTransactionService, private EBikeTransactionService $eBikeTransactionService, - ) {} + ) { + } private function getTotalAmountOfConfirmedTransaction($transactionIds) { @@ -96,12 +97,12 @@ public function determinePeriod($period): ?array $duration = new \DateInterval('P1D'); $comparisonPeriod = [ 'currentPeriod' => [ - 'begins' => (new \DateTime)->format('Y-m-d 00:00:00'), - 'ends' => (new \DateTime)->format('Y-m-d 23:59:59'), + 'begins' => (new \DateTime())->format('Y-m-d 00:00:00'), + 'ends' => (new \DateTime())->format('Y-m-d 23:59:59'), ], 'lastPeriod' => [ - 'begins' => (new \DateTime)->sub($duration)->format('Y-m-d 00:00:00'), - 'ends' => (new \DateTime)->sub($duration)->format('Y-m-d 23:59:59'), + 'begins' => (new \DateTime())->sub($duration)->format('Y-m-d 00:00:00'), + 'ends' => (new \DateTime())->sub($duration)->format('Y-m-d 23:59:59'), ], ]; break; @@ -109,12 +110,12 @@ public function determinePeriod($period): ?array $duration = new \DateInterval('P7D'); $comparisonPeriod = [ 'currentPeriod' => [ - 'begins' => (new \DateTime)->format('Y-m-d 00:00:00'), - 'ends' => (new \DateTime)->format('Y-m-d 23:59:59'), + 'begins' => (new \DateTime())->format('Y-m-d 00:00:00'), + 'ends' => (new \DateTime())->format('Y-m-d 23:59:59'), ], 'lastPeriod' => [ - 'begins' => (new \DateTime)->sub($duration)->format('Y-m-d 00:00:00'), - 'ends' => (new \DateTime)->sub($duration)->format('Y-m-d 23:59:59'), + 'begins' => (new \DateTime())->sub($duration)->format('Y-m-d 00:00:00'), + 'ends' => (new \DateTime())->sub($duration)->format('Y-m-d 23:59:59'), ], ]; break; @@ -123,12 +124,12 @@ public function determinePeriod($period): ?array $lastDuration = new \DateInterval('P14D'); $comparisonPeriod = [ 'currentPeriod' => [ - 'begins' => (new \DateTime)->sub($currentDuration)->format('Y-m-d'), - 'ends' => (new \DateTime)->format('Y-m-d'), + 'begins' => (new \DateTime())->sub($currentDuration)->format('Y-m-d'), + 'ends' => (new \DateTime())->format('Y-m-d'), ], 'lastPeriod' => [ - 'begins' => (new \DateTime)->sub($lastDuration)->format('Y-m-d'), - 'ends' => (new \DateTime)->sub($currentDuration)->format('Y-m-d'), + 'begins' => (new \DateTime())->sub($lastDuration)->format('Y-m-d'), + 'ends' => (new \DateTime())->sub($currentDuration)->format('Y-m-d'), ], ]; break; @@ -137,12 +138,12 @@ public function determinePeriod($period): ?array $lastDuration = new \DateInterval('P60D'); $comparisonPeriod = [ 'currentPeriod' => [ - 'begins' => (new \DateTime)->sub($currentDuration)->format('Y-m-d'), - 'ends' => (new \DateTime)->format('Y-m-d'), + 'begins' => (new \DateTime())->sub($currentDuration)->format('Y-m-d'), + 'ends' => (new \DateTime())->format('Y-m-d'), ], 'lastPeriod' => [ - 'begins' => (new \DateTime)->sub($lastDuration)->format('Y-m-d'), - 'ends' => (new \DateTime)->sub($currentDuration)->format('Y-m-d'), + 'begins' => (new \DateTime())->sub($lastDuration)->format('Y-m-d'), + 'ends' => (new \DateTime())->sub($currentDuration)->format('Y-m-d'), ], ]; break; diff --git a/src/backend/app/modules/User/Events/UserCreatedEvent.php b/src/backend/app/modules/User/Events/UserCreatedEvent.php index 7466dfa93..0e9a16609 100644 --- a/src/backend/app/modules/User/Events/UserCreatedEvent.php +++ b/src/backend/app/modules/User/Events/UserCreatedEvent.php @@ -8,5 +8,7 @@ class UserCreatedEvent { - public function __construct(public User $user, public bool $shouldSyncUser) {} + public function __construct(public User $user, public bool $shouldSyncUser) + { + } } diff --git a/src/backend/app/modules/User/UserListener.php b/src/backend/app/modules/User/UserListener.php index 94dca0b51..66ff8a0a2 100644 --- a/src/backend/app/modules/User/UserListener.php +++ b/src/backend/app/modules/User/UserListener.php @@ -19,7 +19,8 @@ public function __construct( private TicketUserService $ticketUserService, private CompanyService $companyService, private MailHelperInterface $mailHelper, - ) {} + ) { + } public function handle($event): void { diff --git a/src/backend/database/migrations/2022_03_10_120408_create_companies_table.php b/src/backend/database/migrations/2022_03_10_120408_create_companies_table.php index 9a877b2be..f24dcc24e 100644 --- a/src/backend/database/migrations/2022_03_10_120408_create_companies_table.php +++ b/src/backend/database/migrations/2022_03_10_120408_create_companies_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_03_10_134450_create_company_databases_table.php b/src/backend/database/migrations/2022_03_10_134450_create_company_databases_table.php index 3d35c229d..b2a1403cc 100644 --- a/src/backend/database/migrations/2022_03_10_134450_create_company_databases_table.php +++ b/src/backend/database/migrations/2022_03_10_134450_create_company_databases_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_06_18_204649_create_database_proxies_table.php b/src/backend/database/migrations/2022_06_18_204649_create_database_proxies_table.php index b602bc8da..bacc9187c 100644 --- a/src/backend/database/migrations/2022_06_18_204649_create_database_proxies_table.php +++ b/src/backend/database/migrations/2022_06_18_204649_create_database_proxies_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { public function up(): void { Schema::create('database_proxies', function (Blueprint $table) { diff --git a/src/backend/database/migrations/2022_06_21_102121_create_mpm_plugins_table.php b/src/backend/database/migrations/2022_06_21_102121_create_mpm_plugins_table.php index e4c72fbec..ec38f54ba 100644 --- a/src/backend/database/migrations/2022_06_21_102121_create_mpm_plugins_table.php +++ b/src/backend/database/migrations/2022_06_21_102121_create_mpm_plugins_table.php @@ -7,8 +7,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_06_21_122032_add_email_to_companies_table.php b/src/backend/database/migrations/2022_06_21_122032_add_email_to_companies_table.php index 97f813cff..3c068cf02 100644 --- a/src/backend/database/migrations/2022_06_21_122032_add_email_to_companies_table.php +++ b/src/backend/database/migrations/2022_06_21_122032_add_email_to_companies_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_07_05_093903_add_tail_tag_to_mpm_plugins_table.php b/src/backend/database/migrations/2022_07_05_093903_add_tail_tag_to_mpm_plugins_table.php index ed8a4129b..7ab9a9325 100644 --- a/src/backend/database/migrations/2022_07_05_093903_add_tail_tag_to_mpm_plugins_table.php +++ b/src/backend/database/migrations/2022_07_05_093903_add_tail_tag_to_mpm_plugins_table.php @@ -7,8 +7,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_07_07_140545_add_installation_command_to_mpm_plugins_table.php b/src/backend/database/migrations/2022_07_07_140545_add_installation_command_to_mpm_plugins_table.php index f3f527ed3..dd8b35d22 100644 --- a/src/backend/database/migrations/2022_07_07_140545_add_installation_command_to_mpm_plugins_table.php +++ b/src/backend/database/migrations/2022_07_07_140545_add_installation_command_to_mpm_plugins_table.php @@ -7,8 +7,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_09_20_0000000_add_bulk_registration_to_mpm_plugin_table.php b/src/backend/database/migrations/2022_09_20_0000000_add_bulk_registration_to_mpm_plugin_table.php index 195bafe9a..911ed02f3 100644 --- a/src/backend/database/migrations/2022_09_20_0000000_add_bulk_registration_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2022_09_20_0000000_add_bulk_registration_to_mpm_plugin_table.php @@ -5,8 +5,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class extends Migration -{ +return new class () extends Migration { public function up() { DB::table('mpm_plugins')->insert([ diff --git a/src/backend/database/migrations/2022_11_08_0000000_add_viber_messaging_to_mpm_plugin_table.php b/src/backend/database/migrations/2022_11_08_0000000_add_viber_messaging_to_mpm_plugin_table.php index 77a0db62d..15179525a 100644 --- a/src/backend/database/migrations/2022_11_08_0000000_add_viber_messaging_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2022_11_08_0000000_add_viber_messaging_to_mpm_plugin_table.php @@ -5,8 +5,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class extends Migration -{ +return new class () extends Migration { public function up() { DB::table('mpm_plugins')->insert([ diff --git a/src/backend/database/migrations/2022_11_08_154321_update_email_field_for_database_proxies_table.php b/src/backend/database/migrations/2022_11_08_154321_update_email_field_for_database_proxies_table.php index 077eed436..829c9537f 100644 --- a/src/backend/database/migrations/2022_11_08_154321_update_email_field_for_database_proxies_table.php +++ b/src/backend/database/migrations/2022_11_08_154321_update_email_field_for_database_proxies_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_11_21_000000_add_wave_money_payment_to_mpm_plugin_table.php b/src/backend/database/migrations/2022_11_21_000000_add_wave_money_payment_to_mpm_plugin_table.php index f09c3f104..6368c9eb0 100644 --- a/src/backend/database/migrations/2022_11_21_000000_add_wave_money_payment_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2022_11_21_000000_add_wave_money_payment_to_mpm_plugin_table.php @@ -5,8 +5,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class extends Migration -{ +return new class () extends Migration { public function up() { DB::table('mpm_plugins')->insert([ diff --git a/src/backend/database/migrations/2022_11_25_091725_create_company_jobs.php b/src/backend/database/migrations/2022_11_25_091725_create_company_jobs.php index 47ccca2a8..8fe3d2cb1 100644 --- a/src/backend/database/migrations/2022_11_25_091725_create_company_jobs.php +++ b/src/backend/database/migrations/2022_11_25_091725_create_company_jobs.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_11_29_000000_add_micro_star_to_mpm_plugin_table.php b/src/backend/database/migrations/2022_11_29_000000_add_micro_star_to_mpm_plugin_table.php index dada4f14c..acd02c404 100644 --- a/src/backend/database/migrations/2022_11_29_000000_add_micro_star_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2022_11_29_000000_add_micro_star_to_mpm_plugin_table.php @@ -5,8 +5,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class extends Migration -{ +return new class () extends Migration { public function up() { DB::table('mpm_plugins')->insert([ diff --git a/src/backend/database/migrations/2022_12_12_000000_add_root_class_to_mpm_plugins_table.php b/src/backend/database/migrations/2022_12_12_000000_add_root_class_to_mpm_plugins_table.php index bfbae2468..8ecebf7bd 100644 --- a/src/backend/database/migrations/2022_12_12_000000_add_root_class_to_mpm_plugins_table.php +++ b/src/backend/database/migrations/2022_12_12_000000_add_root_class_to_mpm_plugins_table.php @@ -7,8 +7,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_14_12_000000_add_sun_king_to_mpm_plugin_table.php b/src/backend/database/migrations/2022_14_12_000000_add_sun_king_to_mpm_plugin_table.php index 4b6b7a24c..d4883f0ab 100644 --- a/src/backend/database/migrations/2022_14_12_000000_add_sun_king_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2022_14_12_000000_add_sun_king_to_mpm_plugin_table.php @@ -5,8 +5,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class extends Migration -{ +return new class () extends Migration { public function up() { DB::table('mpm_plugins')->insert([ diff --git a/src/backend/database/migrations/2023_01_24_110414_create_protected_pages_table.php b/src/backend/database/migrations/2023_01_24_110414_create_protected_pages_table.php index c5e12285d..f631c9b35 100644 --- a/src/backend/database/migrations/2023_01_24_110414_create_protected_pages_table.php +++ b/src/backend/database/migrations/2023_01_24_110414_create_protected_pages_table.php @@ -6,8 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2023_01_24_112359_add_protected_page_password_to_companies_table.php b/src/backend/database/migrations/2023_01_24_112359_add_protected_page_password_to_companies_table.php index 802133631..654468da4 100644 --- a/src/backend/database/migrations/2023_01_24_112359_add_protected_page_password_to_companies_table.php +++ b/src/backend/database/migrations/2023_01_24_112359_add_protected_page_password_to_companies_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2023_02_06_000000_add_gome_long_to_mpm_plugin_table.php b/src/backend/database/migrations/2023_02_06_000000_add_gome_long_to_mpm_plugin_table.php index 4b0313f6d..ba3042e28 100644 --- a/src/backend/database/migrations/2023_02_06_000000_add_gome_long_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2023_02_06_000000_add_gome_long_to_mpm_plugin_table.php @@ -5,8 +5,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class extends Migration -{ +return new class () extends Migration { public function up() { DB::table('mpm_plugins')->insert([ diff --git a/src/backend/database/migrations/2023_04_02_121811_add_wavecom_to_mpm_plugin_table.php b/src/backend/database/migrations/2023_04_02_121811_add_wavecom_to_mpm_plugin_table.php index f918b822e..31d572551 100644 --- a/src/backend/database/migrations/2023_04_02_121811_add_wavecom_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2023_04_02_121811_add_wavecom_to_mpm_plugin_table.php @@ -5,8 +5,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class extends Migration -{ +return new class () extends Migration { public function up() { DB::table('mpm_plugins')->insert([ diff --git a/src/backend/database/migrations/2023_11_23_134944_update_description_column_in_mpm_plugins_table.php b/src/backend/database/migrations/2023_11_23_134944_update_description_column_in_mpm_plugins_table.php index f15ff5947..a9b567b2f 100644 --- a/src/backend/database/migrations/2023_11_23_134944_update_description_column_in_mpm_plugins_table.php +++ b/src/backend/database/migrations/2023_11_23_134944_update_description_column_in_mpm_plugins_table.php @@ -7,8 +7,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2024_01_01_000000_add_daly_bms_to_mpm_plugin_table.php b/src/backend/database/migrations/2024_01_01_000000_add_daly_bms_to_mpm_plugin_table.php index ab3fee8ec..ee1a746bf 100644 --- a/src/backend/database/migrations/2024_01_01_000000_add_daly_bms_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2024_01_01_000000_add_daly_bms_to_mpm_plugin_table.php @@ -5,8 +5,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class extends Migration -{ +return new class () extends Migration { public function up() { DB::table('mpm_plugins')->insert([ diff --git a/src/backend/database/migrations/2024_01_12_000000_add_angaza_to_mpm_plugin_table.php b/src/backend/database/migrations/2024_01_12_000000_add_angaza_to_mpm_plugin_table.php index 47144188a..7abe2495f 100644 --- a/src/backend/database/migrations/2024_01_12_000000_add_angaza_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2024_01_12_000000_add_angaza_to_mpm_plugin_table.php @@ -5,8 +5,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class extends Migration -{ +return new class () extends Migration { public function up() { DB::table('mpm_plugins')->insert([ diff --git a/src/backend/database/migrations/2024_02_07_100345_create_usage_types_table.php b/src/backend/database/migrations/2024_02_07_100345_create_usage_types_table.php index 70b197d4b..88e95fd43 100644 --- a/src/backend/database/migrations/2024_02_07_100345_create_usage_types_table.php +++ b/src/backend/database/migrations/2024_02_07_100345_create_usage_types_table.php @@ -6,8 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2024_02_07_113319_add_usage_type_column_to_mpm_plugins_table.php b/src/backend/database/migrations/2024_02_07_113319_add_usage_type_column_to_mpm_plugins_table.php index 4f77448ac..a347ab7cb 100644 --- a/src/backend/database/migrations/2024_02_07_113319_add_usage_type_column_to_mpm_plugins_table.php +++ b/src/backend/database/migrations/2024_02_07_113319_add_usage_type_column_to_mpm_plugins_table.php @@ -7,8 +7,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2024_03_21_121825_add_message_and_trace_columns_to_company_jobs_table.php b/src/backend/database/migrations/2024_03_21_121825_add_message_and_trace_columns_to_company_jobs_table.php index 6432a3d10..86819c41f 100644 --- a/src/backend/database/migrations/2024_03_21_121825_add_message_and_trace_columns_to_company_jobs_table.php +++ b/src/backend/database/migrations/2024_03_21_121825_add_message_and_trace_columns_to_company_jobs_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2014_10_12_000000_create_users_table.php b/src/backend/database/migrations/micropowermanager/2014_10_12_000000_create_users_table.php index c888ab131..fb91c6e07 100644 --- a/src/backend/database/migrations/micropowermanager/2014_10_12_000000_create_users_table.php +++ b/src/backend/database/migrations/micropowermanager/2014_10_12_000000_create_users_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2014_10_12_100000_create_password_resets_table.php b/src/backend/database/migrations/micropowermanager/2014_10_12_100000_create_password_resets_table.php index 4caa4fddf..0ba694725 100644 --- a/src/backend/database/migrations/micropowermanager/2014_10_12_100000_create_password_resets_table.php +++ b/src/backend/database/migrations/micropowermanager/2014_10_12_100000_create_password_resets_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_24_195615_create_vodacom_transactions_table.php b/src/backend/database/migrations/micropowermanager/2018_05_24_195615_create_vodacom_transactions_table.php index a88d5b834..18a985c46 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_24_195615_create_vodacom_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_24_195615_create_vodacom_transactions_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_24_201051_create_transactions_table.php b/src/backend/database/migrations/micropowermanager/2018_05_24_201051_create_transactions_table.php index 184752465..648c7237f 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_24_201051_create_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_24_201051_create_transactions_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_24_213335_create_airtel_transactions_table.php b/src/backend/database/migrations/micropowermanager/2018_05_24_213335_create_airtel_transactions_table.php index 7d6b4410e..1df046d52 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_24_213335_create_airtel_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_24_213335_create_airtel_transactions_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_25_131106_create_payment_histories_table.php b/src/backend/database/migrations/micropowermanager/2018_05_25_131106_create_payment_histories_table.php index 78b839949..a77d900e5 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_25_131106_create_payment_histories_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_25_131106_create_payment_histories_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_25_131119_create_meter_tariffs_table.php b/src/backend/database/migrations/micropowermanager/2018_05_25_131119_create_meter_tariffs_table.php index d268b56c6..e13d89193 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_25_131119_create_meter_tariffs_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_25_131119_create_meter_tariffs_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_29_071453_create_addresses_table.php b/src/backend/database/migrations/micropowermanager/2018_05_29_071453_create_addresses_table.php index 5d977f9c0..9717baef7 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_29_071453_create_addresses_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_29_071453_create_addresses_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_29_080926_create_geographical_informations_table.php b/src/backend/database/migrations/micropowermanager/2018_05_29_080926_create_geographical_informations_table.php index ed40ac120..597f17d55 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_29_080926_create_geographical_informations_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_29_080926_create_geographical_informations_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_29_140926_create_meter_types_table.php b/src/backend/database/migrations/micropowermanager/2018_05_29_140926_create_meter_types_table.php index 079386382..b478b7158 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_29_140926_create_meter_types_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_29_140926_create_meter_types_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Reverse the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_30_124521_create_meters_table.php b/src/backend/database/migrations/micropowermanager/2018_05_30_124521_create_meters_table.php index 8c6c3f749..0389ee683 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_30_124521_create_meters_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_30_124521_create_meters_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_31_071601_create_manufacturers_table.php b/src/backend/database/migrations/micropowermanager/2018_05_31_071601_create_manufacturers_table.php index 89bc9017f..12342d0ce 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_31_071601_create_manufacturers_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_31_071601_create_manufacturers_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_31_075346_create_cities_table.php b/src/backend/database/migrations/micropowermanager/2018_05_31_075346_create_cities_table.php index 1f2b6e787..aff7f86b7 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_31_075346_create_cities_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_31_075346_create_cities_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_31_075353_create_countries_table.php b/src/backend/database/migrations/micropowermanager/2018_05_31_075353_create_countries_table.php index af45e40cd..335d12b77 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_31_075353_create_countries_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_31_075353_create_countries_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_06_01_141845_create_people_table.php b/src/backend/database/migrations/micropowermanager/2018_06_01_141845_create_people_table.php index ee14b43c0..8dc05a7af 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_01_141845_create_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_01_141845_create_people_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_06_04_124637_create__roles_table.php b/src/backend/database/migrations/micropowermanager/2018_06_04_124637_create__roles_table.php index fb5048ca6..23a5983ca 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_04_124637_create__roles_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_04_124637_create__roles_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_06_07_155444_create_meter_tokens_table.php b/src/backend/database/migrations/micropowermanager/2018_06_07_155444_create_meter_tokens_table.php index 167fd8f83..aa18106dd 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_07_155444_create_meter_tokens_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_07_155444_create_meter_tokens_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_06_08_102610_create_meter_parameters_table.php b/src/backend/database/migrations/micropowermanager/2018_06_08_102610_create_meter_parameters_table.php index 7c299597c..0123e3aad 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_08_102610_create_meter_parameters_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_08_102610_create_meter_parameters_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_06_11_131951_create_sms_table.php b/src/backend/database/migrations/micropowermanager/2018_06_11_131951_create_sms_table.php index b246ab2c8..b1d9d8123 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_11_131951_create_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_11_131951_create_sms_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_06_15_082352_create_transaction_conflicts_table.php b/src/backend/database/migrations/micropowermanager/2018_06_15_082352_create_transaction_conflicts_table.php index e99ca2365..c9ca7c8cc 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_15_082352_create_transaction_conflicts_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_15_082352_create_transaction_conflicts_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_06_28_080905_create_access_rates_table.php b/src/backend/database/migrations/micropowermanager/2018_06_28_080905_create_access_rates_table.php index 920629066..9c811792b 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_28_080905_create_access_rates_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_28_080905_create_access_rates_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_06_28_080914_create_access_rate_payments_table.php b/src/backend/database/migrations/micropowermanager/2018_06_28_080914_create_access_rate_payments_table.php index 6dcc5df76..293f96abf 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_28_080914_create_access_rate_payments_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_28_080914_create_access_rate_payments_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_07_11_075002_create_permission_tables.php b/src/backend/database/migrations/micropowermanager/2018_07_11_075002_create_permission_tables.php index f98539fa5..647732e73 100644 --- a/src/backend/database/migrations/micropowermanager/2018_07_11_075002_create_permission_tables.php +++ b/src/backend/database/migrations/micropowermanager/2018_07_11_075002_create_permission_tables.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_07_12_133700_create_loans_table.php b/src/backend/database/migrations/micropowermanager/2018_07_12_133700_create_loans_table.php index 2d370a4fa..130cfde42 100644 --- a/src/backend/database/migrations/micropowermanager/2018_07_12_133700_create_loans_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_07_12_133700_create_loans_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_07_12_134253_create_customers_table.php b/src/backend/database/migrations/micropowermanager/2018_07_12_134253_create_customers_table.php index 865dcd793..04e0b0554 100644 --- a/src/backend/database/migrations/micropowermanager/2018_07_12_134253_create_customers_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_07_12_134253_create_customers_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_10_04_195503_create_histories_table.php b/src/backend/database/migrations/micropowermanager/2018_10_04_195503_create_histories_table.php index 67f7e0441..27767e560 100644 --- a/src/backend/database/migrations/micropowermanager/2018_10_04_195503_create_histories_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_10_04_195503_create_histories_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. */ diff --git a/src/backend/database/migrations/micropowermanager/2018_10_12_110924_create_meter_consumptions_table.php b/src/backend/database/migrations/micropowermanager/2018_10_12_110924_create_meter_consumptions_table.php index 98a8dedc8..d7d85ee9b 100644 --- a/src/backend/database/migrations/micropowermanager/2018_10_12_110924_create_meter_consumptions_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_10_12_110924_create_meter_consumptions_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_10_12_123911_create_payment_profiles_table.php b/src/backend/database/migrations/micropowermanager/2018_10_12_123911_create_payment_profiles_table.php index 98c5982f6..dd741492b 100644 --- a/src/backend/database/migrations/micropowermanager/2018_10_12_123911_create_payment_profiles_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_10_12_123911_create_payment_profiles_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_11_29_090603_create_clusters_table.php b/src/backend/database/migrations/micropowermanager/2018_11_29_090603_create_clusters_table.php index bc99be88a..c3b491cd9 100644 --- a/src/backend/database/migrations/micropowermanager/2018_11_29_090603_create_clusters_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_11_29_090603_create_clusters_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_12_05_144906_create_revenues_table.php b/src/backend/database/migrations/micropowermanager/2018_12_05_144906_create_revenues_table.php index fd00a7757..0560c08da 100644 --- a/src/backend/database/migrations/micropowermanager/2018_12_05_144906_create_revenues_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_12_05_144906_create_revenues_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_12_11_083717_create_connection_types_table.php b/src/backend/database/migrations/micropowermanager/2018_12_11_083717_create_connection_types_table.php index fe0131188..e45b79bd9 100644 --- a/src/backend/database/migrations/micropowermanager/2018_12_11_083717_create_connection_types_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_12_11_083717_create_connection_types_table.php @@ -6,8 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_12_13_083722_create_targets_table.php b/src/backend/database/migrations/micropowermanager/2018_12_13_083722_create_targets_table.php index 1bc921da4..fdfe166e4 100644 --- a/src/backend/database/migrations/micropowermanager/2018_12_13_083722_create_targets_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_12_13_083722_create_targets_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_12_13_100738_create_sub_targets_table.php b/src/backend/database/migrations/micropowermanager/2018_12_13_100738_create_sub_targets_table.php index 5cacf555c..79190f40f 100644 --- a/src/backend/database/migrations/micropowermanager/2018_12_13_100738_create_sub_targets_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_12_13_100738_create_sub_targets_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_04_19_083645_customer_group.php b/src/backend/database/migrations/micropowermanager/2019_04_19_083645_customer_group.php index 89a2eb423..cab29f323 100644 --- a/src/backend/database/migrations/micropowermanager/2019_04_19_083645_customer_group.php +++ b/src/backend/database/migrations/micropowermanager/2019_04_19_083645_customer_group.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_04_25_092438_create_sub_connection_types_table.php b/src/backend/database/migrations/micropowermanager/2019_04_25_092438_create_sub_connection_types_table.php index 1c077adb6..ea7947207 100644 --- a/src/backend/database/migrations/micropowermanager/2019_04_25_092438_create_sub_connection_types_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_04_25_092438_create_sub_connection_types_table.php @@ -6,8 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. */ diff --git a/src/backend/database/migrations/micropowermanager/2019_05_01_103123_create_connection_groups_table.php b/src/backend/database/migrations/micropowermanager/2019_05_01_103123_create_connection_groups_table.php index 92551afe4..b97dd78d9 100644 --- a/src/backend/database/migrations/micropowermanager/2019_05_01_103123_create_connection_groups_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_05_01_103123_create_connection_groups_table.php @@ -6,8 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_05_15_122118_reports.php b/src/backend/database/migrations/micropowermanager/2019_05_15_122118_reports.php index b66cda092..076adfe74 100644 --- a/src/backend/database/migrations/micropowermanager/2019_05_15_122118_reports.php +++ b/src/backend/database/migrations/micropowermanager/2019_05_15_122118_reports.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_06_24_160040_create_mini_grids_table.php b/src/backend/database/migrations/micropowermanager/2019_06_24_160040_create_mini_grids_table.php index 616fd839f..bae31d4ee 100644 --- a/src/backend/database/migrations/micropowermanager/2019_06_24_160040_create_mini_grids_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_06_24_160040_create_mini_grids_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_07_01_133655_create_maintenance_users_table.php b/src/backend/database/migrations/micropowermanager/2019_07_01_133655_create_maintenance_users_table.php index e40e79039..2ecd0e202 100644 --- a/src/backend/database/migrations/micropowermanager/2019_07_01_133655_create_maintenance_users_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_07_01_133655_create_maintenance_users_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_11_06_121116_create_energies_table.php b/src/backend/database/migrations/micropowermanager/2019_11_06_121116_create_energies_table.php index d668d24f8..0028c9e56 100644 --- a/src/backend/database/migrations/micropowermanager/2019_11_06_121116_create_energies_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_11_06_121116_create_energies_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_11_15_102431_create_solars_table.php b/src/backend/database/migrations/micropowermanager/2019_11_15_102431_create_solars_table.php index 8bd4a4edd..d9bdc6141 100644 --- a/src/backend/database/migrations/micropowermanager/2019_11_15_102431_create_solars_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_11_15_102431_create_solars_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_11_26_063009_create_batteries_table.php b/src/backend/database/migrations/micropowermanager/2019_11_26_063009_create_batteries_table.php index 788f00238..74e4824ad 100644 --- a/src/backend/database/migrations/micropowermanager/2019_11_26_063009_create_batteries_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_11_26_063009_create_batteries_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_12_16_090907_create_assets_table.php b/src/backend/database/migrations/micropowermanager/2019_12_16_090907_create_assets_table.php index 7c2c0ec40..c781d65ee 100644 --- a/src/backend/database/migrations/micropowermanager/2019_12_16_090907_create_assets_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_12_16_090907_create_assets_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_12_16_091934_create_asset_types_table.php b/src/backend/database/migrations/micropowermanager/2019_12_16_091934_create_asset_types_table.php index 1c165f0ca..3732d70f4 100644 --- a/src/backend/database/migrations/micropowermanager/2019_12_16_091934_create_asset_types_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_12_16_091934_create_asset_types_table.php @@ -6,8 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. */ diff --git a/src/backend/database/migrations/micropowermanager/2019_12_16_092044_create_asset_people_table.php b/src/backend/database/migrations/micropowermanager/2019_12_16_092044_create_asset_people_table.php index 9cbec51f9..0117a7115 100644 --- a/src/backend/database/migrations/micropowermanager/2019_12_16_092044_create_asset_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_12_16_092044_create_asset_people_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_12_16_093223_create_asset_rates_table.php b/src/backend/database/migrations/micropowermanager/2019_12_16_093223_create_asset_rates_table.php index 69b7e93e1..ce01316e8 100644 --- a/src/backend/database/migrations/micropowermanager/2019_12_16_093223_create_asset_rates_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_12_16_093223_create_asset_rates_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_01_27_135206_create_logs_table.php b/src/backend/database/migrations/micropowermanager/2020_01_27_135206_create_logs_table.php index d763fb203..555d4846a 100644 --- a/src/backend/database/migrations/micropowermanager/2020_01_27_135206_create_logs_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_01_27_135206_create_logs_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_04_05_233604_create_p_v_s_table.php b/src/backend/database/migrations/micropowermanager/2020_04_05_233604_create_p_v_s_table.php index d78a89e90..b47d121eb 100644 --- a/src/backend/database/migrations/micropowermanager/2020_04_05_233604_create_p_v_s_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_04_05_233604_create_p_v_s_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_04_19_234527_create_restrictions_table.php b/src/backend/database/migrations/micropowermanager/2020_04_19_234527_create_restrictions_table.php index 8580dad32..ba22b236b 100644 --- a/src/backend/database/migrations/micropowermanager/2020_04_19_234527_create_restrictions_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_04_19_234527_create_restrictions_table.php @@ -5,8 +5,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_04_19_235421_create_upgrades_table.php b/src/backend/database/migrations/micropowermanager/2020_04_19_235421_create_upgrades_table.php index d3fd4bf00..43453dd9e 100644 --- a/src/backend/database/migrations/micropowermanager/2020_04_19_235421_create_upgrades_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_04_19_235421_create_upgrades_table.php @@ -5,8 +5,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_04_20_001454_create_subscriptions_table.php b/src/backend/database/migrations/micropowermanager/2020_04_20_001454_create_subscriptions_table.php index 51e2732c9..b35909c56 100644 --- a/src/backend/database/migrations/micropowermanager/2020_04_20_001454_create_subscriptions_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_04_20_001454_create_subscriptions_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_06_20_085555_weather_data.php b/src/backend/database/migrations/micropowermanager/2020_06_20_085555_weather_data.php index 8da6c591f..e89593640 100644 --- a/src/backend/database/migrations/micropowermanager/2020_06_20_085555_weather_data.php +++ b/src/backend/database/migrations/micropowermanager/2020_06_20_085555_weather_data.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_06_21_131740_create_tariff_pricing_components_table.php b/src/backend/database/migrations/micropowermanager/2020_06_21_131740_create_tariff_pricing_components_table.php index eec5319b4..d6a3d6842 100644 --- a/src/backend/database/migrations/micropowermanager/2020_06_21_131740_create_tariff_pricing_components_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_06_21_131740_create_tariff_pricing_components_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_06_21_194542_create_social_tariffs_table.php b/src/backend/database/migrations/micropowermanager/2020_06_21_194542_create_social_tariffs_table.php index e041c1ba6..81f08e18c 100644 --- a/src/backend/database/migrations/micropowermanager/2020_06_21_194542_create_social_tariffs_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_06_21_194542_create_social_tariffs_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_06_22_085345_create_social_tariff_piggy_banks_table.php b/src/backend/database/migrations/micropowermanager/2020_06_22_085345_create_social_tariff_piggy_banks_table.php index 81a03c8e3..f1bb29501 100644 --- a/src/backend/database/migrations/micropowermanager/2020_06_22_085345_create_social_tariff_piggy_banks_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_06_22_085345_create_social_tariff_piggy_banks_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_06_22_115405_add_total_price_to_meter_tariffs.php b/src/backend/database/migrations/micropowermanager/2020_06_22_115405_add_total_price_to_meter_tariffs.php index 6d1158287..efb03e96f 100644 --- a/src/backend/database/migrations/micropowermanager/2020_06_22_115405_add_total_price_to_meter_tariffs.php +++ b/src/backend/database/migrations/micropowermanager/2020_06_22_115405_add_total_price_to_meter_tariffs.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_07_12_192802_create_agents_table.php b/src/backend/database/migrations/micropowermanager/2020_07_12_192802_create_agents_table.php index 4c1b40ee5..124e9c43c 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_12_192802_create_agents_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_12_192802_create_agents_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_07_13_130601_create_agent_transactions_table.php b/src/backend/database/migrations/micropowermanager/2020_07_13_130601_create_agent_transactions_table.php index 91af541ed..9309c5d51 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_13_130601_create_agent_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_13_130601_create_agent_transactions_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_07_13_132006_create_agent_balance_histories_table.php b/src/backend/database/migrations/micropowermanager/2020_07_13_132006_create_agent_balance_histories_table.php index bee2e11f2..56cfce334 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_13_132006_create_agent_balance_histories_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_13_132006_create_agent_balance_histories_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_07_13_132423_create_agent_assigned_appliances_table.php b/src/backend/database/migrations/micropowermanager/2020_07_13_132423_create_agent_assigned_appliances_table.php index 7045258dd..c841a39b1 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_13_132423_create_agent_assigned_appliances_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_13_132423_create_agent_assigned_appliances_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_07_13_132811_create_agent_sold_appliances_table.php b/src/backend/database/migrations/micropowermanager/2020_07_13_132811_create_agent_sold_appliances_table.php index e92aefadd..a9fd8c036 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_13_132811_create_agent_sold_appliances_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_13_132811_create_agent_sold_appliances_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_07_25_083600_create_agent_commissions_table.php b/src/backend/database/migrations/micropowermanager/2020_07_25_083600_create_agent_commissions_table.php index 5b89a8461..fdf44f20b 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_25_083600_create_agent_commissions_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_25_083600_create_agent_commissions_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_07_25_155837_create_agent_receipts_table.php b/src/backend/database/migrations/micropowermanager/2020_07_25_155837_create_agent_receipts_table.php index 420597e81..a648c6f3f 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_25_155837_create_agent_receipts_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_25_155837_create_agent_receipts_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_08_03_081836_create_agent_charges_table.php b/src/backend/database/migrations/micropowermanager/2020_08_03_081836_create_agent_charges_table.php index 3bab1cd87..495526c62 100644 --- a/src/backend/database/migrations/micropowermanager/2020_08_03_081836_create_agent_charges_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_08_03_081836_create_agent_charges_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_08_05_133748_create_agent_receipt_details_table.php b/src/backend/database/migrations/micropowermanager/2020_08_05_133748_create_agent_receipt_details_table.php index 4aecde4d2..78f9e28fb 100644 --- a/src/backend/database/migrations/micropowermanager/2020_08_05_133748_create_agent_receipt_details_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_08_05_133748_create_agent_receipt_details_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_10_02_072509_create_time_of_usages_table.php b/src/backend/database/migrations/micropowermanager/2020_10_02_072509_create_time_of_usages_table.php index fbe5b4036..b76f584b1 100644 --- a/src/backend/database/migrations/micropowermanager/2020_10_02_072509_create_time_of_usages_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_10_02_072509_create_time_of_usages_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_10_19_122517_create_sub_menu_items_table.php b/src/backend/database/migrations/micropowermanager/2020_10_19_122517_create_sub_menu_items_table.php index 495999ce5..9e6680513 100644 --- a/src/backend/database/migrations/micropowermanager/2020_10_19_122517_create_sub_menu_items_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_10_19_122517_create_sub_menu_items_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_10_19_122649_create_menu_items_table.php b/src/backend/database/migrations/micropowermanager/2020_10_19_122649_create_menu_items_table.php index 8acef855d..ab6e76457 100644 --- a/src/backend/database/migrations/micropowermanager/2020_10_19_122649_create_menu_items_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_10_19_122649_create_menu_items_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_10_29_170007_create_plugins_table.php b/src/backend/database/migrations/micropowermanager/2020_10_29_170007_create_plugins_table.php index 2d0c713f4..0242050b4 100644 --- a/src/backend/database/migrations/micropowermanager/2020_10_29_170007_create_plugins_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_10_29_170007_create_plugins_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_12_17_144527_create_main_settings_table.php b/src/backend/database/migrations/micropowermanager/2020_12_17_144527_create_main_settings_table.php index e0a7f9d78..e98b9ee25 100644 --- a/src/backend/database/migrations/micropowermanager/2020_12_17_144527_create_main_settings_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_12_17_144527_create_main_settings_table.php @@ -6,8 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_12_23_165814_create_map_settings_table.php b/src/backend/database/migrations/micropowermanager/2020_12_23_165814_create_map_settings_table.php index 077e3062d..0b096710c 100644 --- a/src/backend/database/migrations/micropowermanager/2020_12_23_165814_create_map_settings_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_12_23_165814_create_map_settings_table.php @@ -6,8 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_01_02_130016_add_manufacturer_transaction_to_agent_transactions_table.php b/src/backend/database/migrations/micropowermanager/2021_01_02_130016_add_manufacturer_transaction_to_agent_transactions_table.php index b71e501ab..e3588ea13 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_02_130016_add_manufacturer_transaction_to_agent_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_02_130016_add_manufacturer_transaction_to_agent_transactions_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_01_02_130412_create_third_party_transactions.php b/src/backend/database/migrations/micropowermanager/2021_01_02_130412_create_third_party_transactions.php index 7a07aac6e..eb7b82826 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_02_130412_create_third_party_transactions.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_02_130412_create_third_party_transactions.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_01_02_134152_add_manufacturer_transaction_to_vodacom_transactions_table.php b/src/backend/database/migrations/micropowermanager/2021_01_02_134152_add_manufacturer_transaction_to_vodacom_transactions_table.php index fd2cd93cd..75c1454b1 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_02_134152_add_manufacturer_transaction_to_vodacom_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_02_134152_add_manufacturer_transaction_to_vodacom_transactions_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_01_02_134212_add_manufacturer_transaction_to_airtel_transactions_table.php b/src/backend/database/migrations/micropowermanager/2021_01_02_134212_add_manufacturer_transaction_to_airtel_transactions_table.php index e9f437a7f..2bacebbb6 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_02_134212_add_manufacturer_transaction_to_airtel_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_02_134212_add_manufacturer_transaction_to_airtel_transactions_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_01_05_234039_create_ticket_settings_table.php b/src/backend/database/migrations/micropowermanager/2021_01_05_234039_create_ticket_settings_table.php index ca41b6bb8..4f1f7fb36 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_05_234039_create_ticket_settings_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_05_234039_create_ticket_settings_table.php @@ -6,8 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_01_18_122556_add_columns_to_batteries_table.php b/src/backend/database/migrations/micropowermanager/2021_01_18_122556_add_columns_to_batteries_table.php index 748d273d2..5afd57d9b 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_18_122556_add_columns_to_batteries_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_18_122556_add_columns_to_batteries_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_01_18_123245_add_columns_to_p_v_s_table.php b/src/backend/database/migrations/micropowermanager/2021_01_18_123245_add_columns_to_p_v_s_table.php index c7848f8eb..46ca45ff9 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_18_123245_add_columns_to_p_v_s_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_18_123245_add_columns_to_p_v_s_table.php @@ -5,8 +5,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_bodies.php b/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_bodies.php index 127e3e1fc..ebdfa0989 100644 --- a/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_bodies.php +++ b/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_bodies.php @@ -6,8 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_resend_information_keys.php b/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_resend_information_keys.php index 58f5f1655..47c0a507d 100644 --- a/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_resend_information_keys.php +++ b/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_resend_information_keys.php @@ -6,8 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_02_18_156421_create_sms_appliance_remind_rates.php b/src/backend/database/migrations/micropowermanager/2021_02_18_156421_create_sms_appliance_remind_rates.php index 2652ee237..c7a84e8a1 100644 --- a/src/backend/database/migrations/micropowermanager/2021_02_18_156421_create_sms_appliance_remind_rates.php +++ b/src/backend/database/migrations/micropowermanager/2021_02_18_156421_create_sms_appliance_remind_rates.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_03_03_140758_create_sms_android_settings.php b/src/backend/database/migrations/micropowermanager/2021_03_03_140758_create_sms_android_settings.php index b0499a50e..9cc789ad7 100644 --- a/src/backend/database/migrations/micropowermanager/2021_03_03_140758_create_sms_android_settings.php +++ b/src/backend/database/migrations/micropowermanager/2021_03_03_140758_create_sms_android_settings.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_03_03_141706_create_sms_variable_default_values.php b/src/backend/database/migrations/micropowermanager/2021_03_03_141706_create_sms_variable_default_values.php index 984f86e3f..34ed727b7 100644 --- a/src/backend/database/migrations/micropowermanager/2021_03_03_141706_create_sms_variable_default_values.php +++ b/src/backend/database/migrations/micropowermanager/2021_03_03_141706_create_sms_variable_default_values.php @@ -6,8 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_03_2_1561251_update_sms_table.php b/src/backend/database/migrations/micropowermanager/2021_03_2_1561251_update_sms_table.php index 4097f4960..7a17e803a 100644 --- a/src/backend/database/migrations/micropowermanager/2021_03_2_1561251_update_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_03_2_1561251_update_sms_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_04_28_103758_add_additional_json_column_to_people.php b/src/backend/database/migrations/micropowermanager/2021_04_28_103758_add_additional_json_column_to_people.php index 10c631e22..c05d0464c 100644 --- a/src/backend/database/migrations/micropowermanager/2021_04_28_103758_add_additional_json_column_to_people.php +++ b/src/backend/database/migrations/micropowermanager/2021_04_28_103758_add_additional_json_column_to_people.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_04_28_104840_create_person_documents_table.php b/src/backend/database/migrations/micropowermanager/2021_04_28_104840_create_person_documents_table.php index 9a7c204d3..25e5f6b45 100644 --- a/src/backend/database/migrations/micropowermanager/2021_04_28_104840_create_person_documents_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_04_28_104840_create_person_documents_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_06_04_085817_update_meter_consumptions_table.php b/src/backend/database/migrations/micropowermanager/2021_06_04_085817_update_meter_consumptions_table.php index 19b797d02..58d8d3bc1 100644 --- a/src/backend/database/migrations/micropowermanager/2021_06_04_085817_update_meter_consumptions_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_06_04_085817_update_meter_consumptions_table.php @@ -6,8 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_08_17_090801_add_down_payment_to_asset_people_table.php b/src/backend/database/migrations/micropowermanager/2021_08_17_090801_add_down_payment_to_asset_people_table.php index 391d9c4fb..57a38caf6 100644 --- a/src/backend/database/migrations/micropowermanager/2021_08_17_090801_add_down_payment_to_asset_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_08_17_090801_add_down_payment_to_asset_people_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_08_17_090913_add_first_payment_date_to_asset_people_table.php b/src/backend/database/migrations/micropowermanager/2021_08_17_090913_add_first_payment_date_to_asset_people_table.php index 2c34d0c5f..747895479 100644 --- a/src/backend/database/migrations/micropowermanager/2021_08_17_090913_add_first_payment_date_to_asset_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_08_17_090913_add_first_payment_date_to_asset_people_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_09_07_092522_create_cash_transactions_table.php b/src/backend/database/migrations/micropowermanager/2021_09_07_092522_create_cash_transactions_table.php index 4c83b0f13..849193095 100644 --- a/src/backend/database/migrations/micropowermanager/2021_09_07_092522_create_cash_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_09_07_092522_create_cash_transactions_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_10_18_220817_create_mail_settings.php b/src/backend/database/migrations/micropowermanager/2021_10_18_220817_create_mail_settings.php index b7ef02738..ceab71922 100644 --- a/src/backend/database/migrations/micropowermanager/2021_10_18_220817_create_mail_settings.php +++ b/src/backend/database/migrations/micropowermanager/2021_10_18_220817_create_mail_settings.php @@ -6,8 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_093215_update_meter_tariffs_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_093215_update_meter_tariffs_table.php index af1cece3d..743fbdd1d 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_093215_update_meter_tariffs_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_093215_update_meter_tariffs_table.php @@ -6,8 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_101348_update_social_tariffs_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_101348_update_social_tariffs_table.php index dc1148b59..9866bab70 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_101348_update_social_tariffs_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_101348_update_social_tariffs_table.php @@ -6,8 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_101616_update_tariff_pricing_components_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_101616_update_tariff_pricing_components_table.php index c64432ed3..4365574db 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_101616_update_tariff_pricing_components_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_101616_update_tariff_pricing_components_table.php @@ -6,8 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_101855_update_social_tariff_piggy_banks_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_101855_update_social_tariff_piggy_banks_table.php index 2d3a30c88..2dbe149a2 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_101855_update_social_tariff_piggy_banks_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_101855_update_social_tariff_piggy_banks_table.php @@ -6,8 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_102047_update_access_rates_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_102047_update_access_rates_table.php index 30087e453..6b5d726b8 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_102047_update_access_rates_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_102047_update_access_rates_table.php @@ -6,8 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_102214_update_access_rate_payments_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_102214_update_access_rate_payments_table.php index 5db33513e..b2424a07a 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_102214_update_access_rate_payments_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_102214_update_access_rate_payments_table.php @@ -6,8 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_102507_update_asset_people_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_102507_update_asset_people_table.php index 4457a4a15..74154da78 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_102507_update_asset_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_102507_update_asset_people_table.php @@ -6,8 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_102649_update_transactions_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_102649_update_transactions_table.php index 4cff50352..68968bebc 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_102649_update_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_102649_update_transactions_table.php @@ -6,8 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_102805_update_payment_histories_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_102805_update_payment_histories_table.php index 1c6b6e5c3..7f1f6d2d6 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_102805_update_payment_histories_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_102805_update_payment_histories_table.php @@ -6,8 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_05_19_102938_update_asset_types_table.php b/src/backend/database/migrations/micropowermanager/2022_05_19_102938_update_asset_types_table.php index c9d38c082..7f47e8179 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_19_102938_update_asset_types_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_19_102938_update_asset_types_table.php @@ -6,8 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_05_23_104138_add_connection_column_to_agents_table.php b/src/backend/database/migrations/micropowermanager/2022_05_23_104138_add_connection_column_to_agents_table.php index 548651eb4..a818cd1cb 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_23_104138_add_connection_column_to_agents_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_23_104138_add_connection_column_to_agents_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090125_create_calin_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090125_create_calin_tables.php index c32eddab1..7117a6d11 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090125_create_calin_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090125_create_calin_tables.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { public function up() { if (! Schema::hasTable('calin_api_credentials')) { diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090327_create_calin_smart_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090327_create_calin_smart_tables.php index 7525fad5d..a630c3233 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090327_create_calin_smart_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090327_create_calin_smart_tables.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { public function up() { if (! Schema::hasTable('calin_smart_api_credentials')) { diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090338_create_kelin_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090338_create_kelin_tables.php index c3057fadf..777aa6307 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090338_create_kelin_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090338_create_kelin_tables.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { public function up() { if (! Schema::hasTable('kelin_api_credentials')) { diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090345_create_mesomb_payment_provider_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090345_create_mesomb_payment_provider_tables.php index ed89704a2..0e0ba78eb 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090345_create_mesomb_payment_provider_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090345_create_mesomb_payment_provider_tables.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { public function up() { if (! Schema::hasTable('mesomb_transactions')) { diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090351_create_spark_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090351_create_spark_tables.php index 225cf1f1a..5b75e29bc 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090351_create_spark_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090351_create_spark_tables.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { public function up() { if (! Schema::hasTable('sm_api_credentials')) { diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090402_create_steama_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090402_create_steama_tables.php index 20ce44093..350495680 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090402_create_steama_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090402_create_steama_tables.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { public function up() { if (! Schema::hasTable('steama_agents')) { diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090412_create_stron_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090412_create_stron_tables.php index 2ab765b74..26537479e 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090412_create_stron_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090412_create_stron_tables.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { public function up() { if (! Schema::hasTable('stron_api_credentials')) { diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090425_create_swifta_payment_provider_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090425_create_swifta_payment_provider_tables.php index 3de0cd45d..9072b7113 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090425_create_swifta_payment_provider_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090425_create_swifta_payment_provider_tables.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { public function up() { if (! Schema::hasTable('swifta_transactions')) { diff --git a/src/backend/database/migrations/micropowermanager/2022_07_05_092948_create_registration_tail_table.php b/src/backend/database/migrations/micropowermanager/2022_07_05_092948_create_registration_tail_table.php index 4cc517288..23ed77cb3 100644 --- a/src/backend/database/migrations/micropowermanager/2022_07_05_092948_create_registration_tail_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_07_05_092948_create_registration_tail_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_09_20_0000000_create_bulk_registration_tables.php b/src/backend/database/migrations/micropowermanager/2022_09_20_0000000_create_bulk_registration_tables.php index 9a983957d..522b2eef7 100644 --- a/src/backend/database/migrations/micropowermanager/2022_09_20_0000000_create_bulk_registration_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_09_20_0000000_create_bulk_registration_tables.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { public function up() { if (! Schema::connection('shard')->hasTable('bulk_registration_csv_datas')) { diff --git a/src/backend/database/migrations/micropowermanager/2022_10_27_130327_add_direction_column_to_sms_table.php b/src/backend/database/migrations/micropowermanager/2022_10_27_130327_add_direction_column_to_sms_table.php index 39090d2f8..889e28ca2 100644 --- a/src/backend/database/migrations/micropowermanager/2022_10_27_130327_add_direction_column_to_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_10_27_130327_add_direction_column_to_sms_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_10_27_140945_add_gateway_id_column_to_sms_table.php b/src/backend/database/migrations/micropowermanager/2022_10_27_140945_add_gateway_id_column_to_sms_table.php index 046d67475..52967fea1 100644 --- a/src/backend/database/migrations/micropowermanager/2022_10_27_140945_add_gateway_id_column_to_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_10_27_140945_add_gateway_id_column_to_sms_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_10_27_142123_add_dispatched_column_to_sms_table.php b/src/backend/database/migrations/micropowermanager/2022_10_27_142123_add_dispatched_column_to_sms_table.php index 78f0df3f2..fd0890489 100644 --- a/src/backend/database/migrations/micropowermanager/2022_10_27_142123_add_dispatched_column_to_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_10_27_142123_add_dispatched_column_to_sms_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_10_27_142319_add_attempts_column_to_sms_table.php b/src/backend/database/migrations/micropowermanager/2022_10_27_142319_add_attempts_column_to_sms_table.php index 2012b010c..3ddc6c9fd 100644 --- a/src/backend/database/migrations/micropowermanager/2022_10_27_142319_add_attempts_column_to_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_10_27_142319_add_attempts_column_to_sms_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_11_08_0000000_create_viber_messaging_tables.php b/src/backend/database/migrations/micropowermanager/2022_11_08_0000000_create_viber_messaging_tables.php index d5a1927ee..155677b6e 100644 --- a/src/backend/database/migrations/micropowermanager/2022_11_08_0000000_create_viber_messaging_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_11_08_0000000_create_viber_messaging_tables.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { public function up() { if (! Schema::hasTable('viber_credentials')) { diff --git a/src/backend/database/migrations/micropowermanager/2022_11_14_101338_add_minimum_purchase_amount_to_meter_tariffs_table.php b/src/backend/database/migrations/micropowermanager/2022_11_14_101338_add_minimum_purchase_amount_to_meter_tariffs_table.php index 4cc20ef87..29f89dbb0 100644 --- a/src/backend/database/migrations/micropowermanager/2022_11_14_101338_add_minimum_purchase_amount_to_meter_tariffs_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_11_14_101338_add_minimum_purchase_amount_to_meter_tariffs_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_11_21_000000_create_wave_money_payment_provider_tables.php b/src/backend/database/migrations/micropowermanager/2022_11_21_000000_create_wave_money_payment_provider_tables.php index 88a5b16ae..1f93a0540 100644 --- a/src/backend/database/migrations/micropowermanager/2022_11_21_000000_create_wave_money_payment_provider_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_11_21_000000_create_wave_money_payment_provider_tables.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { public function up() { if (! Schema::hasTable('wave_money_transactions')) { diff --git a/src/backend/database/migrations/micropowermanager/2022_11_29_000000_create_micro_star_tables.php b/src/backend/database/migrations/micropowermanager/2022_11_29_000000_create_micro_star_tables.php index d705ebab3..15a4cdae5 100644 --- a/src/backend/database/migrations/micropowermanager/2022_11_29_000000_create_micro_star_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_11_29_000000_create_micro_star_tables.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { public function up() { if (! Schema::hasTable('micro_star_api_credentials')) { diff --git a/src/backend/database/migrations/micropowermanager/2022_12_11_000000_update_swifta_authentication_table.php b/src/backend/database/migrations/micropowermanager/2022_12_11_000000_update_swifta_authentication_table.php index a94907ebb..97def6ebb 100644 --- a/src/backend/database/migrations/micropowermanager/2022_12_11_000000_update_swifta_authentication_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_12_11_000000_update_swifta_authentication_table.php @@ -6,8 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_14_12_create_sun_king_tables.php b/src/backend/database/migrations/micropowermanager/2022_14_12_create_sun_king_tables.php index 95de7d467..a3710cba1 100644 --- a/src/backend/database/migrations/micropowermanager/2022_14_12_create_sun_king_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_14_12_create_sun_king_tables.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { public function up() { if (! Schema::connection('shard')->hasTable('sun_king_api_credentials')) { diff --git a/src/backend/database/migrations/micropowermanager/2023_03_15_092048_add_colums_to_solars_table.php b/src/backend/database/migrations/micropowermanager/2023_03_15_092048_add_colums_to_solars_table.php index 63b866391..6190e2f5b 100644 --- a/src/backend/database/migrations/micropowermanager/2023_03_15_092048_add_colums_to_solars_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_03_15_092048_add_colums_to_solars_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_03_16_105024_update_solars_table.php b/src/backend/database/migrations/micropowermanager/2023_03_16_105024_update_solars_table.php index 97bf3c0b2..bdfbdf2ff 100644 --- a/src/backend/database/migrations/micropowermanager/2023_03_16_105024_update_solars_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_03_16_105024_update_solars_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_03_17_234630_update_data_type_values_energies_table.php b/src/backend/database/migrations/micropowermanager/2023_03_17_234630_update_data_type_values_energies_table.php index 126a819e8..5c994a7c7 100644 --- a/src/backend/database/migrations/micropowermanager/2023_03_17_234630_update_data_type_values_energies_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_03_17_234630_update_data_type_values_energies_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_03_18_014305_update_data_type_values_energies_table.php b/src/backend/database/migrations/micropowermanager/2023_03_18_014305_update_data_type_values_energies_table.php index 8bdd6eb47..2c7b4bf06 100644 --- a/src/backend/database/migrations/micropowermanager/2023_03_18_014305_update_data_type_values_energies_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_03_18_014305_update_data_type_values_energies_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_04_02_121811_create_wavecom_tables.php b/src/backend/database/migrations/micropowermanager/2023_04_02_121811_create_wavecom_tables.php index 72c7fd038..abde750de 100644 --- a/src/backend/database/migrations/micropowermanager/2023_04_02_121811_create_wavecom_tables.php +++ b/src/backend/database/migrations/micropowermanager/2023_04_02_121811_create_wavecom_tables.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { private const TABLE_NAME = 'wavecom_transactions'; public function up() diff --git a/src/backend/database/migrations/micropowermanager/2023_04_04_211421_add_api_type_to_table_transactions.php b/src/backend/database/migrations/micropowermanager/2023_04_04_211421_add_api_type_to_table_transactions.php index 7ca8075c7..292b015af 100644 --- a/src/backend/database/migrations/micropowermanager/2023_04_04_211421_add_api_type_to_table_transactions.php +++ b/src/backend/database/migrations/micropowermanager/2023_04_04_211421_add_api_type_to_table_transactions.php @@ -3,8 +3,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_04_26_223352_update_sms_table.php b/src/backend/database/migrations/micropowermanager/2023_04_26_223352_update_sms_table.php index 01caba803..5abf3c936 100644 --- a/src/backend/database/migrations/micropowermanager/2023_04_26_223352_update_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_04_26_223352_update_sms_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_06_02_create_gome_long_tables.php b/src/backend/database/migrations/micropowermanager/2023_06_02_create_gome_long_tables.php index ecad98b0e..4e819cf34 100644 --- a/src/backend/database/migrations/micropowermanager/2023_06_02_create_gome_long_tables.php +++ b/src/backend/database/migrations/micropowermanager/2023_06_02_create_gome_long_tables.php @@ -6,8 +6,7 @@ // Despite the migration's name, this migration was actually created on Feb 6h // Name should be 2023-02-06 not 2023-06-02... -return new class extends Migration -{ +return new class () extends Migration { public function up() { if (! Schema::hasTable('gome_long_api_credentials')) { diff --git a/src/backend/database/migrations/micropowermanager/2023_09_25_232731_update_assets_asset_people_asset_types_tables.php b/src/backend/database/migrations/micropowermanager/2023_09_25_232731_update_assets_asset_people_asset_types_tables.php index 13d716ea9..fa4e255bb 100644 --- a/src/backend/database/migrations/micropowermanager/2023_09_25_232731_update_assets_asset_people_asset_types_tables.php +++ b/src/backend/database/migrations/micropowermanager/2023_09_25_232731_update_assets_asset_people_asset_types_tables.php @@ -6,8 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_09_28_130619_update_sms_appliance_remind_rates_table.php b/src/backend/database/migrations/micropowermanager/2023_09_28_130619_update_sms_appliance_remind_rates_table.php index 6033a7e53..41c4217a1 100644 --- a/src/backend/database/migrations/micropowermanager/2023_09_28_130619_update_sms_appliance_remind_rates_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_09_28_130619_update_sms_appliance_remind_rates_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * @@ -23,5 +22,7 @@ public function up() * * @return void */ - public function down() {} + public function down() + { + } }; diff --git a/src/backend/database/migrations/micropowermanager/2023_10_25_074114_update_wavecom_wavemoney_tables.php b/src/backend/database/migrations/micropowermanager/2023_10_25_074114_update_wavecom_wavemoney_tables.php index 7b7a06e40..07ef68f96 100644 --- a/src/backend/database/migrations/micropowermanager/2023_10_25_074114_update_wavecom_wavemoney_tables.php +++ b/src/backend/database/migrations/micropowermanager/2023_10_25_074114_update_wavecom_wavemoney_tables.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * @@ -29,5 +28,7 @@ public function up() * * @return void */ - public function down() {} + public function down() + { + } }; diff --git a/src/backend/database/migrations/micropowermanager/2023_11_03_112202_create_devices_table.php b/src/backend/database/migrations/micropowermanager/2023_11_03_112202_create_devices_table.php index 3b59a43a4..8b0b749cb 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_03_112202_create_devices_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_03_112202_create_devices_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_03_120614_create_solar_home_systems_table.php b/src/backend/database/migrations/micropowermanager/2023_11_03_120614_create_solar_home_systems_table.php index c363e96f0..f85c3ac57 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_03_120614_create_solar_home_systems_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_03_120614_create_solar_home_systems_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_03_121740_add_configuration_columns_to_meters_table.php b/src/backend/database/migrations/micropowermanager/2023_11_03_121740_add_configuration_columns_to_meters_table.php index 5047074de..60f31da52 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_03_121740_add_configuration_columns_to_meters_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_03_121740_add_configuration_columns_to_meters_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_11_142307_update_action_field_type_logs_table.php b/src/backend/database/migrations/micropowermanager/2023_11_11_142307_update_action_field_type_logs_table.php index 9ccfeb12d..f3598f212 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_11_142307_update_action_field_type_logs_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_11_142307_update_action_field_type_logs_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * @@ -23,5 +22,7 @@ public function up() * * @return void */ - public function down() {} + public function down() + { + } }; diff --git a/src/backend/database/migrations/micropowermanager/2023_11_14_160711_drop_geo_id_column_from_address_table.php b/src/backend/database/migrations/micropowermanager/2023_11_14_160711_drop_geo_id_column_from_address_table.php index 0ce54ad0e..6ac069628 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_14_160711_drop_geo_id_column_from_address_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_14_160711_drop_geo_id_column_from_address_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_16_175649_add_type_column_to_manufacturers_table.php b/src/backend/database/migrations/micropowermanager/2023_11_16_175649_add_type_column_to_manufacturers_table.php index 9bedee686..89a8c0d24 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_16_175649_add_type_column_to_manufacturers_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_16_175649_add_type_column_to_manufacturers_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_16_175940_add_asset_id_column_to_solar_home_systems_table.php b/src/backend/database/migrations/micropowermanager/2023_11_16_175940_add_asset_id_column_to_solar_home_systems_table.php index 7f4e6b598..b8adf1020 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_16_175940_add_asset_id_column_to_solar_home_systems_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_16_175940_add_asset_id_column_to_solar_home_systems_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_16_220432_update_person_id_column_in_devices_table.php b/src/backend/database/migrations/micropowermanager/2023_11_16_220432_update_person_id_column_in_devices_table.php index a8969a9a1..3e8423d30 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_16_220432_update_person_id_column_in_devices_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_16_220432_update_person_id_column_in_devices_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_16_220931_update_device_serial_column_in_devices_table.php b/src/backend/database/migrations/micropowermanager/2023_11_16_220931_update_device_serial_column_in_devices_table.php index fd219e566..eca4dbdc2 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_16_220931_update_device_serial_column_in_devices_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_16_220931_update_device_serial_column_in_devices_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_16_221111_update_serial_number_column_in_solar_home_systems_table.php b/src/backend/database/migrations/micropowermanager/2023_11_16_221111_update_serial_number_column_in_solar_home_systems_table.php index b56865edb..e4f5bd460 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_16_221111_update_serial_number_column_in_solar_home_systems_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_16_221111_update_serial_number_column_in_solar_home_systems_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_17_095204_create_tokens_table.php b/src/backend/database/migrations/micropowermanager/2023_11_17_095204_create_tokens_table.php index e097b6fe2..ce82cfa03 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_17_095204_create_tokens_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_17_095204_create_tokens_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_18_190332_add_device_serial_column_to_asset_people_table.php b/src/backend/database/migrations/micropowermanager/2023_11_18_190332_add_device_serial_column_to_asset_people_table.php index d5c648761..3b2d1f914 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_18_190332_add_device_serial_column_to_asset_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_18_190332_add_device_serial_column_to_asset_people_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_21_090129_update_derice_serial_column_in_asset_people_table.php b/src/backend/database/migrations/micropowermanager/2023_11_21_090129_update_derice_serial_column_in_asset_people_table.php index 9a3660519..989b8618f 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_21_090129_update_derice_serial_column_in_asset_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_21_090129_update_derice_serial_column_in_asset_people_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_01_01_create_daly_bms_tables.php b/src/backend/database/migrations/micropowermanager/2024_01_01_create_daly_bms_tables.php index 5a297829b..6bd81d992 100644 --- a/src/backend/database/migrations/micropowermanager/2024_01_01_create_daly_bms_tables.php +++ b/src/backend/database/migrations/micropowermanager/2024_01_01_create_daly_bms_tables.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { public function up() { if (! Schema::hasTable('daly_bms_api_credentials')) { diff --git a/src/backend/database/migrations/micropowermanager/2024_01_02_124146_create_e_bikes_table.php b/src/backend/database/migrations/micropowermanager/2024_01_02_124146_create_e_bikes_table.php index 242593bd2..6f8820d3e 100644 --- a/src/backend/database/migrations/micropowermanager/2024_01_02_124146_create_e_bikes_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_01_02_124146_create_e_bikes_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_01_12_create_angaza_tables.php b/src/backend/database/migrations/micropowermanager/2024_01_12_create_angaza_tables.php index bc73df305..e3428cfe2 100644 --- a/src/backend/database/migrations/micropowermanager/2024_01_12_create_angaza_tables.php +++ b/src/backend/database/migrations/micropowermanager/2024_01_12_create_angaza_tables.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { public function up() { if (! Schema::connection('shard')->hasTable('angaza_api_credentials')) { diff --git a/src/backend/database/migrations/micropowermanager/2024_02_07_102305_add_usage_type_column_to_main_settings_table.php b/src/backend/database/migrations/micropowermanager/2024_02_07_102305_add_usage_type_column_to_main_settings_table.php index a9bd8b8b0..c0e1f01bf 100644 --- a/src/backend/database/migrations/micropowermanager/2024_02_07_102305_add_usage_type_column_to_main_settings_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_02_07_102305_add_usage_type_column_to_main_settings_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_02_07_113710_add_usage_type_column_to_menu_items_table.php b/src/backend/database/migrations/micropowermanager/2024_02_07_113710_add_usage_type_column_to_menu_items_table.php index f7feda450..23d3993f9 100644 --- a/src/backend/database/migrations/micropowermanager/2024_02_07_113710_add_usage_type_column_to_menu_items_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_02_07_113710_add_usage_type_column_to_menu_items_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_09_30_113302_remove_siderbar_tables.php b/src/backend/database/migrations/micropowermanager/2024_09_30_113302_remove_siderbar_tables.php index 645be6508..c02aecded 100644 --- a/src/backend/database/migrations/micropowermanager/2024_09_30_113302_remove_siderbar_tables.php +++ b/src/backend/database/migrations/micropowermanager/2024_09_30_113302_remove_siderbar_tables.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_23_153042_add_amount_to_agent_charge.php b/src/backend/database/migrations/micropowermanager/2024_10_23_153042_add_amount_to_agent_charge.php index 38494b3ee..d3b7a9eb6 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_23_153042_add_amount_to_agent_charge.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_23_153042_add_amount_to_agent_charge.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_30_154625_create_notifications_table.php b/src/backend/database/migrations/micropowermanager/2024_10_30_154625_create_notifications_table.php index 4357c9efa..448655043 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_30_154625_create_notifications_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_30_154625_create_notifications_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180458_remove_batteries_table.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180458_remove_batteries_table.php index 123b66ebf..81555990f 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180458_remove_batteries_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180458_remove_batteries_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180510_remove_energies_table.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180510_remove_energies_table.php index c23bda479..a1bd1f04f 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180510_remove_energies_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180510_remove_energies_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180524_remove_mini_grid_frequencies_table.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180524_remove_mini_grid_frequencies_table.php index f846005b9..a9a158daf 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180524_remove_mini_grid_frequencies_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180524_remove_mini_grid_frequencies_table.php @@ -3,8 +3,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180539_remove_pvs_table.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180539_remove_pvs_table.php index 8e6a5b775..0957f165e 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180539_remove_pvs_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180539_remove_pvs_table.php @@ -5,8 +5,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180546_remove_solars_table.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180546_remove_solars_table.php index bd3bfb684..8c2f0b897 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180546_remove_solars_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180546_remove_solars_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180605_remove_weather_data_table.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180605_remove_weather_data_table.php index 65b0af06b..8e91b068d 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180605_remove_weather_data_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180605_remove_weather_data_table.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180852_remove_agent_tickets.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180852_remove_agent_tickets.php index c34016eca..1aec28c01 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180852_remove_agent_tickets.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180852_remove_agent_tickets.php @@ -3,8 +3,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_181016_remove_city_clusters.php b/src/backend/database/migrations/micropowermanager/2024_10_31_181016_remove_city_clusters.php index 24c7e67dc..86d7d95d8 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_181016_remove_city_clusters.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_181016_remove_city_clusters.php @@ -3,8 +3,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_11_11_130340_drop_data_stream_column_from_mini_grid.php b/src/backend/database/migrations/micropowermanager/2024_11_11_130340_drop_data_stream_column_from_mini_grid.php index dc7da3881..82d0ae3e9 100644 --- a/src/backend/database/migrations/micropowermanager/2024_11_11_130340_drop_data_stream_column_from_mini_grid.php +++ b/src/backend/database/migrations/micropowermanager/2024_11_11_130340_drop_data_stream_column_from_mini_grid.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/seeders/TenantSeeder.php b/src/backend/database/seeders/TenantSeeder.php index c8ca30b50..640786320 100644 --- a/src/backend/database/seeders/TenantSeeder.php +++ b/src/backend/database/seeders/TenantSeeder.php @@ -38,7 +38,8 @@ public function __construct( private DatabaseProxyManagerService $databaseProxyManagerService, private RegistrationTailService $registrationTailService, private MainSettingsService $mainSettingsService, - ) {} + ) { + } /** * Run the database seeds. diff --git a/src/backend/packages/inensus/angaza-shs/src/Http/Controllers/AngazaCredentialController.php b/src/backend/packages/inensus/angaza-shs/src/Http/Controllers/AngazaCredentialController.php index 48243d5c8..27228446b 100644 --- a/src/backend/packages/inensus/angaza-shs/src/Http/Controllers/AngazaCredentialController.php +++ b/src/backend/packages/inensus/angaza-shs/src/Http/Controllers/AngazaCredentialController.php @@ -9,7 +9,9 @@ class AngazaCredentialController extends Controller { - public function __construct(private AngazaCredentialService $credentialService) {} + public function __construct(private AngazaCredentialService $credentialService) + { + } public function show(): AngazaResource { diff --git a/src/backend/packages/inensus/angaza-shs/src/Modules/Api/AngazaSHSApi.php b/src/backend/packages/inensus/angaza-shs/src/Modules/Api/AngazaSHSApi.php index 7bd585b55..5b4338c6a 100644 --- a/src/backend/packages/inensus/angaza-shs/src/Modules/Api/AngazaSHSApi.php +++ b/src/backend/packages/inensus/angaza-shs/src/Modules/Api/AngazaSHSApi.php @@ -20,7 +20,8 @@ public function __construct( private AngazaCredentialService $credentialService, private AngazaTransaction $angazaTransaction, private ApiRequests $apiRequests, - ) {} + ) { + } public function chargeMeter(TransactionDataContainer $transactionContainer): array { diff --git a/src/backend/packages/inensus/angaza-shs/src/Modules/Api/ApiRequests.php b/src/backend/packages/inensus/angaza-shs/src/Modules/Api/ApiRequests.php index 6f7ded792..438668e60 100644 --- a/src/backend/packages/inensus/angaza-shs/src/Modules/Api/ApiRequests.php +++ b/src/backend/packages/inensus/angaza-shs/src/Modules/Api/ApiRequests.php @@ -11,7 +11,8 @@ class ApiRequests { public function __construct( private Client $httpClient, - ) {} + ) { + } public function get(AngazaCredential $credentials, array $params, string $slug) { diff --git a/src/backend/packages/inensus/angaza-shs/src/Services/AngazaCredentialService.php b/src/backend/packages/inensus/angaza-shs/src/Services/AngazaCredentialService.php index 9f7ccfafc..e63b14d25 100644 --- a/src/backend/packages/inensus/angaza-shs/src/Services/AngazaCredentialService.php +++ b/src/backend/packages/inensus/angaza-shs/src/Services/AngazaCredentialService.php @@ -8,7 +8,8 @@ class AngazaCredentialService { public function __construct( private AngazaCredential $credential, - ) {} + ) { + } /** * This function uses one time on installation of the package. diff --git a/src/backend/packages/inensus/angaza-shs/src/Services/ManufacturerService.php b/src/backend/packages/inensus/angaza-shs/src/Services/ManufacturerService.php index f6eeaeb2b..74299d063 100644 --- a/src/backend/packages/inensus/angaza-shs/src/Services/ManufacturerService.php +++ b/src/backend/packages/inensus/angaza-shs/src/Services/ManufacturerService.php @@ -6,7 +6,9 @@ class ManufacturerService { - public function __construct(private Manufacturer $manufacturer) {} + public function __construct(private Manufacturer $manufacturer) + { + } public function register() { diff --git a/src/backend/packages/inensus/bulk-registration/database/migrations/create_bulk_registration_tables.php b/src/backend/packages/inensus/bulk-registration/database/migrations/create_bulk_registration_tables.php index 4fc06dd89..8b077f6f2 100644 --- a/src/backend/packages/inensus/bulk-registration/database/migrations/create_bulk_registration_tables.php +++ b/src/backend/packages/inensus/bulk-registration/database/migrations/create_bulk_registration_tables.php @@ -4,8 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class extends Migration -{ +return new class () extends Migration { public function up() { if (! Schema::hasTable('bulk_registration_csv_datas')) { diff --git a/src/backend/packages/inensus/bulk-registration/src/Exceptions/ClusterNotFoundException.php b/src/backend/packages/inensus/bulk-registration/src/Exceptions/ClusterNotFoundException.php index ad3f1f299..092c0ee75 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Exceptions/ClusterNotFoundException.php +++ b/src/backend/packages/inensus/bulk-registration/src/Exceptions/ClusterNotFoundException.php @@ -2,4 +2,6 @@ namespace Inensus\BulkRegistration\Exceptions; -class ClusterNotFoundException extends MissingDataException {} +class ClusterNotFoundException extends MissingDataException +{ +} diff --git a/src/backend/packages/inensus/bulk-registration/src/Exceptions/CsvDataParserException.php b/src/backend/packages/inensus/bulk-registration/src/Exceptions/CsvDataParserException.php index e5e8bcf3c..3a75722a3 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Exceptions/CsvDataParserException.php +++ b/src/backend/packages/inensus/bulk-registration/src/Exceptions/CsvDataParserException.php @@ -2,4 +2,6 @@ namespace Inensus\BulkRegistration\Exceptions; -class CsvDataParserException extends \Exception {} +class CsvDataParserException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/bulk-registration/src/Exceptions/ManufacturerNotSupportedException.php b/src/backend/packages/inensus/bulk-registration/src/Exceptions/ManufacturerNotSupportedException.php index 6e1867634..96e3416d8 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Exceptions/ManufacturerNotSupportedException.php +++ b/src/backend/packages/inensus/bulk-registration/src/Exceptions/ManufacturerNotSupportedException.php @@ -2,4 +2,6 @@ namespace Inensus\BulkRegistration\Exceptions; -class ManufacturerNotSupportedException extends MissingDataException {} +class ManufacturerNotSupportedException extends MissingDataException +{ +} diff --git a/src/backend/packages/inensus/bulk-registration/src/Exceptions/MiniGridNotFoundException.php b/src/backend/packages/inensus/bulk-registration/src/Exceptions/MiniGridNotFoundException.php index 1cd8960ed..956684318 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Exceptions/MiniGridNotFoundException.php +++ b/src/backend/packages/inensus/bulk-registration/src/Exceptions/MiniGridNotFoundException.php @@ -2,4 +2,6 @@ namespace Inensus\BulkRegistration\Exceptions; -class MiniGridNotFoundException extends MissingDataException {} +class MiniGridNotFoundException extends MissingDataException +{ +} diff --git a/src/backend/packages/inensus/bulk-registration/src/Exceptions/MissingDataException.php b/src/backend/packages/inensus/bulk-registration/src/Exceptions/MissingDataException.php index b0e06e839..7fbfa41f4 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Exceptions/MissingDataException.php +++ b/src/backend/packages/inensus/bulk-registration/src/Exceptions/MissingDataException.php @@ -2,4 +2,6 @@ namespace Inensus\BulkRegistration\Exceptions; -class MissingDataException extends \Exception {} +class MissingDataException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/bulk-registration/src/Exceptions/VillageNotFoundException.php b/src/backend/packages/inensus/bulk-registration/src/Exceptions/VillageNotFoundException.php index fd7eec95e..135be2881 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Exceptions/VillageNotFoundException.php +++ b/src/backend/packages/inensus/bulk-registration/src/Exceptions/VillageNotFoundException.php @@ -2,4 +2,6 @@ namespace Inensus\BulkRegistration\Exceptions; -class VillageNotFoundException extends MissingDataException {} +class VillageNotFoundException extends MissingDataException +{ +} diff --git a/src/backend/packages/inensus/bulk-registration/src/Helpers/CsvDataProcessor.php b/src/backend/packages/inensus/bulk-registration/src/Helpers/CsvDataProcessor.php index ee7dd2fef..eac212573 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Helpers/CsvDataProcessor.php +++ b/src/backend/packages/inensus/bulk-registration/src/Helpers/CsvDataProcessor.php @@ -80,7 +80,7 @@ public function processParsedCsvData($csvData) app()->make($this->reflections['GeographicalInformationService']); $geographicalInformationService->resolveCsvDataFromComingRow($row, $meterParameter); - $address = new Address; + $address = new Address(); $address = $address->newQuery()->create([ 'city_id' => $city->id, ]); diff --git a/src/backend/packages/inensus/bulk-registration/src/Helpers/CsvFileParser.php b/src/backend/packages/inensus/bulk-registration/src/Helpers/CsvFileParser.php index 41dabfd48..099f05e88 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Helpers/CsvFileParser.php +++ b/src/backend/packages/inensus/bulk-registration/src/Helpers/CsvFileParser.php @@ -10,7 +10,7 @@ class CsvFileParser public function __construct() { - $this->csv = new Csv; + $this->csv = new Csv(); } public function parseCsvFromFilePath($path) diff --git a/src/backend/packages/inensus/bulk-registration/src/Helpers/GeographicalLocationFinder.php b/src/backend/packages/inensus/bulk-registration/src/Helpers/GeographicalLocationFinder.php index a4e8e0748..0c1d8f3b8 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Helpers/GeographicalLocationFinder.php +++ b/src/backend/packages/inensus/bulk-registration/src/Helpers/GeographicalLocationFinder.php @@ -8,7 +8,7 @@ class GeographicalLocationFinder { public function getCoordinatesGivenAddress($address) { - $client = new \GuzzleHttp\Client; + $client = new \GuzzleHttp\Client(); $geocoder = new Geocoder($client); $geocoder->setApiKey(config('bulk-registration.geocoder.key')); $geocoder->setCountry(config('bulk-registration.geocoder.country', 'US')); diff --git a/src/backend/packages/inensus/bulk-registration/src/Services/AddressService.php b/src/backend/packages/inensus/bulk-registration/src/Services/AddressService.php index 732b77dcf..066865143 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Services/AddressService.php +++ b/src/backend/packages/inensus/bulk-registration/src/Services/AddressService.php @@ -45,7 +45,7 @@ public function resolveCsvDataFromComingRow($csvData) public function createForPerson(int $personId, int $cityId, ?string $phone, ?string $email, ?string $street, bool $isPrimary): Address { - $address = new Address; + $address = new Address(); $address->setOwner($personId, 'person'); $address->setCityId($cityId); $address->setPhone($phone); diff --git a/src/backend/packages/inensus/calin-meter/src/Exceptions/CalinApiResponseException.php b/src/backend/packages/inensus/calin-meter/src/Exceptions/CalinApiResponseException.php index feb525cad..aaaf40e91 100644 --- a/src/backend/packages/inensus/calin-meter/src/Exceptions/CalinApiResponseException.php +++ b/src/backend/packages/inensus/calin-meter/src/Exceptions/CalinApiResponseException.php @@ -2,4 +2,6 @@ namespace Inensus\CalinMeter\Exceptions; -class CalinApiResponseException extends \Exception {} +class CalinApiResponseException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/calin-smart-meter/src/Exceptions/CalinSmartApiResponseException.php b/src/backend/packages/inensus/calin-smart-meter/src/Exceptions/CalinSmartApiResponseException.php index ccb1a2365..8e2bd77cd 100644 --- a/src/backend/packages/inensus/calin-smart-meter/src/Exceptions/CalinSmartApiResponseException.php +++ b/src/backend/packages/inensus/calin-smart-meter/src/Exceptions/CalinSmartApiResponseException.php @@ -2,4 +2,6 @@ namespace Inensus\CalinSmartMeter\Exceptions; -class CalinSmartApiResponseException extends \Exception {} +class CalinSmartApiResponseException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/calin-smart-meter/src/Exceptions/CalinSmartCreadentialsNotFoundException.php b/src/backend/packages/inensus/calin-smart-meter/src/Exceptions/CalinSmartCreadentialsNotFoundException.php index 05c58899b..32d3b4a70 100644 --- a/src/backend/packages/inensus/calin-smart-meter/src/Exceptions/CalinSmartCreadentialsNotFoundException.php +++ b/src/backend/packages/inensus/calin-smart-meter/src/Exceptions/CalinSmartCreadentialsNotFoundException.php @@ -2,4 +2,6 @@ namespace Inensus\CalinSmartMeter\Exceptions; -class CalinSmartCreadentialsNotFoundException extends \Exception {} +class CalinSmartCreadentialsNotFoundException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/daly-bms/src/Http/Controllers/DalyBmsCredentialController.php b/src/backend/packages/inensus/daly-bms/src/Http/Controllers/DalyBmsCredentialController.php index d33cbf6e8..371744bf2 100644 --- a/src/backend/packages/inensus/daly-bms/src/Http/Controllers/DalyBmsCredentialController.php +++ b/src/backend/packages/inensus/daly-bms/src/Http/Controllers/DalyBmsCredentialController.php @@ -11,7 +11,8 @@ class DalyBmsCredentialController extends Controller { public function __construct( private DalyBmsCredentialService $credentialService, - ) {} + ) { + } public function show(): DalyBmsResource { diff --git a/src/backend/packages/inensus/daly-bms/src/Modules/Api/ApiRequests.php b/src/backend/packages/inensus/daly-bms/src/Modules/Api/ApiRequests.php index 67e3e1cf4..c2c4541f8 100644 --- a/src/backend/packages/inensus/daly-bms/src/Modules/Api/ApiRequests.php +++ b/src/backend/packages/inensus/daly-bms/src/Modules/Api/ApiRequests.php @@ -12,7 +12,8 @@ class ApiRequests { public function __construct( private Client $httpClient, - ) {} + ) { + } public function authentication($credential): array { diff --git a/src/backend/packages/inensus/daly-bms/src/Modules/Api/DalyBmsApi.php b/src/backend/packages/inensus/daly-bms/src/Modules/Api/DalyBmsApi.php index ba47e722f..fa2fdc775 100644 --- a/src/backend/packages/inensus/daly-bms/src/Modules/Api/DalyBmsApi.php +++ b/src/backend/packages/inensus/daly-bms/src/Modules/Api/DalyBmsApi.php @@ -29,7 +29,8 @@ public function __construct( private DalyBmsTransaction $dalyBmsTransaction, private EBikeService $eBikeService, private ApiRequests $apiRequests, - ) {} + ) { + } public function getDevices(array $deviceSerials) { diff --git a/src/backend/packages/inensus/daly-bms/src/Services/DalyBmsCredentialService.php b/src/backend/packages/inensus/daly-bms/src/Services/DalyBmsCredentialService.php index d5277ee14..231cf47d9 100644 --- a/src/backend/packages/inensus/daly-bms/src/Services/DalyBmsCredentialService.php +++ b/src/backend/packages/inensus/daly-bms/src/Services/DalyBmsCredentialService.php @@ -8,7 +8,8 @@ class DalyBmsCredentialService { public function __construct( private DalyBmsCredential $credential, - ) {} + ) { + } /** * This function uses one time on installation of the package. diff --git a/src/backend/packages/inensus/daly-bms/src/Services/ManufacturerService.php b/src/backend/packages/inensus/daly-bms/src/Services/ManufacturerService.php index 5996c25e5..14224fba3 100644 --- a/src/backend/packages/inensus/daly-bms/src/Services/ManufacturerService.php +++ b/src/backend/packages/inensus/daly-bms/src/Services/ManufacturerService.php @@ -6,7 +6,9 @@ class ManufacturerService { - public function __construct(private Manufacturer $manufacturer) {} + public function __construct(private Manufacturer $manufacturer) + { + } public function register() { diff --git a/src/backend/packages/inensus/gome-long-meter/src/Exceptions/CronJobException.php b/src/backend/packages/inensus/gome-long-meter/src/Exceptions/CronJobException.php index 2b9a10779..f2eca50cc 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Exceptions/CronJobException.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Exceptions/CronJobException.php @@ -2,4 +2,6 @@ namespace Inensus\GomeLongMeter\Exceptions; -class CronJobException extends \Exception {} +class CronJobException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/gome-long-meter/src/Http/Controllers/GomeLongCredentialController.php b/src/backend/packages/inensus/gome-long-meter/src/Http/Controllers/GomeLongCredentialController.php index 7a6da6ff0..c93d1f52a 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Http/Controllers/GomeLongCredentialController.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Http/Controllers/GomeLongCredentialController.php @@ -11,7 +11,8 @@ class GomeLongCredentialController extends Controller { public function __construct( private GomeLongCredentialService $credentialService, - ) {} + ) { + } public function show(): GomeLongResource { diff --git a/src/backend/packages/inensus/gome-long-meter/src/Modules/Api/ApiRequests.php b/src/backend/packages/inensus/gome-long-meter/src/Modules/Api/ApiRequests.php index 476a2949d..545825988 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Modules/Api/ApiRequests.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Modules/Api/ApiRequests.php @@ -12,7 +12,8 @@ class ApiRequests { public function __construct( private Client $httpClient, - ) {} + ) { + } public function get(GomeLongCredential $credentials, array $params, string $slug) { diff --git a/src/backend/packages/inensus/gome-long-meter/src/Modules/Api/GomeLongMeterApi.php b/src/backend/packages/inensus/gome-long-meter/src/Modules/Api/GomeLongMeterApi.php index 51f515950..34fcec610 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Modules/Api/GomeLongMeterApi.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Modules/Api/GomeLongMeterApi.php @@ -18,7 +18,8 @@ public function __construct( private GomeLongCredentialService $credentialService, private GomeLongTransaction $gomeLongTransaction, private ApiRequests $apiRequests, - ) {} + ) { + } public function chargeDevice(TransactionDataContainer $transactionContainer): array { diff --git a/src/backend/packages/inensus/gome-long-meter/src/Observers/MeterTariffObserver.php b/src/backend/packages/inensus/gome-long-meter/src/Observers/MeterTariffObserver.php index a41d9e0ac..edbe17178 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Observers/MeterTariffObserver.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Observers/MeterTariffObserver.php @@ -16,7 +16,8 @@ class MeterTariffObserver public function __construct( private GomeLongTariffService $gomeLongTariffService, private GomeLongCredentialService $credentialService, - ) {} + ) { + } public function created(MeterTariff $tariff) { diff --git a/src/backend/packages/inensus/gome-long-meter/src/Services/GomeLongCredentialService.php b/src/backend/packages/inensus/gome-long-meter/src/Services/GomeLongCredentialService.php index 4c22c5198..64a980d94 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Services/GomeLongCredentialService.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Services/GomeLongCredentialService.php @@ -8,7 +8,8 @@ class GomeLongCredentialService { public function __construct( private GomeLongCredential $credential, - ) {} + ) { + } /** * This function uses one time on installation of the package. diff --git a/src/backend/packages/inensus/gome-long-meter/src/Services/GomeLongTariffService.php b/src/backend/packages/inensus/gome-long-meter/src/Services/GomeLongTariffService.php index 1bfab89a7..84ba89e35 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Services/GomeLongTariffService.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Services/GomeLongTariffService.php @@ -26,7 +26,8 @@ public function __construct( private GomeLongTariff $gomeLongTariff, private GomeLongCredentialService $credentialService, private MainSettings $mainSettings, - ) {} + ) { + } public function getByMpmTariffId($mpmTariffId) { @@ -156,7 +157,7 @@ public function sync() 'vat' => $gomeLongTariff['FVAT'], ]); } else { - $IncidentModel = new MeterTariff; + $IncidentModel = new MeterTariff(); $IncidentModel->unsetEventDispatcher(); $meterTariff = $IncidentModel->create([ 'name' => $gomeLongTariff['FName'], diff --git a/src/backend/packages/inensus/gome-long-meter/src/Services/ManufacturerService.php b/src/backend/packages/inensus/gome-long-meter/src/Services/ManufacturerService.php index 9efecb8b3..1d21f008e 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Services/ManufacturerService.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Services/ManufacturerService.php @@ -6,7 +6,9 @@ class ManufacturerService { - public function __construct(private Manufacturer $manufacturer) {} + public function __construct(private Manufacturer $manufacturer) + { + } public function register() { diff --git a/src/backend/packages/inensus/kelin-meter/src/Exceptions/CronJobException.php b/src/backend/packages/inensus/kelin-meter/src/Exceptions/CronJobException.php index dc7168cce..4db7ad337 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Exceptions/CronJobException.php +++ b/src/backend/packages/inensus/kelin-meter/src/Exceptions/CronJobException.php @@ -2,4 +2,6 @@ namespace Inensus\KelinMeter\Exceptions; -class CronJobException extends \Exception {} +class CronJobException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiAuthenticationException.php b/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiAuthenticationException.php index faf39f98e..c05efe0a1 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiAuthenticationException.php +++ b/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiAuthenticationException.php @@ -2,4 +2,6 @@ namespace Inensus\KelinMeter\Exceptions; -class KelinApiAuthenticationException extends \Exception {} +class KelinApiAuthenticationException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiCredentialsNotFoundException.php b/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiCredentialsNotFoundException.php index 34301a174..2246d9d4c 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiCredentialsNotFoundException.php +++ b/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiCredentialsNotFoundException.php @@ -2,4 +2,6 @@ namespace Inensus\KelinMeter\Exceptions; -class KelinApiCredentialsNotFoundException extends \Exception {} +class KelinApiCredentialsNotFoundException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiEmtyDataException.php b/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiEmtyDataException.php index ff3866d80..68bd2b579 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiEmtyDataException.php +++ b/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiEmtyDataException.php @@ -2,4 +2,6 @@ namespace Inensus\KelinMeter\Exceptions; -class KelinApiEmtyDataException extends \Exception {} +class KelinApiEmtyDataException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiResponseException.php b/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiResponseException.php index 89c16c12d..63919970c 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiResponseException.php +++ b/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiResponseException.php @@ -2,4 +2,6 @@ namespace Inensus\KelinMeter\Exceptions; -class KelinApiResponseException extends \Exception {} +class KelinApiResponseException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/kelin-meter/src/KelinMeterApi.php b/src/backend/packages/inensus/kelin-meter/src/KelinMeterApi.php index 7657a5aa2..3d7da8919 100644 --- a/src/backend/packages/inensus/kelin-meter/src/KelinMeterApi.php +++ b/src/backend/packages/inensus/kelin-meter/src/KelinMeterApi.php @@ -21,7 +21,8 @@ public function __construct( private KelinMeter $kelinMeter, private KelinTransaction $kelinTransaction, private KelinMeterApiClient $kelinApi, - ) {} + ) { + } public function chargeDevice($transactionContainer): array { @@ -113,5 +114,7 @@ public function chargeDevice($transactionContainer): array } } - public function clearDevice(Device $device) {} + public function clearDevice(Device $device) + { + } } diff --git a/src/backend/packages/inensus/kelin-meter/src/Services/KelinMeterService.php b/src/backend/packages/inensus/kelin-meter/src/Services/KelinMeterService.php index f68b2efc5..8ee54263b 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Services/KelinMeterService.php +++ b/src/backend/packages/inensus/kelin-meter/src/Services/KelinMeterService.php @@ -241,14 +241,14 @@ public function createRelatedMeter($kelinMeter) $kelinMeter['consNo'] )->first(); if ($meter === null) { - $meter = new Meter; - $meterParameter = new MeterParameter; - $geoLocation = new GeographicalInformation; + $meter = new Meter(); + $meterParameter = new MeterParameter(); + $geoLocation = new GeographicalInformation(); } else { $meterParameter = $this->meterParameter->newQuery()->where('meter_id', $meter->id)->first(); $geoLocation = $meterParameter->geo()->first(); if ($geoLocation === null) { - $geoLocation = new GeographicalInformation; + $geoLocation = new GeographicalInformation(); } } $meter->serial_number = $meterSerial; @@ -296,7 +296,7 @@ public function createRelatedMeter($kelinMeter) })->first(); $city = $kelinCustomerAddress->addresses[0]->city()->first() ?? null; - $address = new Address; + $address = new Address(); $address = $address->newQuery()->create([ 'city_id' => $city ? $city->id : 1, ]); diff --git a/src/backend/packages/inensus/kelin-meter/src/Services/PackageInstallationService.php b/src/backend/packages/inensus/kelin-meter/src/Services/PackageInstallationService.php index 5b8b8c095..34ddee422 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Services/PackageInstallationService.php +++ b/src/backend/packages/inensus/kelin-meter/src/Services/PackageInstallationService.php @@ -6,7 +6,8 @@ class PackageInstallationService { public function __construct( private KelinSyncSettingService $syncSettingService, - ) {} + ) { + } public function createDefaultSettingRecords() { diff --git a/src/backend/packages/inensus/kelin-meter/src/Tests/Feature/RechargeMeterTest.php b/src/backend/packages/inensus/kelin-meter/src/Tests/Feature/RechargeMeterTest.php index 971a08775..9cc76b8ce 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Tests/Feature/RechargeMeterTest.php +++ b/src/backend/packages/inensus/kelin-meter/src/Tests/Feature/RechargeMeterTest.php @@ -104,7 +104,7 @@ private function initData() 'connection_type_id' => 1, 'connection_group_id' => 1, ]); - $meterParameter = new MeterParameter; + $meterParameter = new MeterParameter(); $meterParameter->tariff()->associate($tariff); $meterParameter->owner_type = 'person'; $meterParameter->owner_id = 1; diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombPayerMustHaveOnlyOneConnectedMeterException.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombPayerMustHaveOnlyOneConnectedMeterException.php index c65894a50..a2bf80122 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombPayerMustHaveOnlyOneConnectedMeterException.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombPayerMustHaveOnlyOneConnectedMeterException.php @@ -2,4 +2,6 @@ namespace Inensus\MesombPaymentProvider\Exceptions; -class MesombPayerMustHaveOnlyOneConnectedMeterException extends \Exception {} +class MesombPayerMustHaveOnlyOneConnectedMeterException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombPaymentPhoneNumberNotFoundException.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombPaymentPhoneNumberNotFoundException.php index 4e8cb327a..86cc53bd9 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombPaymentPhoneNumberNotFoundException.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombPaymentPhoneNumberNotFoundException.php @@ -2,4 +2,6 @@ namespace Inensus\MesombPaymentProvider\Exceptions; -class MesombPaymentPhoneNumberNotFoundException extends \Exception {} +class MesombPaymentPhoneNumberNotFoundException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombStatusFailedException.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombStatusFailedException.php index d16a9f826..40dc55a05 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombStatusFailedException.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombStatusFailedException.php @@ -2,4 +2,6 @@ namespace Inensus\MesombPaymentProvider\Exceptions; -class MesombStatusFailedException extends \Exception {} +class MesombStatusFailedException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarCertificateController.php b/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarCertificateController.php index c914f1f6b..372a45125 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarCertificateController.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarCertificateController.php @@ -14,7 +14,8 @@ class MicroStarCertificateController extends Controller public function __construct( private MicroStarCertificateService $certificateService, private MicroStarCredentialService $credentialService, - ) {} + ) { + } public function store(ImportCertificateRequest $request) { diff --git a/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarCredentialController.php b/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarCredentialController.php index 87f7db9d2..5d6f60622 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarCredentialController.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarCredentialController.php @@ -9,7 +9,9 @@ class MicroStarCredentialController extends Controller { - public function __construct(private MicroStarCredentialService $credentialService) {} + public function __construct(private MicroStarCredentialService $credentialService) + { + } public function show(): MicroStarResource { diff --git a/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarTestController.php b/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarTestController.php index 5a7d4b69c..01d044421 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarTestController.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarTestController.php @@ -7,7 +7,9 @@ class MicroStarTestController extends Controller { - public function __construct(private ApiRequests $apiRequests) {} + public function __construct(private ApiRequests $apiRequests) + { + } public function show() { diff --git a/src/backend/packages/inensus/micro-star-meter/src/Modules/Api/ApiRequests.php b/src/backend/packages/inensus/micro-star-meter/src/Modules/Api/ApiRequests.php index 70f088723..9e87dfbeb 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Modules/Api/ApiRequests.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Modules/Api/ApiRequests.php @@ -14,7 +14,8 @@ class ApiRequests public function __construct( private Client $httpClient, private ResponseResolver $responseResolver, - ) {} + ) { + } public function get(MicroStarCredential $credentials, array $params, string $slug) { diff --git a/src/backend/packages/inensus/micro-star-meter/src/Modules/Api/MicroStarMeterApi.php b/src/backend/packages/inensus/micro-star-meter/src/Modules/Api/MicroStarMeterApi.php index 538a30e5d..7c70656a3 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Modules/Api/MicroStarMeterApi.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Modules/Api/MicroStarMeterApi.php @@ -18,7 +18,8 @@ public function __construct( private MicroStarCredentialService $credentialService, private MicroStarTransaction $microStarTransaction, private ApiRequests $apiRequests, - ) {} + ) { + } public function chargeDevice(TransactionDataContainer $transactionContainer): array { diff --git a/src/backend/packages/inensus/micro-star-meter/src/Services/ManufacturerService.php b/src/backend/packages/inensus/micro-star-meter/src/Services/ManufacturerService.php index 2079f4b68..8bafd9c23 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Services/ManufacturerService.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Services/ManufacturerService.php @@ -6,7 +6,9 @@ class ManufacturerService { - public function __construct(private Manufacturer $manufacturer) {} + public function __construct(private Manufacturer $manufacturer) + { + } public function register() { diff --git a/src/backend/packages/inensus/micro-star-meter/src/Services/MicroStarCredentialService.php b/src/backend/packages/inensus/micro-star-meter/src/Services/MicroStarCredentialService.php index c58089477..2cff47f14 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Services/MicroStarCredentialService.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Services/MicroStarCredentialService.php @@ -8,7 +8,8 @@ class MicroStarCredentialService { public function __construct( private MicroStarCredential $credential, - ) {} + ) { + } /** * This function uses one time on installation of the package. diff --git a/src/backend/packages/inensus/spark-meter/src/Exceptions/CredentialsNotFoundException.php b/src/backend/packages/inensus/spark-meter/src/Exceptions/CredentialsNotFoundException.php index d6c86a011..09fc5a8a1 100644 --- a/src/backend/packages/inensus/spark-meter/src/Exceptions/CredentialsNotFoundException.php +++ b/src/backend/packages/inensus/spark-meter/src/Exceptions/CredentialsNotFoundException.php @@ -2,4 +2,6 @@ namespace Inensus\SparkMeter\Exceptions; -class CredentialsNotFoundException extends \Exception {} +class CredentialsNotFoundException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/spark-meter/src/Exceptions/CredentialsNotUpToDateException.php b/src/backend/packages/inensus/spark-meter/src/Exceptions/CredentialsNotUpToDateException.php index 6d18e9962..0f55d90a5 100644 --- a/src/backend/packages/inensus/spark-meter/src/Exceptions/CredentialsNotUpToDateException.php +++ b/src/backend/packages/inensus/spark-meter/src/Exceptions/CredentialsNotUpToDateException.php @@ -2,4 +2,6 @@ namespace Inensus\SparkMeter\Exceptions; -class CredentialsNotUpToDateException extends \Exception {} +class CredentialsNotUpToDateException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/spark-meter/src/Exceptions/CronJobException.php b/src/backend/packages/inensus/spark-meter/src/Exceptions/CronJobException.php index 5b0686684..cd08c1991 100644 --- a/src/backend/packages/inensus/spark-meter/src/Exceptions/CronJobException.php +++ b/src/backend/packages/inensus/spark-meter/src/Exceptions/CronJobException.php @@ -2,4 +2,6 @@ namespace Inensus\SparkMeter\Exceptions; -class CronJobException extends \Exception {} +class CronJobException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/spark-meter/src/Exceptions/NoOnlineSiteRecordException.php b/src/backend/packages/inensus/spark-meter/src/Exceptions/NoOnlineSiteRecordException.php index 485b574ee..8c58c8a07 100644 --- a/src/backend/packages/inensus/spark-meter/src/Exceptions/NoOnlineSiteRecordException.php +++ b/src/backend/packages/inensus/spark-meter/src/Exceptions/NoOnlineSiteRecordException.php @@ -2,4 +2,6 @@ namespace Inensus\SparkMeter\Exceptions; -class NoOnlineSiteRecordException extends \Exception {} +class NoOnlineSiteRecordException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/spark-meter/src/Exceptions/SitesNotUpToDateException.php b/src/backend/packages/inensus/spark-meter/src/Exceptions/SitesNotUpToDateException.php index 9c8404b5c..26b5d2ea2 100644 --- a/src/backend/packages/inensus/spark-meter/src/Exceptions/SitesNotUpToDateException.php +++ b/src/backend/packages/inensus/spark-meter/src/Exceptions/SitesNotUpToDateException.php @@ -2,4 +2,6 @@ namespace Inensus\SparkMeter\Exceptions; -class SitesNotUpToDateException extends \Exception {} +class SitesNotUpToDateException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/spark-meter/src/Exceptions/SparkAPIResponseException.php b/src/backend/packages/inensus/spark-meter/src/Exceptions/SparkAPIResponseException.php index 595c3a4e2..cd22db5b8 100644 --- a/src/backend/packages/inensus/spark-meter/src/Exceptions/SparkAPIResponseException.php +++ b/src/backend/packages/inensus/spark-meter/src/Exceptions/SparkAPIResponseException.php @@ -2,4 +2,6 @@ namespace Inensus\SparkMeter\Exceptions; -class SparkAPIResponseException extends \Exception {} +class SparkAPIResponseException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/spark-meter/src/Exceptions/WrongCredentialsException.php b/src/backend/packages/inensus/spark-meter/src/Exceptions/WrongCredentialsException.php index 06dab1b37..ad5eca5af 100644 --- a/src/backend/packages/inensus/spark-meter/src/Exceptions/WrongCredentialsException.php +++ b/src/backend/packages/inensus/spark-meter/src/Exceptions/WrongCredentialsException.php @@ -2,4 +2,6 @@ namespace Inensus\SparkMeter\Exceptions; -class WrongCredentialsException extends \Exception {} +class WrongCredentialsException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/spark-meter/src/Observers/GeographicalInformationObserver.php b/src/backend/packages/inensus/spark-meter/src/Observers/GeographicalInformationObserver.php index b75275113..e0e69db02 100644 --- a/src/backend/packages/inensus/spark-meter/src/Observers/GeographicalInformationObserver.php +++ b/src/backend/packages/inensus/spark-meter/src/Observers/GeographicalInformationObserver.php @@ -18,7 +18,8 @@ public function __construct( private Person $person, private SmCustomer $smCustomer, private PluginsService $pluginsService, - ) {} + ) { + } public function updated(GeographicalInformation $geographicalInformation) { diff --git a/src/backend/packages/inensus/spark-meter/src/Services/CustomerService.php b/src/backend/packages/inensus/spark-meter/src/Services/CustomerService.php index 4bff64c36..e5e20b6e7 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/CustomerService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/CustomerService.php @@ -200,14 +200,14 @@ public function createRelatedPerson($customer, $site_id) $meter = $this->meter->newQuery()->where('serial_number', $sparkCustomerMeterSerial)->first(); $person = null; if ($meter === null) { - $meter = new Meter; - $meterParameter = new MeterParameter; - $geoLocation = new GeographicalInformation; + $meter = new Meter(); + $meterParameter = new MeterParameter(); + $geoLocation = new GeographicalInformation(); } else { $meterParameter = $this->meterParameter->newQuery()->where('meter_id', $meter->id)->first(); $geoLocation = $meterParameter->geo()->first(); if ($geoLocation === null) { - $geoLocation = new GeographicalInformation; + $geoLocation = new GeographicalInformation(); } $person = $this->person->newQuery()->whereHas('meters', static function ($q) use ($meterParameter) { return $q->where('id', $meterParameter->id); @@ -261,7 +261,7 @@ function ($q) use ($currentTariffName) { $site = $this->smSite->newQuery()->with('mpmMiniGrid')->where('site_id', $site_id)->firstOrFail(); $sparkCity = $site->mpmMiniGrid->cities[0]; - $address = new Address; + $address = new Address(); $address = $address->newQuery()->create([ 'city_id' => request()->input('city_id') ?? $sparkCity->id, ]); diff --git a/src/backend/packages/inensus/steama-meter/src/Exceptions/CronJobException.php b/src/backend/packages/inensus/steama-meter/src/Exceptions/CronJobException.php index b64feba19..4ef8e9804 100644 --- a/src/backend/packages/inensus/steama-meter/src/Exceptions/CronJobException.php +++ b/src/backend/packages/inensus/steama-meter/src/Exceptions/CronJobException.php @@ -2,4 +2,6 @@ namespace Inensus\SteamaMeter\Exceptions; -class CronJobException extends \Exception {} +class CronJobException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/steama-meter/src/Exceptions/ModelNotFoundException.php b/src/backend/packages/inensus/steama-meter/src/Exceptions/ModelNotFoundException.php index 2a743e2f9..609220536 100644 --- a/src/backend/packages/inensus/steama-meter/src/Exceptions/ModelNotFoundException.php +++ b/src/backend/packages/inensus/steama-meter/src/Exceptions/ModelNotFoundException.php @@ -2,4 +2,6 @@ namespace Inensus\SteamaMeter\Exceptions; -class ModelNotFoundException extends \Exception {} +class ModelNotFoundException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/steama-meter/src/Exceptions/SteamaApiResponseException.php b/src/backend/packages/inensus/steama-meter/src/Exceptions/SteamaApiResponseException.php index 219f7d6c7..409427086 100644 --- a/src/backend/packages/inensus/steama-meter/src/Exceptions/SteamaApiResponseException.php +++ b/src/backend/packages/inensus/steama-meter/src/Exceptions/SteamaApiResponseException.php @@ -2,4 +2,6 @@ namespace Inensus\SteamaMeter\Exceptions; -class SteamaApiResponseException extends \Exception {} +class SteamaApiResponseException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/steama-meter/src/Exceptions/WrongCredentialsException.php b/src/backend/packages/inensus/steama-meter/src/Exceptions/WrongCredentialsException.php index c77d42a6c..8d4b366a8 100644 --- a/src/backend/packages/inensus/steama-meter/src/Exceptions/WrongCredentialsException.php +++ b/src/backend/packages/inensus/steama-meter/src/Exceptions/WrongCredentialsException.php @@ -2,4 +2,6 @@ namespace Inensus\SteamaMeter\Exceptions; -class WrongCredentialsException extends \Exception {} +class WrongCredentialsException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/steama-meter/src/Services/PackageInstallationService.php b/src/backend/packages/inensus/steama-meter/src/Services/PackageInstallationService.php index ef48cd23e..62cb4f3af 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/PackageInstallationService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/PackageInstallationService.php @@ -19,7 +19,8 @@ public function __construct( private SteamaSmsBodyService $smsBodyService, private SteamaSmsVariableDefaultValueService $defaultValueService, private SteamaSmsFeedbackWordService $steamaSmsFeedbackWordService, - ) {} + ) { + } public function createDefaultSettingRecords() { diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaMeterService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaMeterService.php index 7edc31d86..9aef3289e 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaMeterService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaMeterService.php @@ -43,7 +43,8 @@ public function __construct( private SteamaTariff $tariff, private SteamaSyncSettingService $steamaSyncSettingService, private StemaSyncActionService $steamaSyncActionService, - ) {} + ) { + } public function getMeters($request) { @@ -166,14 +167,14 @@ public function createRelatedMeter($stmMeter) $stmMeter['customer'] )->first(); if ($meter === null) { - $meter = new Meter; - $meterParameter = new MeterParameter; - $geoLocation = new GeographicalInformation; + $meter = new Meter(); + $meterParameter = new MeterParameter(); + $geoLocation = new GeographicalInformation(); } else { $meterParameter = $this->meterParameter->newQuery()->where('meter_id', $meter->id)->first(); $geoLocation = $meterParameter->geo()->first(); if ($geoLocation === null) { - $geoLocation = new GeographicalInformation; + $geoLocation = new GeographicalInformation(); } } $meter->serial_number = $meterSerial; @@ -217,7 +218,7 @@ public function createRelatedMeter($stmMeter) $cityName = $stmCustomerAddress->addresses[0]->city->name; $steamaCity = $this->city->newQuery()->with('miniGrid')->where('name', $cityName)->first(); - $address = new Address; + $address = new Address(); $address = $address->newQuery()->create([ 'city_id' => request()->input('city_id') ?? $steamaCity->id, ]); diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaTariffService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaTariffService.php index cfdc5031c..fb2781dea 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaTariffService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaTariffService.php @@ -7,7 +7,9 @@ class SteamaTariffService { - public function __construct(private readonly SteamaTariff $tariff, private readonly MeterTariff $meterTariff) {} + public function __construct(private readonly SteamaTariff $tariff, private readonly MeterTariff $meterTariff) + { + } /** * This function uses one time on installation of the package. diff --git a/src/backend/packages/inensus/steama-meter/src/SteamaMeterApi.php b/src/backend/packages/inensus/steama-meter/src/SteamaMeterApi.php index afafe565e..0eca704df 100644 --- a/src/backend/packages/inensus/steama-meter/src/SteamaMeterApi.php +++ b/src/backend/packages/inensus/steama-meter/src/SteamaMeterApi.php @@ -107,5 +107,7 @@ public function chargeDevice(TransactionDataContainer $transactionContainer): ar } } - public function clearDevice(Device $device) {} + public function clearDevice(Device $device) + { + } } diff --git a/src/backend/packages/inensus/stron-meter/src/Exceptions/StronApiResponseException.php b/src/backend/packages/inensus/stron-meter/src/Exceptions/StronApiResponseException.php index 37808a756..22007d2aa 100644 --- a/src/backend/packages/inensus/stron-meter/src/Exceptions/StronApiResponseException.php +++ b/src/backend/packages/inensus/stron-meter/src/Exceptions/StronApiResponseException.php @@ -2,4 +2,6 @@ namespace Inensus\StronMeter\Exceptions; -class StronApiResponseException extends \Exception {} +class StronApiResponseException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/sun-king-shs/src/Http/Controllers/SunKingCredentialController.php b/src/backend/packages/inensus/sun-king-shs/src/Http/Controllers/SunKingCredentialController.php index 3c39f7035..8dea71db2 100644 --- a/src/backend/packages/inensus/sun-king-shs/src/Http/Controllers/SunKingCredentialController.php +++ b/src/backend/packages/inensus/sun-king-shs/src/Http/Controllers/SunKingCredentialController.php @@ -9,7 +9,9 @@ class SunKingCredentialController extends Controller { - public function __construct(private SunKingCredentialService $credentialService) {} + public function __construct(private SunKingCredentialService $credentialService) + { + } public function show(): SunKingResource { diff --git a/src/backend/packages/inensus/sun-king-shs/src/Modules/Api/ApiRequests.php b/src/backend/packages/inensus/sun-king-shs/src/Modules/Api/ApiRequests.php index b064711f9..905cb022c 100644 --- a/src/backend/packages/inensus/sun-king-shs/src/Modules/Api/ApiRequests.php +++ b/src/backend/packages/inensus/sun-king-shs/src/Modules/Api/ApiRequests.php @@ -12,7 +12,8 @@ class ApiRequests { public function __construct( private Client $httpClient, - ) {} + ) { + } public function authentication($credential): array { diff --git a/src/backend/packages/inensus/sun-king-shs/src/Modules/Api/SunKingSHSApi.php b/src/backend/packages/inensus/sun-king-shs/src/Modules/Api/SunKingSHSApi.php index 6931622c8..9ffeae752 100644 --- a/src/backend/packages/inensus/sun-king-shs/src/Modules/Api/SunKingSHSApi.php +++ b/src/backend/packages/inensus/sun-king-shs/src/Modules/Api/SunKingSHSApi.php @@ -21,7 +21,8 @@ public function __construct( private SunKingCredentialService $credentialService, private SunKingTransaction $sunKingTransaction, private ApiRequests $apiRequests, - ) {} + ) { + } public function chargeDevice(TransactionDataContainer $transactionContainer): array { diff --git a/src/backend/packages/inensus/sun-king-shs/src/Services/ManufacturerService.php b/src/backend/packages/inensus/sun-king-shs/src/Services/ManufacturerService.php index 99baae766..0568b8944 100644 --- a/src/backend/packages/inensus/sun-king-shs/src/Services/ManufacturerService.php +++ b/src/backend/packages/inensus/sun-king-shs/src/Services/ManufacturerService.php @@ -6,7 +6,9 @@ class ManufacturerService { - public function __construct(private Manufacturer $manufacturer) {} + public function __construct(private Manufacturer $manufacturer) + { + } public function register() { diff --git a/src/backend/packages/inensus/sun-king-shs/src/Services/SunKingCredentialService.php b/src/backend/packages/inensus/sun-king-shs/src/Services/SunKingCredentialService.php index 0a08a1357..bc416a9b6 100644 --- a/src/backend/packages/inensus/sun-king-shs/src/Services/SunKingCredentialService.php +++ b/src/backend/packages/inensus/sun-king-shs/src/Services/SunKingCredentialService.php @@ -8,7 +8,8 @@ class SunKingCredentialService { public function __construct( private SunKingCredential $credential, - ) {} + ) { + } /** * This function uses one time on installation of the package. diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/CipherNotValidException.php b/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/CipherNotValidException.php index 9e0bbbcd3..954e9fd40 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/CipherNotValidException.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/CipherNotValidException.php @@ -2,4 +2,6 @@ namespace Inensus\SwiftaPaymentProvider\Exceptions; -class CipherNotValidException extends \Exception {} +class CipherNotValidException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/CustomerAddressNotFoundException.php b/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/CustomerAddressNotFoundException.php index 36e415f33..8c548c73f 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/CustomerAddressNotFoundException.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/CustomerAddressNotFoundException.php @@ -2,4 +2,6 @@ namespace Inensus\SwiftaPaymentProvider\Exceptions; -class CustomerAddressNotFoundException extends \Exception {} +class CustomerAddressNotFoundException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/SwiftaValidationFailedException.php b/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/SwiftaValidationFailedException.php index ae16b3fb1..1220242ac 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/SwiftaValidationFailedException.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/SwiftaValidationFailedException.php @@ -2,4 +2,6 @@ namespace Inensus\SwiftaPaymentProvider\Exceptions; -class SwiftaValidationFailedException extends \Exception {} +class SwiftaValidationFailedException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/TransactionAmountDifferentException.php b/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/TransactionAmountDifferentException.php index 5ac2ad6a1..1b958300b 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/TransactionAmountDifferentException.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/TransactionAmountDifferentException.php @@ -2,4 +2,6 @@ namespace Inensus\SwiftaPaymentProvider\Exceptions; -class TransactionAmountDifferentException extends \Exception {} +class TransactionAmountDifferentException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/TransactionNotExistsException.php b/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/TransactionNotExistsException.php index 6f45bda5f..5be8a2415 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/TransactionNotExistsException.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/TransactionNotExistsException.php @@ -2,4 +2,6 @@ namespace Inensus\SwiftaPaymentProvider\Exceptions; -class TransactionNotExistsException extends \Exception {} +class TransactionNotExistsException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Http/Controllers/SwiftaAuthenticationController.php b/src/backend/packages/inensus/swifta-payment-provider/src/Http/Controllers/SwiftaAuthenticationController.php index f4e1915e4..99fee28a5 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Http/Controllers/SwiftaAuthenticationController.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Http/Controllers/SwiftaAuthenticationController.php @@ -8,7 +8,9 @@ class SwiftaAuthenticationController extends Controller { - public function __construct(private SwiftaAuthenticationService $swiftaAuthenticationService) {} + public function __construct(private SwiftaAuthenticationService $swiftaAuthenticationService) + { + } public function show(): ApiResource { diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Http/Controllers/SwiftaPaymentProviderController.php b/src/backend/packages/inensus/swifta-payment-provider/src/Http/Controllers/SwiftaPaymentProviderController.php index 0bfdbb2fd..300d77513 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Http/Controllers/SwiftaPaymentProviderController.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Http/Controllers/SwiftaPaymentProviderController.php @@ -11,7 +11,9 @@ class SwiftaPaymentProviderController extends Controller { - public function __construct(private SwiftaTransactionService $swiftaTransactionService) {} + public function __construct(private SwiftaTransactionService $swiftaTransactionService) + { + } public function validation(SwiftaValidationRequest $request) { diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Http/Middleware/SwiftaTransactionCallbackMiddleware.php b/src/backend/packages/inensus/swifta-payment-provider/src/Http/Middleware/SwiftaTransactionCallbackMiddleware.php index 487ed2ea9..ad9af1208 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Http/Middleware/SwiftaTransactionCallbackMiddleware.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Http/Middleware/SwiftaTransactionCallbackMiddleware.php @@ -9,7 +9,9 @@ class SwiftaTransactionCallbackMiddleware { - public function __construct(private SwiftaTransactionService $swiftaTransactionService) {} + public function __construct(private SwiftaTransactionService $swiftaTransactionService) + { + } public function handle(Request $request, \Closure $next) { diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Providers/SwiftaTransactionProvider.php b/src/backend/packages/inensus/swifta-payment-provider/src/Providers/SwiftaTransactionProvider.php index 5bc17517e..e1e58b33c 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Providers/SwiftaTransactionProvider.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Providers/SwiftaTransactionProvider.php @@ -22,7 +22,8 @@ public function __construct( private Transaction $transaction, private SwiftaTransactionService $swiftaTransactionService, private TransactionConflicts $transactionConflicts, - ) {} + ) { + } public function validateRequest($request) { diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Services/SwiftaAuthenticationService.php b/src/backend/packages/inensus/swifta-payment-provider/src/Services/SwiftaAuthenticationService.php index be89b3d58..ced42711f 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Services/SwiftaAuthenticationService.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Services/SwiftaAuthenticationService.php @@ -6,7 +6,9 @@ class SwiftaAuthenticationService { - public function __construct(private SwiftaAuthentication $swiftaAuthentication) {} + public function __construct(private SwiftaAuthentication $swiftaAuthentication) + { + } public function getSwiftaAuthentication() { diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Services/SwiftaTransactionService.php b/src/backend/packages/inensus/swifta-payment-provider/src/Services/SwiftaTransactionService.php index 4594a42a2..85970670c 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Services/SwiftaTransactionService.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Services/SwiftaTransactionService.php @@ -53,7 +53,7 @@ public function setRequestedTransactionsStatusFailed() 'status' => SwiftaTransaction::STATUS_FAILED, ]); $message = 'The transaction that stayed as Unprocessed more than 24 hours, updated to canceled.'; - $conflict = new TransactionConflicts; + $conflict = new TransactionConflicts(); $conflict->state = $message; $conflict->transaction()->associate($transaction); $conflict->save(); diff --git a/src/backend/packages/inensus/ticket/src/Exceptions/ApiUserNotFound.php b/src/backend/packages/inensus/ticket/src/Exceptions/ApiUserNotFound.php index 28f351359..081ae012e 100644 --- a/src/backend/packages/inensus/ticket/src/Exceptions/ApiUserNotFound.php +++ b/src/backend/packages/inensus/ticket/src/Exceptions/ApiUserNotFound.php @@ -2,4 +2,6 @@ namespace Inensus\Ticket\Exceptions; -class ApiUserNotFound extends \Exception {} +class ApiUserNotFound extends \Exception +{ +} diff --git a/src/backend/packages/inensus/ticket/src/Exceptions/TicketOwnerNotFoundException.php b/src/backend/packages/inensus/ticket/src/Exceptions/TicketOwnerNotFoundException.php index c6ff994c0..0cb518af5 100644 --- a/src/backend/packages/inensus/ticket/src/Exceptions/TicketOwnerNotFoundException.php +++ b/src/backend/packages/inensus/ticket/src/Exceptions/TicketOwnerNotFoundException.php @@ -2,4 +2,6 @@ namespace Inensus\Ticket\Exceptions; -class TicketOwnerNotFoundException extends \Exception {} +class TicketOwnerNotFoundException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketAgentController.php b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketAgentController.php index dc496183a..52003b9f8 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketAgentController.php +++ b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketAgentController.php @@ -8,7 +8,9 @@ class TicketAgentController extends Controller { - public function __construct(private TicketService $ticketService) {} + public function __construct(private TicketService $ticketService) + { + } public function index($agentId, Request $request): TicketResource { diff --git a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCategoryController.php b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCategoryController.php index 921a55471..44e9c6f1d 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCategoryController.php +++ b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCategoryController.php @@ -9,7 +9,9 @@ class TicketCategoryController extends Controller { - public function __construct(private TicketCategoryService $ticketCategoryService) {} + public function __construct(private TicketCategoryService $ticketCategoryService) + { + } /** * A list of all stored labels/categories. diff --git a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCommentController.php b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCommentController.php index af9b38648..f144a1a1b 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCommentController.php +++ b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCommentController.php @@ -10,7 +10,9 @@ class TicketCommentController extends Controller { - public function __construct(private TicketCommentService $ticketCommentService, private TicketUserService $ticketUserService) {} + public function __construct(private TicketCommentService $ticketCommentService, private TicketUserService $ticketUserService) + { + } public function store(Request $request) { diff --git a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketController.php b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketController.php index d84a6d724..de5d0e833 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketController.php +++ b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketController.php @@ -10,7 +10,9 @@ class TicketController extends Controller { public const FOR_APP = false; - public function __construct(private TicketService $ticketService) {} + public function __construct(private TicketService $ticketService) + { + } public function index(Request $request): TicketResource { diff --git a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCustomerController.php b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCustomerController.php index 0fd612d8f..48eec9212 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCustomerController.php +++ b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCustomerController.php @@ -25,7 +25,8 @@ public function __construct( private TicketOutSourceService $ticketOutSourceService, private MaintenanceUserService $maintenanceUserService, private MaintenanceUserTicketService $maintenanceUserTicketService, - ) {} + ) { + } public function store(UserTicketCreateRequest $request): TicketResource { diff --git a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketExportController.php b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketExportController.php index 6b9ba8d6a..b0ab396bf 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketExportController.php +++ b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketExportController.php @@ -13,7 +13,8 @@ class TicketExportController public function __construct( private TicketOutsourceReportService $ticketOutsourceReportService, private TicketService $ticketService, - ) {} + ) { + } /** * A list of stored book keeping data. diff --git a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketUserController.php b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketUserController.php index a6383213f..bd23a2f21 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketUserController.php +++ b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketUserController.php @@ -14,7 +14,8 @@ class TicketUserController extends Controller public function __construct( private TicketUserService $ticketUserService, private UserService $userService, - ) {} + ) { + } public function index(Request $request): TicketResource { diff --git a/src/backend/packages/inensus/ticket/src/Models/BaseModel.php b/src/backend/packages/inensus/ticket/src/Models/BaseModel.php index c49f487c9..3097d4d06 100644 --- a/src/backend/packages/inensus/ticket/src/Models/BaseModel.php +++ b/src/backend/packages/inensus/ticket/src/Models/BaseModel.php @@ -2,4 +2,6 @@ namespace Inensus\Ticket\Models; -class BaseModel extends \App\Models\Base\BaseModel {} +class BaseModel extends \App\Models\Base\BaseModel +{ +} diff --git a/src/backend/packages/inensus/ticket/src/Services/TicketCategoryService.php b/src/backend/packages/inensus/ticket/src/Services/TicketCategoryService.php index 36213d666..11278724c 100644 --- a/src/backend/packages/inensus/ticket/src/Services/TicketCategoryService.php +++ b/src/backend/packages/inensus/ticket/src/Services/TicketCategoryService.php @@ -14,7 +14,8 @@ class TicketCategoryService implements IBaseService { public function __construct( private TicketCategory $ticketCategory, - ) {} + ) { + } public function getById(int $categoryId): TicketCategory { diff --git a/src/backend/packages/inensus/ticket/src/Services/TicketCommentService.php b/src/backend/packages/inensus/ticket/src/Services/TicketCommentService.php index 75a17d774..0326c4ff1 100644 --- a/src/backend/packages/inensus/ticket/src/Services/TicketCommentService.php +++ b/src/backend/packages/inensus/ticket/src/Services/TicketCommentService.php @@ -11,7 +11,8 @@ public function __construct( private Person $person, private TicketComment $ticketComment, private TicketUserService $ticketUserService - ) {} + ) { + } public function createComment(int $ticketId, string $comment, int $ticketUserId): TicketComment { diff --git a/src/backend/packages/inensus/ticket/src/Services/TicketOutSourceService.php b/src/backend/packages/inensus/ticket/src/Services/TicketOutSourceService.php index 1bd2b21c7..e70bcb414 100644 --- a/src/backend/packages/inensus/ticket/src/Services/TicketOutSourceService.php +++ b/src/backend/packages/inensus/ticket/src/Services/TicketOutSourceService.php @@ -13,7 +13,8 @@ class TicketOutSourceService implements IBaseService { public function __construct( private TicketOutsource $ticketOutsource, - ) {} + ) { + } public function getById(int $ticketOutsourceId): TicketOutsource { diff --git a/src/backend/packages/inensus/ticket/src/Services/TicketOutsourceReportService.php b/src/backend/packages/inensus/ticket/src/Services/TicketOutsourceReportService.php index f365c7514..3319c575d 100644 --- a/src/backend/packages/inensus/ticket/src/Services/TicketOutsourceReportService.php +++ b/src/backend/packages/inensus/ticket/src/Services/TicketOutsourceReportService.php @@ -18,7 +18,8 @@ class TicketOutsourceReportService implements IBaseService public function __construct( private TicketOutsourceReport $ticketOutsourceReport, private Spreadsheet $spreadsheet - ) {} + ) { + } public function getAll(?int $limit = null): Collection|LengthAwarePaginator { diff --git a/src/backend/packages/inensus/ticket/src/Services/TicketService.php b/src/backend/packages/inensus/ticket/src/Services/TicketService.php index 3314de769..9bba24c0f 100644 --- a/src/backend/packages/inensus/ticket/src/Services/TicketService.php +++ b/src/backend/packages/inensus/ticket/src/Services/TicketService.php @@ -14,7 +14,8 @@ class TicketService implements IAssociative { public function __construct( private Ticket $ticket, - ) {} + ) { + } public function create( string $title, diff --git a/src/backend/packages/inensus/ticket/src/Services/TicketUserService.php b/src/backend/packages/inensus/ticket/src/Services/TicketUserService.php index 40e7c669f..14f6c8153 100644 --- a/src/backend/packages/inensus/ticket/src/Services/TicketUserService.php +++ b/src/backend/packages/inensus/ticket/src/Services/TicketUserService.php @@ -16,7 +16,8 @@ class TicketUserService implements IBaseService public function __construct( private TicketUser $ticketUser, private User $user, - ) {} + ) { + } public function getAll(?int $limit = null, ?bool $outsource = null): Collection|LengthAwarePaginator { diff --git a/src/backend/packages/inensus/viber-messaging/src/Exceptions/MessageNotSentException.php b/src/backend/packages/inensus/viber-messaging/src/Exceptions/MessageNotSentException.php index 6b51cfa7c..774de2d69 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Exceptions/MessageNotSentException.php +++ b/src/backend/packages/inensus/viber-messaging/src/Exceptions/MessageNotSentException.php @@ -2,4 +2,6 @@ namespace Inensus\ViberMessaging\Exceptions; -class MessageNotSentException extends \Exception {} +class MessageNotSentException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/viber-messaging/src/Exceptions/WebhookNotCreatedException.php b/src/backend/packages/inensus/viber-messaging/src/Exceptions/WebhookNotCreatedException.php index 4522049ec..4837bd754 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Exceptions/WebhookNotCreatedException.php +++ b/src/backend/packages/inensus/viber-messaging/src/Exceptions/WebhookNotCreatedException.php @@ -2,4 +2,6 @@ namespace Inensus\ViberMessaging\Exceptions; -class WebhookNotCreatedException extends \Exception {} +class WebhookNotCreatedException extends \Exception +{ +} diff --git a/src/backend/packages/inensus/viber-messaging/src/Http/Controllers/ViberCredentialController.php b/src/backend/packages/inensus/viber-messaging/src/Http/Controllers/ViberCredentialController.php index 67bd8cde5..0dcde78ae 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Http/Controllers/ViberCredentialController.php +++ b/src/backend/packages/inensus/viber-messaging/src/Http/Controllers/ViberCredentialController.php @@ -14,7 +14,8 @@ class ViberCredentialController extends Controller public function __construct( private ViberCredentialService $credentialService, private DatabaseProxyManagerService $databaseProxyManagerService, - ) {} + ) { + } public function show(): ViberResource { diff --git a/src/backend/packages/inensus/viber-messaging/src/Http/Controllers/WebhookController.php b/src/backend/packages/inensus/viber-messaging/src/Http/Controllers/WebhookController.php index 67d1ac553..3c56ebf24 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Http/Controllers/WebhookController.php +++ b/src/backend/packages/inensus/viber-messaging/src/Http/Controllers/WebhookController.php @@ -45,7 +45,7 @@ public function index(string $slug) $resendInformationKey = $this->smsResendInformationKeyService->getResendInformationKeys()->first()->key; $this->bot ->onConversation(function ($event) { - return (new \Viber\Api\Message\Text)->setSender($this->botSender)->setText('Can I help you?'); + return (new \Viber\Api\Message\Text())->setSender($this->botSender)->setText('Can I help you?'); }) ->onText('|register+.*|si', function ($event) use ($bot, $botSender) { $message = $event->getMessage()->getText(); @@ -157,7 +157,7 @@ private function setNoTransactionMessage($meterSerial) private function answerToCustomer($bot, $botSender, $event, $message) { $bot->getClient()->sendMessage( - (new \Viber\Api\Message\Text) + (new \Viber\Api\Message\Text()) ->setSender($botSender) ->setReceiver($event->getSender()->getId()) ->setText("Hello, {$event->getSender()->getName()}! {$message}") diff --git a/src/backend/packages/inensus/viber-messaging/src/Services/ViberContactService.php b/src/backend/packages/inensus/viber-messaging/src/Services/ViberContactService.php index e46d979d7..bbeb6998c 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Services/ViberContactService.php +++ b/src/backend/packages/inensus/viber-messaging/src/Services/ViberContactService.php @@ -15,7 +15,8 @@ class ViberContactService implements IBaseService public function __construct( private ViberContact $viberContact, private Person $person, - ) {} + ) { + } public function createContact($personId, $viberId) { diff --git a/src/backend/packages/inensus/viber-messaging/src/Services/ViberCredentialService.php b/src/backend/packages/inensus/viber-messaging/src/Services/ViberCredentialService.php index 2bccbdd0f..bd544b9f8 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Services/ViberCredentialService.php +++ b/src/backend/packages/inensus/viber-messaging/src/Services/ViberCredentialService.php @@ -10,7 +10,8 @@ public function __construct( private ViberCredential $credential, private WebhookService $webhookService, private AccountService $accountService, - ) {} + ) { + } /** * This function uses one time on installation of the package. diff --git a/src/backend/packages/inensus/viber-messaging/src/Services/ViberMessageService.php b/src/backend/packages/inensus/viber-messaging/src/Services/ViberMessageService.php index 0b2848501..c480c60c9 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Services/ViberMessageService.php +++ b/src/backend/packages/inensus/viber-messaging/src/Services/ViberMessageService.php @@ -13,7 +13,8 @@ class ViberMessageService implements IBaseService { public function __construct( private ViberMessage $viberMessage, - ) {} + ) { + } public function getById(int $id): ViberMessage { diff --git a/src/backend/packages/inensus/viber-messaging/src/ViberGateway.php b/src/backend/packages/inensus/viber-messaging/src/ViberGateway.php index c6f45421c..3d39bb5ed 100644 --- a/src/backend/packages/inensus/viber-messaging/src/ViberGateway.php +++ b/src/backend/packages/inensus/viber-messaging/src/ViberGateway.php @@ -36,7 +36,7 @@ public function sendSms( ) { try { $this->bot->getClient()->sendMessage( - (new \Viber\Api\Message\Text) + (new \Viber\Api\Message\Text()) ->setSender($this->botSender) ->setReceiver($viberId) ->setText($body) diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Controllers/WaveMoneyController.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Controllers/WaveMoneyController.php index f0f2b3db4..3add2dc85 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Controllers/WaveMoneyController.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Controllers/WaveMoneyController.php @@ -16,7 +16,8 @@ class WaveMoneyController extends Controller public function __construct( private WaveMoneyTransactionService $transactionService, private WaveMoneyApiService $apiService, - ) {} + ) { + } public function startTransaction(TransactionInitializeRequest $request): WaveMoneyResource { diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Controllers/WaveMoneyCredentialController.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Controllers/WaveMoneyCredentialController.php index f7df5bdbd..a0fa27144 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Controllers/WaveMoneyCredentialController.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Controllers/WaveMoneyCredentialController.php @@ -16,7 +16,8 @@ public function __construct( private WaveMoneyCredentialService $credentialService, private DatabaseProxyManagerService $databaseProxyManagerService, private CompanyService $companyService, - ) {} + ) { + } public function show(): WaveMoneyResource { diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Middleware/WaveMoneyTransactionCallbackMiddleware.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Middleware/WaveMoneyTransactionCallbackMiddleware.php index a4e62afc9..1a500b31f 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Middleware/WaveMoneyTransactionCallbackMiddleware.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Middleware/WaveMoneyTransactionCallbackMiddleware.php @@ -13,11 +13,13 @@ class WaveMoneyTransactionCallbackMiddleware { - public function __construct(private WaveMoneyTransactionService $transactionService) {} + public function __construct(private WaveMoneyTransactionService $transactionService) + { + } public function handle(Request $request, \Closure $next) { - $mapper = new TransactionCallbackRequestMapper; + $mapper = new TransactionCallbackRequestMapper(); $callbackData = $mapper->getMappedObject($request); try { $waveMoneyTransaction = $this->transactionService->getByOrderId($callbackData->getOrderId()); diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/AbstractApi.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/AbstractApi.php index c0ab9c998..b59f46d74 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/AbstractApi.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/AbstractApi.php @@ -10,7 +10,9 @@ abstract class AbstractApi { - public function __construct(private Client $client) {} + public function __construct(private Client $client) + { + } public function doRequest(AbstractApiResource $resource): AbstractApiResource { diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Data/TransactionCallbackData.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Data/TransactionCallbackData.php index 993ce7f93..19cba1eea 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Data/TransactionCallbackData.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Data/TransactionCallbackData.php @@ -41,7 +41,8 @@ public function __construct( private ?string $additional3, private ?string $additional4, private ?string $additional5, - ) {} + ) { + } public function getStatus(): string { diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Resources/StartTransactionResource.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Resources/StartTransactionResource.php index 3caa3c01b..91bba4230 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Resources/StartTransactionResource.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Resources/StartTransactionResource.php @@ -17,7 +17,8 @@ class StartTransactionResource extends AbstractApiResource public function __construct( private WaveMoneyCredential $waveMoneyCredential, private WaveMoneyTransaction $waveMoneyTransaction, - ) {} + ) { + } public function getRequestMethod(): string { diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/WaveMoneyApi.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/WaveMoneyApi.php index 7e9d95d30..37694efca 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/WaveMoneyApi.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/WaveMoneyApi.php @@ -2,4 +2,6 @@ namespace Inensus\WaveMoneyPaymentProvider\Modules\Api; -class WaveMoneyApi extends AbstractApi {} +class WaveMoneyApi extends AbstractApi +{ +} diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/WaveMoneyApiService.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/WaveMoneyApiService.php index e8cb78df8..68db1b9e7 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/WaveMoneyApiService.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/WaveMoneyApiService.php @@ -13,7 +13,8 @@ class WaveMoneyApiService public function __construct( private WaveMoneyApi $api, private WaveMoneyCredentialService $credentialService, - ) {} + ) { + } public function requestPayment(WaveMoneyTransaction $transaction): array { diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/WaveMoneyTransactionProvider.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/WaveMoneyTransactionProvider.php index f98ce18be..cccac46c3 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/WaveMoneyTransactionProvider.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/WaveMoneyTransactionProvider.php @@ -22,7 +22,8 @@ public function __construct( private Transaction $transaction, private WaveMoneyTransactionService $waveMoneyTransactionService, private TransactionConflicts $transactionConflicts, - ) {} + ) { + } public function validateRequest($request) { diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Services/WaveMoneyCredentialService.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Services/WaveMoneyCredentialService.php index ba83541e8..be608a888 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Services/WaveMoneyCredentialService.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Services/WaveMoneyCredentialService.php @@ -8,7 +8,8 @@ class WaveMoneyCredentialService { public function __construct( private WaveMoneyCredential $credential, - ) {} + ) { + } /** * This function uses one time on installation of the package. diff --git a/src/backend/packages/inensus/wavecom-payment-provider/src/Http/Controllers/WaveComTransactionController.php b/src/backend/packages/inensus/wavecom-payment-provider/src/Http/Controllers/WaveComTransactionController.php index 0727b297e..72eb7e2a5 100644 --- a/src/backend/packages/inensus/wavecom-payment-provider/src/Http/Controllers/WaveComTransactionController.php +++ b/src/backend/packages/inensus/wavecom-payment-provider/src/Http/Controllers/WaveComTransactionController.php @@ -11,7 +11,9 @@ class WaveComTransactionController extends Controller { - public function __construct(private TransactionService $transactionService) {} + public function __construct(private TransactionService $transactionService) + { + } public function uploadTransaction(UploadTransactionRequest $request): ApiResource { diff --git a/src/backend/packages/inensus/wavecom-payment-provider/src/Providers/WaveComTransactionProvider.php b/src/backend/packages/inensus/wavecom-payment-provider/src/Providers/WaveComTransactionProvider.php index 945a4c907..d23449afa 100644 --- a/src/backend/packages/inensus/wavecom-payment-provider/src/Providers/WaveComTransactionProvider.php +++ b/src/backend/packages/inensus/wavecom-payment-provider/src/Providers/WaveComTransactionProvider.php @@ -24,7 +24,8 @@ public function __construct( private SmsService $smsService, private TransactionConflicts $transactionConflicts, private WaveComTransaction $waveComTransaction, - ) {} + ) { + } public function saveTransaction() { diff --git a/src/backend/packages/inensus/wavecom-payment-provider/src/Services/TransactionService.php b/src/backend/packages/inensus/wavecom-payment-provider/src/Services/TransactionService.php index 2a4916f92..3253f4111 100644 --- a/src/backend/packages/inensus/wavecom-payment-provider/src/Services/TransactionService.php +++ b/src/backend/packages/inensus/wavecom-payment-provider/src/Services/TransactionService.php @@ -17,7 +17,9 @@ class TransactionService extends AbstractPaymentAggregatorTransactionService { - public function __construct(private Csv $csv) {} + public function __construct(private Csv $csv) + { + } public function createTransactionsFromFile(UploadedFile $file): array { @@ -28,7 +30,7 @@ public function createTransactionsFromFile(UploadedFile $file): array foreach ($this->csv->data as $transactionData) { try { $this->validateTransaction($transactionData); - $transaction = new WaveComTransaction; + $transaction = new WaveComTransaction(); $transaction->setTransactionId($transactionData['transaction_id']); $transaction->setSender($transactionData['sender']); @@ -48,7 +50,7 @@ public function createTransactionsFromFile(UploadedFile $file): array continue; } - $baseTransaction = new Transaction; + $baseTransaction = new Transaction(); $baseTransaction->setAmount($transaction->getAmount()); $baseTransaction->setSender($transaction->getSender()); $baseTransaction->setMessage($transaction->getMessage()); diff --git a/src/backend/tests/Feature/SocialTariffPiggyBankTest.php b/src/backend/tests/Feature/SocialTariffPiggyBankTest.php index aa410eaf3..22cfe95d9 100644 --- a/src/backend/tests/Feature/SocialTariffPiggyBankTest.php +++ b/src/backend/tests/Feature/SocialTariffPiggyBankTest.php @@ -44,7 +44,7 @@ public function testAddPiggyBankBalance() $createPiggyBankJob = new CreatePiggyBankEntry(Person::first()->meters()->first()); $createPiggyBankJob->handle(); - $job = new SocialTariffPiggyBankManager; + $job = new SocialTariffPiggyBankManager(); $socialTariff = SocialTariff::first(); $socialBank = SocialTariffPiggyBank::first(); $savings = $socialBank->savings; diff --git a/src/backend/tests/Unit/Exports/DailyTransactions.php b/src/backend/tests/Unit/Exports/DailyTransactions.php index d2b04d1d3..7e6d6aefe 100644 --- a/src/backend/tests/Unit/Exports/DailyTransactions.php +++ b/src/backend/tests/Unit/Exports/DailyTransactions.php @@ -7,5 +7,7 @@ class DailyTransactions extends TestCase /** * Get all transactions from the database (Seeder) and gets only the confirmed ones. */ - public function testGetDailyTransactions() {} + public function testGetDailyTransactions() + { + } } diff --git a/src/backend/tests/Unit/Transaction/AccessRateTest.php b/src/backend/tests/Unit/Transaction/AccessRateTest.php index da7562253..794a46dd5 100644 --- a/src/backend/tests/Unit/Transaction/AccessRateTest.php +++ b/src/backend/tests/Unit/Transaction/AccessRateTest.php @@ -33,7 +33,7 @@ private function initApplication(): void $meterType = MeterTypeFactory::new()->create(); $connectionType = ConnectionTypeFactory::new()->create(); $connectionGroup = ConnectionGroupFactory::new()->create(); - $meter = new Meter; + $meter = new Meter(); $meter->serial_number = '47000268748'; $meter->meterType()->associate($meterType); $meter->manufacturer()->associate($manufacturer); @@ -43,7 +43,7 @@ private function initApplication(): void $accessRate = AccessRateFactory::new()->make(); $tariff->accessRate()->save($accessRate); $customer = PersonFactory::new()->create(); - $meterParameter = new MeterParameter; + $meterParameter = new MeterParameter(); $meterParameter->tariff()->associate($tariff); $meterParameter->meter()->associate($meter); $meterParameter->connectionGroup()->associate($connectionGroup); diff --git a/src/backend/tests/Unit/Transaction/VodacomTransactionTest.php b/src/backend/tests/Unit/Transaction/VodacomTransactionTest.php index 68593a224..45db0a761 100644 --- a/src/backend/tests/Unit/Transaction/VodacomTransactionTest.php +++ b/src/backend/tests/Unit/Transaction/VodacomTransactionTest.php @@ -29,7 +29,7 @@ public function testTransactionSentFromUnknownIpAddress(): void [], ['REMOTE_ADDR' => '127.0.0.2'] ); - $middleWare = new Transaction; + $middleWare = new Transaction(); $response = $middleWare->handle($request, function () {}); @@ -47,7 +47,7 @@ public function testTransactionSentFromWhiteListedIpAddress(): void ['REMOTE_ADDR' => config('services.vodacom.ips')[0]] ); - $middleWare = new Transaction; + $middleWare = new Transaction(); $middleWare->handle($request, function ($x) { $this->assertInstanceOf(VodacomTransactionProvider::class, $x->attributes->get('transactionProcessor')); From 686804595dae44fd05eb0d65d0224666cd824bc3 Mon Sep 17 00:00:00 2001 From: mark8-1 Date: Wed, 20 Nov 2024 11:33:20 +0200 Subject: [PATCH 5/8] fix lint file --- .github/workflows/lint.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index afd0b3d74..ab95f2d33 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -28,8 +28,4 @@ jobs: - name: Run Pint run: pint working-directory: ./src/backend - - - name: Commit linted files - uses: stefanzweifel/git-auto-commit-action@v5 - with: - commit_message: "Fixes coding style" \ No newline at end of file + \ No newline at end of file From 44fcd4221892f2bbe3ac197e382a7f8eef03ecc7 Mon Sep 17 00:00:00 2001 From: mark8-1 Date: Wed, 20 Nov 2024 11:40:19 +0200 Subject: [PATCH 6/8] fix lint --- .github/workflows/lint.yml | 13 ++++++------- src/backend/pint.json | 18 ++++++++---------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ab95f2d33..6abee311d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,7 +1,7 @@ name: Fix Code Style - + on: [push] - + jobs: lint: runs-on: ubuntu-latest @@ -9,23 +9,22 @@ jobs: fail-fast: true matrix: php: [8.3] - + steps: - name: Checkout code uses: actions/checkout@v4 - + - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} extensions: json, dom, curl, libxml, mbstring coverage: none - + - name: Install Pint run: composer global require laravel/pint working-directory: ./src/backend - + - name: Run Pint run: pint working-directory: ./src/backend - \ No newline at end of file diff --git a/src/backend/pint.json b/src/backend/pint.json index d5f9599ec..644c00b7a 100644 --- a/src/backend/pint.json +++ b/src/backend/pint.json @@ -1,11 +1,9 @@ { - "preset": "psr12", - "rules": { - "no_superfluous_phpdoc_tags": false, - "yoda_style": false, - "no_unused_imports": false - }, - "exclude": [ - "bootstrap/cache" - ] -} \ No newline at end of file + "preset": "psr12", + "rules": { + "no_superfluous_phpdoc_tags": false, + "yoda_style": false, + "no_unused_imports": false + }, + "exclude": ["bootstrap/cache"] +} From 7a5e9147fab358266a05322ad5cd0602bc430d20 Mon Sep 17 00:00:00 2001 From: mark8-1 Date: Wed, 20 Nov 2024 11:44:53 +0200 Subject: [PATCH 7/8] fix lint --- .../Console/Commands/AccessRateChecker.php | 2 +- .../app/Console/Commands/DummyDataCreator.php | 2 +- .../app/Console/Commands/RoutesGenerator.php | 2 +- src/backend/app/Console/Kernel.php | 1 - src/backend/app/Exceptions/Handler.php | 6 +- src/backend/app/Helpers/MailHelper.php | 6 +- .../app/Helpers/MailHelperInterface.php | 2 +- src/backend/app/Helpers/MailHelperMock.php | 2 +- src/backend/app/Helpers/PowerConverter.php | 2 +- src/backend/app/Helpers/RelationsManager.php | 2 +- .../AgentAssignedApplianceWebController.php | 3 +- .../AgentAssignedAppliancesController.php | 1 - .../Http/Controllers/AgentAuthController.php | 5 +- .../AgentBalanceHistoryController.php | 3 - .../AgentCommissionWebController.php | 1 - .../Controllers/AgentCustomerController.php | 1 - .../Controllers/AgentReceiptWebController.php | 5 +- .../AgentSoldApplianceController.php | 1 - .../Controllers/AgentTicketController.php | 2 +- .../Controllers/AssetPersonController.php | 4 +- .../Http/Controllers/AssetRateController.php | 7 ++- .../Http/Controllers/AssetTypeController.php | 2 - .../app/Http/Controllers/AuthController.php | 5 +- .../Http/Controllers/CompanyController.php | 2 +- .../Controllers/ManufacturerController.php | 2 +- .../app/Http/Controllers/MeterController.php | 1 - ...MeterGeographicalInformationController.php | 4 +- .../Controllers/MeterTariffController.php | 2 +- .../Http/Controllers/MeterTypeController.php | 4 +- .../Http/Controllers/MiniGridController.php | 4 +- .../Controllers/PaymentHistoryController.php | 11 ++-- .../app/Http/Controllers/PersonController.php | 4 -- .../app/Http/Controllers/PluginController.php | 4 +- .../app/Http/Controllers/ReportController.php | 2 +- src/backend/app/Http/Controllers/Reports.php | 39 ++++++------- .../Http/Controllers/RevenueController.php | 3 +- .../app/Http/Controllers/SmsController.php | 2 +- .../SubConnectionTypeController.php | 2 +- .../Controllers/UserPasswordController.php | 2 +- .../Middleware/AgentBalanceMiddleware.php | 7 ++- .../Middleware/RedirectIfAuthenticated.php | 5 +- .../Http/Middleware/RestrictionMiddleware.php | 7 ++- .../Http/Middleware/TransactionRequest.php | 3 +- ...serDefaultDatabaseConnectionMiddleware.php | 4 +- .../app/Http/Resources/ApiResource.php | 3 +- .../app/Http/Resources/MeterResource.php | 3 +- .../app/Http/Resources/MeterTypeResource.php | 3 +- .../Resources/SmsSearchResultResource.php | 8 +-- .../app/Http/Resources/UserResource.php | 3 +- .../app/Jobs/EnergyTransactionProcessor.php | 2 +- src/backend/app/Jobs/ProcessPayment.php | 2 +- src/backend/app/Jobs/SmsProcessor.php | 6 +- src/backend/app/Jobs/TokenProcessor.php | 2 +- src/backend/app/Jobs/UpdatePiggyBankEntry.php | 2 +- src/backend/app/Lib/IMeterReader.php | 8 ++- src/backend/app/Lib/ISmsProvider.php | 1 - .../app/Listeners/AccessRateListener.php | 2 +- .../app/Listeners/ClusterGeoListener.php | 7 +-- src/backend/app/Listeners/HistoryListener.php | 4 +- src/backend/app/Listeners/PaymentListener.php | 8 +-- src/backend/app/Listeners/SmsListener.php | 4 +- .../app/ManufacturerApi/CalinReadMeter.php | 17 +++--- src/backend/app/Misc/LoanDataContainer.php | 4 +- src/backend/app/Models/Address/Address.php | 8 +-- src/backend/app/Models/Agent.php | 14 ++--- src/backend/app/Models/AgentCommission.php | 2 +- src/backend/app/Models/AssetRate.php | 6 +- src/backend/app/Models/City.php | 8 +-- src/backend/app/Models/Cluster.php | 2 +- src/backend/app/Models/Company.php | 2 +- src/backend/app/Models/History.php | 6 +- src/backend/app/Models/MainSettings.php | 6 +- src/backend/app/Models/MapSettings.php | 2 +- src/backend/app/Models/Meter/Meter.php | 4 +- .../app/Models/Meter/MeterConsumption.php | 10 ++-- src/backend/app/Models/Meter/MeterTariff.php | 10 ++-- src/backend/app/Models/Meter/MeterToken.php | 2 +- src/backend/app/Models/Meter/MeterType.php | 6 +- src/backend/app/Models/MiniGrid.php | 6 +- src/backend/app/Models/PaymentHistory.php | 4 +- src/backend/app/Models/Person/Person.php | 10 ++-- src/backend/app/Models/Report.php | 2 +- src/backend/app/Models/Restriction.php | 6 +- src/backend/app/Models/Sms.php | 12 ++-- .../app/Models/SocialTariffPiggyBank.php | 4 +- src/backend/app/Models/Subscription.php | 4 +- src/backend/app/Models/Target.php | 4 +- .../app/Models/TariffPricingComponent.php | 6 +- src/backend/app/Models/TicketSettings.php | 2 +- .../Models/Transaction/AirtelTransaction.php | 4 +- .../app/Models/Transaction/Transaction.php | 4 +- src/backend/app/Models/User.php | 6 +- .../Observers/AgentBalanceHistoryObserver.php | 1 - src/backend/app/PaymentHandler/AccessRate.php | 2 +- src/backend/app/Relations/BelongsToMorph.php | 25 ++++---- .../app/Services/AbstractExportService.php | 2 +- ...actPaymentAggregatorTransactionService.php | 8 +-- .../app/Services/AgentTransactionService.php | 2 +- .../app/Services/AppliancePaymentService.php | 2 +- .../app/Services/ClusterRevenueService.php | 10 ++-- .../app/Services/Interfaces/IAssociative.php | 2 +- .../app/Services/Interfaces/IBaseService.php | 3 +- .../Services/Interfaces/ISettingsService.php | 3 +- src/backend/app/Services/PeriodService.php | 2 +- src/backend/app/Services/PersonService.php | 7 ++- .../app/Services/RegistrationTailService.php | 6 +- src/backend/app/Services/SessionService.php | 2 +- src/backend/app/Services/SmsService.php | 6 +- src/backend/app/Services/TargetService.php | 2 +- .../app/Services/UserAddressService.php | 2 +- src/backend/app/Sms/AndroidGateway.php | 4 +- .../SmsResendInformationHeader.php | 2 +- .../Senders/ResendInformationNotification.php | 2 +- src/backend/app/Sms/Senders/SmsSender.php | 4 +- .../app/Traits/RestExceptionHandler.php | 23 ++++---- .../app/Utils/ApplianceInstallmentPayer.php | 2 +- .../Ecosys/CustomerDatabaseParser.php | 4 +- .../Services/AppliancePersonService.php | 2 +- .../Sharding/ApiCompanyResolverService.php | 4 +- .../Sharding/ApiResolvers/TestApiResolver.php | 2 +- .../Provider/AgentTransactionProvider.php | 2 +- .../Provider/AirtelVoltTerraProvider.php | 6 +- .../Provider/TransactionAdapter.php | 2 +- .../Provider/VodacomTransactionProvider.php | 19 +++--- ...22_03_10_120408_create_companies_table.php | 2 +- ..._134450_create_company_databases_table.php | 2 +- ...8_204649_create_database_proxies_table.php | 2 +- ..._06_21_102121_create_mpm_plugins_table.php | 2 +- ...21_122032_add_email_to_companies_table.php | 2 +- ...3903_add_tail_tag_to_mpm_plugins_table.php | 2 +- ...tallation_command_to_mpm_plugins_table.php | 2 +- ..._bulk_registration_to_mpm_plugin_table.php | 2 +- ...dd_viber_messaging_to_mpm_plugin_table.php | 2 +- ...email_field_for_database_proxies_table.php | 2 +- ...wave_money_payment_to_mpm_plugin_table.php | 2 +- .../2022_11_25_091725_create_company_jobs.php | 2 +- ...000_add_micro_star_to_mpm_plugin_table.php | 2 +- ...00_add_root_class_to_mpm_plugins_table.php | 2 +- ...00000_add_sun_king_to_mpm_plugin_table.php | 2 +- ...24_110414_create_protected_pages_table.php | 2 +- ...ected_page_password_to_companies_table.php | 2 +- ...0000_add_gome_long_to_mpm_plugin_table.php | 2 +- ...121811_add_wavecom_to_mpm_plugin_table.php | 2 +- ...escription_column_in_mpm_plugins_table.php | 2 +- ...00000_add_daly_bms_to_mpm_plugin_table.php | 2 +- ..._000000_add_angaza_to_mpm_plugin_table.php | 2 +- ..._02_07_100345_create_usage_types_table.php | 2 +- ...usage_type_column_to_mpm_plugins_table.php | 2 +- ...nd_trace_columns_to_company_jobs_table.php | 2 +- .../2014_10_12_000000_create_users_table.php | 2 +- ...12_100000_create_password_resets_table.php | 2 +- ...5615_create_vodacom_transactions_table.php | 2 +- ...05_24_201051_create_transactions_table.php | 2 +- ...13335_create_airtel_transactions_table.php | 2 +- ..._131106_create_payment_histories_table.php | 2 +- ...5_25_131119_create_meter_tariffs_table.php | 2 +- ...18_05_29_071453_create_addresses_table.php | 2 +- ...create_geographical_informations_table.php | 2 +- ..._05_29_140926_create_meter_types_table.php | 2 +- .../2018_05_30_124521_create_meters_table.php | 2 +- ...5_31_071601_create_manufacturers_table.php | 2 +- .../2018_05_31_075346_create_cities_table.php | 2 +- ...18_05_31_075353_create_countries_table.php | 2 +- .../2018_06_01_141845_create_people_table.php | 2 +- .../2018_06_04_124637_create__roles_table.php | 2 +- ...06_07_155444_create_meter_tokens_table.php | 2 +- ...8_102610_create_meter_parameters_table.php | 2 +- .../2018_06_11_131951_create_sms_table.php | 2 +- ...352_create_transaction_conflicts_table.php | 2 +- ...06_28_080905_create_access_rates_table.php | 2 +- ...0914_create_access_rate_payments_table.php | 2 +- ..._07_11_075002_create_permission_tables.php | 2 +- .../2018_07_12_133700_create_loans_table.php | 2 +- ...18_07_12_134253_create_customers_table.php | 2 +- ...18_10_04_195503_create_histories_table.php | 2 +- ...110924_create_meter_consumptions_table.php | 2 +- ...2_123911_create_payment_profiles_table.php | 2 +- ...018_11_29_090603_create_clusters_table.php | 2 +- ...018_12_05_144906_create_revenues_table.php | 2 +- ...1_083717_create_connection_types_table.php | 2 +- ...2018_12_13_083722_create_targets_table.php | 2 +- ..._12_13_100738_create_sub_targets_table.php | 2 +- .../2019_04_19_083645_customer_group.php | 2 +- ...2438_create_sub_connection_types_table.php | 2 +- ..._103123_create_connection_groups_table.php | 2 +- .../2019_05_15_122118_reports.php | 2 +- ...9_06_24_160040_create_mini_grids_table.php | 2 +- ..._133655_create_maintenance_users_table.php | 2 +- ...019_11_06_121116_create_energies_table.php | 2 +- .../2019_11_15_102431_create_solars_table.php | 2 +- ...19_11_26_063009_create_batteries_table.php | 2 +- .../2019_12_16_090907_create_assets_table.php | 2 +- ..._12_16_091934_create_asset_types_table.php | 2 +- ...12_16_092044_create_asset_people_table.php | 2 +- ..._12_16_093223_create_asset_rates_table.php | 2 +- .../2020_01_27_135206_create_logs_table.php | 2 +- .../2020_04_05_233604_create_p_v_s_table.php | 2 +- ...04_19_234527_create_restrictions_table.php | 2 +- ...020_04_19_235421_create_upgrades_table.php | 2 +- ...4_20_001454_create_subscriptions_table.php | 2 +- .../2020_06_20_085555_weather_data.php | 2 +- ...create_tariff_pricing_components_table.php | 2 +- ..._21_194542_create_social_tariffs_table.php | 2 +- ...create_social_tariff_piggy_banks_table.php | 2 +- ...15405_add_total_price_to_meter_tariffs.php | 2 +- .../2020_07_12_192802_create_agents_table.php | 2 +- ...130601_create_agent_transactions_table.php | 2 +- ...6_create_agent_balance_histories_table.php | 2 +- ...create_agent_assigned_appliances_table.php | 2 +- ...811_create_agent_sold_appliances_table.php | 2 +- ..._083600_create_agent_commissions_table.php | 2 +- ..._25_155837_create_agent_receipts_table.php | 2 +- ...8_03_081836_create_agent_charges_table.php | 2 +- ...748_create_agent_receipt_details_table.php | 2 +- ..._02_072509_create_time_of_usages_table.php | 2 +- ..._19_122517_create_sub_menu_items_table.php | 2 +- ...0_10_19_122649_create_menu_items_table.php | 2 +- ...2020_10_29_170007_create_plugins_table.php | 2 +- ...2_17_144527_create_main_settings_table.php | 2 +- ...12_23_165814_create_map_settings_table.php | 2 +- ...ransaction_to_agent_transactions_table.php | 2 +- ...130412_create_third_party_transactions.php | 2 +- ...nsaction_to_vodacom_transactions_table.php | 2 +- ...ansaction_to_airtel_transactions_table.php | 2 +- ...05_234039_create_ticket_settings_table.php | 2 +- ..._122556_add_columns_to_batteries_table.php | 2 +- ...1_18_123245_add_columns_to_p_v_s_table.php | 2 +- .../2021_02_18_153556_create_sms_bodies.php | 2 +- ...556_create_sms_resend_information_keys.php | 2 +- ...6421_create_sms_appliance_remind_rates.php | 2 +- ..._03_140758_create_sms_android_settings.php | 2 +- ...706_create_sms_variable_default_values.php | 2 +- .../2021_03_2_1561251_update_sms_table.php | 2 +- ...8_add_additional_json_column_to_people.php | 2 +- ...8_104840_create_person_documents_table.php | 2 +- ...085817_update_meter_consumptions_table.php | 4 +- ...add_down_payment_to_asset_people_table.php | 2 +- ...rst_payment_date_to_asset_people_table.php | 2 +- ..._092522_create_cash_transactions_table.php | 2 +- ...2021_10_18_220817_create_mail_settings.php | 2 +- ...5_10_093215_update_meter_tariffs_table.php | 4 +- ..._10_101348_update_social_tariffs_table.php | 4 +- ...update_tariff_pricing_components_table.php | 4 +- ...update_social_tariff_piggy_banks_table.php | 4 +- ...05_10_102047_update_access_rates_table.php | 4 +- ...2214_update_access_rate_payments_table.php | 4 +- ...05_10_102507_update_asset_people_table.php | 4 +- ...05_10_102649_update_transactions_table.php | 4 +- ..._102805_update_payment_histories_table.php | 4 +- ..._05_19_102938_update_asset_types_table.php | 4 +- ..._add_connection_column_to_agents_table.php | 2 +- .../2022_06_21_090125_create_calin_tables.php | 6 +- ...06_21_090327_create_calin_smart_tables.php | 6 +- .../2022_06_21_090338_create_kelin_tables.php | 20 +++---- ..._create_mesomb_payment_provider_tables.php | 4 +- .../2022_06_21_090351_create_spark_tables.php | 34 +++++------ ...2022_06_21_090402_create_steama_tables.php | 58 +++++++++---------- .../2022_06_21_090412_create_stron_tables.php | 6 +- ..._create_swifta_payment_provider_tables.php | 6 +- ..._092948_create_registration_tail_table.php | 2 +- ...000000_create_bulk_registration_tables.php | 4 +- ...0327_add_direction_column_to_sms_table.php | 2 +- ...945_add_gateway_id_column_to_sms_table.php | 2 +- ...123_add_dispatched_column_to_sms_table.php | 2 +- ...42319_add_attempts_column_to_sms_table.php | 2 +- ..._0000000_create_viber_messaging_tables.php | 8 +-- ...purchase_amount_to_meter_tariffs_table.php | 2 +- ...ate_wave_money_payment_provider_tables.php | 6 +- ..._11_29_000000_create_micro_star_tables.php | 6 +- ...000_update_swifta_authentication_table.php | 4 +- .../2022_14_12_create_sun_king_tables.php | 6 +- ...3_15_092048_add_colums_to_solars_table.php | 2 +- .../2023_03_16_105024_update_solars_table.php | 2 +- ...update_data_type_values_energies_table.php | 2 +- ...update_data_type_values_energies_table.php | 2 +- ...023_04_02_121811_create_wavecom_tables.php | 4 +- ...421_add_api_type_to_table_transactions.php | 2 +- .../2023_04_26_223352_update_sms_table.php | 2 +- .../2023_06_02_create_gome_long_tables.php | 8 +-- ...assets_asset_people_asset_types_tables.php | 4 +- ...pdate_sms_appliance_remind_rates_table.php | 2 +- ...074114_update_wavecom_wavemoney_tables.php | 2 +- ...2023_11_03_112202_create_devices_table.php | 2 +- ...120614_create_solar_home_systems_table.php | 2 +- ..._configuration_columns_to_meters_table.php | 2 +- ...07_update_action_field_type_logs_table.php | 2 +- ..._drop_geo_id_column_from_address_table.php | 2 +- ...add_type_column_to_manufacturers_table.php | 2 +- ..._id_column_to_solar_home_systems_table.php | 2 +- ...date_person_id_column_in_devices_table.php | 2 +- ..._device_serial_column_in_devices_table.php | 2 +- ...ber_column_in_solar_home_systems_table.php | 2 +- .../2023_11_17_095204_create_tokens_table.php | 2 +- ...ce_serial_column_to_asset_people_table.php | 2 +- ...ce_serial_column_in_asset_people_table.php | 2 +- .../2024_01_01_create_daly_bms_tables.php | 6 +- ...2024_01_02_124146_create_e_bikes_table.php | 2 +- .../2024_01_12_create_angaza_tables.php | 6 +- ...age_type_column_to_main_settings_table.php | 2 +- ..._usage_type_column_to_menu_items_table.php | 2 +- ...24_09_30_113302_remove_siderbar_tables.php | 2 +- ...0_23_153042_add_amount_to_agent_charge.php | 2 +- ...0_30_154625_create_notifications_table.php | 2 +- ...24_10_31_180458_remove_batteries_table.php | 2 +- ...024_10_31_180510_remove_energies_table.php | 2 +- ...524_remove_mini_grid_frequencies_table.php | 2 +- .../2024_10_31_180539_remove_pvs_table.php | 2 +- .../2024_10_31_180546_remove_solars_table.php | 2 +- ...10_31_180605_remove_weather_data_table.php | 2 +- ...2024_10_31_180852_remove_agent_tickets.php | 2 +- ...2024_10_31_181016_remove_city_clusters.php | 2 +- ...drop_data_stream_column_from_mini_grid.php | 2 +- .../seeders/SolarHomeSystemSeeder.php | 2 +- .../src/Http/Resources/AngazaResource.php | 3 +- .../src/Services/ManufacturerService.php | 2 +- .../create_bulk_registration_tables.php | 4 +- .../src/Console/Commands/UpdatePackage.php | 2 +- .../src/Exceptions/Handler.php | 4 +- .../src/Helpers/CsvDataProcessor.php | 2 +- .../src/Services/CityService.php | 4 +- .../src/Services/ClusterService.php | 4 +- .../src/Services/ManufacturerService.php | 2 +- .../src/Services/MiniGridService.php | 4 +- .../src/Console/Commands/UpdatePackage.php | 2 +- .../calin-meter/src/Helpers/ApiHelpers.php | 2 +- .../src/Http/Resources/CalinResource.php | 3 +- .../src/CalinSmartMeterApi.php | 2 +- .../src/Console/Commands/UpdatePackage.php | 2 +- .../src/Helpers/ApiHelpers.php | 2 +- .../src/Http/Resources/CalinSmartResource.php | 3 +- .../src/Console/Commands/CheckPayments.php | 2 +- .../src/Console/Commands/SyncBikes.php | 2 +- .../src/Http/Resources/DalyBmsResource.php | 3 +- .../daly-bms/src/Modules/Api/ApiRequests.php | 2 +- .../daly-bms/src/Modules/Api/DalyBmsApi.php | 6 +- .../src/Services/ManufacturerService.php | 2 +- .../src/Http/Resources/GomeLongResource.php | 3 +- .../src/Observers/MeterTariffObserver.php | 6 +- .../src/Services/GomeLongTariffService.php | 6 +- .../src/Services/ManufacturerService.php | 2 +- .../Console/Commands/AccessTokenRefresher.php | 2 +- .../src/Console/Commands/DataSynchronizer.php | 8 +-- .../Commands/ReadDailyMeterConsumptions.php | 2 +- .../ReadMinutelyMeterConsumptions.php | 2 +- .../src/Console/Commands/UpdatePackage.php | 2 +- .../kelin-meter/src/Helpers/ApiHelpers.php | 2 +- .../Resources/DailyConsumptionCollection.php | 3 +- .../Resources/KelinCustomerCollection.php | 3 +- .../Http/Resources/KelinMeterCollection.php | 3 +- .../src/Http/Resources/KelinResource.php | 3 +- .../Http/Resources/KelinSettingCollection.php | 3 +- .../MinutelyConsumptionCollection.php | 3 +- .../src/Services/DailyConsumptionService.php | 2 +- .../src/Services/KelinCredentialService.php | 2 +- .../src/Services/KelinMeterService.php | 8 +-- .../src/Services/KelinSyncActionService.php | 2 +- .../src/Services/KelinSyncSettingService.php | 4 +- .../Services/MinutelyConsumptionService.php | 2 +- .../src/Console/Commands/UpdatePackage.php | 2 +- .../MesombTransactionProcessingResource.php | 3 +- .../src/Services/MesomTransactionService.php | 2 +- .../src/Console/Commands/UpdatePackage.php | 2 +- .../src/Http/Resources/MicroStarResource.php | 3 +- .../src/Services/ManufacturerService.php | 2 +- .../Services/MicroStarCertificateService.php | 4 +- .../Commands/InstallSparkMeterPackage.php | 4 +- .../Commands/SparkMeterDataSynchronizer.php | 8 +-- .../Commands/SparkMeterSmsNotifier.php | 12 ++-- .../SparkMeterTransactionStatusCheck.php | 2 +- .../Commands/UpdateSparkMeterPackage.php | 2 +- .../src/Helpers/InsertSparkMeterApi.php | 2 +- .../SparkMeterCredentialResource.php | 3 +- .../src/Http/Resources/SparkResource.php | 3 +- .../src/Listeners/MeterParameterListener.php | 4 +- .../spark-meter/src/Listeners/SmsListener.php | 2 +- .../src/Services/CustomerService.php | 2 +- .../src/Services/OrganizationService.php | 2 +- .../src/Services/SmSmsSettingService.php | 4 +- .../src/Services/SmSyncActionService.php | 2 +- .../src/Services/SmSyncSettingService.php | 12 ++-- .../src/Services/TariffService.php | 2 +- .../src/Services/TransactionService.php | 20 +++---- .../SparkSmsMeterResetFeedbackHeader.php | 2 +- .../src/Sms/Senders/MeterResetFeedback.php | 2 +- .../src/Tests/Unit/SmsNotifyTest.php | 10 ++-- .../src/Console/Commands/InstallPackage.php | 2 +- .../Commands/ReadHourlyMeterReadings.php | 2 +- .../Commands/SteamaMeterDataSynchronizer.php | 8 +-- .../Console/Commands/SteamaSmsNotifier.php | 8 +-- .../src/Console/Commands/UpdatePackage.php | 2 +- .../steama-meter/src/Helpers/ApiHelpers.php | 2 +- .../Resources/SteamaCredentialResource.php | 3 +- .../src/Http/Resources/SteamaResource.php | 3 +- .../src/Listeners/MeterParameterListener.php | 6 +- .../src/Listeners/SmsListener.php | 2 +- .../src/Services/SteamaAgentService.php | 2 +- .../src/Services/SteamaMeterService.php | 2 +- .../SteamaSiteLevelPaymentPlanTypeService.php | 2 +- .../src/Services/SteamaSmsSettingService.php | 4 +- .../src/Services/SteamaSyncSettingService.php | 10 ++-- .../src/Services/SteamaTariffService.php | 2 +- .../src/Services/SteamaUserTypeService.php | 6 +- .../src/Services/StemaSyncActionService.php | 2 +- .../src/Tests/Unit/SmsNotifyTest.php | 10 ++-- .../src/Console/Commands/UpdatePackage.php | 2 +- .../stron-meter/src/Helpers/ApiHelpers.php | 2 +- .../Resources/StronCredentialResource.php | 3 +- .../src/Http/Resources/StronResource.php | 3 +- .../src/Http/Resources/SunKingResource.php | 3 +- .../src/Services/ManufacturerService.php | 2 +- .../src/Console/Commands/InstallPackage.php | 2 +- .../Commands/TransactionStatusChecker.php | 2 +- .../src/Console/Commands/UpdatePackage.php | 4 +- .../Controllers/TicketExportController.php | 2 - .../Http/Controllers/WatcherController.php | 6 +- .../src/Http/Resources/TicketResource.php | 3 +- .../src/Models/TicketOutsourceReport.php | 2 +- .../inensus/ticket/src/Models/TicketUser.php | 4 +- .../src/Providers/TicketServiceProvider.php | 2 +- .../src/Services/TicketCommentService.php | 4 +- .../Services/TicketOutsourceReportService.php | 4 +- .../src/Console/Commands/UpdatePackage.php | 2 +- .../Http/Controllers/WebhookController.php | 8 +-- .../src/Http/Resources/ViberResource.php | 3 +- .../src/Services/ViberCredentialService.php | 4 +- ...ate_wave_money_payment_provider_tables.php | 4 +- .../src/Console/Commands/InstallPackage.php | 2 +- .../src/Console/Commands/UpdatePackage.php | 2 +- .../src/Http/Resources/WaveMoneyResource.php | 3 +- .../src/Models/WaveComTransaction.php | 4 +- src/backend/tests/Feature/CityTest.php | 6 +- .../Feature/ClusterDashboardCacheTest.php | 6 +- .../tests/Feature/ClusterRevenueTest.php | 6 +- src/backend/tests/Feature/ClusterTest.php | 6 +- .../tests/Feature/ConnectionGroupTest.php | 2 +- .../tests/Feature/ConnectionTypeTest.php | 2 +- .../tests/Feature/CreateEnvironments.php | 58 +++++++++---------- src/backend/tests/Feature/MeterTest.php | 4 +- .../tests/Feature/MiniGridRevenueTest.php | 6 +- src/backend/tests/Feature/MiniGridTest.php | 4 +- .../Feature/SocialTariffPiggyBankTest.php | 2 +- .../tests/RefreshMultipleDatabases.php | 2 +- src/backend/tests/TestCase.php | 2 +- 443 files changed, 852 insertions(+), 830 deletions(-) diff --git a/src/backend/app/Console/Commands/AccessRateChecker.php b/src/backend/app/Console/Commands/AccessRateChecker.php index 76558600b..940cd571c 100644 --- a/src/backend/app/Console/Commands/AccessRateChecker.php +++ b/src/backend/app/Console/Commands/AccessRateChecker.php @@ -26,7 +26,7 @@ public function runInCompanyScope(): void // access-rate is defined if ($accessRate->amount > 0) { $accessRatePayment->debt += $accessRate->amount; - $accessRatePayment->unpaid_in_row++; + ++$accessRatePayment->unpaid_in_row; } $accessRatePayment->save(); diff --git a/src/backend/app/Console/Commands/DummyDataCreator.php b/src/backend/app/Console/Commands/DummyDataCreator.php index 05172ca62..904af260c 100644 --- a/src/backend/app/Console/Commands/DummyDataCreator.php +++ b/src/backend/app/Console/Commands/DummyDataCreator.php @@ -74,7 +74,7 @@ public function handle() return; } - for ($i = 1; $i <= $amount; $i++) { + for ($i = 1; $i <= $amount; ++$i) { echo "$type is generating number: $i \n"; try { DB::connection('shard')->beginTransaction(); diff --git a/src/backend/app/Console/Commands/RoutesGenerator.php b/src/backend/app/Console/Commands/RoutesGenerator.php index a06c31d17..844ceb047 100644 --- a/src/backend/app/Console/Commands/RoutesGenerator.php +++ b/src/backend/app/Console/Commands/RoutesGenerator.php @@ -69,7 +69,7 @@ private function appendLines(string $packageRoutesTmp, $coreRoutesTmp): void $newLine = str_pad($value, strlen($value) + 4, ' ', STR_PAD_LEFT); } fwrite($tmp, $newLine); - $counter++; + ++$counter; } fclose($tmp); } diff --git a/src/backend/app/Console/Kernel.php b/src/backend/app/Console/Kernel.php index 6e54c1655..79e49cc57 100644 --- a/src/backend/app/Console/Kernel.php +++ b/src/backend/app/Console/Kernel.php @@ -54,7 +54,6 @@ class Kernel extends ConsoleKernel /** * Define the application's command schedule. * - * * @return void */ protected function schedule(Schedule $schedule) diff --git a/src/backend/app/Exceptions/Handler.php b/src/backend/app/Exceptions/Handler.php index 426b70947..05b8317c0 100644 --- a/src/backend/app/Exceptions/Handler.php +++ b/src/backend/app/Exceptions/Handler.php @@ -34,7 +34,6 @@ class Handler extends ExceptionHandler /** * Report or log an exception. * - * * @return void */ public function report(\Throwable $exception) @@ -46,8 +45,9 @@ public function report(\Throwable $exception) /** * Render an exception into an HTTP response. * - * @param Request $request - * @param \Throwable $exception + * @param Request $request + * @param \Throwable $exception + * * @return \Illuminate\Http\JsonResponse */ public function render($request, \Exception|\Throwable $exception) diff --git a/src/backend/app/Helpers/MailHelper.php b/src/backend/app/Helpers/MailHelper.php index 70ed158b1..c9c92e998 100644 --- a/src/backend/app/Helpers/MailHelper.php +++ b/src/backend/app/Helpers/MailHelper.php @@ -35,7 +35,7 @@ private function configure(): void } /** - * @param null $attachment + * @param null $attachment * * @throws MailNotSentException * @throws PHPMailerException @@ -60,7 +60,7 @@ public function sendPlain($to, $title, $body, $attachment = null): void $this->mailer->AltBody = $this->mailSettings['default_message']; - if (! $this->mailer->send()) { + if (!$this->mailer->send()) { throw new MailNotSentException($this->mailer->ErrorInfo); } } @@ -84,7 +84,7 @@ public function sendViaTemplate(string $to, string $title, string $templatePath, $this->mailer->addAttachment($attachmentPath); } - if (! $this->mailer->send()) { + if (!$this->mailer->send()) { throw new MailNotSentException($this->mailer->ErrorInfo); } } diff --git a/src/backend/app/Helpers/MailHelperInterface.php b/src/backend/app/Helpers/MailHelperInterface.php index bd59bfe98..4817d0744 100644 --- a/src/backend/app/Helpers/MailHelperInterface.php +++ b/src/backend/app/Helpers/MailHelperInterface.php @@ -8,7 +8,7 @@ interface MailHelperInterface { /** - * @param null $attachment + * @param null $attachment * * @throws MailNotSentException * @throws PHPMailerException diff --git a/src/backend/app/Helpers/MailHelperMock.php b/src/backend/app/Helpers/MailHelperMock.php index 53ef2b8cf..0db3ea1a5 100644 --- a/src/backend/app/Helpers/MailHelperMock.php +++ b/src/backend/app/Helpers/MailHelperMock.php @@ -8,7 +8,7 @@ class MailHelperMock implements MailHelperInterface { /** - * @param null $attachment + * @param null $attachment * * @throws MailNotSentException * @throws PHPMailerException diff --git a/src/backend/app/Helpers/PowerConverter.php b/src/backend/app/Helpers/PowerConverter.php index 103f2dca5..181ba96ac 100644 --- a/src/backend/app/Helpers/PowerConverter.php +++ b/src/backend/app/Helpers/PowerConverter.php @@ -14,7 +14,7 @@ class PowerConverter ]; /** - * @param int|string $power + * @param int|string $power */ public static function convert($power, $powerUnit, string $expectedUnit = 'Wh') { diff --git a/src/backend/app/Helpers/RelationsManager.php b/src/backend/app/Helpers/RelationsManager.php index 23f2ee172..a9ee86ac7 100644 --- a/src/backend/app/Helpers/RelationsManager.php +++ b/src/backend/app/Helpers/RelationsManager.php @@ -30,7 +30,7 @@ trait RelationsManager public static function getAllRelations($type = null): array { - if (! self::$relationsInitialized) { + if (!self::$relationsInitialized) { self::initAllRelations(); } if ($type) { diff --git a/src/backend/app/Http/Controllers/AgentAssignedApplianceWebController.php b/src/backend/app/Http/Controllers/AgentAssignedApplianceWebController.php index 8478fe623..ebc4a6f3a 100644 --- a/src/backend/app/Http/Controllers/AgentAssignedApplianceWebController.php +++ b/src/backend/app/Http/Controllers/AgentAssignedApplianceWebController.php @@ -40,7 +40,8 @@ public function store(CreateAgentAssignedApplianceRequest $request) /** * List for Web interface. * - * @param Agent $agent + * @param Agent $agent + * * @return ApiResource */ public function index($agentId, Request $request) diff --git a/src/backend/app/Http/Controllers/AgentAssignedAppliancesController.php b/src/backend/app/Http/Controllers/AgentAssignedAppliancesController.php index 924aa762b..7dc39a7bc 100644 --- a/src/backend/app/Http/Controllers/AgentAssignedAppliancesController.php +++ b/src/backend/app/Http/Controllers/AgentAssignedAppliancesController.php @@ -23,7 +23,6 @@ public function __construct( /** * List for Android-APP. * - * * @return ApiResource */ public function index(Request $request) diff --git a/src/backend/app/Http/Controllers/AgentAuthController.php b/src/backend/app/Http/Controllers/AgentAuthController.php index 953260e87..001ecb8e3 100644 --- a/src/backend/app/Http/Controllers/AgentAuthController.php +++ b/src/backend/app/Http/Controllers/AgentAuthController.php @@ -34,7 +34,7 @@ public function login(Request $request) { $credentials = $request->only(['email', 'password']); - if (! $token = auth('agent_api')->setTTL(525600)->attempt($credentials)) { + if (!$token = auth('agent_api')->setTTL(525600)->attempt($credentials)) { return response()->json(['data' => ['message' => 'Unauthorized', 'status' => 401]], 401); } @@ -82,7 +82,8 @@ public function refresh() /** * Get the token array structure. * - * @param string $token + * @param string $token + * * @return JsonResponse */ protected function respondWithToken($token) diff --git a/src/backend/app/Http/Controllers/AgentBalanceHistoryController.php b/src/backend/app/Http/Controllers/AgentBalanceHistoryController.php index 1c4400264..8a9867071 100644 --- a/src/backend/app/Http/Controllers/AgentBalanceHistoryController.php +++ b/src/backend/app/Http/Controllers/AgentBalanceHistoryController.php @@ -38,7 +38,6 @@ public function store(Agent $agent, CreateAgentBalanceHistoryRequest $request): /** * Display the specified resource. * - * * @return void */ public function show(AgentBalanceHistory $agent_balance_history) @@ -48,7 +47,6 @@ public function show(AgentBalanceHistory $agent_balance_history) /** * Update the specified resource in storage. * - * * @return void */ public function update(Request $request, AgentBalanceHistory $agent_balance_history) @@ -58,7 +56,6 @@ public function update(Request $request, AgentBalanceHistory $agent_balance_hist /** * Remove the specified resource from storage. * - * * @return void */ public function destroy(AgentBalanceHistory $agent_balance_history) diff --git a/src/backend/app/Http/Controllers/AgentCommissionWebController.php b/src/backend/app/Http/Controllers/AgentCommissionWebController.php index fccd99376..f7dd9b25b 100644 --- a/src/backend/app/Http/Controllers/AgentCommissionWebController.php +++ b/src/backend/app/Http/Controllers/AgentCommissionWebController.php @@ -26,7 +26,6 @@ public function index(Request $request): ApiResource /** * Store a newly created resource in storage. * - * * @return ApiResource */ public function store(CreateAgentCommissionRequest $request) diff --git a/src/backend/app/Http/Controllers/AgentCustomerController.php b/src/backend/app/Http/Controllers/AgentCustomerController.php index e2561aa7e..a1bd5774d 100644 --- a/src/backend/app/Http/Controllers/AgentCustomerController.php +++ b/src/backend/app/Http/Controllers/AgentCustomerController.php @@ -18,7 +18,6 @@ public function __construct( /** * Display a listing of the resource. * - * * @return ApiResource */ public function index(Request $request) diff --git a/src/backend/app/Http/Controllers/AgentReceiptWebController.php b/src/backend/app/Http/Controllers/AgentReceiptWebController.php index 58b324cd6..82b185264 100644 --- a/src/backend/app/Http/Controllers/AgentReceiptWebController.php +++ b/src/backend/app/Http/Controllers/AgentReceiptWebController.php @@ -19,7 +19,6 @@ public function __construct( /** * Display a listing of the resource. * - * * @return ApiResource */ public function show($agentId, Request $request) @@ -32,7 +31,6 @@ public function show($agentId, Request $request) /** * Display a listing of the resource. * - * * @return ApiResource */ public function index(Request $request) @@ -45,7 +43,8 @@ public function index(Request $request) /** * Store a newly created resource in storage. * - * @param $agentId + * @param $agentId + * * @return ApiResource */ public function store(CreateAgentReceiptRequest $request) diff --git a/src/backend/app/Http/Controllers/AgentSoldApplianceController.php b/src/backend/app/Http/Controllers/AgentSoldApplianceController.php index fe1f28e18..1bc2d62d1 100644 --- a/src/backend/app/Http/Controllers/AgentSoldApplianceController.php +++ b/src/backend/app/Http/Controllers/AgentSoldApplianceController.php @@ -36,7 +36,6 @@ public function show($customerId, Request $request): ApiResource /** * Store a newly created resource in storage. * - * * @return ApiResource */ public function store(CreateAgentSoldApplianceRequest $request) diff --git a/src/backend/app/Http/Controllers/AgentTicketController.php b/src/backend/app/Http/Controllers/AgentTicketController.php index 8666d7b49..f7c0283f8 100644 --- a/src/backend/app/Http/Controllers/AgentTicketController.php +++ b/src/backend/app/Http/Controllers/AgentTicketController.php @@ -57,7 +57,7 @@ public function store(CreateAgentTicketRequest $request): TicketResource $ownerId = $ticketData['owner_id']; $owner = $this->personService->getById($ownerId); - if (! $owner) { + if (!$owner) { throw new TicketOwnerNotFoundException('Ticket owner with following id not found '.$ownerId); } diff --git a/src/backend/app/Http/Controllers/AssetPersonController.php b/src/backend/app/Http/Controllers/AssetPersonController.php index 61d8a9975..b12416855 100644 --- a/src/backend/app/Http/Controllers/AssetPersonController.php +++ b/src/backend/app/Http/Controllers/AssetPersonController.php @@ -42,7 +42,7 @@ public function __construct( /** * Store a newly created resource in storage. * - * @param AssetType $assetType + * @param AssetType $assetType */ public function store( Asset $asset, @@ -105,7 +105,7 @@ public function store( $this->geographicalInformationService->save($geographicalInformation); } if ($downPayment > 0) { - $sender = ! isset($addressData) ? '-' : $addressData['phone']; + $sender = !isset($addressData) ? '-' : $addressData['phone']; $transaction = $this->cashTransactionService->createCashTransaction( $user->id, $downPayment, diff --git a/src/backend/app/Http/Controllers/AssetRateController.php b/src/backend/app/Http/Controllers/AssetRateController.php index 591bf9a13..fde4078e7 100644 --- a/src/backend/app/Http/Controllers/AssetRateController.php +++ b/src/backend/app/Http/Controllers/AssetRateController.php @@ -13,8 +13,9 @@ class AssetRateController extends Controller /** * Update the specified resource in storage. * - * @param Request $request - * @param AssetRate $assetRate + * @param Request $request + * @param AssetRate $assetRate + * * @return ApiResource */ private $cashTransactionService; @@ -41,7 +42,7 @@ public function update(Request $request, AssetRate $applianceRate): ApiResource if ($newCost === 0) { $this->applianceRateService ->deleteUpdatedApplianceRateIfCostZero($applianceRate, $creatorId, $cost, $newCost); - $appliancePerson->rate_count--; + --$appliancePerson->rate_count; } else { $this->applianceRateService->updateApplianceRateCost($applianceRate, $creatorId, $cost, $newCost); } diff --git a/src/backend/app/Http/Controllers/AssetTypeController.php b/src/backend/app/Http/Controllers/AssetTypeController.php index e5df4e5d0..dad942212 100644 --- a/src/backend/app/Http/Controllers/AssetTypeController.php +++ b/src/backend/app/Http/Controllers/AssetTypeController.php @@ -55,8 +55,6 @@ public function update(AssetTypeUpdateRequest $request, AssetType $assetType): A /** * Remove the specified resource from storage. * - * - * * @throws \Exception */ public function destroy(AssetType $assetType): ApiResource diff --git a/src/backend/app/Http/Controllers/AuthController.php b/src/backend/app/Http/Controllers/AuthController.php index 51e67fee4..5c0a69433 100644 --- a/src/backend/app/Http/Controllers/AuthController.php +++ b/src/backend/app/Http/Controllers/AuthController.php @@ -31,7 +31,7 @@ public function login() { $credentials = request(['email', 'password']); - if (! $token = auth('api')->attempt($credentials)) { + if (!$token = auth('api')->attempt($credentials)) { return response()->json(['data' => ['message' => 'Unauthorized', 'status' => 401]], 401); } @@ -75,7 +75,8 @@ public function refresh() /** * Get the token array structure. * - * @param string $token + * @param string $token + * * @return JsonResponse */ protected function respondWithToken($token) diff --git a/src/backend/app/Http/Controllers/CompanyController.php b/src/backend/app/Http/Controllers/CompanyController.php index a86f98e32..8b6f0c889 100644 --- a/src/backend/app/Http/Controllers/CompanyController.php +++ b/src/backend/app/Http/Controllers/CompanyController.php @@ -94,7 +94,7 @@ function () use ($company, $plugins) { '-', $mpmPlugin->tail_tag ) : null, - 'adjusted' => ! isset($mpmPlugin->tail_tag), + 'adjusted' => !isset($mpmPlugin->tail_tag), ]; Artisan::call($mpmPlugin->installation_command); } diff --git a/src/backend/app/Http/Controllers/ManufacturerController.php b/src/backend/app/Http/Controllers/ManufacturerController.php index 2d4fa4597..5f909de41 100644 --- a/src/backend/app/Http/Controllers/ManufacturerController.php +++ b/src/backend/app/Http/Controllers/ManufacturerController.php @@ -49,7 +49,7 @@ public function store(ManufacturerRequest $request): JsonResponse /** * Display the specified resource. * - * @param int $manufacturerId + * @param int $manufacturerId */ public function show($manufacturerId): ApiResource { diff --git a/src/backend/app/Http/Controllers/MeterController.php b/src/backend/app/Http/Controllers/MeterController.php index a4d685ffb..a8668ddbc 100644 --- a/src/backend/app/Http/Controllers/MeterController.php +++ b/src/backend/app/Http/Controllers/MeterController.php @@ -40,7 +40,6 @@ public function index(Request $request): ApiResource * Create * Stores a new meter. * - * * @bodyParam serial_number string required * @bodyParam meter_type_id int required * @bodyParam manufacturer_id int required diff --git a/src/backend/app/Http/Controllers/MeterGeographicalInformationController.php b/src/backend/app/Http/Controllers/MeterGeographicalInformationController.php index 03ccaacba..ede227cb4 100644 --- a/src/backend/app/Http/Controllers/MeterGeographicalInformationController.php +++ b/src/backend/app/Http/Controllers/MeterGeographicalInformationController.php @@ -53,7 +53,7 @@ public function index($miniGridId): ApiResource * * @urlParam person required The ID of the person * - * @param int $person + * @param int $person * * @responseFile responses/people/person.meter.list.json */ @@ -70,7 +70,7 @@ public function show(int $personId): ApiResource * * @bodyParam points string. Comma seperated latitude and longitude. Example 1,2 * - * @param Meter $meter + * @param Meter $meter */ public function update(Request $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/MeterTariffController.php b/src/backend/app/Http/Controllers/MeterTariffController.php index 7680a3e1f..6c5c21c8e 100644 --- a/src/backend/app/Http/Controllers/MeterTariffController.php +++ b/src/backend/app/Http/Controllers/MeterTariffController.php @@ -37,7 +37,7 @@ public function index(Request $request): ApiResource * * @responseFile responses/tariffs/tariff.detail.json * - * @param MeterTariff $tariff + * @param MeterTariff $tariff */ public function show(Request $request, $meterTariffId): ApiResource { diff --git a/src/backend/app/Http/Controllers/MeterTypeController.php b/src/backend/app/Http/Controllers/MeterTypeController.php index 80ba04c9c..703c7b72f 100644 --- a/src/backend/app/Http/Controllers/MeterTypeController.php +++ b/src/backend/app/Http/Controllers/MeterTypeController.php @@ -55,7 +55,7 @@ public function store(MeterTypeCreateRequest $request) * * @bodyParam id int required * - * @param int $meterTypeId + * @param int $meterTypeId */ public function show($meterTypeId): ApiResource { @@ -72,7 +72,7 @@ public function show($meterTypeId): ApiResource * @bodyParam phase int required * @bodyParam max_current int required * - * @param int $meterTypeId + * @param int $meterTypeId */ public function update(MeterTypeUpdateRequest $request, $meterTypeId): ApiResource { diff --git a/src/backend/app/Http/Controllers/MiniGridController.php b/src/backend/app/Http/Controllers/MiniGridController.php index d0d7dac55..1c117f8b2 100644 --- a/src/backend/app/Http/Controllers/MiniGridController.php +++ b/src/backend/app/Http/Controllers/MiniGridController.php @@ -35,7 +35,7 @@ public function index(Request $request): ApiResource * * @bodyParam id int required * - * @param int $id + * @param int $id */ public function show($miniGridId, Request $request): ApiResource { @@ -66,7 +66,7 @@ public function store(StoreMiniGridRequest $request): ApiResource * * @bodyParam name string The name of the MiniGrid. * - * @param MiniGrid $miniGrid + * @param MiniGrid $miniGrid */ public function update($miniGridId, UpdateMiniGridRequest $request): ApiResource { diff --git a/src/backend/app/Http/Controllers/PaymentHistoryController.php b/src/backend/app/Http/Controllers/PaymentHistoryController.php index 6c87cbb1f..b0996318b 100644 --- a/src/backend/app/Http/Controllers/PaymentHistoryController.php +++ b/src/backend/app/Http/Controllers/PaymentHistoryController.php @@ -37,8 +37,9 @@ public function __construct(PaymentHistory $history) * @urlParam limit integer * @urlParam order string * - * @param null $limit - * @param string $order + * @param null $limit + * @param string $order + * * @return array */ public function show(int $payerId, string $period, $limit = null, $order = 'ASC') @@ -74,7 +75,8 @@ public function show(int $payerId, string $period, $limit = null, $order = 'ASC' * * @urlParam personId integer required * - * @param $personId + * @param $personId + * * @return ApiResource * * @throws \Exception @@ -121,7 +123,8 @@ public function byYear(int $personId, ?int $year = null): array * @urlParam personId integer required * checks if the person has any debts to the system * - * @param int $personId + * @param int $personId + * * @return ApiResource */ public function debts($personId) diff --git a/src/backend/app/Http/Controllers/PersonController.php b/src/backend/app/Http/Controllers/PersonController.php index b25a23aa7..9336d6da8 100644 --- a/src/backend/app/Http/Controllers/PersonController.php +++ b/src/backend/app/Http/Controllers/PersonController.php @@ -54,8 +54,6 @@ public function index(Request $request): ApiResource * - Role * - Meter list. * - * - * * @apiResourceModel App\Models\Person\Person * * @responseFile responses/people/people.detail.json @@ -138,8 +136,6 @@ public function update( * The list of all transactions(paginated) which belong to that person. * Each page contains 7 entries of the last transaction. * - * - * * @bodyParam person_id int required the ID of the person. Example: 2 * * @responseFile responses/people/person.transaction.list.json diff --git a/src/backend/app/Http/Controllers/PluginController.php b/src/backend/app/Http/Controllers/PluginController.php index d797c1d6b..d3ca01642 100644 --- a/src/backend/app/Http/Controllers/PluginController.php +++ b/src/backend/app/Http/Controllers/PluginController.php @@ -36,14 +36,14 @@ public function update(Request $request, $mpmPluginId): ApiResource 'status' => $request->input('checked'), ]; - if (! $plugin && ! $request->input('checked')) { + if (!$plugin && !$request->input('checked')) { throw new \Exception('Plugin not found'); } if ($request->input('checked')) { // Check if this is the first time we are installing the plugin. // In that case we also need to run install commands, if present - if (! $plugin) { + if (!$plugin) { $createdPlugin = $this->pluginsService->create($pluginData); $this->registrationTailService->addMpmPluginToRegistrationTail($registrationTail, $mpmPlugin); diff --git a/src/backend/app/Http/Controllers/ReportController.php b/src/backend/app/Http/Controllers/ReportController.php index ceba5a5fa..75ea04362 100644 --- a/src/backend/app/Http/Controllers/ReportController.php +++ b/src/backend/app/Http/Controllers/ReportController.php @@ -20,7 +20,7 @@ public function __construct(Report $report) public function download($id) { - if (! $id) { + if (!$id) { return; } $report = $this->report->find($id); diff --git a/src/backend/app/Http/Controllers/Reports.php b/src/backend/app/Http/Controllers/Reports.php index 70c12f799..13ff37ea2 100644 --- a/src/backend/app/Http/Controllers/Reports.php +++ b/src/backend/app/Http/Controllers/Reports.php @@ -124,12 +124,12 @@ private function addTargetConnectionGroups(Worksheet $sheet): void )->get(); foreach ($connections as $connection) { $sheet->setCellValue($column.$row, $connection->name); - $row++; + ++$row; foreach ($connection->subConnections as $subConnection) { foreach ($subConnection->meterParameters as $meterParameter) { $sheet->setCellValue($subColumn.$row, $meterParameter->connectionGroup()->first()->name); $this->subConnectionRows[$meterParameter->connectionGroup()->first()->name] = $row; - $row++; + ++$row; } } } @@ -236,7 +236,7 @@ private function addStaticText(Worksheet $sheet, string $dateRange): void } /** - * @param Builder[]|Collection $transactions + * @param Builder[]|Collection $transactions * * @throws CustomerGroupNotFound * @throws \PhpOffice\PhpSpreadsheet\Exception @@ -265,8 +265,8 @@ public function generateXls( } /** - * @param bool $addPurchaseBreakDown - * @param Builder[]|Collection $transactions + * @param bool $addPurchaseBreakDown + * @param Builder[]|Collection $transactions * * @throws CustomerGroupNotFound */ @@ -276,7 +276,7 @@ private function addTransactions(Worksheet $sheet, $transactions, $addPurchaseBr $balance = 0; foreach ($transactions as $index => $transaction) { - if (! $transaction->meter || ! $transaction->meter->meterParameter) { + if (!$transaction->meter || !$transaction->meter->meterParameter) { continue; } @@ -328,7 +328,6 @@ private function addTransactions(Worksheet $sheet, $transactions, $addPurchaseBr /** * Add the breakdown of the transaction amount into the right place on the spreadsheet. * - * * @throws CustomerGroupNotFound */ private function purchaseBreakDown( @@ -381,7 +380,7 @@ private function storeConnectionGroupColumn(string $connectionGroup, string $col } /** - * @param Builder[]|Collection $connectionGroups + * @param Builder[]|Collection $connectionGroups * * @throws \PhpOffice\PhpSpreadsheet\Exception */ @@ -409,23 +408,23 @@ private function addConnectionGroupsToXLS( if ($accessRate) { if ($accessRate->amount > 0) { $nextColumn = $startingColumn; - $nextColumn++; + ++$nextColumn; $sheet->mergeCells($startingColumn.$startingRow.':'. $nextColumn.$startingRow); - $startingColumn++; + ++$startingColumn; break; } } } } - $startingColumn++; + ++$startingColumn; } } private function addSoldTotal(string $connectionGroupName, array $amount, $unit = null): void { - if (! array_key_exists($connectionGroupName, $this->totalSold)) { + if (!array_key_exists($connectionGroupName, $this->totalSold)) { $this->totalSold[$connectionGroupName] = [ 'energy' => 0, 'access_rate' => 0, @@ -485,8 +484,8 @@ private function addSoldSummary(Worksheet $sheet): void */ private function excelColumnRange(string $lower, string $upper): \Generator { - $upper++; - for ($i = $lower; $i !== $upper; $i++) { + ++$upper; + for ($i = $lower; $i !== $upper; ++$i) { yield $i; } } @@ -561,7 +560,7 @@ static function ($q) { $databaseProxy = app()->make(DatabaseProxy::class); $companyId = $databaseProxy->findByEmail($user->email)->getCompanyId(); - if (! file_exists($dirPath) && ! mkdir($dirPath, 0774, true) && ! is_dir($dirPath)) { + if (!file_exists($dirPath) && !mkdir($dirPath, 0774, true) && !is_dir($dirPath)) { throw new \RuntimeException(sprintf('Directory "%s" was not created', $dirPath)); } try { @@ -613,10 +612,10 @@ private function getCustomerGroupEnergyUsagePerMonth(array $dates): void $tariffPrice = $groupRevenue->tariff_price; - if (! $tariffPrice || $tariffPrice === 0) { + if (!$tariffPrice || $tariffPrice === 0) { continue; } - if (! $energyRevenue || $energyRevenue === 0) { + if (!$energyRevenue || $energyRevenue === 0) { continue; } $tariffPrice /= 100; @@ -661,7 +660,7 @@ private function addTargetsToXls(Worksheet $sheet): void { foreach ($this->monthlyTargetDatas as $subConnection => $monthlyTargetData) { $row = $this->subConnectionRows[$subConnection]; - if (! $row) { + if (!$row) { continue; } $sheet->setCellValue('E'.$row, $monthlyTargetData['connections']); @@ -679,12 +678,12 @@ private function addStoredTargets(Worksheet $sheet, int $cityId, $endDate): void ->where('owner_id', $cityId) ->orderBy('target_date', 'asc')->first(); - if (! $targetData) { // no target is defined for that mini-grid + if (!$targetData) { // no target is defined for that mini-grid return; } foreach ($targetData->subTargets as $subTarget) { - if (! isset($this->subConnectionRows[$subTarget->connectionType->name])) { + if (!isset($this->subConnectionRows[$subTarget->connectionType->name])) { continue; } $row = $this->subConnectionRows[$subTarget->connectionType->name]; diff --git a/src/backend/app/Http/Controllers/RevenueController.php b/src/backend/app/Http/Controllers/RevenueController.php index 7528ab541..a1e1c144f 100644 --- a/src/backend/app/Http/Controllers/RevenueController.php +++ b/src/backend/app/Http/Controllers/RevenueController.php @@ -78,7 +78,7 @@ public function trending($id, Request $request): ApiResource $cities = $this->city::query()->where('mini_grid_id', $id)->get(); $cityIds = implode(',', $cities->pluck('id')->toArray()); - if (! count($cities)) { + if (!count($cities)) { $response = ['data' => null, 'message' => 'There is no city for this MiniGrid']; return ApiResource::make($response); @@ -117,7 +117,6 @@ public function trending($id, Request $request): ApiResource /** * Prepares the data for revenue dashboard. * - * * @return array|mixed */ public function revenueData(Request $request): ApiResource diff --git a/src/backend/app/Http/Controllers/SmsController.php b/src/backend/app/Http/Controllers/SmsController.php index 830178a8c..7915f09a6 100644 --- a/src/backend/app/Http/Controllers/SmsController.php +++ b/src/backend/app/Http/Controllers/SmsController.php @@ -218,7 +218,7 @@ static function ($q) { /** * Marks the sms as sent. * - * @param string $uuid + * @param string $uuid */ public function updateForDelivered($uuid): void { diff --git a/src/backend/app/Http/Controllers/SubConnectionTypeController.php b/src/backend/app/Http/Controllers/SubConnectionTypeController.php index a789a87fb..999e8c88f 100644 --- a/src/backend/app/Http/Controllers/SubConnectionTypeController.php +++ b/src/backend/app/Http/Controllers/SubConnectionTypeController.php @@ -38,7 +38,7 @@ public function store(SubConnectionTypeCreateRequest $request): ApiResource /** * Update the specified resource in storage. * - * @param SubConnectionType $subConnectionType + * @param SubConnectionType $subConnectionType */ public function update(Request $request, $subConnectionTypeId): ApiResource { diff --git a/src/backend/app/Http/Controllers/UserPasswordController.php b/src/backend/app/Http/Controllers/UserPasswordController.php index 4fb67e1ef..960b86cb6 100644 --- a/src/backend/app/Http/Controllers/UserPasswordController.php +++ b/src/backend/app/Http/Controllers/UserPasswordController.php @@ -20,7 +20,7 @@ public function __construct(UserService $userService) public function forgotPassword(AdminResetPasswordRequest $request, Response $response): Response { - if (! $this->userService->resetPassword($request->input('email'))) { + if (!$this->userService->resetPassword($request->input('email'))) { return $response->setStatusCode(422)->setContent( [ 'data' => [ diff --git a/src/backend/app/Http/Middleware/AgentBalanceMiddleware.php b/src/backend/app/Http/Middleware/AgentBalanceMiddleware.php index 862b3f76c..1553ccc2a 100644 --- a/src/backend/app/Http/Middleware/AgentBalanceMiddleware.php +++ b/src/backend/app/Http/Middleware/AgentBalanceMiddleware.php @@ -23,7 +23,8 @@ public function __construct( /** * Handle an incoming request. * - * @param \Illuminate\Http\Request $request + * @param \Illuminate\Http\Request $request + * * @return mixed */ public function handle($request, \Closure $next) @@ -36,11 +37,11 @@ public function handle($request, \Closure $next) if ($routeName === 'agent-sell-appliance') { $assignedApplianceCost = $this->agentAssignedApplianceService->getById($request->input('agent_assigned_appliance_id')); $downPayment = $request->input('down_payment'); - if (! $assignedApplianceCost) { + if (!$assignedApplianceCost) { throw new ModelNotFoundException('Assigned Appliance not found'); } - if (! isset($downPayment)) { + if (!isset($downPayment)) { throw new DownPaymentNotFoundException('DownPayment not found'); } diff --git a/src/backend/app/Http/Middleware/RedirectIfAuthenticated.php b/src/backend/app/Http/Middleware/RedirectIfAuthenticated.php index 5765f549f..34e232eff 100644 --- a/src/backend/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/src/backend/app/Http/Middleware/RedirectIfAuthenticated.php @@ -10,8 +10,9 @@ class RedirectIfAuthenticated /** * Handle an incoming request. * - * @param Request $request - * @param string|null $guard + * @param Request $request + * @param string|null $guard + * * @return mixed */ public function handle($request, \Closure $next, $guard = null) diff --git a/src/backend/app/Http/Middleware/RestrictionMiddleware.php b/src/backend/app/Http/Middleware/RestrictionMiddleware.php index 096a35607..1436dba1c 100644 --- a/src/backend/app/Http/Middleware/RestrictionMiddleware.php +++ b/src/backend/app/Http/Middleware/RestrictionMiddleware.php @@ -24,8 +24,9 @@ public function __construct( /** * Handle an incoming request. * - * @param Request $request - * @param $type + * @param Request $request + * @param $type + * * @return mixed */ public function handle($request, \Closure $next, $target) @@ -34,7 +35,7 @@ public function handle($request, \Closure $next, $target) $restriction = $this->restrictionService->getRestrictionForTarget($target); $restrictionResult = $this->handleRestriction($restriction->limit, $target, $request); - if (! $restrictionResult) { + if (!$restrictionResult) { $baseMessage = 'Your free limit of %s is exceeded. You can order more slots below.'; if ($target === 'maintenance-user') { diff --git a/src/backend/app/Http/Middleware/TransactionRequest.php b/src/backend/app/Http/Middleware/TransactionRequest.php index 2641e1dfe..1591edcf1 100644 --- a/src/backend/app/Http/Middleware/TransactionRequest.php +++ b/src/backend/app/Http/Middleware/TransactionRequest.php @@ -11,7 +11,8 @@ class TransactionRequest /** * Handle an incoming request. * - * @param Request $request + * @param Request $request + * * @return mixed */ public function handle($request, \Closure $next) diff --git a/src/backend/app/Http/Middleware/UserDefaultDatabaseConnectionMiddleware.php b/src/backend/app/Http/Middleware/UserDefaultDatabaseConnectionMiddleware.php index 99940c4e0..7a8216a46 100644 --- a/src/backend/app/Http/Middleware/UserDefaultDatabaseConnectionMiddleware.php +++ b/src/backend/app/Http/Middleware/UserDefaultDatabaseConnectionMiddleware.php @@ -76,7 +76,7 @@ private function handleApiRequest(Request $request, \Closure $next) $companyId = $databaseProxy->getCompanyId(); } elseif ($this->isAgentApp($request->path())) { // agent app authenticated user requests $companyId = auth('agent_api')->payload()->get('companyId'); - if (! is_numeric($companyId)) { + if (!is_numeric($companyId)) { throw new \Exception('JWT is not provided'); } } elseif ($this->resolveThirdPartyApi($request->path())) { @@ -87,7 +87,7 @@ private function handleApiRequest(Request $request, \Closure $next) } else { // web client authenticated user requests $companyId = auth('api')->payload()->get('companyId'); - if (! is_numeric($companyId)) { + if (!is_numeric($companyId)) { throw new \Exception('JWT is not provided'); } } diff --git a/src/backend/app/Http/Resources/ApiResource.php b/src/backend/app/Http/Resources/ApiResource.php index 1095cd954..5016dea38 100644 --- a/src/backend/app/Http/Resources/ApiResource.php +++ b/src/backend/app/Http/Resources/ApiResource.php @@ -10,7 +10,8 @@ class ApiResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request + * @param Request $request + * * @return array */ public function toArray($request) diff --git a/src/backend/app/Http/Resources/MeterResource.php b/src/backend/app/Http/Resources/MeterResource.php index 1054b63f7..4eba9a77d 100644 --- a/src/backend/app/Http/Resources/MeterResource.php +++ b/src/backend/app/Http/Resources/MeterResource.php @@ -10,7 +10,8 @@ class MeterResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request + * @param Request $request + * * @return array */ public function toArray($request) diff --git a/src/backend/app/Http/Resources/MeterTypeResource.php b/src/backend/app/Http/Resources/MeterTypeResource.php index 500cdbe9b..0f79f0186 100644 --- a/src/backend/app/Http/Resources/MeterTypeResource.php +++ b/src/backend/app/Http/Resources/MeterTypeResource.php @@ -10,7 +10,8 @@ class MeterTypeResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request + * @param Request $request + * * @return array */ public function toArray($request) diff --git a/src/backend/app/Http/Resources/SmsSearchResultResource.php b/src/backend/app/Http/Resources/SmsSearchResultResource.php index 9cd0980a2..8080af841 100644 --- a/src/backend/app/Http/Resources/SmsSearchResultResource.php +++ b/src/backend/app/Http/Resources/SmsSearchResultResource.php @@ -7,9 +7,9 @@ use Illuminate\Support\Collection; /** - * @property int $id - * @property string $name - * @property string $surname + * @property int $id + * @property string $name + * @property string $surname * @property Collection $addresses */ class SmsSearchResultResource extends JsonResource @@ -17,7 +17,7 @@ class SmsSearchResultResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request + * @param Request $request */ public function toArray($request): array { diff --git a/src/backend/app/Http/Resources/UserResource.php b/src/backend/app/Http/Resources/UserResource.php index 9197f45c6..9aa7c241a 100644 --- a/src/backend/app/Http/Resources/UserResource.php +++ b/src/backend/app/Http/Resources/UserResource.php @@ -10,7 +10,8 @@ class UserResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request + * @param Request $request + * * @return array */ public function toArray($request) diff --git a/src/backend/app/Jobs/EnergyTransactionProcessor.php b/src/backend/app/Jobs/EnergyTransactionProcessor.php index e9a1ba931..4f8cb3be7 100644 --- a/src/backend/app/Jobs/EnergyTransactionProcessor.php +++ b/src/backend/app/Jobs/EnergyTransactionProcessor.php @@ -72,7 +72,7 @@ private function checkForMinimumPurchaseAmount(TransactionDataContainer $transac if ($minimumPurchaseAmount > 0) { $validator = resolve('MinimumPurchaseAmountValidator'); try { - if (! $validator->validate($transactionData, $minimumPurchaseAmount)) { + if (!$validator->validate($transactionData, $minimumPurchaseAmount)) { throw new TransactionAmountNotEnoughException("Minimum purchase amount not reached for {$transactionData->device->device_serial}"); } } catch (\Exception $e) { diff --git a/src/backend/app/Jobs/ProcessPayment.php b/src/backend/app/Jobs/ProcessPayment.php index 72f2afcb4..2b2960a66 100644 --- a/src/backend/app/Jobs/ProcessPayment.php +++ b/src/backend/app/Jobs/ProcessPayment.php @@ -24,7 +24,7 @@ class ProcessPayment extends AbstractJob /** * Create a new job instance. * - * @param int $transaction_id + * @param int $transaction_id */ public function __construct(int $transactionId) { diff --git a/src/backend/app/Jobs/SmsProcessor.php b/src/backend/app/Jobs/SmsProcessor.php index 41fe1bcf9..17c1f848d 100644 --- a/src/backend/app/Jobs/SmsProcessor.php +++ b/src/backend/app/Jobs/SmsProcessor.php @@ -22,9 +22,9 @@ class SmsProcessor extends AbstractJob /** * Create a new job instance. * - * @param $data - * @param int $smsType - * @param $smsConfigs + * @param $data + * @param int $smsType + * @param $smsConfigs */ public function __construct(private SmsSender $smsSender) { diff --git a/src/backend/app/Jobs/TokenProcessor.php b/src/backend/app/Jobs/TokenProcessor.php index 818c8a327..96b363b38 100644 --- a/src/backend/app/Jobs/TokenProcessor.php +++ b/src/backend/app/Jobs/TokenProcessor.php @@ -114,7 +114,7 @@ private function handleTokenGenerationFailure(\Exception $e): void private function retryTokenGeneration(): void { - $this->counter++; + ++$this->counter; self::dispatch( $this->transactionContainer, false, diff --git a/src/backend/app/Jobs/UpdatePiggyBankEntry.php b/src/backend/app/Jobs/UpdatePiggyBankEntry.php index d9add72bc..2365c996a 100644 --- a/src/backend/app/Jobs/UpdatePiggyBankEntry.php +++ b/src/backend/app/Jobs/UpdatePiggyBankEntry.php @@ -39,7 +39,7 @@ public function __construct(MeterParameter $meterParameter) public function executeJob() { $socialTariff = $this->meterParameter->tariff()->first()->socialTariff; - if (! $socialTariff) { + if (!$socialTariff) { echo "meter has no social tariff should be deleted \n"; // meter parameter has no social tariff diff --git a/src/backend/app/Lib/IMeterReader.php b/src/backend/app/Lib/IMeterReader.php index 7448672be..eb0b9c614 100644 --- a/src/backend/app/Lib/IMeterReader.php +++ b/src/backend/app/Lib/IMeterReader.php @@ -7,7 +7,8 @@ interface IMeterReader /** * Reads the data for a single meter. * - * @param int $type defines what to read from the remote api + * @param int $type defines what to read from the remote api + * * @return mixed */ public function readMeter($meterIdentifier, $type); @@ -15,8 +16,9 @@ public function readMeter($meterIdentifier, $type); /** * Reads the data for a given meter list. * - * @param int $type defines what to read from the remote api - * * @param array $options + * @param int $type defines what to read from the remote api + * * @param array $options + * * @return mixed */ public function readBatch($meterList, $type, $options); diff --git a/src/backend/app/Lib/ISmsProvider.php b/src/backend/app/Lib/ISmsProvider.php index 5feb3a3d9..bf8455769 100644 --- a/src/backend/app/Lib/ISmsProvider.php +++ b/src/backend/app/Lib/ISmsProvider.php @@ -9,7 +9,6 @@ interface ISmsProvider /** * Sends the sms to the sms provider. * - * * @return mixed */ public function sendSms(string $number, string $body, string $callback, SmsAndroidSetting $smsAndroidSetting); diff --git a/src/backend/app/Listeners/AccessRateListener.php b/src/backend/app/Listeners/AccessRateListener.php index 87fcce7aa..e417d5534 100644 --- a/src/backend/app/Listeners/AccessRateListener.php +++ b/src/backend/app/Listeners/AccessRateListener.php @@ -15,7 +15,7 @@ public function initializeAccessRatePayment(Meter $meter): void { try { $accessRate = $meter->tariff()->first()->accessRate; - if (! $accessRate) { + if (!$accessRate) { throw new NoAccessRateFound('Access Rate is not set'); } $nextPaymentDate = Carbon::now()->addDays($accessRate->period)->toDateString(); diff --git a/src/backend/app/Listeners/ClusterGeoListener.php b/src/backend/app/Listeners/ClusterGeoListener.php index aa9e068e3..5b2a8f4e7 100644 --- a/src/backend/app/Listeners/ClusterGeoListener.php +++ b/src/backend/app/Listeners/ClusterGeoListener.php @@ -53,7 +53,6 @@ private function storeData(Cluster $cluster, $data): void /** * External geojson resource has lon,lat format. Change order to lat,lon. * - * * @return array[] * * @throws GeoFormatException @@ -63,15 +62,15 @@ private function storeData(Cluster $cluster, $data): void public function reformatExternalData($data): array { $formatted = []; - if (is_array($data) && ! array_key_exists('geojson', $data)) { + if (is_array($data) && !array_key_exists('geojson', $data)) { $data = $data[0]; } - if (! array_key_exists('geojson', $data)) { + if (!array_key_exists('geojson', $data)) { throw new GeoFormatException('external resource should contain a geojson key'); } - if (! array_key_exists('coordinates', $data['geojson'])) { + if (!array_key_exists('coordinates', $data['geojson'])) { throw new GeoFormatException('geojson key has not coordinates key'); } diff --git a/src/backend/app/Listeners/HistoryListener.php b/src/backend/app/Listeners/HistoryListener.php index c756bb014..0c35e74c4 100644 --- a/src/backend/app/Listeners/HistoryListener.php +++ b/src/backend/app/Listeners/HistoryListener.php @@ -25,8 +25,8 @@ public function __construct(History $historyModel) /** * Saves a new event in to the histories table. * - * @param mixed $data is an object which should be stored on the histories table - * @param string $content the stringified message about the entry + * @param mixed $data is an object which should be stored on the histories table + * @param string $content the stringified message about the entry */ public function save($data, string $content, string $type, ?string $field): void { diff --git a/src/backend/app/Listeners/PaymentListener.php b/src/backend/app/Listeners/PaymentListener.php index 0efcefd44..45c7b41b9 100644 --- a/src/backend/app/Listeners/PaymentListener.php +++ b/src/backend/app/Listeners/PaymentListener.php @@ -50,10 +50,10 @@ public function onPaymentFailed(): void } /** - * @param int $amount - * @param string $paymentService the name of the Payment gateway - * @param mixed $sender : The number or person who sent the money - * @param mixed $paidFor the identifier for the payment. Ex; { LoanID, TokenID } + * @param int $amount + * @param string $paymentService the name of the Payment gateway + * @param mixed $sender : The number or person who sent the money + * @param mixed $paidFor the identifier for the payment. Ex; { LoanID, TokenID } */ public function onPaymentSuccess( $amount, diff --git a/src/backend/app/Listeners/SmsListener.php b/src/backend/app/Listeners/SmsListener.php index e023ad4a6..eceab931d 100644 --- a/src/backend/app/Listeners/SmsListener.php +++ b/src/backend/app/Listeners/SmsListener.php @@ -31,11 +31,11 @@ public function __construct( public function onSmsStored($sender, $message) { $resendInformationKey = $this->smsResendInformationKeyService->getResendInformationKeys()->first(); - if (! $resendInformationKey) { + if (!$resendInformationKey) { return; } $resend = strpos(strtolower($message), strtolower($resendInformationKey)); - if (! $resend) { + if (!$resend) { return; } $wordsInMessage = explode(' ', $message); diff --git a/src/backend/app/ManufacturerApi/CalinReadMeter.php b/src/backend/app/ManufacturerApi/CalinReadMeter.php index 0d232fdf8..95c1af3a2 100644 --- a/src/backend/app/ManufacturerApi/CalinReadMeter.php +++ b/src/backend/app/ManufacturerApi/CalinReadMeter.php @@ -25,7 +25,6 @@ class CalinReadMeter implements IMeterReader /** * CalinReadMeter constructor. * - * * @throws \SoapFault */ public function __construct(MeterConsumption $consumption) @@ -38,8 +37,9 @@ public function __construct(MeterConsumption $consumption) } /** - * @param string $meterId serial number of the meter - * @param string $date y-m-d format date + * @param string $meterId serial number of the meter + * @param string $date y-m-d format date + * * @return mixed */ public function readDailyData($meterId, $date) @@ -59,7 +59,6 @@ public function readDailyData($meterId, $date) /** * Reads the total consumption of a meter. * - * * @return void */ public function readMeter($meterId, $type) @@ -69,14 +68,15 @@ public function readMeter($meterId, $type) /** * Reads the data for a given meter list. * - * @param int $type defines what to read from the remote api - * @param array $options + * @param int $type defines what to read from the remote api + * @param array $options + * * @return void */ public function readBatch($meterList, $type, $options) { if ($type === self::READ_DAILY) { - if (! isset($options['date'])) { + if (!isset($options['date'])) { throw new InvalidDateException('Date', 'date is not set. Send date within the options array'); } foreach ($meterList as $meter) { @@ -150,7 +150,8 @@ private function fetchResponseData($data): array } /** - * @param string $action + * @param string $action + * * @return array (\Illuminate\Config\Repository|float|mixed)[] */ private function prepareDailyReq(string $meterId, string $year, string $month, string $day, $action = 'Read'): array diff --git a/src/backend/app/Misc/LoanDataContainer.php b/src/backend/app/Misc/LoanDataContainer.php index b41afd284..2ad41fab4 100644 --- a/src/backend/app/Misc/LoanDataContainer.php +++ b/src/backend/app/Misc/LoanDataContainer.php @@ -29,7 +29,7 @@ public function initialize(Transaction $transaction): void public function loanCost() { - if (! $this->meterOwner) { + if (!$this->meterOwner) { throw new MeterParameterNotFound('loan data container'); } $loans = $this->getCustomerDueRates($this->meterOwner); @@ -121,7 +121,7 @@ private function getMeterOwner(string $serialNumber): ?Person } // meter is not been used by anyone - if (! $meter->in_use) { + if (!$meter->in_use) { throw new MeterIsNotInUse($serialNumber.' meter is not in use'); } diff --git a/src/backend/app/Models/Address/Address.php b/src/backend/app/Models/Address/Address.php index d7b17aa1d..47b657506 100644 --- a/src/backend/app/Models/Address/Address.php +++ b/src/backend/app/Models/Address/Address.php @@ -16,10 +16,10 @@ * @property string|null $email * @property string|null $phone * @property string|null $street - * @property int $city_id - * @property int $is_primary - * @property int $owner_id - * @property string $owner_type + * @property int $city_id + * @property int $is_primary + * @property int $owner_id + * @property string $owner_type */ class Address extends BaseModel { diff --git a/src/backend/app/Models/Agent.php b/src/backend/app/Models/Agent.php index 9182a5e1e..49dcbf3ee 100644 --- a/src/backend/app/Models/Agent.php +++ b/src/backend/app/Models/Agent.php @@ -18,19 +18,19 @@ /** * Class Agent. * - * @property int $id - * @property int $person_id - * @property int $mini_grid_id - * @property int $agent_commission_id + * @property int $id + * @property int $person_id + * @property int $mini_grid_id + * @property int $agent_commission_id * @property string $device_id * @property string $name * @property string $email * @property string $password * @property string $fire_base_token - * @property float $balance - * @property float $available_balance + * @property float $balance + * @property float $available_balance * @property string $remember_token - * @property int $company_id + * @property int $company_id */ class Agent extends Authenticatable implements JWTSubject { diff --git a/src/backend/app/Models/AgentCommission.php b/src/backend/app/Models/AgentCommission.php index aac65eeb7..bf5c3e75d 100644 --- a/src/backend/app/Models/AgentCommission.php +++ b/src/backend/app/Models/AgentCommission.php @@ -10,7 +10,7 @@ /** * Class AgentCommission. * - * @property int $id + * @property int $id * @property float $energy_commission * @property float $appliance_commission * @property float $risk_balance diff --git a/src/backend/app/Models/AssetRate.php b/src/backend/app/Models/AssetRate.php index 027bbbd53..fb7eb22ae 100644 --- a/src/backend/app/Models/AssetRate.php +++ b/src/backend/app/Models/AssetRate.php @@ -11,9 +11,9 @@ /** * Class AssetRate. * - * @property int $asset_person_id - * @property int $rate_cost - * @property int $remaining + * @property int $asset_person_id + * @property int $rate_cost + * @property int $remaining * @property string $due_date * @property AssetPerson assetPerson */ diff --git a/src/backend/app/Models/City.php b/src/backend/app/Models/City.php index 01556cb04..696945aa0 100644 --- a/src/backend/app/Models/City.php +++ b/src/backend/app/Models/City.php @@ -12,11 +12,11 @@ /** * Class City. * - * @property int $id + * @property int $id * @property string $name - * @property int $country_id - * @property int $cluster_id - * @property int $mini_grid_id + * @property int $country_id + * @property int $cluster_id + * @property int $mini_grid_id */ class City extends BaseModel { diff --git a/src/backend/app/Models/Cluster.php b/src/backend/app/Models/Cluster.php index 776f234f5..acf8bfaf2 100644 --- a/src/backend/app/Models/Cluster.php +++ b/src/backend/app/Models/Cluster.php @@ -11,7 +11,7 @@ /** * Class Cluster. * - * @property int $id + * @property int $id * @property string $name * @property int manager_id * @property string geo_data diff --git a/src/backend/app/Models/Company.php b/src/backend/app/Models/Company.php index a7362016d..584247dca 100644 --- a/src/backend/app/Models/Company.php +++ b/src/backend/app/Models/Company.php @@ -8,7 +8,7 @@ use Illuminate\Database\Eloquent\Relations\HasOne; /** - * @property int $id + * @property int $id * @property string $name; */ class Company extends BaseModelCore diff --git a/src/backend/app/Models/History.php b/src/backend/app/Models/History.php index 2c0bcb105..ddd6e1eab 100644 --- a/src/backend/app/Models/History.php +++ b/src/backend/app/Models/History.php @@ -8,9 +8,9 @@ /** * Class History holds all the changes in the system for the current day. * - * @property int $id - * @property string $action the type of the action like created, updated, deleted/closed - * @property string $field the affected field. Only required for the update action + * @property int $id + * @property string $action the type of the action like created, updated, deleted/closed + * @property string $field the affected field. Only required for the update action * @property string $content; */ class History extends BaseModel diff --git a/src/backend/app/Models/MainSettings.php b/src/backend/app/Models/MainSettings.php index 1d0222e43..d64c2a842 100644 --- a/src/backend/app/Models/MainSettings.php +++ b/src/backend/app/Models/MainSettings.php @@ -7,14 +7,14 @@ /** * Class MainSettings. * - * @property int $id + * @property int $id * @property string $site_title * @property string $company_name * @property string $currency * @property string $country * @property string $language - * @property float $vat_energy - * @property float $vat_appliance + * @property float $vat_energy + * @property float $vat_appliance * */ class MainSettings extends BaseModel { diff --git a/src/backend/app/Models/MapSettings.php b/src/backend/app/Models/MapSettings.php index 6cf816243..dbb4ea829 100644 --- a/src/backend/app/Models/MapSettings.php +++ b/src/backend/app/Models/MapSettings.php @@ -7,7 +7,7 @@ /** * Class MapSettings. * - * @property int $id + * @property int $id * @property float $zoom * @property float $latitude * @property float $longitude diff --git a/src/backend/app/Models/Meter/Meter.php b/src/backend/app/Models/Meter/Meter.php index b614bbad3..0f1e10cd1 100644 --- a/src/backend/app/Models/Meter/Meter.php +++ b/src/backend/app/Models/Meter/Meter.php @@ -17,9 +17,9 @@ use Illuminate\Database\Eloquent\Relations\MorphOne; /** - * @property int $id + * @property int $id * @property MeterTariff $tariff - * @property bool $in_use + * @property bool $in_use */ class Meter extends BaseModel { diff --git a/src/backend/app/Models/Meter/MeterConsumption.php b/src/backend/app/Models/Meter/MeterConsumption.php index 4fd8c17f4..d922b5bd8 100644 --- a/src/backend/app/Models/Meter/MeterConsumption.php +++ b/src/backend/app/Models/Meter/MeterConsumption.php @@ -8,11 +8,11 @@ /** * Class MeterConsumption. * - * @property int $id - * @property int $meter_id - * @property float $total_consumption - * @property float $consumption - * @property float $credit_on_meter + * @property int $id + * @property int $meter_id + * @property float $total_consumption + * @property float $consumption + * @property float $credit_on_meter * @property string $reading_date */ class MeterConsumption extends BaseModel diff --git a/src/backend/app/Models/Meter/MeterTariff.php b/src/backend/app/Models/Meter/MeterTariff.php index 46d752f7e..dbf24de90 100644 --- a/src/backend/app/Models/Meter/MeterTariff.php +++ b/src/backend/app/Models/Meter/MeterTariff.php @@ -17,11 +17,11 @@ /** * Class Tariff. * - * @property string $name - * @property int $price (100 times the price. Allows to play with .00 decimals) - * @property int $total_price (100 times the price. Allows to play with .00 decimals) - * @property string $currency - * @property int|null $factor + * @property string $name + * @property int $price (100 times the price. Allows to play with .00 decimals) + * @property int $total_price (100 times the price. Allows to play with .00 decimals) + * @property string $currency + * @property int|null $factor * @property AccessRate $accessRate */ class MeterTariff extends BaseModel diff --git a/src/backend/app/Models/Meter/MeterToken.php b/src/backend/app/Models/Meter/MeterToken.php index e122e3551..f5313c187 100644 --- a/src/backend/app/Models/Meter/MeterToken.php +++ b/src/backend/app/Models/Meter/MeterToken.php @@ -14,7 +14,7 @@ * Class Token. * * @property string $token - * @property float $energy + * @property float $energy */ class MeterToken extends BaseModel { diff --git a/src/backend/app/Models/Meter/MeterType.php b/src/backend/app/Models/Meter/MeterType.php index 8faf50d5e..4393e3b3d 100644 --- a/src/backend/app/Models/Meter/MeterType.php +++ b/src/backend/app/Models/Meter/MeterType.php @@ -7,10 +7,10 @@ use Illuminate\Database\Eloquent\Relations\HasMany; /** - * @property int $id - * @property bool $online + * @property int $id + * @property bool $online * @property string $phase - * @property int $max_current + * @property int $max_current */ class MeterType extends BaseModel { diff --git a/src/backend/app/Models/MiniGrid.php b/src/backend/app/Models/MiniGrid.php index 0f214ec9e..286fc95a0 100644 --- a/src/backend/app/Models/MiniGrid.php +++ b/src/backend/app/Models/MiniGrid.php @@ -14,9 +14,9 @@ /** * Class MiniGrid. * - * @property int $id - * @property string $name - * @property int $cluster_id + * @property int $id + * @property string $name + * @property int $cluster_id * @property Collection $cities */ class MiniGrid extends BaseModel implements TargetAssignable diff --git a/src/backend/app/Models/PaymentHistory.php b/src/backend/app/Models/PaymentHistory.php index 0253d7695..6601fa629 100644 --- a/src/backend/app/Models/PaymentHistory.php +++ b/src/backend/app/Models/PaymentHistory.php @@ -84,8 +84,8 @@ public function getPaymentFlow(string $payer_type, int $payer_id, int $year) } /** - * @param Request|array|string $begin - * @param Request|array|string $end + * @param Request|array|string $begin + * @param Request|array|string $end */ public function getOverview($begin, $end) { diff --git a/src/backend/app/Models/Person/Person.php b/src/backend/app/Models/Person/Person.php index 0e6a2d8fd..6fc5ffac0 100644 --- a/src/backend/app/Models/Person/Person.php +++ b/src/backend/app/Models/Person/Person.php @@ -28,15 +28,15 @@ /** * Class Person. * - * @property int $id + * @property int $id * @property string $title * @property string $education * @property string $name * @property string $surname - * @property mixed $birth_date - * @property string $sex TODO: replace with gender - * @property int $nationality - * @property int $is_customer + * @property mixed $birth_date + * @property string $sex TODO: replace with gender + * @property int $nationality + * @property int $is_customer */ class Person extends BaseModel implements HasAddressesInterface, RoleInterface { diff --git a/src/backend/app/Models/Report.php b/src/backend/app/Models/Report.php index 50fda112c..2b4d2e9a2 100644 --- a/src/backend/app/Models/Report.php +++ b/src/backend/app/Models/Report.php @@ -7,7 +7,7 @@ /** * Class Report. * - * @property int $id + * @property int $id * @property string $name * @property string $date * @property string $path diff --git a/src/backend/app/Models/Restriction.php b/src/backend/app/Models/Restriction.php index ffae96ca7..98bd99ed2 100644 --- a/src/backend/app/Models/Restriction.php +++ b/src/backend/app/Models/Restriction.php @@ -8,10 +8,10 @@ /** * Class Restriction. * - * @property int $id + * @property int $id * @property string $target - * @property int $default - * @property int $limit + * @property int $default + * @property int $limit */ class Restriction extends BaseModel { diff --git a/src/backend/app/Models/Sms.php b/src/backend/app/Models/Sms.php index 37e23fb66..36cbdbf81 100644 --- a/src/backend/app/Models/Sms.php +++ b/src/backend/app/Models/Sms.php @@ -10,15 +10,15 @@ /** * Class Sms. * - * @property int $id + * @property int $id * @property string $trigger_type - * @property int $trigger_id + * @property int $trigger_id * @property string $receiver * @property string $body - * @property int $status the status of the sms 0 : waiting, 1 sent out to the receiver by sms provider - * @property string $uuid used for the callback to update the status of the sms - * @property int $direction - * @property int $sender_id + * @property int $status the status of the sms 0 : waiting, 1 sent out to the receiver by sms provider + * @property string $uuid used for the callback to update the status of the sms + * @property int $direction + * @property int $sender_id */ class Sms extends BaseModel { diff --git a/src/backend/app/Models/SocialTariffPiggyBank.php b/src/backend/app/Models/SocialTariffPiggyBank.php index 2f78c4988..3deb05a7a 100644 --- a/src/backend/app/Models/SocialTariffPiggyBank.php +++ b/src/backend/app/Models/SocialTariffPiggyBank.php @@ -9,9 +9,9 @@ /** * Class SocialTariffPiggyBank. * - * @property int $owner_id + * @property int $owner_id * @property string $owner_type - * @property int $savings + * @property int $savings */ class SocialTariffPiggyBank extends BaseModel { diff --git a/src/backend/app/Models/Subscription.php b/src/backend/app/Models/Subscription.php index 3d0b1dff6..bbc1d7bd2 100644 --- a/src/backend/app/Models/Subscription.php +++ b/src/backend/app/Models/Subscription.php @@ -8,8 +8,8 @@ /** * Class Subscription. * - * @property int $id - * @property int $upgrade_id + * @property int $id + * @property int $upgrade_id * @property string $expires * @property string $transaction_id */ diff --git a/src/backend/app/Models/Target.php b/src/backend/app/Models/Target.php index 7ebea43bd..51093002b 100644 --- a/src/backend/app/Models/Target.php +++ b/src/backend/app/Models/Target.php @@ -12,10 +12,10 @@ /** * Class Target. * - * @property int $id + * @property int $id * @property string $start_date * @property string $end_date - * @property int $city_id + * @property int $city_id */ class Target extends BaseModel { diff --git a/src/backend/app/Models/TariffPricingComponent.php b/src/backend/app/Models/TariffPricingComponent.php index cf7b9edab..73422b6e0 100644 --- a/src/backend/app/Models/TariffPricingComponent.php +++ b/src/backend/app/Models/TariffPricingComponent.php @@ -8,10 +8,10 @@ /** * Class TariffPricingComponent. * - * @property int $id + * @property int $id * @property string $name - * @property int $price - * @property int $owner_id + * @property int $price + * @property int $owner_id * @property string $owner_type */ class TariffPricingComponent extends BaseModel diff --git a/src/backend/app/Models/TicketSettings.php b/src/backend/app/Models/TicketSettings.php index d7cf76ab8..081c3f385 100644 --- a/src/backend/app/Models/TicketSettings.php +++ b/src/backend/app/Models/TicketSettings.php @@ -7,7 +7,7 @@ /** * Class TicketSettings. * - * @property int $id + * @property int $id * @property string $name * @property string $api_token * @property string $api_url diff --git a/src/backend/app/Models/Transaction/AirtelTransaction.php b/src/backend/app/Models/Transaction/AirtelTransaction.php index afe8d2364..c638dcc65 100644 --- a/src/backend/app/Models/Transaction/AirtelTransaction.php +++ b/src/backend/app/Models/Transaction/AirtelTransaction.php @@ -11,11 +11,11 @@ /** * Class AirtelTransaction. * - * @property int $id + * @property int $id * @property string $interface_id * @property string $business_number * @property string $trans_id - * @property int $status + * @property int $status * @property string $tr_id */ class AirtelTransaction extends BaseModel implements FullySupportedTransactionInterface, IRawTransaction diff --git a/src/backend/app/Models/Transaction/Transaction.php b/src/backend/app/Models/Transaction/Transaction.php index bf5e24c22..b35a2a89e 100644 --- a/src/backend/app/Models/Transaction/Transaction.php +++ b/src/backend/app/Models/Transaction/Transaction.php @@ -20,8 +20,8 @@ /** * Class Transaction. * - * @property int $id - * @property int $amount + * @property int $id + * @property int $amount * @property string $type * @property string $sender * @property string $message diff --git a/src/backend/app/Models/User.php b/src/backend/app/Models/User.php index df44d4add..1b787188a 100644 --- a/src/backend/app/Models/User.php +++ b/src/backend/app/Models/User.php @@ -17,9 +17,9 @@ /** * Class User. * - * @property int $id - * @property int $company_id - * @property string $name + * @property int $id + * @property int $company_id + * @property string $name * @property string|null $email */ class User extends Authenticatable implements JWTSubject diff --git a/src/backend/app/Observers/AgentBalanceHistoryObserver.php b/src/backend/app/Observers/AgentBalanceHistoryObserver.php index acd2814b1..3db4e311e 100644 --- a/src/backend/app/Observers/AgentBalanceHistoryObserver.php +++ b/src/backend/app/Observers/AgentBalanceHistoryObserver.php @@ -20,7 +20,6 @@ public function __construct( /** * Handle the asset person "updated" event. * - * * @return void */ public function created(AgentBalanceHistory $agentBalanceHistory) diff --git a/src/backend/app/PaymentHandler/AccessRate.php b/src/backend/app/PaymentHandler/AccessRate.php index ede6b64e3..7b9e9f815 100644 --- a/src/backend/app/PaymentHandler/AccessRate.php +++ b/src/backend/app/PaymentHandler/AccessRate.php @@ -24,7 +24,7 @@ class AccessRate /** * AccessRatePayment constructor. * - * @param AccessRate $accessRate + * @param AccessRate $accessRate */ public function __construct() { diff --git a/src/backend/app/Relations/BelongsToMorph.php b/src/backend/app/Relations/BelongsToMorph.php index b87cbb6bb..07aeda666 100644 --- a/src/backend/app/Relations/BelongsToMorph.php +++ b/src/backend/app/Relations/BelongsToMorph.php @@ -35,9 +35,10 @@ public function __construct(Builder $query, Model $parent, $name, $type, $id, $o /** * Add the constraints for a relationship query. * - * @param Builder $query - * @param Builder $parent - * @param array|mixed $columns + * @param Builder $query + * @param Builder $parent + * @param array|mixed $columns + * * @return Builder */ /** @@ -64,9 +65,9 @@ public function getResults() /** * Get the polymorphic relationship columns. * - * @param string $name - * @param string $type - * @param string $id + * @param string $name + * @param string $type + * @param string $id */ protected static function getMorphs($name, $type, $id): array { @@ -79,12 +80,12 @@ protected static function getMorphs($name, $type, $id): array /** * Define an inverse morph relationship. * - * @param string $related - * @param string $name - * @param null $type - * @param null $id - * @param null $otherKey - * @param null $relation + * @param string $related + * @param string $name + * @param null $type + * @param null $id + * @param null $otherKey + * @param null $relation */ public static function build( Model $parent, diff --git a/src/backend/app/Services/AbstractExportService.php b/src/backend/app/Services/AbstractExportService.php index 05adde591..e495608d4 100644 --- a/src/backend/app/Services/AbstractExportService.php +++ b/src/backend/app/Services/AbstractExportService.php @@ -74,7 +74,7 @@ public function readable($amount, $separator = ',') $amount = strval($amount); // If the amount is not a valid float, return it as is - if (! is_numeric($amount) || floatval($amount) != $amount) { + if (!is_numeric($amount) || floatval($amount) != $amount) { return $amount; } diff --git a/src/backend/app/Services/AbstractPaymentAggregatorTransactionService.php b/src/backend/app/Services/AbstractPaymentAggregatorTransactionService.php index cb5b9f9b6..fad456b89 100644 --- a/src/backend/app/Services/AbstractPaymentAggregatorTransactionService.php +++ b/src/backend/app/Services/AbstractPaymentAggregatorTransactionService.php @@ -38,17 +38,17 @@ public function __construct( public function validatePaymentOwner(string $meterSerialNumber, float $amount): void { - if (! $meter = $this->meter->findBySerialNumber($meterSerialNumber)) { + if (!$meter = $this->meter->findBySerialNumber($meterSerialNumber)) { throw new ModelNotFoundException('Meter not found with serial number you entered'); } - if (! $meterTariff = $meter->meterParameter->tariff) { + if (!$meterTariff = $meter->meterParameter->tariff) { throw new ModelNotFoundException('Tariff not found with meter serial number you entered'); } $customerId = $meter->MeterParameter->owner_id; - if (! $customerId) { + if (!$customerId) { throw new ModelNotFoundException('Customer not found with meter serial number you entered'); } @@ -99,7 +99,7 @@ private function isImitationTransactionValid($transaction) $validator = resolve('MinimumPurchaseAmountValidator'); try { - if (! $validator->validate($transactionData, $this->getMinimumPurchaseAmount())) { + if (!$validator->validate($transactionData, $this->getMinimumPurchaseAmount())) { throw new TransactionAmountNotEnoughException('Transaction amount is not enough'); } } catch (TransactionAmountNotEnoughException $e) { diff --git a/src/backend/app/Services/AgentTransactionService.php b/src/backend/app/Services/AgentTransactionService.php index 4d308fcb2..7d75e37cf 100644 --- a/src/backend/app/Services/AgentTransactionService.php +++ b/src/backend/app/Services/AgentTransactionService.php @@ -54,7 +54,7 @@ public function getById(int $agentId, ?int $customerId = null): AgentTransaction $customerDeviceSerials = $this->device->newQuery()->where('person_id', $customerId) ->get()->pluck('device_serial'); - if (! $customerDeviceSerials->count()) { + if (!$customerDeviceSerials->count()) { return null; } diff --git a/src/backend/app/Services/AppliancePaymentService.php b/src/backend/app/Services/AppliancePaymentService.php index 9eccca948..73d5ef8f4 100644 --- a/src/backend/app/Services/AppliancePaymentService.php +++ b/src/backend/app/Services/AppliancePaymentService.php @@ -131,7 +131,7 @@ private function processPaymentForDevice($deviceSerial, $transaction, $appliance { $device = $this->deviceService->getBySerialNumber($deviceSerial); - if (! $device) { + if (!$device) { throw new ModelNotFoundException("No device found with $deviceSerial"); } diff --git a/src/backend/app/Services/ClusterRevenueService.php b/src/backend/app/Services/ClusterRevenueService.php index cd307aa65..1c8169f03 100644 --- a/src/backend/app/Services/ClusterRevenueService.php +++ b/src/backend/app/Services/ClusterRevenueService.php @@ -169,10 +169,10 @@ public function getRevenueAnalysisForConnectionTypesByCluser( $periods = $this->periodService->generatePeriodicList($startDate, $endDate, $period, 0); foreach ($connectionTypes as $connectionType) { - if (! isset($revenueAnalysis[$connectionType->name])) { + if (!isset($revenueAnalysis[$connectionType->name])) { $revenueAnalysis[$connectionType->name] = $periods; } - if (! isset($revenueAnalysis['Total'])) { + if (!isset($revenueAnalysis['Total'])) { $revenueAnalysis['Total'] = $periods; } @@ -216,11 +216,11 @@ public function getMonthlyRevenueAnalysisForConnectionTypesById( $periods = $this->periodService->generatePeriodicList($startDate, $endDate, $period, 0); foreach ($connectionTypes as $connectionType) { - if (! isset($revenueAnalysis[$connectionType->name])) { + if (!isset($revenueAnalysis[$connectionType->name])) { $revenueAnalysis[$connectionType->name] = $periods; } - if (! isset($revenueAnalysis['Total'])) { + if (!isset($revenueAnalysis['Total'])) { $revenueAnalysis['Total'] = $periods; } @@ -311,7 +311,7 @@ public function getMiniGridBasedRevenueById( public function setDatesForRequest($startDate, $endDate): array { - if (! $startDate) { + if (!$startDate) { $start = new \DateTime(); $start->setDate($start->format('Y'), $start->format('n'), 1); // Normalize the day to 1 $start->setTime(0, 0, 0); // Normalize time to midnight diff --git a/src/backend/app/Services/Interfaces/IAssociative.php b/src/backend/app/Services/Interfaces/IAssociative.php index 1de36ad03..12859bb1f 100644 --- a/src/backend/app/Services/Interfaces/IAssociative.php +++ b/src/backend/app/Services/Interfaces/IAssociative.php @@ -14,7 +14,7 @@ interface IAssociative public function make(array $data): Model; /** - * @param T $model + * @param T $model */ public function save(Model $model): bool; } diff --git a/src/backend/app/Services/Interfaces/IBaseService.php b/src/backend/app/Services/Interfaces/IBaseService.php index 4c2d225b1..90651b23e 100644 --- a/src/backend/app/Services/Interfaces/IBaseService.php +++ b/src/backend/app/Services/Interfaces/IBaseService.php @@ -20,7 +20,8 @@ public function getById(int $id): ?Model; public function create(array $data): Model; /** - * @param T $model + * @param T $model + * * @return T */ public function update(Model $model, array $data): Model; diff --git a/src/backend/app/Services/Interfaces/ISettingsService.php b/src/backend/app/Services/Interfaces/ISettingsService.php index 5d73f9348..37a6f47a3 100644 --- a/src/backend/app/Services/Interfaces/ISettingsService.php +++ b/src/backend/app/Services/Interfaces/ISettingsService.php @@ -15,7 +15,8 @@ interface ISettingsService public function get(): ?Model; /** - * @param T $model + * @param T $model + * * @return T */ public function update(Model $model, array $data): Model; diff --git a/src/backend/app/Services/PeriodService.php b/src/backend/app/Services/PeriodService.php index c09d5409f..c5b8a91ef 100644 --- a/src/backend/app/Services/PeriodService.php +++ b/src/backend/app/Services/PeriodService.php @@ -5,7 +5,7 @@ class PeriodService { /** - * @param (int|int[])[]|int $initialData + * @param (int|int[])[]|int $initialData * * @throws \Exception */ diff --git a/src/backend/app/Services/PersonService.php b/src/backend/app/Services/PersonService.php index cac29a6b5..4011bf9f2 100644 --- a/src/backend/app/Services/PersonService.php +++ b/src/backend/app/Services/PersonService.php @@ -35,7 +35,7 @@ public function addCitizenship(Person $person, Country $country): Model public function getDetails(int $personID, bool $allRelations = false) { - if (! $allRelations) { + if (!$allRelations) { return $this->getById($personID); } @@ -54,8 +54,9 @@ public function getDetails(int $personID, bool $allRelations = false) } /** - * @param string $searchTerm could either phone, name or surname - * @param Request|array|int|string $paginate + * @param string $searchTerm could either phone, name or surname + * @param Request|array|int|string $paginate + * * @return Builder[]|Collection|LengthAwarePaginator * * @psalm-return Collection|LengthAwarePaginator|array diff --git a/src/backend/app/Services/RegistrationTailService.php b/src/backend/app/Services/RegistrationTailService.php index dcfa68ca1..82af06afb 100644 --- a/src/backend/app/Services/RegistrationTailService.php +++ b/src/backend/app/Services/RegistrationTailService.php @@ -58,7 +58,7 @@ public function getFirst($limit = null) public function addMpmPluginToRegistrationTail(RegistrationTail $registrationTail, MpmPlugin $mpmPlugin): RegistrationTail { - $tail = ! empty($registrationTail->tail) ? json_decode($registrationTail->tail, true) : []; + $tail = !empty($registrationTail->tail) ? json_decode($registrationTail->tail, true) : []; array_push($tail, [ 'tag' => $mpmPlugin->tail_tag, @@ -67,7 +67,7 @@ public function addMpmPluginToRegistrationTail(RegistrationTail $registrationTai '-', $mpmPlugin->tail_tag ) : null, - 'adjusted' => ! isset($mpmPlugin->tail_tag), + 'adjusted' => !isset($mpmPlugin->tail_tag), ]); return $this->update( @@ -78,7 +78,7 @@ public function addMpmPluginToRegistrationTail(RegistrationTail $registrationTai public function removeMpmPluginFromRegistrationTail(RegistrationTail $registrationTail, MpmPlugin $mpmPlugin): RegistrationTail { - $tail = ! empty($registrationTail->tail) ? json_decode($registrationTail->tail, true) : []; + $tail = !empty($registrationTail->tail) ? json_decode($registrationTail->tail, true) : []; $updatedTail = array_filter($tail, function ($item) use ($mpmPlugin) { return $item['tag'] !== $mpmPlugin->tail_tag; diff --git a/src/backend/app/Services/SessionService.php b/src/backend/app/Services/SessionService.php index 97704825e..a85928ba0 100644 --- a/src/backend/app/Services/SessionService.php +++ b/src/backend/app/Services/SessionService.php @@ -13,7 +13,7 @@ public function setModel(BaseModel|Model $model): void { $this->model = $model; $databaseName = $model->getConnectionName(); - if (! $this->checkDatabaseName($databaseName)) { + if (!$this->checkDatabaseName($databaseName)) { $this->model->setConnection($this->getAuthenticatedUserDatabaseName()); } } diff --git a/src/backend/app/Services/SmsService.php b/src/backend/app/Services/SmsService.php index 42d04534f..01c4aea15 100644 --- a/src/backend/app/Services/SmsService.php +++ b/src/backend/app/Services/SmsService.php @@ -96,13 +96,13 @@ public function sendSms($data, $smsType, $smsConfigs) private function resolveSmsType($data, $smsType, $smsConfigs, $smsAndroidSettings) { $configs = resolve($smsConfigs); - if (! array_key_exists($smsType, $configs->smsTypes)) { + if (!array_key_exists($smsType, $configs->smsTypes)) { throw new SmsTypeNotFoundException('SmsType could not resolve.'); } $smsBodyService = resolve($configs->servicePath); $reflection = new \ReflectionClass($configs->smsTypes[$smsType]); - if (! $reflection->isSubclassOf(SmsSender::class)) { + if (!$reflection->isSubclassOf(SmsSender::class)) { throw new SmsBodyParserNotExtendedException('SmsBodyParser has not extended.'); } @@ -116,7 +116,7 @@ private function resolveSmsType($data, $smsType, $smsConfigs, $smsAndroidSetting private function associateSmsWithForSmsType($smsType, $data, $uuid, $receiver, $smsAndroidSettings) { - if (! ($smsType instanceof ManualSms)) { + if (!($smsType instanceof ManualSms)) { $sms = Sms::query()->make([ 'uuid' => $uuid, 'body' => $smsType->body, diff --git a/src/backend/app/Services/TargetService.php b/src/backend/app/Services/TargetService.php index 9cd956c9c..5a8d4193d 100644 --- a/src/backend/app/Services/TargetService.php +++ b/src/backend/app/Services/TargetService.php @@ -31,7 +31,7 @@ public function create(CarbonImmutable $period, string $targetForType, TargetAss 'target_date' => $period->format('Y-m-d'), 'type' => $targetForType, ]); - if (! $targetOwner instanceof Model) { + if (!$targetOwner instanceof Model) { throw new ValidationException('target owner should be a model'); } $target->owner()->associate($targetOwner); diff --git a/src/backend/app/Services/UserAddressService.php b/src/backend/app/Services/UserAddressService.php index eb3478d24..7bb1ffdc7 100644 --- a/src/backend/app/Services/UserAddressService.php +++ b/src/backend/app/Services/UserAddressService.php @@ -38,7 +38,7 @@ public function update(User $user, $data) $user->name = $data['name']; $user->update(); $address = $user->address()->first(); - if (! $address) { + if (!$address) { $address = $this->address->newQuery()->create([ 'email' => $user->email, 'phone' => $data['phone'], diff --git a/src/backend/app/Sms/AndroidGateway.php b/src/backend/app/Sms/AndroidGateway.php index 2baf09487..b4c342bc5 100644 --- a/src/backend/app/Sms/AndroidGateway.php +++ b/src/backend/app/Sms/AndroidGateway.php @@ -12,11 +12,11 @@ class AndroidGateway implements ISmsProvider /** * Sends the sms to the sms provider. * - * @param SmsAndroidSetting $smsAndroidSettings + * @param SmsAndroidSetting $smsAndroidSettings */ public function sendSms(string $number, string $body, string $callback, SmsAndroidSetting $smsAndroidSetting) { - if (! config('app.env') == 'production') { + if (!config('app.env') == 'production') { Log::debug('Send sms on allowed in production', ['number' => $number, 'message' => $body]); return; diff --git a/src/backend/app/Sms/BodyParsers/SmsResendInformationHeader.php b/src/backend/app/Sms/BodyParsers/SmsResendInformationHeader.php index 6135ae592..b1174b456 100644 --- a/src/backend/app/Sms/BodyParsers/SmsResendInformationHeader.php +++ b/src/backend/app/Sms/BodyParsers/SmsResendInformationHeader.php @@ -17,7 +17,7 @@ public function __construct($data) protected function getVariableValue($variable) { - if (! is_array($this->data)) { + if (!is_array($this->data)) { $person = $this->data->meter->meterParameter->owner()->first(); } else { try { diff --git a/src/backend/app/Sms/Senders/ResendInformationNotification.php b/src/backend/app/Sms/Senders/ResendInformationNotification.php index 646a3b4c6..eb8e9f776 100644 --- a/src/backend/app/Sms/Senders/ResendInformationNotification.php +++ b/src/backend/app/Sms/Senders/ResendInformationNotification.php @@ -22,7 +22,7 @@ class ResendInformationNotification extends SmsSender public function prepareBody() { - if (! is_array($this->data)) { + if (!is_array($this->data)) { try { $smsBody = $this->smsBodyService->getSmsBodyByReference('ResendInformation'); } catch (ModelNotFoundException $exception) { diff --git a/src/backend/app/Sms/Senders/SmsSender.php b/src/backend/app/Sms/Senders/SmsSender.php index ff5072360..715e4681b 100644 --- a/src/backend/app/Sms/Senders/SmsSender.php +++ b/src/backend/app/Sms/Senders/SmsSender.php @@ -162,7 +162,7 @@ public function getReceiver() '+' ) === 0 ? $this->data->assetPerson->person->addresses->first()->phone : '+'.$this->data->assetPerson->person->addresses->first()->phone; - } elseif (! is_array($this->data) && $this->data->mpmPerson) { + } elseif (!is_array($this->data) && $this->data->mpmPerson) { $this->receiver = strpos( $this->data->mpmPerson->addresses[0]->phone, '+' @@ -194,7 +194,7 @@ private function checkForViberIdOfReceiverIfPluginIsActive() if ($viberMessagingPlugin && $viberMessagingPlugin->status === Plugins::ACTIVE) { $viberContact = $viberContactService->getByReceiverPhoneNumber($this->receiver); - if (! $viberContact) { + if (!$viberContact) { return null; } diff --git a/src/backend/app/Traits/RestExceptionHandler.php b/src/backend/app/Traits/RestExceptionHandler.php index 7655af9fc..9a6770ac9 100644 --- a/src/backend/app/Traits/RestExceptionHandler.php +++ b/src/backend/app/Traits/RestExceptionHandler.php @@ -16,7 +16,8 @@ trait RestExceptionHandler /** * Creates a new response based on exception type. * - * @param \Exception $e + * @param \Exception $e + * * @return JsonResponse */ protected function getJsonResponseForException(Request $request, \Exception|\Throwable $e) @@ -44,8 +45,9 @@ protected function getJsonResponseForException(Request $request, \Exception|\Thr /** * returns a json response for all excepion types except modelnotfoundexception. * - * @param string $message - * @param int $status_code + * @param string $message + * @param int $status_code + * * @return JsonResponse */ protected function badRequest($message = 'Bad request', $status_code = 400) @@ -62,8 +64,9 @@ protected function badRequest($message = 'Bad request', $status_code = 400) /** * Returns a json response for Model not found exception. * - * @param string $message - * @param int $status_code + * @param string $message + * @param int $status_code + * * @return JsonResponse */ protected function modelNotFound($message = 'Record not found', $status_code = 404) @@ -80,8 +83,9 @@ protected function modelNotFound($message = 'Record not found', $status_code = 4 /** * Generates validation error response. * - * @param string $message - * @param int $status_code + * @param string $message + * @param int $status_code + * * @return JsonResponse */ protected function validationError($message = 'Validation failed', $status_code = 422) @@ -98,7 +102,7 @@ protected function validationError($message = 'Validation failed', $status_code /** * Determines if the exception type is Model not found exception. * - * @param \Exception $e + * @param \Exception $e */ protected function isModelNotFoundException($e): bool { @@ -108,7 +112,7 @@ protected function isModelNotFoundException($e): bool /** * Determines if given Exception is Validation Exception. * - * @param \Exception $e + * @param \Exception $e */ protected function isValidationException($e): bool { @@ -118,7 +122,6 @@ protected function isValidationException($e): bool /** * Generates a json response & returns it. * - * * @return JsonResponse */ protected function jsonResponse(?array $payload, $status_code) diff --git a/src/backend/app/Utils/ApplianceInstallmentPayer.php b/src/backend/app/Utils/ApplianceInstallmentPayer.php index 156be8fa3..b5c3951b8 100644 --- a/src/backend/app/Utils/ApplianceInstallmentPayer.php +++ b/src/backend/app/Utils/ApplianceInstallmentPayer.php @@ -84,7 +84,7 @@ private function getCustomerByDeviceSerial(string $serialNumber): Person { $device = $this->deviceService->getBySerialNumber($serialNumber); - if (! $device) { + if (!$device) { throw new DeviceIsNotAssignedToCustomer('Device is not assigned to customer'); } diff --git a/src/backend/app/modules/CustomBulkRegistration/Ecosys/CustomerDatabaseParser.php b/src/backend/app/modules/CustomBulkRegistration/Ecosys/CustomerDatabaseParser.php index ce68f6965..6643b22c7 100644 --- a/src/backend/app/modules/CustomBulkRegistration/Ecosys/CustomerDatabaseParser.php +++ b/src/backend/app/modules/CustomBulkRegistration/Ecosys/CustomerDatabaseParser.php @@ -86,7 +86,7 @@ public function insertFromCsv() $city = $this->createRecordFromCsv($row, CityService::class); $row['city_id'] = $city->id; - if (! $isExistingPerson) { + if (!$isExistingPerson) { $this->createRecordFromCsv($row, AddressService::class); } @@ -142,7 +142,7 @@ private function createRecordFromCsv($row, $service) private function checkRecordWasRecentlyCreated($record, $type) { if ($record->wasRecentlyCreated) { - $this->recentlyCreatedRecords[$type]++; + ++$this->recentlyCreatedRecords[$type]; } } } diff --git a/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/AppliancePersonService.php b/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/AppliancePersonService.php index fc434242e..ceb75346e 100644 --- a/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/AppliancePersonService.php +++ b/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/AppliancePersonService.php @@ -92,7 +92,7 @@ private function calculateRateCount($price, $downPayment, $minimumPaymentAmount) while ($rawCost > 0) { $rawCost = $rawCost - $minimumPaymentAmount; - $rateCount++; + ++$rateCount; } return $rateCount; diff --git a/src/backend/app/modules/Sharding/ApiCompanyResolverService.php b/src/backend/app/modules/Sharding/ApiCompanyResolverService.php index de17e7e3d..78b7dd31c 100644 --- a/src/backend/app/modules/Sharding/ApiCompanyResolverService.php +++ b/src/backend/app/modules/Sharding/ApiCompanyResolverService.php @@ -19,7 +19,7 @@ public function __construct(private ApiResolverMap $apiResolverMap) public function resolve(Request $request): int { $api = collect($this->apiResolverMap::RESOLVABLE_APIS)->filter(fn ($apiPath) => Str::startsWith(Str::lower($request->path()), Str::lower($apiPath))); - if (! $api) { + if (!$api) { throw new ValidationException('No api resolver registered for '.$request->path()); } @@ -31,7 +31,7 @@ public function resolve(Request $request): int private function startResolver(string $api): ApiResolverInterface { $apiResolver = $this->apiResolverMap->getApiResolver($api); - if (! $apiResolver) { + if (!$apiResolver) { throw new ValidationException('Api is registered to resolve but no resolver class is assigned'.$api); } /** @var ApiResolverInterface $resolver */ diff --git a/src/backend/app/modules/Sharding/ApiResolvers/TestApiResolver.php b/src/backend/app/modules/Sharding/ApiResolvers/TestApiResolver.php index c8b572072..d499c42ed 100644 --- a/src/backend/app/modules/Sharding/ApiResolvers/TestApiResolver.php +++ b/src/backend/app/modules/Sharding/ApiResolvers/TestApiResolver.php @@ -15,7 +15,7 @@ class TestApiResolver implements ApiResolverInterface public function resolveCompanyId(Request $request): int { $companyId = $request->input(self::QUERY_PARAM_COMPANY_ID); - if (! is_numeric($companyId)) { + if (!is_numeric($companyId)) { throw new ValidationException('the field which is used to identify the company is not provided'); } diff --git a/src/backend/app/modules/Transaction/Provider/AgentTransactionProvider.php b/src/backend/app/modules/Transaction/Provider/AgentTransactionProvider.php index d55f86afb..c57ba5a5e 100644 --- a/src/backend/app/modules/Transaction/Provider/AgentTransactionProvider.php +++ b/src/backend/app/modules/Transaction/Provider/AgentTransactionProvider.php @@ -57,7 +57,7 @@ public function sendResult(bool $requestType, Transaction $transaction): void $this->agentTransaction->update(['status' => $requestType === true ? 1 : -1]); $agent = $this->agentTransaction->agent; - if (! $requestType) { + if (!$requestType) { $body = $this->prepareBodyFail($transaction); $this->fireBaseService->sendNotify($agent->fire_base_token, $body); diff --git a/src/backend/app/modules/Transaction/Provider/AirtelVoltTerraProvider.php b/src/backend/app/modules/Transaction/Provider/AirtelVoltTerraProvider.php index 2527a5005..9256ab430 100644 --- a/src/backend/app/modules/Transaction/Provider/AirtelVoltTerraProvider.php +++ b/src/backend/app/modules/Transaction/Provider/AirtelVoltTerraProvider.php @@ -76,17 +76,17 @@ public function validateRequest($request): bool $meterModel = new Meter(); - if (! $meter = $meterModel->findBySerialNumber($meterSerial)) { + if (!$meter = $meterModel->findBySerialNumber($meterSerial)) { throw new ModelNotFoundException('Meter not found with serial number you entered'); } - if (! $meterTariff = $meter->meterParameter->tariff) { + if (!$meterTariff = $meter->meterParameter->tariff) { throw new ModelNotFoundException('Tariff not found with meter serial number you entered'); } $customerId = $meter->MeterParameter->owner_id; - if (! $customerId) { + if (!$customerId) { throw new ModelNotFoundException('Customer not found with meter serial number you entered'); } $minimumPurchaseAmount = $meterTariff->minimum_purchase_amount ?? 0; diff --git a/src/backend/app/modules/Transaction/Provider/TransactionAdapter.php b/src/backend/app/modules/Transaction/Provider/TransactionAdapter.php index a9a4cc1bf..9bb19e780 100644 --- a/src/backend/app/modules/Transaction/Provider/TransactionAdapter.php +++ b/src/backend/app/modules/Transaction/Provider/TransactionAdapter.php @@ -12,7 +12,7 @@ class TransactionAdapter { /** - * @param ITransactionProvider $transactionProvider + * @param ITransactionProvider $transactionProvider */ public static function getTransaction($transactionProvider): ?ITransactionProvider { diff --git a/src/backend/app/modules/Transaction/Provider/VodacomTransactionProvider.php b/src/backend/app/modules/Transaction/Provider/VodacomTransactionProvider.php index 223007895..c48fa6e4f 100644 --- a/src/backend/app/modules/Transaction/Provider/VodacomTransactionProvider.php +++ b/src/backend/app/modules/Transaction/Provider/VodacomTransactionProvider.php @@ -44,7 +44,7 @@ public function saveTransaction(): void */ public function sendResult(bool $requestType, Transaction $transaction): void { - if (! app()->environment('production')) { + if (!app()->environment('production')) { return; } $requestContent = $this->prepareRequest($requestType); @@ -66,7 +66,7 @@ public function sendResult(bool $requestType, Transaction $transaction): void ); // request was successful if ($response->getStatusCode() === 200) { - if (! $requestType) { + if (!$requestType) { Log::critical( 'Vodacom transaction cancelled', [ @@ -86,7 +86,7 @@ public function sendResult(bool $requestType, Transaction $transaction): void // vodacom returns 0 for confirmation and 999 for cancellation request // cast bool to int gives (0,1) as number. Multiply its inverse by // 999 gives 0 for true and 999 for false - $expectedResponseCode = (int) ! $requestType * 999; + $expectedResponseCode = (int) !$requestType * 999; if ((int) $xmlResponse->response->responseCode === $expectedResponseCode) { // mark transaction as done $this->vodacomTransaction->status = $requestType === true ? 1 : -1; @@ -124,7 +124,6 @@ public function sendResult(bool $requestType, Transaction $transaction): void * Validates incoming request * stores the request data to valid_data if request is valid. * - * * @throws \Exception */ public function validateRequest($request): void @@ -244,7 +243,7 @@ private function prepareRequest(bool $requestType): string $providerPassword = $this->encryptProviderPassword($time); $phonePassword = $this->encryptPhonePassword(); - if (! $requestType) { + if (!$requestType) { $requestContent = $this->serveResult( $providerPassword, $phonePassword, @@ -268,11 +267,11 @@ private function prepareRequest(bool $requestType): string /** * Generates result for cancel/approve transaction. * - * @param string $serviceProviderPassword - * @param string $phonePassword - * @param string $time Y-md H:i:s - * @param string $result - * @param int $resultCode + * @param string $serviceProviderPassword + * @param string $phonePassword + * @param string $time Y-md H:i:s + * @param string $result + * @param int $resultCode */ private function serveResult( $serviceProviderPassword, diff --git a/src/backend/database/migrations/2022_03_10_120408_create_companies_table.php b/src/backend/database/migrations/2022_03_10_120408_create_companies_table.php index f24dcc24e..86d746c4e 100644 --- a/src/backend/database/migrations/2022_03_10_120408_create_companies_table.php +++ b/src/backend/database/migrations/2022_03_10_120408_create_companies_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_03_10_134450_create_company_databases_table.php b/src/backend/database/migrations/2022_03_10_134450_create_company_databases_table.php index b2a1403cc..d2b568602 100644 --- a/src/backend/database/migrations/2022_03_10_134450_create_company_databases_table.php +++ b/src/backend/database/migrations/2022_03_10_134450_create_company_databases_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_06_18_204649_create_database_proxies_table.php b/src/backend/database/migrations/2022_06_18_204649_create_database_proxies_table.php index bacc9187c..6f51e02b3 100644 --- a/src/backend/database/migrations/2022_06_18_204649_create_database_proxies_table.php +++ b/src/backend/database/migrations/2022_06_18_204649_create_database_proxies_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { public function up(): void { Schema::create('database_proxies', function (Blueprint $table) { diff --git a/src/backend/database/migrations/2022_06_21_102121_create_mpm_plugins_table.php b/src/backend/database/migrations/2022_06_21_102121_create_mpm_plugins_table.php index ec38f54ba..252e717ed 100644 --- a/src/backend/database/migrations/2022_06_21_102121_create_mpm_plugins_table.php +++ b/src/backend/database/migrations/2022_06_21_102121_create_mpm_plugins_table.php @@ -7,7 +7,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_06_21_122032_add_email_to_companies_table.php b/src/backend/database/migrations/2022_06_21_122032_add_email_to_companies_table.php index 3c068cf02..683ee1f16 100644 --- a/src/backend/database/migrations/2022_06_21_122032_add_email_to_companies_table.php +++ b/src/backend/database/migrations/2022_06_21_122032_add_email_to_companies_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_07_05_093903_add_tail_tag_to_mpm_plugins_table.php b/src/backend/database/migrations/2022_07_05_093903_add_tail_tag_to_mpm_plugins_table.php index 7ab9a9325..2f2079520 100644 --- a/src/backend/database/migrations/2022_07_05_093903_add_tail_tag_to_mpm_plugins_table.php +++ b/src/backend/database/migrations/2022_07_05_093903_add_tail_tag_to_mpm_plugins_table.php @@ -7,7 +7,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_07_07_140545_add_installation_command_to_mpm_plugins_table.php b/src/backend/database/migrations/2022_07_07_140545_add_installation_command_to_mpm_plugins_table.php index dd8b35d22..693d3017d 100644 --- a/src/backend/database/migrations/2022_07_07_140545_add_installation_command_to_mpm_plugins_table.php +++ b/src/backend/database/migrations/2022_07_07_140545_add_installation_command_to_mpm_plugins_table.php @@ -7,7 +7,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_09_20_0000000_add_bulk_registration_to_mpm_plugin_table.php b/src/backend/database/migrations/2022_09_20_0000000_add_bulk_registration_to_mpm_plugin_table.php index 911ed02f3..141572263 100644 --- a/src/backend/database/migrations/2022_09_20_0000000_add_bulk_registration_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2022_09_20_0000000_add_bulk_registration_to_mpm_plugin_table.php @@ -5,7 +5,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class () extends Migration { +return new class extends Migration { public function up() { DB::table('mpm_plugins')->insert([ diff --git a/src/backend/database/migrations/2022_11_08_0000000_add_viber_messaging_to_mpm_plugin_table.php b/src/backend/database/migrations/2022_11_08_0000000_add_viber_messaging_to_mpm_plugin_table.php index 15179525a..a623dc146 100644 --- a/src/backend/database/migrations/2022_11_08_0000000_add_viber_messaging_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2022_11_08_0000000_add_viber_messaging_to_mpm_plugin_table.php @@ -5,7 +5,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class () extends Migration { +return new class extends Migration { public function up() { DB::table('mpm_plugins')->insert([ diff --git a/src/backend/database/migrations/2022_11_08_154321_update_email_field_for_database_proxies_table.php b/src/backend/database/migrations/2022_11_08_154321_update_email_field_for_database_proxies_table.php index 829c9537f..b5873bd60 100644 --- a/src/backend/database/migrations/2022_11_08_154321_update_email_field_for_database_proxies_table.php +++ b/src/backend/database/migrations/2022_11_08_154321_update_email_field_for_database_proxies_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_11_21_000000_add_wave_money_payment_to_mpm_plugin_table.php b/src/backend/database/migrations/2022_11_21_000000_add_wave_money_payment_to_mpm_plugin_table.php index 6368c9eb0..0f7e83fed 100644 --- a/src/backend/database/migrations/2022_11_21_000000_add_wave_money_payment_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2022_11_21_000000_add_wave_money_payment_to_mpm_plugin_table.php @@ -5,7 +5,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class () extends Migration { +return new class extends Migration { public function up() { DB::table('mpm_plugins')->insert([ diff --git a/src/backend/database/migrations/2022_11_25_091725_create_company_jobs.php b/src/backend/database/migrations/2022_11_25_091725_create_company_jobs.php index 8fe3d2cb1..f5cb6bfaf 100644 --- a/src/backend/database/migrations/2022_11_25_091725_create_company_jobs.php +++ b/src/backend/database/migrations/2022_11_25_091725_create_company_jobs.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_11_29_000000_add_micro_star_to_mpm_plugin_table.php b/src/backend/database/migrations/2022_11_29_000000_add_micro_star_to_mpm_plugin_table.php index acd02c404..2fbfd37e8 100644 --- a/src/backend/database/migrations/2022_11_29_000000_add_micro_star_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2022_11_29_000000_add_micro_star_to_mpm_plugin_table.php @@ -5,7 +5,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class () extends Migration { +return new class extends Migration { public function up() { DB::table('mpm_plugins')->insert([ diff --git a/src/backend/database/migrations/2022_12_12_000000_add_root_class_to_mpm_plugins_table.php b/src/backend/database/migrations/2022_12_12_000000_add_root_class_to_mpm_plugins_table.php index 8ecebf7bd..052cf053a 100644 --- a/src/backend/database/migrations/2022_12_12_000000_add_root_class_to_mpm_plugins_table.php +++ b/src/backend/database/migrations/2022_12_12_000000_add_root_class_to_mpm_plugins_table.php @@ -7,7 +7,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2022_14_12_000000_add_sun_king_to_mpm_plugin_table.php b/src/backend/database/migrations/2022_14_12_000000_add_sun_king_to_mpm_plugin_table.php index d4883f0ab..ee5dee0f3 100644 --- a/src/backend/database/migrations/2022_14_12_000000_add_sun_king_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2022_14_12_000000_add_sun_king_to_mpm_plugin_table.php @@ -5,7 +5,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class () extends Migration { +return new class extends Migration { public function up() { DB::table('mpm_plugins')->insert([ diff --git a/src/backend/database/migrations/2023_01_24_110414_create_protected_pages_table.php b/src/backend/database/migrations/2023_01_24_110414_create_protected_pages_table.php index f631c9b35..37e51a3b8 100644 --- a/src/backend/database/migrations/2023_01_24_110414_create_protected_pages_table.php +++ b/src/backend/database/migrations/2023_01_24_110414_create_protected_pages_table.php @@ -6,7 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2023_01_24_112359_add_protected_page_password_to_companies_table.php b/src/backend/database/migrations/2023_01_24_112359_add_protected_page_password_to_companies_table.php index 654468da4..0ed96210f 100644 --- a/src/backend/database/migrations/2023_01_24_112359_add_protected_page_password_to_companies_table.php +++ b/src/backend/database/migrations/2023_01_24_112359_add_protected_page_password_to_companies_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2023_02_06_000000_add_gome_long_to_mpm_plugin_table.php b/src/backend/database/migrations/2023_02_06_000000_add_gome_long_to_mpm_plugin_table.php index ba3042e28..7bacd70cf 100644 --- a/src/backend/database/migrations/2023_02_06_000000_add_gome_long_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2023_02_06_000000_add_gome_long_to_mpm_plugin_table.php @@ -5,7 +5,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class () extends Migration { +return new class extends Migration { public function up() { DB::table('mpm_plugins')->insert([ diff --git a/src/backend/database/migrations/2023_04_02_121811_add_wavecom_to_mpm_plugin_table.php b/src/backend/database/migrations/2023_04_02_121811_add_wavecom_to_mpm_plugin_table.php index 31d572551..b0bf2b309 100644 --- a/src/backend/database/migrations/2023_04_02_121811_add_wavecom_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2023_04_02_121811_add_wavecom_to_mpm_plugin_table.php @@ -5,7 +5,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class () extends Migration { +return new class extends Migration { public function up() { DB::table('mpm_plugins')->insert([ diff --git a/src/backend/database/migrations/2023_11_23_134944_update_description_column_in_mpm_plugins_table.php b/src/backend/database/migrations/2023_11_23_134944_update_description_column_in_mpm_plugins_table.php index a9b567b2f..4157e3ac7 100644 --- a/src/backend/database/migrations/2023_11_23_134944_update_description_column_in_mpm_plugins_table.php +++ b/src/backend/database/migrations/2023_11_23_134944_update_description_column_in_mpm_plugins_table.php @@ -7,7 +7,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2024_01_01_000000_add_daly_bms_to_mpm_plugin_table.php b/src/backend/database/migrations/2024_01_01_000000_add_daly_bms_to_mpm_plugin_table.php index ee1a746bf..e16792502 100644 --- a/src/backend/database/migrations/2024_01_01_000000_add_daly_bms_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2024_01_01_000000_add_daly_bms_to_mpm_plugin_table.php @@ -5,7 +5,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class () extends Migration { +return new class extends Migration { public function up() { DB::table('mpm_plugins')->insert([ diff --git a/src/backend/database/migrations/2024_01_12_000000_add_angaza_to_mpm_plugin_table.php b/src/backend/database/migrations/2024_01_12_000000_add_angaza_to_mpm_plugin_table.php index 7abe2495f..388e3631b 100644 --- a/src/backend/database/migrations/2024_01_12_000000_add_angaza_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2024_01_12_000000_add_angaza_to_mpm_plugin_table.php @@ -5,7 +5,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class () extends Migration { +return new class extends Migration { public function up() { DB::table('mpm_plugins')->insert([ diff --git a/src/backend/database/migrations/2024_02_07_100345_create_usage_types_table.php b/src/backend/database/migrations/2024_02_07_100345_create_usage_types_table.php index 88e95fd43..d97075caf 100644 --- a/src/backend/database/migrations/2024_02_07_100345_create_usage_types_table.php +++ b/src/backend/database/migrations/2024_02_07_100345_create_usage_types_table.php @@ -6,7 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2024_02_07_113319_add_usage_type_column_to_mpm_plugins_table.php b/src/backend/database/migrations/2024_02_07_113319_add_usage_type_column_to_mpm_plugins_table.php index a347ab7cb..f8f2db0b7 100644 --- a/src/backend/database/migrations/2024_02_07_113319_add_usage_type_column_to_mpm_plugins_table.php +++ b/src/backend/database/migrations/2024_02_07_113319_add_usage_type_column_to_mpm_plugins_table.php @@ -7,7 +7,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/2024_03_21_121825_add_message_and_trace_columns_to_company_jobs_table.php b/src/backend/database/migrations/2024_03_21_121825_add_message_and_trace_columns_to_company_jobs_table.php index 86819c41f..f2b07ddaa 100644 --- a/src/backend/database/migrations/2024_03_21_121825_add_message_and_trace_columns_to_company_jobs_table.php +++ b/src/backend/database/migrations/2024_03_21_121825_add_message_and_trace_columns_to_company_jobs_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2014_10_12_000000_create_users_table.php b/src/backend/database/migrations/micropowermanager/2014_10_12_000000_create_users_table.php index fb91c6e07..5a9665ae8 100644 --- a/src/backend/database/migrations/micropowermanager/2014_10_12_000000_create_users_table.php +++ b/src/backend/database/migrations/micropowermanager/2014_10_12_000000_create_users_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2014_10_12_100000_create_password_resets_table.php b/src/backend/database/migrations/micropowermanager/2014_10_12_100000_create_password_resets_table.php index 0ba694725..f1d5cd1e2 100644 --- a/src/backend/database/migrations/micropowermanager/2014_10_12_100000_create_password_resets_table.php +++ b/src/backend/database/migrations/micropowermanager/2014_10_12_100000_create_password_resets_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_24_195615_create_vodacom_transactions_table.php b/src/backend/database/migrations/micropowermanager/2018_05_24_195615_create_vodacom_transactions_table.php index 18a985c46..c7b377d77 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_24_195615_create_vodacom_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_24_195615_create_vodacom_transactions_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_24_201051_create_transactions_table.php b/src/backend/database/migrations/micropowermanager/2018_05_24_201051_create_transactions_table.php index 648c7237f..6a2bbb5ae 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_24_201051_create_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_24_201051_create_transactions_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_24_213335_create_airtel_transactions_table.php b/src/backend/database/migrations/micropowermanager/2018_05_24_213335_create_airtel_transactions_table.php index 1df046d52..0ac0b8858 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_24_213335_create_airtel_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_24_213335_create_airtel_transactions_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_25_131106_create_payment_histories_table.php b/src/backend/database/migrations/micropowermanager/2018_05_25_131106_create_payment_histories_table.php index a77d900e5..0e5f8a612 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_25_131106_create_payment_histories_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_25_131106_create_payment_histories_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_25_131119_create_meter_tariffs_table.php b/src/backend/database/migrations/micropowermanager/2018_05_25_131119_create_meter_tariffs_table.php index e13d89193..b0744f4d0 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_25_131119_create_meter_tariffs_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_25_131119_create_meter_tariffs_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_29_071453_create_addresses_table.php b/src/backend/database/migrations/micropowermanager/2018_05_29_071453_create_addresses_table.php index 9717baef7..5428f4d4d 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_29_071453_create_addresses_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_29_071453_create_addresses_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_29_080926_create_geographical_informations_table.php b/src/backend/database/migrations/micropowermanager/2018_05_29_080926_create_geographical_informations_table.php index 597f17d55..a52a9b450 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_29_080926_create_geographical_informations_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_29_080926_create_geographical_informations_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_29_140926_create_meter_types_table.php b/src/backend/database/migrations/micropowermanager/2018_05_29_140926_create_meter_types_table.php index b478b7158..0b9b325a4 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_29_140926_create_meter_types_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_29_140926_create_meter_types_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Reverse the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_30_124521_create_meters_table.php b/src/backend/database/migrations/micropowermanager/2018_05_30_124521_create_meters_table.php index 0389ee683..e32b18a61 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_30_124521_create_meters_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_30_124521_create_meters_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_31_071601_create_manufacturers_table.php b/src/backend/database/migrations/micropowermanager/2018_05_31_071601_create_manufacturers_table.php index 12342d0ce..0e15fcd86 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_31_071601_create_manufacturers_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_31_071601_create_manufacturers_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_31_075346_create_cities_table.php b/src/backend/database/migrations/micropowermanager/2018_05_31_075346_create_cities_table.php index aff7f86b7..9529c29fc 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_31_075346_create_cities_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_31_075346_create_cities_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_05_31_075353_create_countries_table.php b/src/backend/database/migrations/micropowermanager/2018_05_31_075353_create_countries_table.php index 335d12b77..a62992da9 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_31_075353_create_countries_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_31_075353_create_countries_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_06_01_141845_create_people_table.php b/src/backend/database/migrations/micropowermanager/2018_06_01_141845_create_people_table.php index 8dc05a7af..0139098bc 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_01_141845_create_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_01_141845_create_people_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_06_04_124637_create__roles_table.php b/src/backend/database/migrations/micropowermanager/2018_06_04_124637_create__roles_table.php index 23a5983ca..d0450ff81 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_04_124637_create__roles_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_04_124637_create__roles_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_06_07_155444_create_meter_tokens_table.php b/src/backend/database/migrations/micropowermanager/2018_06_07_155444_create_meter_tokens_table.php index aa18106dd..23877aee2 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_07_155444_create_meter_tokens_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_07_155444_create_meter_tokens_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_06_08_102610_create_meter_parameters_table.php b/src/backend/database/migrations/micropowermanager/2018_06_08_102610_create_meter_parameters_table.php index 0123e3aad..a1b6fb9b4 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_08_102610_create_meter_parameters_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_08_102610_create_meter_parameters_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_06_11_131951_create_sms_table.php b/src/backend/database/migrations/micropowermanager/2018_06_11_131951_create_sms_table.php index b1d9d8123..61220d925 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_11_131951_create_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_11_131951_create_sms_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_06_15_082352_create_transaction_conflicts_table.php b/src/backend/database/migrations/micropowermanager/2018_06_15_082352_create_transaction_conflicts_table.php index c9ca7c8cc..6252b570d 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_15_082352_create_transaction_conflicts_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_15_082352_create_transaction_conflicts_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_06_28_080905_create_access_rates_table.php b/src/backend/database/migrations/micropowermanager/2018_06_28_080905_create_access_rates_table.php index 9c811792b..4c36881bc 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_28_080905_create_access_rates_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_28_080905_create_access_rates_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_06_28_080914_create_access_rate_payments_table.php b/src/backend/database/migrations/micropowermanager/2018_06_28_080914_create_access_rate_payments_table.php index 293f96abf..1d4ac732e 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_28_080914_create_access_rate_payments_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_28_080914_create_access_rate_payments_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_07_11_075002_create_permission_tables.php b/src/backend/database/migrations/micropowermanager/2018_07_11_075002_create_permission_tables.php index 647732e73..52a64a061 100644 --- a/src/backend/database/migrations/micropowermanager/2018_07_11_075002_create_permission_tables.php +++ b/src/backend/database/migrations/micropowermanager/2018_07_11_075002_create_permission_tables.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_07_12_133700_create_loans_table.php b/src/backend/database/migrations/micropowermanager/2018_07_12_133700_create_loans_table.php index 130cfde42..6202eb9a0 100644 --- a/src/backend/database/migrations/micropowermanager/2018_07_12_133700_create_loans_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_07_12_133700_create_loans_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_07_12_134253_create_customers_table.php b/src/backend/database/migrations/micropowermanager/2018_07_12_134253_create_customers_table.php index 04e0b0554..a74747af6 100644 --- a/src/backend/database/migrations/micropowermanager/2018_07_12_134253_create_customers_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_07_12_134253_create_customers_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_10_04_195503_create_histories_table.php b/src/backend/database/migrations/micropowermanager/2018_10_04_195503_create_histories_table.php index 27767e560..fea4b8872 100644 --- a/src/backend/database/migrations/micropowermanager/2018_10_04_195503_create_histories_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_10_04_195503_create_histories_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. */ diff --git a/src/backend/database/migrations/micropowermanager/2018_10_12_110924_create_meter_consumptions_table.php b/src/backend/database/migrations/micropowermanager/2018_10_12_110924_create_meter_consumptions_table.php index d7d85ee9b..3780d7efd 100644 --- a/src/backend/database/migrations/micropowermanager/2018_10_12_110924_create_meter_consumptions_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_10_12_110924_create_meter_consumptions_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_10_12_123911_create_payment_profiles_table.php b/src/backend/database/migrations/micropowermanager/2018_10_12_123911_create_payment_profiles_table.php index dd741492b..9594e3c81 100644 --- a/src/backend/database/migrations/micropowermanager/2018_10_12_123911_create_payment_profiles_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_10_12_123911_create_payment_profiles_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_11_29_090603_create_clusters_table.php b/src/backend/database/migrations/micropowermanager/2018_11_29_090603_create_clusters_table.php index c3b491cd9..1c4048b7b 100644 --- a/src/backend/database/migrations/micropowermanager/2018_11_29_090603_create_clusters_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_11_29_090603_create_clusters_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_12_05_144906_create_revenues_table.php b/src/backend/database/migrations/micropowermanager/2018_12_05_144906_create_revenues_table.php index 0560c08da..729380b0e 100644 --- a/src/backend/database/migrations/micropowermanager/2018_12_05_144906_create_revenues_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_12_05_144906_create_revenues_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_12_11_083717_create_connection_types_table.php b/src/backend/database/migrations/micropowermanager/2018_12_11_083717_create_connection_types_table.php index e45b79bd9..e35198c21 100644 --- a/src/backend/database/migrations/micropowermanager/2018_12_11_083717_create_connection_types_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_12_11_083717_create_connection_types_table.php @@ -6,7 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_12_13_083722_create_targets_table.php b/src/backend/database/migrations/micropowermanager/2018_12_13_083722_create_targets_table.php index fdfe166e4..5f68c0492 100644 --- a/src/backend/database/migrations/micropowermanager/2018_12_13_083722_create_targets_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_12_13_083722_create_targets_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2018_12_13_100738_create_sub_targets_table.php b/src/backend/database/migrations/micropowermanager/2018_12_13_100738_create_sub_targets_table.php index 79190f40f..a9d3433fa 100644 --- a/src/backend/database/migrations/micropowermanager/2018_12_13_100738_create_sub_targets_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_12_13_100738_create_sub_targets_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_04_19_083645_customer_group.php b/src/backend/database/migrations/micropowermanager/2019_04_19_083645_customer_group.php index cab29f323..dc1b08a2d 100644 --- a/src/backend/database/migrations/micropowermanager/2019_04_19_083645_customer_group.php +++ b/src/backend/database/migrations/micropowermanager/2019_04_19_083645_customer_group.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_04_25_092438_create_sub_connection_types_table.php b/src/backend/database/migrations/micropowermanager/2019_04_25_092438_create_sub_connection_types_table.php index ea7947207..4d2dff495 100644 --- a/src/backend/database/migrations/micropowermanager/2019_04_25_092438_create_sub_connection_types_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_04_25_092438_create_sub_connection_types_table.php @@ -6,7 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. */ diff --git a/src/backend/database/migrations/micropowermanager/2019_05_01_103123_create_connection_groups_table.php b/src/backend/database/migrations/micropowermanager/2019_05_01_103123_create_connection_groups_table.php index b97dd78d9..c19716b7a 100644 --- a/src/backend/database/migrations/micropowermanager/2019_05_01_103123_create_connection_groups_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_05_01_103123_create_connection_groups_table.php @@ -6,7 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_05_15_122118_reports.php b/src/backend/database/migrations/micropowermanager/2019_05_15_122118_reports.php index 076adfe74..de15e08a0 100644 --- a/src/backend/database/migrations/micropowermanager/2019_05_15_122118_reports.php +++ b/src/backend/database/migrations/micropowermanager/2019_05_15_122118_reports.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_06_24_160040_create_mini_grids_table.php b/src/backend/database/migrations/micropowermanager/2019_06_24_160040_create_mini_grids_table.php index bae31d4ee..58ae32ad7 100644 --- a/src/backend/database/migrations/micropowermanager/2019_06_24_160040_create_mini_grids_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_06_24_160040_create_mini_grids_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_07_01_133655_create_maintenance_users_table.php b/src/backend/database/migrations/micropowermanager/2019_07_01_133655_create_maintenance_users_table.php index 2ecd0e202..7ed712525 100644 --- a/src/backend/database/migrations/micropowermanager/2019_07_01_133655_create_maintenance_users_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_07_01_133655_create_maintenance_users_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_11_06_121116_create_energies_table.php b/src/backend/database/migrations/micropowermanager/2019_11_06_121116_create_energies_table.php index 0028c9e56..ceb964f95 100644 --- a/src/backend/database/migrations/micropowermanager/2019_11_06_121116_create_energies_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_11_06_121116_create_energies_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_11_15_102431_create_solars_table.php b/src/backend/database/migrations/micropowermanager/2019_11_15_102431_create_solars_table.php index d9bdc6141..092056f67 100644 --- a/src/backend/database/migrations/micropowermanager/2019_11_15_102431_create_solars_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_11_15_102431_create_solars_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_11_26_063009_create_batteries_table.php b/src/backend/database/migrations/micropowermanager/2019_11_26_063009_create_batteries_table.php index 74e4824ad..e84d8693c 100644 --- a/src/backend/database/migrations/micropowermanager/2019_11_26_063009_create_batteries_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_11_26_063009_create_batteries_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_12_16_090907_create_assets_table.php b/src/backend/database/migrations/micropowermanager/2019_12_16_090907_create_assets_table.php index c781d65ee..864a51c53 100644 --- a/src/backend/database/migrations/micropowermanager/2019_12_16_090907_create_assets_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_12_16_090907_create_assets_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_12_16_091934_create_asset_types_table.php b/src/backend/database/migrations/micropowermanager/2019_12_16_091934_create_asset_types_table.php index 3732d70f4..7a704050b 100644 --- a/src/backend/database/migrations/micropowermanager/2019_12_16_091934_create_asset_types_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_12_16_091934_create_asset_types_table.php @@ -6,7 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. */ diff --git a/src/backend/database/migrations/micropowermanager/2019_12_16_092044_create_asset_people_table.php b/src/backend/database/migrations/micropowermanager/2019_12_16_092044_create_asset_people_table.php index 0117a7115..bf5851245 100644 --- a/src/backend/database/migrations/micropowermanager/2019_12_16_092044_create_asset_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_12_16_092044_create_asset_people_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2019_12_16_093223_create_asset_rates_table.php b/src/backend/database/migrations/micropowermanager/2019_12_16_093223_create_asset_rates_table.php index ce01316e8..bf5ff42ba 100644 --- a/src/backend/database/migrations/micropowermanager/2019_12_16_093223_create_asset_rates_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_12_16_093223_create_asset_rates_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_01_27_135206_create_logs_table.php b/src/backend/database/migrations/micropowermanager/2020_01_27_135206_create_logs_table.php index 555d4846a..8b6eb8dc4 100644 --- a/src/backend/database/migrations/micropowermanager/2020_01_27_135206_create_logs_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_01_27_135206_create_logs_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_04_05_233604_create_p_v_s_table.php b/src/backend/database/migrations/micropowermanager/2020_04_05_233604_create_p_v_s_table.php index b47d121eb..4248e8a37 100644 --- a/src/backend/database/migrations/micropowermanager/2020_04_05_233604_create_p_v_s_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_04_05_233604_create_p_v_s_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_04_19_234527_create_restrictions_table.php b/src/backend/database/migrations/micropowermanager/2020_04_19_234527_create_restrictions_table.php index ba22b236b..343eb5b1e 100644 --- a/src/backend/database/migrations/micropowermanager/2020_04_19_234527_create_restrictions_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_04_19_234527_create_restrictions_table.php @@ -5,7 +5,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_04_19_235421_create_upgrades_table.php b/src/backend/database/migrations/micropowermanager/2020_04_19_235421_create_upgrades_table.php index 43453dd9e..758fd9dc6 100644 --- a/src/backend/database/migrations/micropowermanager/2020_04_19_235421_create_upgrades_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_04_19_235421_create_upgrades_table.php @@ -5,7 +5,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_04_20_001454_create_subscriptions_table.php b/src/backend/database/migrations/micropowermanager/2020_04_20_001454_create_subscriptions_table.php index b35909c56..03f59e136 100644 --- a/src/backend/database/migrations/micropowermanager/2020_04_20_001454_create_subscriptions_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_04_20_001454_create_subscriptions_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_06_20_085555_weather_data.php b/src/backend/database/migrations/micropowermanager/2020_06_20_085555_weather_data.php index e89593640..40ce2c983 100644 --- a/src/backend/database/migrations/micropowermanager/2020_06_20_085555_weather_data.php +++ b/src/backend/database/migrations/micropowermanager/2020_06_20_085555_weather_data.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_06_21_131740_create_tariff_pricing_components_table.php b/src/backend/database/migrations/micropowermanager/2020_06_21_131740_create_tariff_pricing_components_table.php index d6a3d6842..748b295cb 100644 --- a/src/backend/database/migrations/micropowermanager/2020_06_21_131740_create_tariff_pricing_components_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_06_21_131740_create_tariff_pricing_components_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_06_21_194542_create_social_tariffs_table.php b/src/backend/database/migrations/micropowermanager/2020_06_21_194542_create_social_tariffs_table.php index 81f08e18c..26d61b55b 100644 --- a/src/backend/database/migrations/micropowermanager/2020_06_21_194542_create_social_tariffs_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_06_21_194542_create_social_tariffs_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_06_22_085345_create_social_tariff_piggy_banks_table.php b/src/backend/database/migrations/micropowermanager/2020_06_22_085345_create_social_tariff_piggy_banks_table.php index f1bb29501..61697c8b9 100644 --- a/src/backend/database/migrations/micropowermanager/2020_06_22_085345_create_social_tariff_piggy_banks_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_06_22_085345_create_social_tariff_piggy_banks_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_06_22_115405_add_total_price_to_meter_tariffs.php b/src/backend/database/migrations/micropowermanager/2020_06_22_115405_add_total_price_to_meter_tariffs.php index efb03e96f..6d311f3d0 100644 --- a/src/backend/database/migrations/micropowermanager/2020_06_22_115405_add_total_price_to_meter_tariffs.php +++ b/src/backend/database/migrations/micropowermanager/2020_06_22_115405_add_total_price_to_meter_tariffs.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_07_12_192802_create_agents_table.php b/src/backend/database/migrations/micropowermanager/2020_07_12_192802_create_agents_table.php index 124e9c43c..84b02871f 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_12_192802_create_agents_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_12_192802_create_agents_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_07_13_130601_create_agent_transactions_table.php b/src/backend/database/migrations/micropowermanager/2020_07_13_130601_create_agent_transactions_table.php index 9309c5d51..86730eb84 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_13_130601_create_agent_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_13_130601_create_agent_transactions_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_07_13_132006_create_agent_balance_histories_table.php b/src/backend/database/migrations/micropowermanager/2020_07_13_132006_create_agent_balance_histories_table.php index 56cfce334..e73d0b7c3 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_13_132006_create_agent_balance_histories_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_13_132006_create_agent_balance_histories_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_07_13_132423_create_agent_assigned_appliances_table.php b/src/backend/database/migrations/micropowermanager/2020_07_13_132423_create_agent_assigned_appliances_table.php index c841a39b1..6f0e7e097 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_13_132423_create_agent_assigned_appliances_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_13_132423_create_agent_assigned_appliances_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_07_13_132811_create_agent_sold_appliances_table.php b/src/backend/database/migrations/micropowermanager/2020_07_13_132811_create_agent_sold_appliances_table.php index a9fd8c036..1cc6849f5 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_13_132811_create_agent_sold_appliances_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_13_132811_create_agent_sold_appliances_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_07_25_083600_create_agent_commissions_table.php b/src/backend/database/migrations/micropowermanager/2020_07_25_083600_create_agent_commissions_table.php index fdf44f20b..9002d5b8a 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_25_083600_create_agent_commissions_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_25_083600_create_agent_commissions_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_07_25_155837_create_agent_receipts_table.php b/src/backend/database/migrations/micropowermanager/2020_07_25_155837_create_agent_receipts_table.php index a648c6f3f..ac1b4a33f 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_25_155837_create_agent_receipts_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_25_155837_create_agent_receipts_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_08_03_081836_create_agent_charges_table.php b/src/backend/database/migrations/micropowermanager/2020_08_03_081836_create_agent_charges_table.php index 495526c62..45f6599bc 100644 --- a/src/backend/database/migrations/micropowermanager/2020_08_03_081836_create_agent_charges_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_08_03_081836_create_agent_charges_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_08_05_133748_create_agent_receipt_details_table.php b/src/backend/database/migrations/micropowermanager/2020_08_05_133748_create_agent_receipt_details_table.php index 78f9e28fb..52dd76cea 100644 --- a/src/backend/database/migrations/micropowermanager/2020_08_05_133748_create_agent_receipt_details_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_08_05_133748_create_agent_receipt_details_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_10_02_072509_create_time_of_usages_table.php b/src/backend/database/migrations/micropowermanager/2020_10_02_072509_create_time_of_usages_table.php index b76f584b1..c41292352 100644 --- a/src/backend/database/migrations/micropowermanager/2020_10_02_072509_create_time_of_usages_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_10_02_072509_create_time_of_usages_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_10_19_122517_create_sub_menu_items_table.php b/src/backend/database/migrations/micropowermanager/2020_10_19_122517_create_sub_menu_items_table.php index 9e6680513..7924e56bb 100644 --- a/src/backend/database/migrations/micropowermanager/2020_10_19_122517_create_sub_menu_items_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_10_19_122517_create_sub_menu_items_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_10_19_122649_create_menu_items_table.php b/src/backend/database/migrations/micropowermanager/2020_10_19_122649_create_menu_items_table.php index ab6e76457..2d2512d7b 100644 --- a/src/backend/database/migrations/micropowermanager/2020_10_19_122649_create_menu_items_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_10_19_122649_create_menu_items_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_10_29_170007_create_plugins_table.php b/src/backend/database/migrations/micropowermanager/2020_10_29_170007_create_plugins_table.php index 0242050b4..b57721df7 100644 --- a/src/backend/database/migrations/micropowermanager/2020_10_29_170007_create_plugins_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_10_29_170007_create_plugins_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_12_17_144527_create_main_settings_table.php b/src/backend/database/migrations/micropowermanager/2020_12_17_144527_create_main_settings_table.php index e98b9ee25..a9bfe2c7f 100644 --- a/src/backend/database/migrations/micropowermanager/2020_12_17_144527_create_main_settings_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_12_17_144527_create_main_settings_table.php @@ -6,7 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2020_12_23_165814_create_map_settings_table.php b/src/backend/database/migrations/micropowermanager/2020_12_23_165814_create_map_settings_table.php index 0b096710c..3e51dd8c6 100644 --- a/src/backend/database/migrations/micropowermanager/2020_12_23_165814_create_map_settings_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_12_23_165814_create_map_settings_table.php @@ -6,7 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_01_02_130016_add_manufacturer_transaction_to_agent_transactions_table.php b/src/backend/database/migrations/micropowermanager/2021_01_02_130016_add_manufacturer_transaction_to_agent_transactions_table.php index e3588ea13..f9102782f 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_02_130016_add_manufacturer_transaction_to_agent_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_02_130016_add_manufacturer_transaction_to_agent_transactions_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_01_02_130412_create_third_party_transactions.php b/src/backend/database/migrations/micropowermanager/2021_01_02_130412_create_third_party_transactions.php index eb7b82826..0ea1fb8d4 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_02_130412_create_third_party_transactions.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_02_130412_create_third_party_transactions.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_01_02_134152_add_manufacturer_transaction_to_vodacom_transactions_table.php b/src/backend/database/migrations/micropowermanager/2021_01_02_134152_add_manufacturer_transaction_to_vodacom_transactions_table.php index 75c1454b1..8d6587a9a 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_02_134152_add_manufacturer_transaction_to_vodacom_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_02_134152_add_manufacturer_transaction_to_vodacom_transactions_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_01_02_134212_add_manufacturer_transaction_to_airtel_transactions_table.php b/src/backend/database/migrations/micropowermanager/2021_01_02_134212_add_manufacturer_transaction_to_airtel_transactions_table.php index 2bacebbb6..c8ea0ae32 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_02_134212_add_manufacturer_transaction_to_airtel_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_02_134212_add_manufacturer_transaction_to_airtel_transactions_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_01_05_234039_create_ticket_settings_table.php b/src/backend/database/migrations/micropowermanager/2021_01_05_234039_create_ticket_settings_table.php index 4f1f7fb36..9cdbe3bda 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_05_234039_create_ticket_settings_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_05_234039_create_ticket_settings_table.php @@ -6,7 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_01_18_122556_add_columns_to_batteries_table.php b/src/backend/database/migrations/micropowermanager/2021_01_18_122556_add_columns_to_batteries_table.php index 5afd57d9b..33160094d 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_18_122556_add_columns_to_batteries_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_18_122556_add_columns_to_batteries_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_01_18_123245_add_columns_to_p_v_s_table.php b/src/backend/database/migrations/micropowermanager/2021_01_18_123245_add_columns_to_p_v_s_table.php index 46ca45ff9..0dd8d204d 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_18_123245_add_columns_to_p_v_s_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_18_123245_add_columns_to_p_v_s_table.php @@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_bodies.php b/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_bodies.php index ebdfa0989..90c658d13 100644 --- a/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_bodies.php +++ b/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_bodies.php @@ -6,7 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_resend_information_keys.php b/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_resend_information_keys.php index 47c0a507d..9a80c7383 100644 --- a/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_resend_information_keys.php +++ b/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_resend_information_keys.php @@ -6,7 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_02_18_156421_create_sms_appliance_remind_rates.php b/src/backend/database/migrations/micropowermanager/2021_02_18_156421_create_sms_appliance_remind_rates.php index c7a84e8a1..8ebddbbd0 100644 --- a/src/backend/database/migrations/micropowermanager/2021_02_18_156421_create_sms_appliance_remind_rates.php +++ b/src/backend/database/migrations/micropowermanager/2021_02_18_156421_create_sms_appliance_remind_rates.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_03_03_140758_create_sms_android_settings.php b/src/backend/database/migrations/micropowermanager/2021_03_03_140758_create_sms_android_settings.php index 9cc789ad7..fb89c99c4 100644 --- a/src/backend/database/migrations/micropowermanager/2021_03_03_140758_create_sms_android_settings.php +++ b/src/backend/database/migrations/micropowermanager/2021_03_03_140758_create_sms_android_settings.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_03_03_141706_create_sms_variable_default_values.php b/src/backend/database/migrations/micropowermanager/2021_03_03_141706_create_sms_variable_default_values.php index 34ed727b7..c4a52ea02 100644 --- a/src/backend/database/migrations/micropowermanager/2021_03_03_141706_create_sms_variable_default_values.php +++ b/src/backend/database/migrations/micropowermanager/2021_03_03_141706_create_sms_variable_default_values.php @@ -6,7 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_03_2_1561251_update_sms_table.php b/src/backend/database/migrations/micropowermanager/2021_03_2_1561251_update_sms_table.php index 7a17e803a..370737ae3 100644 --- a/src/backend/database/migrations/micropowermanager/2021_03_2_1561251_update_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_03_2_1561251_update_sms_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_04_28_103758_add_additional_json_column_to_people.php b/src/backend/database/migrations/micropowermanager/2021_04_28_103758_add_additional_json_column_to_people.php index c05d0464c..95a98688a 100644 --- a/src/backend/database/migrations/micropowermanager/2021_04_28_103758_add_additional_json_column_to_people.php +++ b/src/backend/database/migrations/micropowermanager/2021_04_28_103758_add_additional_json_column_to_people.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_04_28_104840_create_person_documents_table.php b/src/backend/database/migrations/micropowermanager/2021_04_28_104840_create_person_documents_table.php index 25e5f6b45..665872e34 100644 --- a/src/backend/database/migrations/micropowermanager/2021_04_28_104840_create_person_documents_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_04_28_104840_create_person_documents_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_06_04_085817_update_meter_consumptions_table.php b/src/backend/database/migrations/micropowermanager/2021_06_04_085817_update_meter_consumptions_table.php index 58d8d3bc1..23371ddd6 100644 --- a/src/backend/database/migrations/micropowermanager/2021_06_04_085817_update_meter_consumptions_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_06_04_085817_update_meter_consumptions_table.php @@ -6,7 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * @@ -14,7 +14,7 @@ */ public function up() { - if (! Type::hasType('double')) { + if (!Type::hasType('double')) { Type::addType('double', FloatType::class); } Schema::connection('shard')->table('meter_consumptions', function (Blueprint $table) { diff --git a/src/backend/database/migrations/micropowermanager/2021_08_17_090801_add_down_payment_to_asset_people_table.php b/src/backend/database/migrations/micropowermanager/2021_08_17_090801_add_down_payment_to_asset_people_table.php index 57a38caf6..24351a0b9 100644 --- a/src/backend/database/migrations/micropowermanager/2021_08_17_090801_add_down_payment_to_asset_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_08_17_090801_add_down_payment_to_asset_people_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_08_17_090913_add_first_payment_date_to_asset_people_table.php b/src/backend/database/migrations/micropowermanager/2021_08_17_090913_add_first_payment_date_to_asset_people_table.php index 747895479..6c7f61835 100644 --- a/src/backend/database/migrations/micropowermanager/2021_08_17_090913_add_first_payment_date_to_asset_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_08_17_090913_add_first_payment_date_to_asset_people_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_09_07_092522_create_cash_transactions_table.php b/src/backend/database/migrations/micropowermanager/2021_09_07_092522_create_cash_transactions_table.php index 849193095..0256a7245 100644 --- a/src/backend/database/migrations/micropowermanager/2021_09_07_092522_create_cash_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_09_07_092522_create_cash_transactions_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2021_10_18_220817_create_mail_settings.php b/src/backend/database/migrations/micropowermanager/2021_10_18_220817_create_mail_settings.php index ceab71922..6373909e0 100644 --- a/src/backend/database/migrations/micropowermanager/2021_10_18_220817_create_mail_settings.php +++ b/src/backend/database/migrations/micropowermanager/2021_10_18_220817_create_mail_settings.php @@ -6,7 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_093215_update_meter_tariffs_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_093215_update_meter_tariffs_table.php index 743fbdd1d..adc97125e 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_093215_update_meter_tariffs_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_093215_update_meter_tariffs_table.php @@ -6,7 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * @@ -14,7 +14,7 @@ */ public function up() { - if (! Type::hasType('double')) { + if (!Type::hasType('double')) { Type::addType('double', FloatType::class); } Schema::connection('shard')->table('meter_tariffs', function (Blueprint $table) { diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_101348_update_social_tariffs_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_101348_update_social_tariffs_table.php index 9866bab70..0e583258e 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_101348_update_social_tariffs_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_101348_update_social_tariffs_table.php @@ -6,7 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * @@ -14,7 +14,7 @@ */ public function up() { - if (! Type::hasType('double')) { + if (!Type::hasType('double')) { Type::addType('double', FloatType::class); } Schema::connection('shard')->table('social_tariffs', function (Blueprint $table) { diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_101616_update_tariff_pricing_components_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_101616_update_tariff_pricing_components_table.php index 4365574db..df5be7dff 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_101616_update_tariff_pricing_components_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_101616_update_tariff_pricing_components_table.php @@ -6,7 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * @@ -14,7 +14,7 @@ */ public function up() { - if (! Type::hasType('double')) { + if (!Type::hasType('double')) { Type::addType('double', FloatType::class); } Schema::connection('shard')->table('tariff_pricing_components', function (Blueprint $table) { diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_101855_update_social_tariff_piggy_banks_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_101855_update_social_tariff_piggy_banks_table.php index 2dbe149a2..10d1b30a2 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_101855_update_social_tariff_piggy_banks_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_101855_update_social_tariff_piggy_banks_table.php @@ -6,7 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * @@ -14,7 +14,7 @@ */ public function up() { - if (! Type::hasType('double')) { + if (!Type::hasType('double')) { Type::addType('double', FloatType::class); } Schema::connection('shard')->table('social_tariff_piggy_banks', function (Blueprint $table) { diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_102047_update_access_rates_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_102047_update_access_rates_table.php index 6b5d726b8..d16be1a73 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_102047_update_access_rates_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_102047_update_access_rates_table.php @@ -6,7 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * @@ -14,7 +14,7 @@ */ public function up() { - if (! Type::hasType('double')) { + if (!Type::hasType('double')) { Type::addType('double', FloatType::class); } Schema::connection('shard')->table('access_rates', function (Blueprint $table) { diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_102214_update_access_rate_payments_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_102214_update_access_rate_payments_table.php index b2424a07a..2a000621d 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_102214_update_access_rate_payments_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_102214_update_access_rate_payments_table.php @@ -6,7 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * @@ -14,7 +14,7 @@ */ public function up() { - if (! Type::hasType('double')) { + if (!Type::hasType('double')) { Type::addType('double', FloatType::class); } Schema::connection('shard')->table('access_rate_payments', function (Blueprint $table) { diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_102507_update_asset_people_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_102507_update_asset_people_table.php index 74154da78..93a3c8c43 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_102507_update_asset_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_102507_update_asset_people_table.php @@ -6,7 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * @@ -14,7 +14,7 @@ */ public function up() { - if (! Type::hasType('double')) { + if (!Type::hasType('double')) { Type::addType('double', FloatType::class); } Schema::connection('shard')->table('asset_people', function (Blueprint $table) { diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_102649_update_transactions_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_102649_update_transactions_table.php index 68968bebc..1ba707cf1 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_102649_update_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_102649_update_transactions_table.php @@ -6,7 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * @@ -14,7 +14,7 @@ */ public function up() { - if (! Type::hasType('double')) { + if (!Type::hasType('double')) { Type::addType('double', FloatType::class); } Schema::connection('shard')->table('transactions', function (Blueprint $table) { diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_102805_update_payment_histories_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_102805_update_payment_histories_table.php index 7f1f6d2d6..4d26923b2 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_102805_update_payment_histories_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_102805_update_payment_histories_table.php @@ -6,7 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * @@ -14,7 +14,7 @@ */ public function up() { - if (! Type::hasType('double')) { + if (!Type::hasType('double')) { Type::addType('double', FloatType::class); } Schema::connection('shard')->table('payment_histories', function (Blueprint $table) { diff --git a/src/backend/database/migrations/micropowermanager/2022_05_19_102938_update_asset_types_table.php b/src/backend/database/migrations/micropowermanager/2022_05_19_102938_update_asset_types_table.php index 7f47e8179..685ac3089 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_19_102938_update_asset_types_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_19_102938_update_asset_types_table.php @@ -6,7 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * @@ -14,7 +14,7 @@ */ public function up() { - if (! Type::hasType('double')) { + if (!Type::hasType('double')) { Type::addType('double', FloatType::class); } Schema::connection('shard')->table('asset_types', function (Blueprint $table) { diff --git a/src/backend/database/migrations/micropowermanager/2022_05_23_104138_add_connection_column_to_agents_table.php b/src/backend/database/migrations/micropowermanager/2022_05_23_104138_add_connection_column_to_agents_table.php index a818cd1cb..a9374728b 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_23_104138_add_connection_column_to_agents_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_23_104138_add_connection_column_to_agents_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090125_create_calin_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090125_create_calin_tables.php index 7117a6d11..650ee27f5 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090125_create_calin_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090125_create_calin_tables.php @@ -4,10 +4,10 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { public function up() { - if (! Schema::hasTable('calin_api_credentials')) { + if (!Schema::hasTable('calin_api_credentials')) { Schema::connection('shard')->create('calin_api_credentials', static function (Blueprint $table) { $table->increments('id'); $table->string('api_url')->default('http://api.calinhost.com/api'); @@ -16,7 +16,7 @@ public function up() $table->timestamps(); }); } - if (! Schema::hasTable('calin_transactions')) { + if (!Schema::hasTable('calin_transactions')) { Schema::connection('shard')->create('calin_transactions', static function (Blueprint $table) { $table->increments('id'); $table->timestamps(); diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090327_create_calin_smart_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090327_create_calin_smart_tables.php index a630c3233..0cbffde97 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090327_create_calin_smart_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090327_create_calin_smart_tables.php @@ -4,10 +4,10 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { public function up() { - if (! Schema::hasTable('calin_smart_api_credentials')) { + if (!Schema::hasTable('calin_smart_api_credentials')) { Schema::connection('shard')->create('calin_smart_api_credentials', static function (Blueprint $table) { $table->increments('id'); $table->string('api_url')->default('https://ami.calinhost.com/api'); @@ -18,7 +18,7 @@ public function up() $table->timestamps(); }); } - if (! Schema::hasTable('calin_smart_transactions')) { + if (!Schema::hasTable('calin_smart_transactions')) { Schema::connection('shard')->create('calin_smart_transactions', static function (Blueprint $table) { $table->increments('id'); $table->timestamps(); diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090338_create_kelin_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090338_create_kelin_tables.php index 777aa6307..b0c7decd2 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090338_create_kelin_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090338_create_kelin_tables.php @@ -4,10 +4,10 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { public function up() { - if (! Schema::hasTable('kelin_api_credentials')) { + if (!Schema::hasTable('kelin_api_credentials')) { Schema::connection('shard')->create('kelin_api_credentials', static function (Blueprint $table) { $table->increments('id'); $table->string('api_url')->nullable(); @@ -19,7 +19,7 @@ public function up() }); } - if (! Schema::hasTable('kelin_customers')) { + if (!Schema::hasTable('kelin_customers')) { Schema::connection('shard')->create('kelin_customers', static function (Blueprint $table) { $table->increments('id'); $table->integer('mpm_customer_id')->unique(); // Code of the customer, id of corresponding person in MPM @@ -31,7 +31,7 @@ public function up() }); } - if (! Schema::hasTable('kelin_meters')) { + if (!Schema::hasTable('kelin_meters')) { Schema::connection('shard')->create('kelin_meters', function (Blueprint $table) { $table->increments('id'); $table->integer('mpm_meter_id')->unique(); @@ -44,7 +44,7 @@ public function up() }); } - if (! Schema::hasTable('kelin_transactions')) { + if (!Schema::hasTable('kelin_transactions')) { Schema::connection('shard')->create('kelin_transactions', function (Blueprint $table) { $table->increments('id'); $table->string('meter_serial'); @@ -59,7 +59,7 @@ public function up() }); } - if (! Schema::hasTable('kelin_sync_actions')) { + if (!Schema::hasTable('kelin_sync_actions')) { Schema::connection('shard')->create('kelin_sync_actions', function (Blueprint $table) { $table->increments('id'); $table->integer('sync_setting_id'); @@ -70,7 +70,7 @@ public function up() }); } - if (! Schema::hasTable('kelin_sync_settings')) { + if (!Schema::hasTable('kelin_sync_settings')) { Schema::connection('shard')->create('kelin_sync_settings', function (Blueprint $table) { $table->increments('id'); $table->string('action_name')->unique(); @@ -81,7 +81,7 @@ public function up() }); } - if (! Schema::hasTable('kelin_meter_minutely_datas')) { + if (!Schema::hasTable('kelin_meter_minutely_datas')) { Schema::connection('shard')->create('kelin_meter_minutely_datas', static function (Blueprint $table) { $table->increments('id'); $table->integer('id_of_terminal'); @@ -116,7 +116,7 @@ public function up() }); } - if (! Schema::hasTable('kelin_meter_daily_datas')) { + if (!Schema::hasTable('kelin_meter_daily_datas')) { Schema::connection('shard')->create('kelin_meter_daily_datas', static function (Blueprint $table) { $table->increments('id'); $table->integer('id_of_terminal'); @@ -148,7 +148,7 @@ public function up() }); } - if (! Schema::hasTable('kelin_settings')) { + if (!Schema::hasTable('kelin_settings')) { Schema::connection('shard')->create('kelin_settings', function (Blueprint $table) { $table->increments('id'); $table->integer('setting_id'); diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090345_create_mesomb_payment_provider_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090345_create_mesomb_payment_provider_tables.php index 0e0ba78eb..df8f72421 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090345_create_mesomb_payment_provider_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090345_create_mesomb_payment_provider_tables.php @@ -4,10 +4,10 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { public function up() { - if (! Schema::hasTable('mesomb_transactions')) { + if (!Schema::hasTable('mesomb_transactions')) { Schema::connection('shard')->create('mesomb_transactions', static function (Blueprint $table) { $table->increments('id'); $table->string('pk'); diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090351_create_spark_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090351_create_spark_tables.php index 5b75e29bc..c5fae50c0 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090351_create_spark_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090351_create_spark_tables.php @@ -4,10 +4,10 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { public function up() { - if (! Schema::hasTable('sm_api_credentials')) { + if (!Schema::hasTable('sm_api_credentials')) { Schema::connection('shard')->create('sm_api_credentials', static function (Blueprint $table) { $table->increments('id'); $table->string('api_url')->default('https://www.sparkmeter.cloud/api/v0'); @@ -19,7 +19,7 @@ public function up() }); } - if (! Schema::hasTable('sm_customers')) { + if (!Schema::hasTable('sm_customers')) { Schema::connection('shard')->create('sm_customers', static function (Blueprint $table) { $table->increments('id'); $table->string('customer_id')->unique(); // Code of the customer, id of corresponding person in MPM @@ -32,7 +32,7 @@ public function up() }); } - if (! Schema::hasTable('sm_meter_models')) { + if (!Schema::hasTable('sm_meter_models')) { Schema::connection('shard')->create('sm_meter_models', static function (Blueprint $table) { $table->increments('id'); $table->string('site_id'); @@ -45,7 +45,7 @@ public function up() }); } - if (! Schema::hasTable('sm_organizations')) { + if (!Schema::hasTable('sm_organizations')) { Schema::connection('shard')->create('sm_organizations', static function (Blueprint $table) { $table->increments('id'); $table->string('organization_id')->unique(); @@ -55,7 +55,7 @@ public function up() }); } - if (! Schema::hasTable('sm_sites')) { + if (!Schema::hasTable('sm_sites')) { Schema::connection('shard')->create('sm_sites', static function (Blueprint $table) { $table->increments('id'); $table->string('site_id')->unique(); @@ -69,7 +69,7 @@ public function up() }); } - if (! Schema::hasTable('sm_tariffs')) { + if (!Schema::hasTable('sm_tariffs')) { Schema::connection('shard')->create('sm_tariffs', static function (Blueprint $table) { $table->increments('id'); $table->string('site_id'); @@ -83,7 +83,7 @@ public function up() }); } - if (! Schema::hasTable('sm_transactions')) { + if (!Schema::hasTable('sm_transactions')) { Schema::connection('shard')->create('sm_transactions', static function (Blueprint $table) { $table->increments('id'); $table->string('site_id'); @@ -96,7 +96,7 @@ public function up() }); } - if (! Schema::hasTable('sm_sync_actions')) { + if (!Schema::hasTable('sm_sync_actions')) { Schema::connection('shard')->create('sm_sync_actions', function (Blueprint $table) { $table->increments('id'); $table->integer('sync_setting_id'); @@ -107,7 +107,7 @@ public function up() }); } - if (! Schema::hasTable('sm_settings')) { + if (!Schema::hasTable('sm_settings')) { Schema::connection('shard')->create('sm_settings', function (Blueprint $table) { $table->increments('id'); $table->integer('setting_id'); @@ -116,7 +116,7 @@ public function up() }); } - if (! Schema::hasTable('sm_sms_settings')) { + if (!Schema::hasTable('sm_sms_settings')) { Schema::connection('shard')->create('sm_sms_settings', function (Blueprint $table) { $table->increments('id'); $table->string('state')->unique(); @@ -126,7 +126,7 @@ public function up() }); } - if (! Schema::hasTable('sm_sync_settings')) { + if (!Schema::hasTable('sm_sync_settings')) { Schema::connection('shard')->create('sm_sync_settings', function (Blueprint $table) { $table->increments('id'); $table->string('action_name')->unique(); @@ -137,7 +137,7 @@ public function up() }); } - if (! Schema::hasTable('sm_sms_notified_customers')) { + if (!Schema::hasTable('sm_sms_notified_customers')) { Schema::connection('shard')->create('sm_sms_notified_customers', function (Blueprint $table) { $table->increments('id'); $table->string('customer_id'); @@ -147,7 +147,7 @@ public function up() }); } - if (! Schema::hasTable('sm_sms_bodies')) { + if (!Schema::hasTable('sm_sms_bodies')) { Schema::connection('shard')->create('sm_sms_bodies', function (Blueprint $table) { $table->increments('id'); $table->string('reference', 50)->unique(); @@ -159,7 +159,7 @@ public function up() }); } - if (! Schema::hasTable('sm_sms_variable_default_values')) { + if (!Schema::hasTable('sm_sms_variable_default_values')) { Schema::connection('shard')->create('sm_sms_variable_default_values', function (Blueprint $table) { $table->id(); $table->string('variable'); @@ -168,7 +168,7 @@ public function up() }); } - if (! Schema::hasTable('sm_sales_accounts')) { + if (!Schema::hasTable('sm_sales_accounts')) { Schema::connection('shard')->create('sm_sales_accounts', static function (Blueprint $table) { $table->increments('id'); $table->string('sales_account_id'); @@ -183,7 +183,7 @@ public function up() }); } - if (! Schema::hasTable('sm_sms_feedback_words')) { + if (!Schema::hasTable('sm_sms_feedback_words')) { Schema::connection('shard')->create('sm_sms_feedback_words', function (Blueprint $table) { $table->increments('id'); $table->string('meter_reset')->nullable(); diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090402_create_steama_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090402_create_steama_tables.php index 350495680..b6264ceac 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090402_create_steama_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090402_create_steama_tables.php @@ -4,10 +4,10 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { public function up() { - if (! Schema::hasTable('steama_agents')) { + if (!Schema::hasTable('steama_agents')) { Schema::connection('shard')->create('steama_agents', function (Blueprint $table) { $table->increments('id'); $table->integer('site_id'); @@ -20,7 +20,7 @@ public function up() }); } - if (! Schema::hasTable('steama_asset_rates_payment_plans')) { + if (!Schema::hasTable('steama_asset_rates_payment_plans')) { Schema::connection('shard')->create('steama_asset_rates_payment_plans', function (Blueprint $table) { $table->increments('id'); $table->integer('mpm_asset_people_id'); @@ -29,7 +29,7 @@ public function up() }); } - if (! Schema::hasTable('steama_credentials')) { + if (!Schema::hasTable('steama_credentials')) { Schema::connection('shard')->create('steama_credentials', function (Blueprint $table) { $table->increments('id'); $table->string('username')->nullable(); @@ -41,7 +41,7 @@ public function up() }); } - if (! Schema::hasTable('steama_customer_basis_payment_plans')) { + if (!Schema::hasTable('steama_customer_basis_payment_plans')) { Schema::connection('shard')->create('steama_customer_basis_payment_plans', function (Blueprint $table) { $table->increments('id'); $table->integer('customer_id'); @@ -51,7 +51,7 @@ public function up() }); } - if (! Schema::hasTable('steama_customer_basis_time_of_usages')) { + if (!Schema::hasTable('steama_customer_basis_time_of_usages')) { Schema::connection('shard')->create('steama_customer_basis_time_of_usages', function (Blueprint $table) { $table->increments('id'); $table->integer('start'); @@ -61,7 +61,7 @@ public function up() }); } - if (! Schema::hasTable('steama_customers')) { + if (!Schema::hasTable('steama_customers')) { Schema::connection('shard')->create('steama_customers', function (Blueprint $table) { $table->increments('id'); $table->integer('site_id'); @@ -76,7 +76,7 @@ public function up() }); } - if (! Schema::hasTable('steama_flat_rate_payment_plans')) { + if (!Schema::hasTable('steama_flat_rate_payment_plans')) { Schema::connection('shard')->create('steama_flat_rate_payment_plans', function (Blueprint $table) { $table->increments('id'); $table->decimal('energy_price')->default(0); @@ -84,7 +84,7 @@ public function up() }); } - if (! Schema::hasTable('steama_hybrid_payment_plans')) { + if (!Schema::hasTable('steama_hybrid_payment_plans')) { Schema::connection('shard')->create('steama_hybrid_payment_plans', function (Blueprint $table) { $table->increments('id'); $table->decimal('connection_fee')->nullable(); @@ -94,7 +94,7 @@ public function up() }); } - if (! Schema::hasTable('steama_meter_types')) { + if (!Schema::hasTable('steama_meter_types')) { Schema::connection('shard')->create('steama_meter_types', function (Blueprint $table) { $table->increments('id'); $table->integer('mpm_meter_type_id'); @@ -105,7 +105,7 @@ public function up() }); } - if (! Schema::hasTable('steama_meters')) { + if (!Schema::hasTable('steama_meters')) { Schema::connection('shard')->create('steama_meters', function (Blueprint $table) { $table->increments('id'); $table->integer('meter_id')->unique(); @@ -117,7 +117,7 @@ public function up() }); } - if (! Schema::hasTable('steama_minimum_top_up_requirements_payment_plans')) { + if (!Schema::hasTable('steama_minimum_top_up_requirements_payment_plans')) { Schema::connection('shard')->create('steama_minimum_top_up_requirements_payment_plans', function (Blueprint $table) { $table->increments('id'); $table->decimal('threshold')->default(0); @@ -125,7 +125,7 @@ public function up() }); } - if (! Schema::hasTable('steama_per_kwh_payment_plans')) { + if (!Schema::hasTable('steama_per_kwh_payment_plans')) { Schema::connection('shard')->create('steama_per_kwh_payment_plans', function (Blueprint $table) { $table->increments('id'); $table->decimal('energy_price')->default(0); @@ -133,7 +133,7 @@ public function up() }); } - if (! Schema::hasTable('steama_site_level_payment_plan_types')) { + if (!Schema::hasTable('steama_site_level_payment_plan_types')) { Schema::connection('shard')->create('steama_site_level_payment_plan_types', function (Blueprint $table) { $table->increments('id'); $table->string('name'); @@ -141,7 +141,7 @@ public function up() }); } - if (! Schema::hasTable('steama_site_level_payment_plans')) { + if (!Schema::hasTable('steama_site_level_payment_plans')) { Schema::connection('shard')->create('steama_site_level_payment_plans', function (Blueprint $table) { $table->increments('id'); $table->integer('site_id'); @@ -153,7 +153,7 @@ public function up() }); } - if (! Schema::hasTable('steama_sites')) { + if (!Schema::hasTable('steama_sites')) { Schema::connection('shard')->create('steama_sites', function (Blueprint $table) { $table->increments('id'); $table->integer('site_id')->unique(); @@ -163,7 +163,7 @@ public function up() }); } - if (! Schema::hasTable('steama_subscription_payment_plans')) { + if (!Schema::hasTable('steama_subscription_payment_plans')) { Schema::connection('shard')->create('steama_subscription_payment_plans', function (Blueprint $table) { $table->increments('id'); $table->decimal('plan_fee')->default(0); @@ -174,7 +174,7 @@ public function up() }); } - if (! Schema::hasTable('steama_tariff_override_payment_plans')) { + if (!Schema::hasTable('steama_tariff_override_payment_plans')) { Schema::connection('shard')->create('steama_tariff_override_payment_plans', function (Blueprint $table) { $table->increments('id'); $table->decimal('energy_price')->default(0); @@ -182,7 +182,7 @@ public function up() }); } - if (! Schema::hasTable('steama_tariffs')) { + if (!Schema::hasTable('steama_tariffs')) { Schema::connection('shard')->create('steama_tariffs', function (Blueprint $table) { $table->increments('id'); $table->integer('mpm_tariff_id')->unique(); @@ -190,7 +190,7 @@ public function up() }); } - if (! Schema::hasTable('steama_transactions')) { + if (!Schema::hasTable('steama_transactions')) { Schema::connection('shard')->create('steama_transactions', function (Blueprint $table) { $table->increments('id'); $table->integer('site_id'); @@ -205,7 +205,7 @@ public function up() }); } - if (! Schema::hasTable('steama_user_types')) { + if (!Schema::hasTable('steama_user_types')) { Schema::connection('shard')->create('steama_user_types', function (Blueprint $table) { $table->increments('id'); $table->integer('mpm_connection_type_id'); @@ -215,7 +215,7 @@ public function up() }); } - if (! Schema::hasTable('steama_sync_actions')) { + if (!Schema::hasTable('steama_sync_actions')) { Schema::connection('shard')->create('steama_sync_actions', function (Blueprint $table) { $table->increments('id'); $table->integer('sync_setting_id'); @@ -226,7 +226,7 @@ public function up() }); } - if (! Schema::hasTable('steama_settings')) { + if (!Schema::hasTable('steama_settings')) { Schema::connection('shard')->create('steama_settings', function (Blueprint $table) { $table->increments('id'); $table->integer('setting_id'); @@ -235,7 +235,7 @@ public function up() }); } - if (! Schema::hasTable('steama_sms_settings')) { + if (!Schema::hasTable('steama_sms_settings')) { Schema::connection('shard')->create('steama_sms_settings', function (Blueprint $table) { $table->increments('id'); $table->string('state')->unique(); @@ -245,7 +245,7 @@ public function up() }); } - if (! Schema::hasTable('steama_sync_settings')) { + if (!Schema::hasTable('steama_sync_settings')) { Schema::connection('shard')->create('steama_sync_settings', function (Blueprint $table) { $table->increments('id'); $table->string('action_name')->unique(); @@ -256,7 +256,7 @@ public function up() }); } - if (! Schema::hasTable('steama_sms_notified_customers')) { + if (!Schema::hasTable('steama_sms_notified_customers')) { Schema::connection('shard')->create('steama_sms_notified_customers', function (Blueprint $table) { $table->increments('id'); $table->integer('customer_id'); @@ -266,7 +266,7 @@ public function up() }); } - if (! Schema::hasTable('steama_sms_bodies')) { + if (!Schema::hasTable('steama_sms_bodies')) { Schema::connection('shard')->create('steama_sms_bodies', function (Blueprint $table) { $table->increments('id'); $table->string('reference', 50)->unique(); @@ -278,7 +278,7 @@ public function up() }); } - if (! Schema::hasTable('steama_sms_variable_default_values')) { + if (!Schema::hasTable('steama_sms_variable_default_values')) { Schema::connection('shard')->create('steama_sms_variable_default_values', function (Blueprint $table) { $table->id(); $table->string('variable'); @@ -287,7 +287,7 @@ public function up() }); } - if (! Schema::hasTable('steama_sms_feedback_words')) { + if (!Schema::hasTable('steama_sms_feedback_words')) { Schema::connection('shard')->create('steama_sms_feedback_words', function (Blueprint $table) { $table->increments('id'); $table->string('meter_balance')->nullable(); diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090412_create_stron_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090412_create_stron_tables.php index 26537479e..8c1e7343f 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090412_create_stron_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090412_create_stron_tables.php @@ -4,10 +4,10 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { public function up() { - if (! Schema::hasTable('stron_api_credentials')) { + if (!Schema::hasTable('stron_api_credentials')) { Schema::connection('shard')->create('stron_api_credentials', static function (Blueprint $table) { $table->increments('id'); $table->string('api_url')->default('http://www.saitecapi.stronpower.com/api'); @@ -19,7 +19,7 @@ public function up() $table->timestamps(); }); } - if (! Schema::hasTable('stron_transactions')) { + if (!Schema::hasTable('stron_transactions')) { Schema::connection('shard')->create('stron_transactions', static function (Blueprint $table) { $table->increments('id'); $table->timestamps(); diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090425_create_swifta_payment_provider_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090425_create_swifta_payment_provider_tables.php index 9072b7113..39905bf5c 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090425_create_swifta_payment_provider_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090425_create_swifta_payment_provider_tables.php @@ -4,10 +4,10 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { public function up() { - if (! Schema::hasTable('swifta_transactions')) { + if (!Schema::hasTable('swifta_transactions')) { Schema::connection('shard')->create('swifta_transactions', static function (Blueprint $table) { $table->increments('id'); $table->string('transaction_reference')->nullable(); @@ -20,7 +20,7 @@ public function up() $table->timestamps(); }); } - if (! Schema::hasTable('swifta_authentication')) { + if (!Schema::hasTable('swifta_authentication')) { Schema::connection('shard')->create('swifta_authentication', static function (Blueprint $table) { $table->increments('id'); $table->string('token')->nullable(); diff --git a/src/backend/database/migrations/micropowermanager/2022_07_05_092948_create_registration_tail_table.php b/src/backend/database/migrations/micropowermanager/2022_07_05_092948_create_registration_tail_table.php index 23ed77cb3..c0f14af3e 100644 --- a/src/backend/database/migrations/micropowermanager/2022_07_05_092948_create_registration_tail_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_07_05_092948_create_registration_tail_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_09_20_0000000_create_bulk_registration_tables.php b/src/backend/database/migrations/micropowermanager/2022_09_20_0000000_create_bulk_registration_tables.php index 522b2eef7..5d4adeaeb 100644 --- a/src/backend/database/migrations/micropowermanager/2022_09_20_0000000_create_bulk_registration_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_09_20_0000000_create_bulk_registration_tables.php @@ -4,10 +4,10 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { public function up() { - if (! Schema::connection('shard')->hasTable('bulk_registration_csv_datas')) { + if (!Schema::connection('shard')->hasTable('bulk_registration_csv_datas')) { Schema::connection('shard')->create('bulk_registration_csv_datas', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('user_id'); diff --git a/src/backend/database/migrations/micropowermanager/2022_10_27_130327_add_direction_column_to_sms_table.php b/src/backend/database/migrations/micropowermanager/2022_10_27_130327_add_direction_column_to_sms_table.php index 889e28ca2..34ad352e9 100644 --- a/src/backend/database/migrations/micropowermanager/2022_10_27_130327_add_direction_column_to_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_10_27_130327_add_direction_column_to_sms_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_10_27_140945_add_gateway_id_column_to_sms_table.php b/src/backend/database/migrations/micropowermanager/2022_10_27_140945_add_gateway_id_column_to_sms_table.php index 52967fea1..ce2821e1d 100644 --- a/src/backend/database/migrations/micropowermanager/2022_10_27_140945_add_gateway_id_column_to_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_10_27_140945_add_gateway_id_column_to_sms_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_10_27_142123_add_dispatched_column_to_sms_table.php b/src/backend/database/migrations/micropowermanager/2022_10_27_142123_add_dispatched_column_to_sms_table.php index fd0890489..02e97429d 100644 --- a/src/backend/database/migrations/micropowermanager/2022_10_27_142123_add_dispatched_column_to_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_10_27_142123_add_dispatched_column_to_sms_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_10_27_142319_add_attempts_column_to_sms_table.php b/src/backend/database/migrations/micropowermanager/2022_10_27_142319_add_attempts_column_to_sms_table.php index 3ddc6c9fd..d8da6df80 100644 --- a/src/backend/database/migrations/micropowermanager/2022_10_27_142319_add_attempts_column_to_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_10_27_142319_add_attempts_column_to_sms_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_11_08_0000000_create_viber_messaging_tables.php b/src/backend/database/migrations/micropowermanager/2022_11_08_0000000_create_viber_messaging_tables.php index 155677b6e..48c5c383c 100644 --- a/src/backend/database/migrations/micropowermanager/2022_11_08_0000000_create_viber_messaging_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_11_08_0000000_create_viber_messaging_tables.php @@ -4,10 +4,10 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { public function up() { - if (! Schema::hasTable('viber_credentials')) { + if (!Schema::hasTable('viber_credentials')) { Schema::connection('shard')->create('viber_credentials', static function (Blueprint $table) { $table->increments('id'); $table->string('api_token')->nullable(); @@ -17,14 +17,14 @@ public function up() $table->timestamps(); }); } - if (! Schema::hasTable('viber_messages')) { + if (!Schema::hasTable('viber_messages')) { Schema::connection('shard')->create('viber_messages', static function (Blueprint $table) { $table->increments('id'); $table->integer('sms_id'); $table->timestamps(); }); } - if (! Schema::hasTable('viber_contacts')) { + if (!Schema::hasTable('viber_contacts')) { Schema::connection('shard')->create('viber_contacts', static function (Blueprint $table) { $table->increments('id'); $table->integer('person_id'); diff --git a/src/backend/database/migrations/micropowermanager/2022_11_14_101338_add_minimum_purchase_amount_to_meter_tariffs_table.php b/src/backend/database/migrations/micropowermanager/2022_11_14_101338_add_minimum_purchase_amount_to_meter_tariffs_table.php index 29f89dbb0..1bb868b51 100644 --- a/src/backend/database/migrations/micropowermanager/2022_11_14_101338_add_minimum_purchase_amount_to_meter_tariffs_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_11_14_101338_add_minimum_purchase_amount_to_meter_tariffs_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2022_11_21_000000_create_wave_money_payment_provider_tables.php b/src/backend/database/migrations/micropowermanager/2022_11_21_000000_create_wave_money_payment_provider_tables.php index 1f93a0540..c2fd8756c 100644 --- a/src/backend/database/migrations/micropowermanager/2022_11_21_000000_create_wave_money_payment_provider_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_11_21_000000_create_wave_money_payment_provider_tables.php @@ -4,10 +4,10 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { public function up() { - if (! Schema::hasTable('wave_money_transactions')) { + if (!Schema::hasTable('wave_money_transactions')) { Schema::connection('shard')->create('wave_money_transactions', static function (Blueprint $table) { $table->increments('id'); $table->integer('status')->default(-2); @@ -22,7 +22,7 @@ public function up() $table->timestamps(); }); } - if (! Schema::hasTable('wave_money_credentials')) { + if (!Schema::hasTable('wave_money_credentials')) { Schema::connection('shard')->create('wave_money_credentials', static function (Blueprint $table) { $table->increments('id'); $table->string('merchant_id')->nullable(); diff --git a/src/backend/database/migrations/micropowermanager/2022_11_29_000000_create_micro_star_tables.php b/src/backend/database/migrations/micropowermanager/2022_11_29_000000_create_micro_star_tables.php index 15a4cdae5..f8d27f2e2 100644 --- a/src/backend/database/migrations/micropowermanager/2022_11_29_000000_create_micro_star_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_11_29_000000_create_micro_star_tables.php @@ -4,10 +4,10 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { public function up() { - if (! Schema::hasTable('micro_star_api_credentials')) { + if (!Schema::hasTable('micro_star_api_credentials')) { Schema::connection('shard')->create('micro_star_api_credentials', static function (Blueprint $table) { $table->increments('id'); $table->string('api_url')->nullable(); @@ -18,7 +18,7 @@ public function up() $table->timestamps(); }); } - if (! Schema::hasTable('micro_star_transactions')) { + if (!Schema::hasTable('micro_star_transactions')) { Schema::connection('shard')->create('micro_star_transactions', static function (Blueprint $table) { $table->increments('id'); $table->timestamps(); diff --git a/src/backend/database/migrations/micropowermanager/2022_12_11_000000_update_swifta_authentication_table.php b/src/backend/database/migrations/micropowermanager/2022_12_11_000000_update_swifta_authentication_table.php index 97def6ebb..756749f5a 100644 --- a/src/backend/database/migrations/micropowermanager/2022_12_11_000000_update_swifta_authentication_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_12_11_000000_update_swifta_authentication_table.php @@ -6,7 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * @@ -14,7 +14,7 @@ */ public function up() { - if (! Type::hasType('token')) { + if (!Type::hasType('token')) { Type::addType('token', FloatType::class); } Schema::connection('shard')->table('swifta_authentication', function (Blueprint $table) { diff --git a/src/backend/database/migrations/micropowermanager/2022_14_12_create_sun_king_tables.php b/src/backend/database/migrations/micropowermanager/2022_14_12_create_sun_king_tables.php index a3710cba1..2836b3223 100644 --- a/src/backend/database/migrations/micropowermanager/2022_14_12_create_sun_king_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_14_12_create_sun_king_tables.php @@ -4,10 +4,10 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { public function up() { - if (! Schema::connection('shard')->hasTable('sun_king_api_credentials')) { + if (!Schema::connection('shard')->hasTable('sun_king_api_credentials')) { Schema::connection('shard')->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'); @@ -19,7 +19,7 @@ public function up() $table->timestamps(); }); } - if (! Schema::connection('shard')->hasTable('sun_king_transactions')) { + if (!Schema::connection('shard')->hasTable('sun_king_transactions')) { Schema::connection('shard')->create('sun_king_transactions', static function (Blueprint $table) { $table->increments('id'); $table->timestamps(); diff --git a/src/backend/database/migrations/micropowermanager/2023_03_15_092048_add_colums_to_solars_table.php b/src/backend/database/migrations/micropowermanager/2023_03_15_092048_add_colums_to_solars_table.php index 6190e2f5b..011ac4f62 100644 --- a/src/backend/database/migrations/micropowermanager/2023_03_15_092048_add_colums_to_solars_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_03_15_092048_add_colums_to_solars_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_03_16_105024_update_solars_table.php b/src/backend/database/migrations/micropowermanager/2023_03_16_105024_update_solars_table.php index bdfbdf2ff..8e54b500f 100644 --- a/src/backend/database/migrations/micropowermanager/2023_03_16_105024_update_solars_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_03_16_105024_update_solars_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_03_17_234630_update_data_type_values_energies_table.php b/src/backend/database/migrations/micropowermanager/2023_03_17_234630_update_data_type_values_energies_table.php index 5c994a7c7..e180bf954 100644 --- a/src/backend/database/migrations/micropowermanager/2023_03_17_234630_update_data_type_values_energies_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_03_17_234630_update_data_type_values_energies_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_03_18_014305_update_data_type_values_energies_table.php b/src/backend/database/migrations/micropowermanager/2023_03_18_014305_update_data_type_values_energies_table.php index 2c7b4bf06..f2344b9a0 100644 --- a/src/backend/database/migrations/micropowermanager/2023_03_18_014305_update_data_type_values_energies_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_03_18_014305_update_data_type_values_energies_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_04_02_121811_create_wavecom_tables.php b/src/backend/database/migrations/micropowermanager/2023_04_02_121811_create_wavecom_tables.php index abde750de..245fa7a8b 100644 --- a/src/backend/database/migrations/micropowermanager/2023_04_02_121811_create_wavecom_tables.php +++ b/src/backend/database/migrations/micropowermanager/2023_04_02_121811_create_wavecom_tables.php @@ -4,12 +4,12 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { private const TABLE_NAME = 'wavecom_transactions'; public function up() { - if (! Schema::hasTable(self::TABLE_NAME)) { + if (!Schema::hasTable(self::TABLE_NAME)) { Schema::create(self::TABLE_NAME, function (Blueprint $table) { $table->increments('id'); $table->string('transaction_id')->unique(); diff --git a/src/backend/database/migrations/micropowermanager/2023_04_04_211421_add_api_type_to_table_transactions.php b/src/backend/database/migrations/micropowermanager/2023_04_04_211421_add_api_type_to_table_transactions.php index 292b015af..2358fd0b9 100644 --- a/src/backend/database/migrations/micropowermanager/2023_04_04_211421_add_api_type_to_table_transactions.php +++ b/src/backend/database/migrations/micropowermanager/2023_04_04_211421_add_api_type_to_table_transactions.php @@ -3,7 +3,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\DB; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_04_26_223352_update_sms_table.php b/src/backend/database/migrations/micropowermanager/2023_04_26_223352_update_sms_table.php index 5abf3c936..4c46c099e 100644 --- a/src/backend/database/migrations/micropowermanager/2023_04_26_223352_update_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_04_26_223352_update_sms_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_06_02_create_gome_long_tables.php b/src/backend/database/migrations/micropowermanager/2023_06_02_create_gome_long_tables.php index 4e819cf34..71d96f441 100644 --- a/src/backend/database/migrations/micropowermanager/2023_06_02_create_gome_long_tables.php +++ b/src/backend/database/migrations/micropowermanager/2023_06_02_create_gome_long_tables.php @@ -6,10 +6,10 @@ // Despite the migration's name, this migration was actually created on Feb 6h // Name should be 2023-02-06 not 2023-06-02... -return new class () extends Migration { +return new class extends Migration { public function up() { - if (! Schema::hasTable('gome_long_api_credentials')) { + if (!Schema::hasTable('gome_long_api_credentials')) { Schema::create('gome_long_api_credentials', static function (Blueprint $table) { $table->increments('id'); $table->string('api_url')->default('http://60.205.216.142:8085/api/EKPower'); @@ -19,14 +19,14 @@ public function up() }); } - if (! Schema::hasTable('gome_long_transactions')) { + if (!Schema::hasTable('gome_long_transactions')) { Schema::create('gome_long_transactions', static function (Blueprint $table) { $table->increments('id'); $table->timestamps(); }); } - if (! Schema::hasTable('gome_long_tariffs')) { + if (!Schema::hasTable('gome_long_tariffs')) { Schema::create('gome_long_tariffs', static function (Blueprint $table) { $table->increments('id'); $table->string('tariff_id')->unique(); diff --git a/src/backend/database/migrations/micropowermanager/2023_09_25_232731_update_assets_asset_people_asset_types_tables.php b/src/backend/database/migrations/micropowermanager/2023_09_25_232731_update_assets_asset_people_asset_types_tables.php index fa4e255bb..c729cdd8b 100644 --- a/src/backend/database/migrations/micropowermanager/2023_09_25_232731_update_assets_asset_people_asset_types_tables.php +++ b/src/backend/database/migrations/micropowermanager/2023_09_25_232731_update_assets_asset_people_asset_types_tables.php @@ -6,7 +6,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * @@ -46,7 +46,7 @@ public function down() $table->renameColumn('price', 'default_price'); $table->integer('default_rate'); }); - if (! Type::hasType('double')) { + if (!Type::hasType('double')) { Type::addType('double', FloatType::class); } Schema::connection('shard')->table('asset_types', function (Blueprint $table) { diff --git a/src/backend/database/migrations/micropowermanager/2023_09_28_130619_update_sms_appliance_remind_rates_table.php b/src/backend/database/migrations/micropowermanager/2023_09_28_130619_update_sms_appliance_remind_rates_table.php index 41c4217a1..6182a8d76 100644 --- a/src/backend/database/migrations/micropowermanager/2023_09_28_130619_update_sms_appliance_remind_rates_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_09_28_130619_update_sms_appliance_remind_rates_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_10_25_074114_update_wavecom_wavemoney_tables.php b/src/backend/database/migrations/micropowermanager/2023_10_25_074114_update_wavecom_wavemoney_tables.php index 07ef68f96..78b331283 100644 --- a/src/backend/database/migrations/micropowermanager/2023_10_25_074114_update_wavecom_wavemoney_tables.php +++ b/src/backend/database/migrations/micropowermanager/2023_10_25_074114_update_wavecom_wavemoney_tables.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_03_112202_create_devices_table.php b/src/backend/database/migrations/micropowermanager/2023_11_03_112202_create_devices_table.php index 8b0b749cb..45ac7b542 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_03_112202_create_devices_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_03_112202_create_devices_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_03_120614_create_solar_home_systems_table.php b/src/backend/database/migrations/micropowermanager/2023_11_03_120614_create_solar_home_systems_table.php index f85c3ac57..bfa0ee70a 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_03_120614_create_solar_home_systems_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_03_120614_create_solar_home_systems_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_03_121740_add_configuration_columns_to_meters_table.php b/src/backend/database/migrations/micropowermanager/2023_11_03_121740_add_configuration_columns_to_meters_table.php index 60f31da52..4bfc16837 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_03_121740_add_configuration_columns_to_meters_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_03_121740_add_configuration_columns_to_meters_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_11_142307_update_action_field_type_logs_table.php b/src/backend/database/migrations/micropowermanager/2023_11_11_142307_update_action_field_type_logs_table.php index f3598f212..2fe634fb0 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_11_142307_update_action_field_type_logs_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_11_142307_update_action_field_type_logs_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_14_160711_drop_geo_id_column_from_address_table.php b/src/backend/database/migrations/micropowermanager/2023_11_14_160711_drop_geo_id_column_from_address_table.php index 6ac069628..c0df218ad 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_14_160711_drop_geo_id_column_from_address_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_14_160711_drop_geo_id_column_from_address_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_16_175649_add_type_column_to_manufacturers_table.php b/src/backend/database/migrations/micropowermanager/2023_11_16_175649_add_type_column_to_manufacturers_table.php index 89a8c0d24..b3cf72cad 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_16_175649_add_type_column_to_manufacturers_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_16_175649_add_type_column_to_manufacturers_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_16_175940_add_asset_id_column_to_solar_home_systems_table.php b/src/backend/database/migrations/micropowermanager/2023_11_16_175940_add_asset_id_column_to_solar_home_systems_table.php index b8adf1020..88cc96d66 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_16_175940_add_asset_id_column_to_solar_home_systems_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_16_175940_add_asset_id_column_to_solar_home_systems_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_16_220432_update_person_id_column_in_devices_table.php b/src/backend/database/migrations/micropowermanager/2023_11_16_220432_update_person_id_column_in_devices_table.php index 3e8423d30..d664a8186 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_16_220432_update_person_id_column_in_devices_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_16_220432_update_person_id_column_in_devices_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_16_220931_update_device_serial_column_in_devices_table.php b/src/backend/database/migrations/micropowermanager/2023_11_16_220931_update_device_serial_column_in_devices_table.php index eca4dbdc2..ae99fec1a 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_16_220931_update_device_serial_column_in_devices_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_16_220931_update_device_serial_column_in_devices_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_16_221111_update_serial_number_column_in_solar_home_systems_table.php b/src/backend/database/migrations/micropowermanager/2023_11_16_221111_update_serial_number_column_in_solar_home_systems_table.php index e4f5bd460..55c5ddce8 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_16_221111_update_serial_number_column_in_solar_home_systems_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_16_221111_update_serial_number_column_in_solar_home_systems_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_17_095204_create_tokens_table.php b/src/backend/database/migrations/micropowermanager/2023_11_17_095204_create_tokens_table.php index ce82cfa03..a96a4b81a 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_17_095204_create_tokens_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_17_095204_create_tokens_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_18_190332_add_device_serial_column_to_asset_people_table.php b/src/backend/database/migrations/micropowermanager/2023_11_18_190332_add_device_serial_column_to_asset_people_table.php index 3b2d1f914..f082d21e1 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_18_190332_add_device_serial_column_to_asset_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_18_190332_add_device_serial_column_to_asset_people_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2023_11_21_090129_update_derice_serial_column_in_asset_people_table.php b/src/backend/database/migrations/micropowermanager/2023_11_21_090129_update_derice_serial_column_in_asset_people_table.php index 989b8618f..dc9926242 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_21_090129_update_derice_serial_column_in_asset_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_21_090129_update_derice_serial_column_in_asset_people_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_01_01_create_daly_bms_tables.php b/src/backend/database/migrations/micropowermanager/2024_01_01_create_daly_bms_tables.php index 6bd81d992..af89ef270 100644 --- a/src/backend/database/migrations/micropowermanager/2024_01_01_create_daly_bms_tables.php +++ b/src/backend/database/migrations/micropowermanager/2024_01_01_create_daly_bms_tables.php @@ -4,10 +4,10 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { public function up() { - if (! Schema::hasTable('daly_bms_api_credentials')) { + if (!Schema::hasTable('daly_bms_api_credentials')) { Schema::create('daly_bms_api_credentials', static function (Blueprint $table) { $table->increments('id'); $table->string('api_url')->default('https://dev.iov18.com/api'); @@ -18,7 +18,7 @@ public function up() $table->timestamps(); }); } - if (! Schema::hasTable('daly_bms_transactions')) { + if (!Schema::hasTable('daly_bms_transactions')) { Schema::create('daly_bms_transactions', static function (Blueprint $table) { $table->increments('id'); $table->timestamps(); diff --git a/src/backend/database/migrations/micropowermanager/2024_01_02_124146_create_e_bikes_table.php b/src/backend/database/migrations/micropowermanager/2024_01_02_124146_create_e_bikes_table.php index 6f8820d3e..c600d582c 100644 --- a/src/backend/database/migrations/micropowermanager/2024_01_02_124146_create_e_bikes_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_01_02_124146_create_e_bikes_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_01_12_create_angaza_tables.php b/src/backend/database/migrations/micropowermanager/2024_01_12_create_angaza_tables.php index e3428cfe2..78200f4b5 100644 --- a/src/backend/database/migrations/micropowermanager/2024_01_12_create_angaza_tables.php +++ b/src/backend/database/migrations/micropowermanager/2024_01_12_create_angaza_tables.php @@ -4,10 +4,10 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { public function up() { - if (! Schema::connection('shard')->hasTable('angaza_api_credentials')) { + if (!Schema::connection('shard')->hasTable('angaza_api_credentials')) { Schema::connection('shard')->create('angaza_api_credentials', static function (Blueprint $table) { $table->increments('id'); $table->string('api_url')->default('https://payg.angazadesign.com/nexus/v1'); @@ -16,7 +16,7 @@ public function up() $table->timestamps(); }); } - if (! Schema::connection('shard')->hasTable('angaza_transactions')) { + if (!Schema::connection('shard')->hasTable('angaza_transactions')) { Schema::connection('shard')->create('angaza_transactions', static function (Blueprint $table) { $table->increments('id'); $table->timestamps(); diff --git a/src/backend/database/migrations/micropowermanager/2024_02_07_102305_add_usage_type_column_to_main_settings_table.php b/src/backend/database/migrations/micropowermanager/2024_02_07_102305_add_usage_type_column_to_main_settings_table.php index c0e1f01bf..d977f2a13 100644 --- a/src/backend/database/migrations/micropowermanager/2024_02_07_102305_add_usage_type_column_to_main_settings_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_02_07_102305_add_usage_type_column_to_main_settings_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_02_07_113710_add_usage_type_column_to_menu_items_table.php b/src/backend/database/migrations/micropowermanager/2024_02_07_113710_add_usage_type_column_to_menu_items_table.php index 23d3993f9..d16cd7fb9 100644 --- a/src/backend/database/migrations/micropowermanager/2024_02_07_113710_add_usage_type_column_to_menu_items_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_02_07_113710_add_usage_type_column_to_menu_items_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_09_30_113302_remove_siderbar_tables.php b/src/backend/database/migrations/micropowermanager/2024_09_30_113302_remove_siderbar_tables.php index c02aecded..3d7fe14f9 100644 --- a/src/backend/database/migrations/micropowermanager/2024_09_30_113302_remove_siderbar_tables.php +++ b/src/backend/database/migrations/micropowermanager/2024_09_30_113302_remove_siderbar_tables.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_23_153042_add_amount_to_agent_charge.php b/src/backend/database/migrations/micropowermanager/2024_10_23_153042_add_amount_to_agent_charge.php index d3b7a9eb6..a0f9ed99e 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_23_153042_add_amount_to_agent_charge.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_23_153042_add_amount_to_agent_charge.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_30_154625_create_notifications_table.php b/src/backend/database/migrations/micropowermanager/2024_10_30_154625_create_notifications_table.php index 448655043..3d6cbf7f8 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_30_154625_create_notifications_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_30_154625_create_notifications_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180458_remove_batteries_table.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180458_remove_batteries_table.php index 81555990f..4da0bd72e 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180458_remove_batteries_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180458_remove_batteries_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180510_remove_energies_table.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180510_remove_energies_table.php index a1bd1f04f..55994d8e8 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180510_remove_energies_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180510_remove_energies_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180524_remove_mini_grid_frequencies_table.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180524_remove_mini_grid_frequencies_table.php index a9a158daf..4a350e0eb 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180524_remove_mini_grid_frequencies_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180524_remove_mini_grid_frequencies_table.php @@ -3,7 +3,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180539_remove_pvs_table.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180539_remove_pvs_table.php index 0957f165e..3b6fb8e94 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180539_remove_pvs_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180539_remove_pvs_table.php @@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180546_remove_solars_table.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180546_remove_solars_table.php index 8c2f0b897..87b6114b5 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180546_remove_solars_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180546_remove_solars_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180605_remove_weather_data_table.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180605_remove_weather_data_table.php index 8e91b068d..35d582874 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180605_remove_weather_data_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180605_remove_weather_data_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180852_remove_agent_tickets.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180852_remove_agent_tickets.php index 1aec28c01..d81b62db0 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180852_remove_agent_tickets.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180852_remove_agent_tickets.php @@ -3,7 +3,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_181016_remove_city_clusters.php b/src/backend/database/migrations/micropowermanager/2024_10_31_181016_remove_city_clusters.php index 86d7d95d8..afc95f4a0 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_181016_remove_city_clusters.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_181016_remove_city_clusters.php @@ -3,7 +3,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/migrations/micropowermanager/2024_11_11_130340_drop_data_stream_column_from_mini_grid.php b/src/backend/database/migrations/micropowermanager/2024_11_11_130340_drop_data_stream_column_from_mini_grid.php index 82d0ae3e9..2f89d59cb 100644 --- a/src/backend/database/migrations/micropowermanager/2024_11_11_130340_drop_data_stream_column_from_mini_grid.php +++ b/src/backend/database/migrations/micropowermanager/2024_11_11_130340_drop_data_stream_column_from_mini_grid.php @@ -4,7 +4,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { /** * Run the migrations. * diff --git a/src/backend/database/seeders/SolarHomeSystemSeeder.php b/src/backend/database/seeders/SolarHomeSystemSeeder.php index feb80b5ac..e9505edd5 100644 --- a/src/backend/database/seeders/SolarHomeSystemSeeder.php +++ b/src/backend/database/seeders/SolarHomeSystemSeeder.php @@ -58,7 +58,7 @@ public function run() ->create(); // Create not-yet-sold SHS such that we can "sell" them in the Demo - for ($i = 1; $i <= 10; $i++) { + for ($i = 1; $i <= 10; ++$i) { $solarHomeSystem = SolarHomeSystem::factory() ->for(Asset::all()->random(), 'appliance') ->for(Manufacturer::where('type', 'shs')->get()->random()) diff --git a/src/backend/packages/inensus/angaza-shs/src/Http/Resources/AngazaResource.php b/src/backend/packages/inensus/angaza-shs/src/Http/Resources/AngazaResource.php index eaf3510c3..4cd7c6ade 100644 --- a/src/backend/packages/inensus/angaza-shs/src/Http/Resources/AngazaResource.php +++ b/src/backend/packages/inensus/angaza-shs/src/Http/Resources/AngazaResource.php @@ -10,7 +10,8 @@ class AngazaResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request + * @param Request $request + * * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/angaza-shs/src/Services/ManufacturerService.php b/src/backend/packages/inensus/angaza-shs/src/Services/ManufacturerService.php index 74299d063..5b6179c7c 100644 --- a/src/backend/packages/inensus/angaza-shs/src/Services/ManufacturerService.php +++ b/src/backend/packages/inensus/angaza-shs/src/Services/ManufacturerService.php @@ -13,7 +13,7 @@ public function __construct(private Manufacturer $manufacturer) public function register() { $api = $this->manufacturer->newQuery()->where('api_name', 'AngazaSHSApi')->first(); - if (! $api) { + if (!$api) { $this->manufacturer->newQuery()->create([ 'name' => 'Angaza SHS', 'type' => 'shs', diff --git a/src/backend/packages/inensus/bulk-registration/database/migrations/create_bulk_registration_tables.php b/src/backend/packages/inensus/bulk-registration/database/migrations/create_bulk_registration_tables.php index 8b077f6f2..987381d2d 100644 --- a/src/backend/packages/inensus/bulk-registration/database/migrations/create_bulk_registration_tables.php +++ b/src/backend/packages/inensus/bulk-registration/database/migrations/create_bulk_registration_tables.php @@ -4,10 +4,10 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class extends Migration { public function up() { - if (! Schema::hasTable('bulk_registration_csv_datas')) { + if (!Schema::hasTable('bulk_registration_csv_datas')) { Schema::create('bulk_registration_csv_datas', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('user_id'); diff --git a/src/backend/packages/inensus/bulk-registration/src/Console/Commands/UpdatePackage.php b/src/backend/packages/inensus/bulk-registration/src/Console/Commands/UpdatePackage.php index 3cabead09..51a1f0db0 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Console/Commands/UpdatePackage.php +++ b/src/backend/packages/inensus/bulk-registration/src/Console/Commands/UpdatePackage.php @@ -59,7 +59,7 @@ private function deleteMigration(Filesystem $filesystem) $migrationFile = $filesystem->glob(database_path().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR.'*_create_bulk-registration_tables.php')[0]; $migration = DB::table('migrations') ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->first(); - if (! $migration) { + if (!$migration) { return false; } diff --git a/src/backend/packages/inensus/bulk-registration/src/Exceptions/Handler.php b/src/backend/packages/inensus/bulk-registration/src/Exceptions/Handler.php index 7cf909713..0e1cf57d0 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Exceptions/Handler.php +++ b/src/backend/packages/inensus/bulk-registration/src/Exceptions/Handler.php @@ -28,7 +28,6 @@ class Handler extends ExceptionHandler /** * Report or log an exception. * - * * @return void * * @throws \Exception @@ -41,7 +40,8 @@ public function report(\Throwable $exception) /** * Render an exception into an HTTP response. * - * @param \Illuminate\Http\Request $request + * @param \Illuminate\Http\Request $request + * * @return \Symfony\Component\HttpFoundation\Response * * @throws \Throwable diff --git a/src/backend/packages/inensus/bulk-registration/src/Helpers/CsvDataProcessor.php b/src/backend/packages/inensus/bulk-registration/src/Helpers/CsvDataProcessor.php index eac212573..cba669c12 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Helpers/CsvDataProcessor.php +++ b/src/backend/packages/inensus/bulk-registration/src/Helpers/CsvDataProcessor.php @@ -111,7 +111,7 @@ private function createRecordFromCsv($row, $serviceName) private function checkRecordWasRecentlyCreated($record, $type) { if ($record->wasRecentlyCreated) { - $this->recentlyCreatedRecords[$type]++; + ++$this->recentlyCreatedRecords[$type]; } } } diff --git a/src/backend/packages/inensus/bulk-registration/src/Services/CityService.php b/src/backend/packages/inensus/bulk-registration/src/Services/CityService.php index f37930099..690d62dea 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Services/CityService.php +++ b/src/backend/packages/inensus/bulk-registration/src/Services/CityService.php @@ -16,12 +16,12 @@ public function resolveCsvDataFromComingRow($csvData) { $cityConfig = config('bulk-registration.csv_fields.city'); - if (! $csvData[$cityConfig['name']]) { + if (!$csvData[$cityConfig['name']]) { throw new VillageNotFoundException('Village Name is required'); } $registeredCity = City::query()->where('name', $csvData[$cityConfig['name']])->first(); - if (! $registeredCity) { + if (!$registeredCity) { $message = 'There is no registered Village for '.$csvData[$cityConfig['name']]. '. Please add the Village first.'; diff --git a/src/backend/packages/inensus/bulk-registration/src/Services/ClusterService.php b/src/backend/packages/inensus/bulk-registration/src/Services/ClusterService.php index deb89dff2..bfde714e2 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Services/ClusterService.php +++ b/src/backend/packages/inensus/bulk-registration/src/Services/ClusterService.php @@ -17,12 +17,12 @@ public function resolveCsvDataFromComingRow($csvData) { $clusterConfig = config('bulk-registration.csv_fields.cluster'); - if (! $csvData[$clusterConfig['name']]) { + if (!$csvData[$clusterConfig['name']]) { throw new ClusterNotFoundException('Cluster Name is required'); } $registeredCluster = Cluster::query()->where('name', $csvData[$clusterConfig['name']])->first(); - if (! $registeredCluster) { + if (!$registeredCluster) { $message = 'There is no cluster registered for '.$csvData[$clusterConfig['name']]. '. Please add the Cluster first.'; diff --git a/src/backend/packages/inensus/bulk-registration/src/Services/ManufacturerService.php b/src/backend/packages/inensus/bulk-registration/src/Services/ManufacturerService.php index 48e557292..697f8e7dd 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Services/ManufacturerService.php +++ b/src/backend/packages/inensus/bulk-registration/src/Services/ManufacturerService.php @@ -26,7 +26,7 @@ public function resolveCsvDataFromComingRow($csvData) { $manufacturerConfig = config('bulk-registration.csv_fields.manufacturer'); - if (! in_array($csvData[$manufacturerConfig['name']], $this->manufacturers)) { + if (!in_array($csvData[$manufacturerConfig['name']], $this->manufacturers)) { $message = 'Manufacturer '.$csvData[$manufacturerConfig['name']]. ' is not supported. Supported manufacturers are '.implode(', ', $this->manufacturers); throw new ManufacturerNotSupportedException($message); diff --git a/src/backend/packages/inensus/bulk-registration/src/Services/MiniGridService.php b/src/backend/packages/inensus/bulk-registration/src/Services/MiniGridService.php index 4120044c2..d6cb31d50 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Services/MiniGridService.php +++ b/src/backend/packages/inensus/bulk-registration/src/Services/MiniGridService.php @@ -16,13 +16,13 @@ public function resolveCsvDataFromComingRow($csvData) { $miniGridConfig = config('bulk-registration.csv_fields.mini_grid'); - if (! $csvData[$miniGridConfig['name']]) { + if (!$csvData[$miniGridConfig['name']]) { throw new MiniGridNotFoundException('Mini Grid Name is required'); } $registeredMiniGrid = MiniGrid::query()->where('name', $csvData[$miniGridConfig['name']])->first(); - if (! $registeredMiniGrid) { + if (!$registeredMiniGrid) { $message = 'There is no registered Mini Grid for '.$csvData[$miniGridConfig['name']]. '. Please add the Mini Grid first.'; throw new MiniGridNotFoundException($message); diff --git a/src/backend/packages/inensus/calin-meter/src/Console/Commands/UpdatePackage.php b/src/backend/packages/inensus/calin-meter/src/Console/Commands/UpdatePackage.php index 093744721..779d89343 100644 --- a/src/backend/packages/inensus/calin-meter/src/Console/Commands/UpdatePackage.php +++ b/src/backend/packages/inensus/calin-meter/src/Console/Commands/UpdatePackage.php @@ -52,7 +52,7 @@ private function deleteMigration(Filesystem $filesystem) $migrationFile = $filesystem->glob(database_path().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR.'*_create_calin_tables.php')[0]; $migration = DB::table('migrations') ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->first(); - if (! $migration) { + if (!$migration) { return false; } diff --git a/src/backend/packages/inensus/calin-meter/src/Helpers/ApiHelpers.php b/src/backend/packages/inensus/calin-meter/src/Helpers/ApiHelpers.php index a9e6724ba..5443a5b77 100644 --- a/src/backend/packages/inensus/calin-meter/src/Helpers/ApiHelpers.php +++ b/src/backend/packages/inensus/calin-meter/src/Helpers/ApiHelpers.php @@ -17,7 +17,7 @@ public function __construct(Manufacturer $manufacturerModel) public function registerCalinMeterManufacturer() { $api = $this->manufacturer->newQuery()->where('api_name', 'CalinMeterApi')->first(); - if (! $api) { + if (!$api) { $this->manufacturer->newQuery()->create([ 'name' => 'Calin Meters', 'website' => 'http://www.calinmeter.com/', diff --git a/src/backend/packages/inensus/calin-meter/src/Http/Resources/CalinResource.php b/src/backend/packages/inensus/calin-meter/src/Http/Resources/CalinResource.php index 34ba97dd2..2c5b6dd4b 100644 --- a/src/backend/packages/inensus/calin-meter/src/Http/Resources/CalinResource.php +++ b/src/backend/packages/inensus/calin-meter/src/Http/Resources/CalinResource.php @@ -10,7 +10,8 @@ class CalinResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request + * @param Request $request + * * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/calin-smart-meter/src/CalinSmartMeterApi.php b/src/backend/packages/inensus/calin-smart-meter/src/CalinSmartMeterApi.php index 7f634a6d5..5940fcd7e 100644 --- a/src/backend/packages/inensus/calin-smart-meter/src/CalinSmartMeterApi.php +++ b/src/backend/packages/inensus/calin-smart-meter/src/CalinSmartMeterApi.php @@ -73,7 +73,7 @@ public function chargeDevice($transactionContainer): array } /** - * @param Meter $meter + * @param Meter $meter * * @throws GuzzleException * diff --git a/src/backend/packages/inensus/calin-smart-meter/src/Console/Commands/UpdatePackage.php b/src/backend/packages/inensus/calin-smart-meter/src/Console/Commands/UpdatePackage.php index 622aa7db7..f5426000e 100644 --- a/src/backend/packages/inensus/calin-smart-meter/src/Console/Commands/UpdatePackage.php +++ b/src/backend/packages/inensus/calin-smart-meter/src/Console/Commands/UpdatePackage.php @@ -50,7 +50,7 @@ private function deleteMigration(Filesystem $filesystem) $migrationFile = $filesystem->glob(database_path().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR.'*_create_calin_smart_tables.php')[0]; $migration = DB::table('migrations') ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->first(); - if (! $migration) { + if (!$migration) { return false; } diff --git a/src/backend/packages/inensus/calin-smart-meter/src/Helpers/ApiHelpers.php b/src/backend/packages/inensus/calin-smart-meter/src/Helpers/ApiHelpers.php index a02660b2e..550b05bbb 100644 --- a/src/backend/packages/inensus/calin-smart-meter/src/Helpers/ApiHelpers.php +++ b/src/backend/packages/inensus/calin-smart-meter/src/Helpers/ApiHelpers.php @@ -17,7 +17,7 @@ public function __construct(Manufacturer $manufacturerModel) public function registerCalinMeterManufacturer() { $api = $this->manufacturer->newQuery()->where('api_name', 'CalinSmartMeterApi')->first(); - if (! $api) { + if (!$api) { $this->manufacturer->newQuery()->create([ 'name' => 'Calin Smart Meters', 'website' => 'https://ami.calinhost.com/', diff --git a/src/backend/packages/inensus/calin-smart-meter/src/Http/Resources/CalinSmartResource.php b/src/backend/packages/inensus/calin-smart-meter/src/Http/Resources/CalinSmartResource.php index 0045cfc2f..0be320896 100644 --- a/src/backend/packages/inensus/calin-smart-meter/src/Http/Resources/CalinSmartResource.php +++ b/src/backend/packages/inensus/calin-smart-meter/src/Http/Resources/CalinSmartResource.php @@ -10,7 +10,8 @@ class CalinSmartResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request + * @param Request $request + * * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/daly-bms/src/Console/Commands/CheckPayments.php b/src/backend/packages/inensus/daly-bms/src/Console/Commands/CheckPayments.php index 4bcc151b8..da62dc0dc 100644 --- a/src/backend/packages/inensus/daly-bms/src/Console/Commands/CheckPayments.php +++ b/src/backend/packages/inensus/daly-bms/src/Console/Commands/CheckPayments.php @@ -37,7 +37,7 @@ public function __construct( public function handle(): void { - if (! $this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { + if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } diff --git a/src/backend/packages/inensus/daly-bms/src/Console/Commands/SyncBikes.php b/src/backend/packages/inensus/daly-bms/src/Console/Commands/SyncBikes.php index 038262e32..d6d82c812 100644 --- a/src/backend/packages/inensus/daly-bms/src/Console/Commands/SyncBikes.php +++ b/src/backend/packages/inensus/daly-bms/src/Console/Commands/SyncBikes.php @@ -31,7 +31,7 @@ public function __construct( public function handle(): void { - if (! $this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { + if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } diff --git a/src/backend/packages/inensus/daly-bms/src/Http/Resources/DalyBmsResource.php b/src/backend/packages/inensus/daly-bms/src/Http/Resources/DalyBmsResource.php index 3894c0ca6..0e7cc1363 100644 --- a/src/backend/packages/inensus/daly-bms/src/Http/Resources/DalyBmsResource.php +++ b/src/backend/packages/inensus/daly-bms/src/Http/Resources/DalyBmsResource.php @@ -10,7 +10,8 @@ class DalyBmsResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request + * @param Request $request + * * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/daly-bms/src/Modules/Api/ApiRequests.php b/src/backend/packages/inensus/daly-bms/src/Modules/Api/ApiRequests.php index c2c4541f8..6b9b21775 100644 --- a/src/backend/packages/inensus/daly-bms/src/Modules/Api/ApiRequests.php +++ b/src/backend/packages/inensus/daly-bms/src/Modules/Api/ApiRequests.php @@ -64,7 +64,7 @@ public function postWithBodyParams(DalyBmsCredential $credentials, array $params $body = json_decode((string) $response->getBody(), true); $status = $body['status']; - if (($status !== 200 && $status !== 201) || (! is_array($body['response']) && $body['response'] === false)) { + if (($status !== 200 && $status !== 201) || (!is_array($body['response']) && $body['response'] === false)) { throw new DalyBmsApiResponseException($body['msg']); } diff --git a/src/backend/packages/inensus/daly-bms/src/Modules/Api/DalyBmsApi.php b/src/backend/packages/inensus/daly-bms/src/Modules/Api/DalyBmsApi.php index fa2fdc775..e5d2417a6 100644 --- a/src/backend/packages/inensus/daly-bms/src/Modules/Api/DalyBmsApi.php +++ b/src/backend/packages/inensus/daly-bms/src/Modules/Api/DalyBmsApi.php @@ -41,7 +41,7 @@ public function getDevices(array $deviceSerials) $credentials = $this->credentialService->getCredentials(); try { - if (! $this->credentialService->isAccessTokenValid($credentials)) { + if (!$this->credentialService->isAccessTokenValid($credentials)) { $authResponse = $this->apiRequests->authentication($credentials); $this->credentialService->updateCredentials($credentials, $authResponse); } @@ -64,7 +64,7 @@ public function getDevice(string $code) $credentials = $this->credentialService->getCredentials(); try { - if (! $this->credentialService->isAccessTokenValid($credentials)) { + if (!$this->credentialService->isAccessTokenValid($credentials)) { $authResponse = $this->apiRequests->authentication($credentials); $this->credentialService->updateCredentials($credentials, $authResponse); } @@ -92,7 +92,7 @@ public function switchDevice(string $code, bool $isOn) $credentials = $this->credentialService->getCredentials(); try { - if (! $this->credentialService->isAccessTokenValid($credentials)) { + if (!$this->credentialService->isAccessTokenValid($credentials)) { $authResponse = $this->apiRequests->authentication($credentials); $this->credentialService->updateCredentials($credentials, $authResponse); } diff --git a/src/backend/packages/inensus/daly-bms/src/Services/ManufacturerService.php b/src/backend/packages/inensus/daly-bms/src/Services/ManufacturerService.php index 14224fba3..f9902e410 100644 --- a/src/backend/packages/inensus/daly-bms/src/Services/ManufacturerService.php +++ b/src/backend/packages/inensus/daly-bms/src/Services/ManufacturerService.php @@ -13,7 +13,7 @@ public function __construct(private Manufacturer $manufacturer) public function register() { $api = $this->manufacturer->newQuery()->where('api_name', 'DalyBmsApi')->first(); - if (! $api) { + if (!$api) { $this->manufacturer->newQuery()->create([ 'name' => 'DalyBms', 'type' => 'e-bike', diff --git a/src/backend/packages/inensus/gome-long-meter/src/Http/Resources/GomeLongResource.php b/src/backend/packages/inensus/gome-long-meter/src/Http/Resources/GomeLongResource.php index 2aa0c3563..2cae87243 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Http/Resources/GomeLongResource.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Http/Resources/GomeLongResource.php @@ -10,7 +10,8 @@ class GomeLongResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request + * @param Request $request + * * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/gome-long-meter/src/Observers/MeterTariffObserver.php b/src/backend/packages/inensus/gome-long-meter/src/Observers/MeterTariffObserver.php index edbe17178..7db874da3 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Observers/MeterTariffObserver.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Observers/MeterTariffObserver.php @@ -21,7 +21,7 @@ public function __construct( public function created(MeterTariff $tariff) { - if (! $this->checkForPluginStatusIsActive(MpmPlugin::GOME_LONG_METERS)) { + if (!$this->checkForPluginStatusIsActive(MpmPlugin::GOME_LONG_METERS)) { return; } $credential = $this->credentialService->getCredentials(); @@ -32,7 +32,7 @@ public function created(MeterTariff $tariff) public function updated(MeterTariff $tariff) { - if (! $this->checkForPluginStatusIsActive(MpmPlugin::GOME_LONG_METERS)) { + if (!$this->checkForPluginStatusIsActive(MpmPlugin::GOME_LONG_METERS)) { return; } $credential = $this->credentialService->getCredentials(); @@ -44,7 +44,7 @@ public function updated(MeterTariff $tariff) public function deleted(MeterTariff $tariff) { - if (! $this->checkForPluginStatusIsActive(MpmPlugin::GOME_LONG_METERS)) { + if (!$this->checkForPluginStatusIsActive(MpmPlugin::GOME_LONG_METERS)) { return; } $credential = $this->credentialService->getCredentials(); diff --git a/src/backend/packages/inensus/gome-long-meter/src/Services/GomeLongTariffService.php b/src/backend/packages/inensus/gome-long-meter/src/Services/GomeLongTariffService.php index 84ba89e35..d9fdc1cff 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Services/GomeLongTariffService.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Services/GomeLongTariffService.php @@ -38,7 +38,7 @@ public function createGomeLongTariff($tariff) { $gomeLongTariff = $this->getByMpmTariffId($tariff->id); - if (! $gomeLongTariff) { + if (!$gomeLongTariff) { $credentials = $this->credentialService->getCredentials(); $vatEnergy = $this->mainSettings->newQuery()->first()->vat_energy; $params = [ @@ -65,7 +65,7 @@ public function updateGomeLongTariff($tariff) try { $gomeLongTariff = $this->getByMpmTariffId($tariff->id); - if (! $gomeLongTariff) { + if (!$gomeLongTariff) { return true; } @@ -122,7 +122,7 @@ public function sync() try { $credentials = $this->credentialService->getCredentials(); - if (! $credentials || ($credentials->getUserId() === null + if (!$credentials || ($credentials->getUserId() === null || $credentials->getUserPassword() === null)) { return true; } diff --git a/src/backend/packages/inensus/gome-long-meter/src/Services/ManufacturerService.php b/src/backend/packages/inensus/gome-long-meter/src/Services/ManufacturerService.php index 1d21f008e..0ee2502ee 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Services/ManufacturerService.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Services/ManufacturerService.php @@ -13,7 +13,7 @@ public function __construct(private Manufacturer $manufacturer) public function register() { $api = $this->manufacturer->newQuery()->where('api_name', 'GomeLongMeterApi')->first(); - if (! $api) { + if (!$api) { $this->manufacturer->newQuery()->create([ 'name' => 'GomeLong Meters', 'website' => 'https://www.gomelongmeter.com/', diff --git a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/AccessTokenRefresher.php b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/AccessTokenRefresher.php index 123a453f7..b69d93720 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/AccessTokenRefresher.php +++ b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/AccessTokenRefresher.php @@ -24,7 +24,7 @@ public function __construct(private KelinCredentialService $credentialService) public function handle(): void { - if (! $this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { + if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } diff --git a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/DataSynchronizer.php b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/DataSynchronizer.php index 637944975..792134e89 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/DataSynchronizer.php +++ b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/DataSynchronizer.php @@ -39,7 +39,7 @@ public function __construct( public function handle(): void { - if (! $this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { + if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } @@ -53,18 +53,18 @@ public function handle(): void try { $this->syncSettingService->getSyncSettings()->each(function ($syncSetting) use ($syncActions) { $syncAction = $syncActions->where('sync_setting_id', $syncSetting->id)->first(); - if (! $syncAction) { + if (!$syncAction) { return true; } if ($syncAction->attempts >= $syncSetting->max_attempts) { $nextSync = Carbon::parse($syncAction->next_sync)->addHours(2); $syncAction->next_sync = $nextSync; $cluster = $this->cluster->newQuery()->with('manager')->first(); - if (! $cluster) { + if (!$cluster) { return true; } $adminAddress = $this->address->whereHasMorph('owner', [$cluster->manager])->first(); - if (! $adminAddress) { + if (!$adminAddress) { return true; } $data = [ diff --git a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/ReadDailyMeterConsumptions.php b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/ReadDailyMeterConsumptions.php index 43055cf97..cec9d61b9 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/ReadDailyMeterConsumptions.php +++ b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/ReadDailyMeterConsumptions.php @@ -27,7 +27,7 @@ public function __construct( public function handle(): void { - if (! $this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { + if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } diff --git a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/ReadMinutelyMeterConsumptions.php b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/ReadMinutelyMeterConsumptions.php index 95e0fbba5..5d8d26f14 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/ReadMinutelyMeterConsumptions.php +++ b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/ReadMinutelyMeterConsumptions.php @@ -27,7 +27,7 @@ public function __construct( public function handle(): void { - if (! $this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { + if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } diff --git a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/UpdatePackage.php b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/UpdatePackage.php index 9dc1c908f..e09c67120 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/UpdatePackage.php +++ b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/UpdatePackage.php @@ -56,7 +56,7 @@ private function deleteMigration(Filesystem $filesystem) $migrationFile = $filesystem->glob(database_path().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR.'*_create_kelin_tables.php')[0]; $migration = DB::table('migrations') ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->first(); - if (! $migration) { + if (!$migration) { return false; } diff --git a/src/backend/packages/inensus/kelin-meter/src/Helpers/ApiHelpers.php b/src/backend/packages/inensus/kelin-meter/src/Helpers/ApiHelpers.php index 8216dbe75..d4e2f4c6e 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Helpers/ApiHelpers.php +++ b/src/backend/packages/inensus/kelin-meter/src/Helpers/ApiHelpers.php @@ -27,7 +27,7 @@ public function registerMeterManufacturer() public function checkApiResult($result) { - if (! $result) { + if (!$result) { throw new KelinApiEmtyDataException('Null result returned.'); } if ($result['status'] == -1) { diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/DailyConsumptionCollection.php b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/DailyConsumptionCollection.php index 1366fec14..e3c9b2908 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/DailyConsumptionCollection.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/DailyConsumptionCollection.php @@ -9,7 +9,8 @@ class DailyConsumptionCollection extends ResourceCollection /** * Transform the resource collection into an array. * - * @param \Illuminate\Http\Request $request + * @param \Illuminate\Http\Request $request + * * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinCustomerCollection.php b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinCustomerCollection.php index 8b9935933..e5d3baeba 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinCustomerCollection.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinCustomerCollection.php @@ -9,7 +9,8 @@ class KelinCustomerCollection extends ResourceCollection /** * Transform the resource collection into an array. * - * @param \Illuminate\Http\Request $request + * @param \Illuminate\Http\Request $request + * * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinMeterCollection.php b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinMeterCollection.php index e6144951f..ad033f477 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinMeterCollection.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinMeterCollection.php @@ -9,7 +9,8 @@ class KelinMeterCollection extends ResourceCollection /** * Transform the resource collection into an array. * - * @param \Illuminate\Http\Request $request + * @param \Illuminate\Http\Request $request + * * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinResource.php b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinResource.php index 013bc8a96..5c5b2694f 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinResource.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinResource.php @@ -10,7 +10,8 @@ class KelinResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request + * @param Request $request + * * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinSettingCollection.php b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinSettingCollection.php index e1bf4d578..560514960 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinSettingCollection.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinSettingCollection.php @@ -9,7 +9,8 @@ class KelinSettingCollection extends ResourceCollection /** * Transform the resource collection into an array. * - * @param \Illuminate\Http\Request $request + * @param \Illuminate\Http\Request $request + * * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/MinutelyConsumptionCollection.php b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/MinutelyConsumptionCollection.php index 243bd67d4..e5f600943 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/MinutelyConsumptionCollection.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/MinutelyConsumptionCollection.php @@ -9,7 +9,8 @@ class MinutelyConsumptionCollection extends ResourceCollection /** * Transform the resource collection into an array. * - * @param \Illuminate\Http\Request $request + * @param \Illuminate\Http\Request $request + * * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/kelin-meter/src/Services/DailyConsumptionService.php b/src/backend/packages/inensus/kelin-meter/src/Services/DailyConsumptionService.php index 508839cef..161c47c70 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Services/DailyConsumptionService.php +++ b/src/backend/packages/inensus/kelin-meter/src/Services/DailyConsumptionService.php @@ -67,7 +67,7 @@ public function getDailyDataFromAPI() 'reverted_reactive_total_daily_power' => $data['dlFw'], ]); }); - $pageNo++; + ++$pageNo; } catch (\Exception $exception) { Log::error('Failed on daily data request .', ['message' => $exception->getMessage()]); $result['dataCount'] = 0; diff --git a/src/backend/packages/inensus/kelin-meter/src/Services/KelinCredentialService.php b/src/backend/packages/inensus/kelin-meter/src/Services/KelinCredentialService.php index d977fe722..b9ab61dfc 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Services/KelinCredentialService.php +++ b/src/backend/packages/inensus/kelin-meter/src/Services/KelinCredentialService.php @@ -80,7 +80,7 @@ public function updateCredentials($data) public function refreshAccessToken() { $credential = $this->getCredentials(); - if (! $credential->username && ! $credential->password) { + if (!$credential->username && !$credential->password) { Log::debug('KelinMeter credentials is not registered yet.'); return; diff --git a/src/backend/packages/inensus/kelin-meter/src/Services/KelinMeterService.php b/src/backend/packages/inensus/kelin-meter/src/Services/KelinMeterService.php index 8ee54263b..5dfaa9725 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Services/KelinMeterService.php +++ b/src/backend/packages/inensus/kelin-meter/src/Services/KelinMeterService.php @@ -267,13 +267,13 @@ public function createRelatedMeter($kelinMeter) $p = $points == null ? ',' : $kelinCustomer->address; $geoLocation->points = $p; $connectionType = $this->connectionType->newQuery()->first(); - if (! $connectionType) { + if (!$connectionType) { $connectionType = $this->connectionType->newQuery()->create([ 'name' => 'default', ]); } $connectionGroup = $this->connectionGroup->newQuery()->first(); - if (! $connectionGroup) { + if (!$connectionGroup) { $connectionGroup = $this->connectionGroup->newQuery()->create([ 'name' => 'default', ]); @@ -340,7 +340,7 @@ public function updateRelatedMeter($kelinMeter, $meter) private function findRegisteredMeter($kelinMeter) { $meter = collect($this->earlyRegisteredMeters)->where('meter_serial', $kelinMeter['meterAddr'])->first(); - if (! $meter) { + if (!$meter) { return $meter; } @@ -365,7 +365,7 @@ private function generateMeterSerialNumberInFormat($meterAddress) { $length = strlen($meterAddress); $newSerial = $meterAddress[0]; - for ($i = 0; $i < $length; $i++) { + for ($i = 0; $i < $length; ++$i) { if ($i != 0) { if ($i % 4 == 0) { $newSerial .= '-'.$meterAddress[$i]; diff --git a/src/backend/packages/inensus/kelin-meter/src/Services/KelinSyncActionService.php b/src/backend/packages/inensus/kelin-meter/src/Services/KelinSyncActionService.php index 67330e3ca..2e192df61 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Services/KelinSyncActionService.php +++ b/src/backend/packages/inensus/kelin-meter/src/Services/KelinSyncActionService.php @@ -32,7 +32,7 @@ public function getActionsNeedsToSync() public function updateSyncAction($syncAction, $syncSetting, $syncResult) { - if (! $syncResult) { + if (!$syncResult) { return $syncAction->update([ 'attempts' => $syncAction->attempts + 1, 'last_sync' => Carbon::now(), diff --git a/src/backend/packages/inensus/kelin-meter/src/Services/KelinSyncSettingService.php b/src/backend/packages/inensus/kelin-meter/src/Services/KelinSyncSettingService.php index e6f09f94f..6cd9b4712 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Services/KelinSyncSettingService.php +++ b/src/backend/packages/inensus/kelin-meter/src/Services/KelinSyncSettingService.php @@ -32,7 +32,7 @@ public function createDefaultSettings() $fiveMinInterval = CarbonInterval::make('5minute'); $syncCustomer = $this->syncSetting->newQuery()->where('action_name', 'Customers')->first(); - if (! $syncCustomer) { + if (!$syncCustomer) { $now = Carbon::now(); $customerSetting = $this->setting->newQuery()->make(); $syncCustomer = $this->syncSetting->newQuery()->create([ @@ -50,7 +50,7 @@ public function createDefaultSettings() } $syncMeter = $this->syncSetting->newQuery()->where('action_name', 'Meters')->first(); - if (! $syncMeter) { + if (!$syncMeter) { $now = Carbon::now(); $meterSetting = $this->setting->newQuery()->make(); $syncMeter = $this->syncSetting->newQuery()->create([ diff --git a/src/backend/packages/inensus/kelin-meter/src/Services/MinutelyConsumptionService.php b/src/backend/packages/inensus/kelin-meter/src/Services/MinutelyConsumptionService.php index af27f2b7c..3473bf500 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Services/MinutelyConsumptionService.php +++ b/src/backend/packages/inensus/kelin-meter/src/Services/MinutelyConsumptionService.php @@ -73,7 +73,7 @@ public function getMinutelyDataFromAPI() 'flow_velocity' => $data['sPEED'], ]); }); - $pageNo++; + ++$pageNo; } catch (\Exception $exception) { Log::error('Failed on minutely data request .', ['message' => $exception->getMessage()]); $result['data']['dataCount'] = 0; diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Console/Commands/UpdatePackage.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Console/Commands/UpdatePackage.php index df729965a..f9d4463b8 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Console/Commands/UpdatePackage.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Console/Commands/UpdatePackage.php @@ -49,7 +49,7 @@ private function deleteMigration(Filesystem $filesystem) $migrationFile = $filesystem->glob(database_path().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR.'*_create_mesomb_payment_provider_tables.php')[0]; $migration = DB::table('migrations') ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->first(); - if (! $migration) { + if (!$migration) { return; } DB::table('migrations') diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Http/Resources/MesombTransactionProcessingResource.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Http/Resources/MesombTransactionProcessingResource.php index 6cb749f26..ad3fa435c 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Http/Resources/MesombTransactionProcessingResource.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Http/Resources/MesombTransactionProcessingResource.php @@ -9,7 +9,8 @@ class MesombTransactionProcessingResource extends JsonResource /** * Transform the resource into an array. * - * @param \Illuminate\Http\Request $request + * @param \Illuminate\Http\Request $request + * * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Services/MesomTransactionService.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Services/MesomTransactionService.php index 7f0297529..baa9227ed 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Services/MesomTransactionService.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Services/MesomTransactionService.php @@ -13,7 +13,7 @@ class MesomTransactionService public function __construct( MesombTransaction $mesombTransaction, - Transaction $transaction + Transaction $transaction, ) { $this->mesombTransaction = $mesombTransaction; $this->transaction = $transaction; diff --git a/src/backend/packages/inensus/micro-star-meter/src/Console/Commands/UpdatePackage.php b/src/backend/packages/inensus/micro-star-meter/src/Console/Commands/UpdatePackage.php index 57b656ec4..0691a891e 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Console/Commands/UpdatePackage.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Console/Commands/UpdatePackage.php @@ -50,7 +50,7 @@ private function deleteMigration(Filesystem $filesystem) .'*_create_micro_star_tables.php')[0]; $migration = DB::table('migrations') ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->first(); - if (! $migration) { + if (!$migration) { return false; } diff --git a/src/backend/packages/inensus/micro-star-meter/src/Http/Resources/MicroStarResource.php b/src/backend/packages/inensus/micro-star-meter/src/Http/Resources/MicroStarResource.php index c6f7202dc..6450670aa 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Http/Resources/MicroStarResource.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Http/Resources/MicroStarResource.php @@ -10,7 +10,8 @@ class MicroStarResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request + * @param Request $request + * * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/micro-star-meter/src/Services/ManufacturerService.php b/src/backend/packages/inensus/micro-star-meter/src/Services/ManufacturerService.php index 8bafd9c23..7915b77aa 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Services/ManufacturerService.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Services/ManufacturerService.php @@ -13,7 +13,7 @@ public function __construct(private Manufacturer $manufacturer) public function register() { $api = $this->manufacturer->newQuery()->where('api_name', 'MicroStarMeterApi')->first(); - if (! $api) { + if (!$api) { $this->manufacturer->newQuery()->create([ 'name' => 'MicroStar Meters', 'website' => 'https://www.microstarelectric.com/', diff --git a/src/backend/packages/inensus/micro-star-meter/src/Services/MicroStarCertificateService.php b/src/backend/packages/inensus/micro-star-meter/src/Services/MicroStarCertificateService.php index e0debd7e0..f25ee9ac5 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Services/MicroStarCertificateService.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Services/MicroStarCertificateService.php @@ -13,7 +13,7 @@ public function upload($request, $credentials) $file = $request->file('cert'); $companyId = app()->make(UserService::class)->getCompanyId(); - if (! File::isDirectory(storage_path("/app/certs/companies/$companyId"))) { + if (!File::isDirectory(storage_path("/app/certs/companies/$companyId"))) { File::makeDirectory(storage_path("/app/certs/companies/$companyId"), 0777, true, true); } @@ -30,7 +30,7 @@ public function upload($request, $credentials) public function getUploadedCertificate($credentials) { - if (! $credentials->certificate_path || ! $credentials->certificate_file_name) { + if (!$credentials->certificate_path || !$credentials->certificate_file_name) { return ''; } diff --git a/src/backend/packages/inensus/spark-meter/src/Console/Commands/InstallSparkMeterPackage.php b/src/backend/packages/inensus/spark-meter/src/Console/Commands/InstallSparkMeterPackage.php index ce840de01..68a533d67 100644 --- a/src/backend/packages/inensus/spark-meter/src/Console/Commands/InstallSparkMeterPackage.php +++ b/src/backend/packages/inensus/spark-meter/src/Console/Commands/InstallSparkMeterPackage.php @@ -45,12 +45,12 @@ public function handle(): void $this->credentialService->createSmCredentials(); $this->info('Package installed successfully..'); $connections = $this->customerService->checkConnectionAvailability(); - if (! $this->siteService->checkLocationAvailability()) { + if (!$this->siteService->checkLocationAvailability()) { $this->warn('------------------------------'); $this->warn('Spark Meter package needs least one registered Cluster.'); $this->warn('If you have no Cluster, please navigate to #Locations# section and register your locations.'); } - if (! $connections['type'] || ! $connections['group']) { + if (!$connections['type'] || !$connections['group']) { $this->warn('------------------------------'); $this->warn('Spark Meter package needs least one Connection Group and one Connection Type.'); $this->warn('Before you get Customers from Spark Meter please check them in #Connection# section.'); diff --git a/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterDataSynchronizer.php b/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterDataSynchronizer.php index a6aeb0015..1bc3bcf7d 100644 --- a/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterDataSynchronizer.php +++ b/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterDataSynchronizer.php @@ -46,7 +46,7 @@ public function __construct( public function handle(): void { - if (! $this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { + if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } @@ -60,7 +60,7 @@ public function handle(): void try { $this->smSyncSettingService->getSyncSettings()->each(function ($syncSetting) use ($syncActions) { $syncAction = $syncActions->where('sync_setting_id', $syncSetting->id)->first(); - if (! $syncAction) { + if (!$syncAction) { return true; } if ($syncAction->attempts >= $syncSetting->max_attempts) { @@ -68,7 +68,7 @@ public function handle(): void $syncAction->next_sync = $nextSync; $syncAction->save(); $cluster = $this->cluster->newQuery()->with('manager')->first(); - if (! $cluster) { + if (!$cluster) { return true; } $adminId = $cluster->manager->id; @@ -80,7 +80,7 @@ function ($q) use ($adminId) { } )->first(); - if (! $adminAddress) { + if (!$adminAddress) { return true; } $data = [ diff --git a/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterSmsNotifier.php b/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterSmsNotifier.php index 31e4d01dc..2185401bd 100644 --- a/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterSmsNotifier.php +++ b/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterSmsNotifier.php @@ -74,11 +74,11 @@ private function sendTransactionNotifySms($transactionMin, $smsNotifiedCustomers return $customer->customer_id == $smTransaction->customer_id; })->first(); - if (! $notifyCustomer) { + if (!$notifyCustomer) { return true; } if ( - ! $notifyCustomer->mpmPerson->addresses + !$notifyCustomer->mpmPerson->addresses || $notifyCustomer->mpmPerson->addresses[0]->phone === null || $notifyCustomer->mpmPerson->addresses[0]->phone === '' ) { @@ -114,7 +114,7 @@ private function sendLowBalanceWarningNotifySms($customers, $smsNotifiedCustomer return true; } if ( - ! $customer->mpmPerson->addresses || $customer->mpmPerson->addresses[0]->phone === null + !$customer->mpmPerson->addresses || $customer->mpmPerson->addresses[0]->phone === null || $customer->mpmPerson->addresses[0]->phone === '' ) { return true; @@ -132,7 +132,7 @@ private function sendLowBalanceWarningNotifySms($customers, $smsNotifiedCustomer public function handle(): void { - if (! $this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { + if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } @@ -145,14 +145,14 @@ public function handle(): void $smsSettings = $this->smsSettingsService->getSmsSettings(); $transactionsSettings = $smsSettings->where('state', 'Transactions')->first(); - if (! $transactionsSettings) { + if (!$transactionsSettings) { throw new CronJobException('Transaction min is not set'); } $transactionMin = $transactionsSettings->not_send_elder_than_mins; $lowBalanceWarningSetting = $smsSettings->where('state', 'Low Balance Warning')->first(); - if (! $lowBalanceWarningSetting) { + if (!$lowBalanceWarningSetting) { throw new CronJobException('Low balance min is not set'); } diff --git a/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterTransactionStatusCheck.php b/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterTransactionStatusCheck.php index 0eaf207f0..ff27950db 100644 --- a/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterTransactionStatusCheck.php +++ b/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterTransactionStatusCheck.php @@ -25,7 +25,7 @@ public function __construct( public function handle(): void { - if (! $this->checkForPluginStatusIsActive(MpmPlugin::SPARK_METER)) { + if (!$this->checkForPluginStatusIsActive(MpmPlugin::SPARK_METER)) { return; } diff --git a/src/backend/packages/inensus/spark-meter/src/Console/Commands/UpdateSparkMeterPackage.php b/src/backend/packages/inensus/spark-meter/src/Console/Commands/UpdateSparkMeterPackage.php index 9a442728a..654c082b8 100644 --- a/src/backend/packages/inensus/spark-meter/src/Console/Commands/UpdateSparkMeterPackage.php +++ b/src/backend/packages/inensus/spark-meter/src/Console/Commands/UpdateSparkMeterPackage.php @@ -74,7 +74,7 @@ private function deleteMigration(Filesystem $filesystem) $migrationFile = $filesystem->glob(database_path().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR.'*_create_spark_tables.php')[0]; $migration = DB::table('migrations') ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->first(); - if (! $migration) { + if (!$migration) { return false; } diff --git a/src/backend/packages/inensus/spark-meter/src/Helpers/InsertSparkMeterApi.php b/src/backend/packages/inensus/spark-meter/src/Helpers/InsertSparkMeterApi.php index a5e6db955..99bd7fd4e 100644 --- a/src/backend/packages/inensus/spark-meter/src/Helpers/InsertSparkMeterApi.php +++ b/src/backend/packages/inensus/spark-meter/src/Helpers/InsertSparkMeterApi.php @@ -17,7 +17,7 @@ public function __construct( public function registerSparkMeterManufacturer() { $api = $this->manufacturer->newQuery()->where('api_name', 'SparkMeterApi')->first(); - if (! $api) { + if (!$api) { $this->manufacturer->newQuery()->create([ 'name' => 'Spark Meters', 'website' => 'https://www.sparkmeter.io/', diff --git a/src/backend/packages/inensus/spark-meter/src/Http/Resources/SparkMeterCredentialResource.php b/src/backend/packages/inensus/spark-meter/src/Http/Resources/SparkMeterCredentialResource.php index acec3b74f..891e090a1 100644 --- a/src/backend/packages/inensus/spark-meter/src/Http/Resources/SparkMeterCredentialResource.php +++ b/src/backend/packages/inensus/spark-meter/src/Http/Resources/SparkMeterCredentialResource.php @@ -16,7 +16,8 @@ public function __construct(SmCredential $smCredential) /** * Transform the resource into an array. * - * @param Request $request + * @param Request $request + * * @return Request */ public function toArray($request) diff --git a/src/backend/packages/inensus/spark-meter/src/Http/Resources/SparkResource.php b/src/backend/packages/inensus/spark-meter/src/Http/Resources/SparkResource.php index 1aeb5b160..d28e1c463 100644 --- a/src/backend/packages/inensus/spark-meter/src/Http/Resources/SparkResource.php +++ b/src/backend/packages/inensus/spark-meter/src/Http/Resources/SparkResource.php @@ -10,7 +10,8 @@ class SparkResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request + * @param Request $request + * * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/spark-meter/src/Listeners/MeterParameterListener.php b/src/backend/packages/inensus/spark-meter/src/Listeners/MeterParameterListener.php index d2e427f0d..600d1ff7a 100644 --- a/src/backend/packages/inensus/spark-meter/src/Listeners/MeterParameterListener.php +++ b/src/backend/packages/inensus/spark-meter/src/Listeners/MeterParameterListener.php @@ -77,7 +77,7 @@ public function onParameterSaved(int $meter_id) $smTariff = $this->smTariff->newQuery()->whereHas('mpmTariff', function ($q) use ($tariffId) { $q->where('mpm_tariff_id', $tariffId); })->first(); - if (! $smTariff) { + if (!$smTariff) { $this->tariffService->createSmTariff($meterInfo->tariff, $smSite->site_id); } if ($meterInfo->owner) { @@ -89,7 +89,7 @@ function ($q) use ($customerId) { $q->where('mpm_customer_id', $customerId); } )->first(); - if (! $smCustomer) { + if (!$smCustomer) { $this->customerService->createCustomer($meterInfo, $smSite->site_id); } } diff --git a/src/backend/packages/inensus/spark-meter/src/Listeners/SmsListener.php b/src/backend/packages/inensus/spark-meter/src/Listeners/SmsListener.php index a6046df5a..7e6b84689 100644 --- a/src/backend/packages/inensus/spark-meter/src/Listeners/SmsListener.php +++ b/src/backend/packages/inensus/spark-meter/src/Listeners/SmsListener.php @@ -36,7 +36,7 @@ public function __construct( public function onSmsStored($sender, $message) { $sparkCustomer = $this->customerService->getSparkCustomerWithPhone($sender); - if (! $sparkCustomer) { + if (!$sparkCustomer) { return; } $smsFeedbackWords = $this->smsFeedbackWordService->getSmsFeedbackWords(); diff --git a/src/backend/packages/inensus/spark-meter/src/Services/CustomerService.php b/src/backend/packages/inensus/spark-meter/src/Services/CustomerService.php index e5e20b6e7..3444d59fe 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/CustomerService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/CustomerService.php @@ -121,7 +121,7 @@ public function createCustomer($meterInfo, $siteId) 'hash' => $smCustomerHash, ]); } - if (! $customerExists) { + if (!$customerExists) { $rootUrl = '/system-info'; $result = $this->sparkMeterApiRequests->get($rootUrl, $siteId); $grid = $result['grids'][0]; diff --git a/src/backend/packages/inensus/spark-meter/src/Services/OrganizationService.php b/src/backend/packages/inensus/spark-meter/src/Services/OrganizationService.php index 821a1a415..8cdaa098c 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/OrganizationService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/OrganizationService.php @@ -22,7 +22,7 @@ public function getOrganizations() public function createOrganization($organizationData) { $organization = $this->organization->newQuery()->first(); - if (! $organization) { + if (!$organization) { return $this->organization->newQuery()->create([ 'organization_id' => $organizationData['id'], 'code' => $organizationData['code'], diff --git a/src/backend/packages/inensus/spark-meter/src/Services/SmSmsSettingService.php b/src/backend/packages/inensus/spark-meter/src/Services/SmSmsSettingService.php index 2e512e137..7d3f76f90 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/SmSmsSettingService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/SmSmsSettingService.php @@ -20,7 +20,7 @@ public function __construct(SmSmsSetting $smsSetting, SmSetting $setting) public function createDefaultSettings() { $smsTransaction = $this->smsSetting->newQuery()->where('state', 'Transactions')->first(); - if (! $smsTransaction) { + if (!$smsTransaction) { $smsSetting = $this->setting->newQuery()->make(); $smsTransaction = $this->smsSetting->newQuery()->create([ 'state' => 'Transactions', @@ -30,7 +30,7 @@ public function createDefaultSettings() $smsSetting->save(); } $smsLowBalanceWarning = $this->smsSetting->newQuery()->where('state', 'Low Balance Warning')->first(); - if (! $smsLowBalanceWarning) { + if (!$smsLowBalanceWarning) { $balanceSetting = $this->setting->newQuery()->make(); $smsLowBalanceWarning = $this->smsSetting->newQuery()->create([ 'state' => 'Low Balance Warning', diff --git a/src/backend/packages/inensus/spark-meter/src/Services/SmSyncActionService.php b/src/backend/packages/inensus/spark-meter/src/Services/SmSyncActionService.php index 37a7a0399..f2de4658a 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/SmSyncActionService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/SmSyncActionService.php @@ -32,7 +32,7 @@ public function getActionsNeedsToSync() public function updateSyncAction($syncAction, $syncSetting, $syncResult) { - if (! $syncResult) { + if (!$syncResult) { return $syncAction->update([ 'attempts' => $syncAction->attempts + 1, 'last_sync' => Carbon::now(), diff --git a/src/backend/packages/inensus/spark-meter/src/Services/SmSyncSettingService.php b/src/backend/packages/inensus/spark-meter/src/Services/SmSyncSettingService.php index 42cae03d1..1e68cdb16 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/SmSyncSettingService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/SmSyncSettingService.php @@ -30,7 +30,7 @@ public function createDefaultSettings() $syncSite = $this->syncSetting->newQuery()->where('action_name', 'Sites')->first(); - if (! $syncSite) { + if (!$syncSite) { $now = Carbon::now(); $siteSetting = $this->setting->newQuery()->make(); $syncSite = $this->syncSetting->newQuery()->create([ @@ -48,7 +48,7 @@ public function createDefaultSettings() } $syncMeterMotel = $this->syncSetting->newQuery()->where('action_name', 'MeterModels')->first(); - if (! $syncMeterMotel) { + if (!$syncMeterMotel) { $now = Carbon::now(); $meterModelSetting = $this->setting->newQuery()->make(); $syncMeterMotel = $this->syncSetting->newQuery()->create([ @@ -66,7 +66,7 @@ public function createDefaultSettings() } $syncTariff = $this->syncSetting->newQuery()->where('action_name', 'Tariffs')->first(); - if (! $syncTariff) { + if (!$syncTariff) { $now = Carbon::now(); $tariffSetting = $this->setting->newQuery()->make(); $syncTariff = $this->syncSetting->newQuery()->create([ @@ -84,7 +84,7 @@ public function createDefaultSettings() } $syncCustomer = $this->syncSetting->newQuery()->where('action_name', 'Customers')->first(); - if (! $syncCustomer) { + if (!$syncCustomer) { $now = Carbon::now(); $customerSetting = $this->setting->newQuery()->make(); $syncCustomer = $this->syncSetting->newQuery()->create([ @@ -102,7 +102,7 @@ public function createDefaultSettings() } $syncTransaction = $this->syncSetting->newQuery()->where('action_name', 'Transactions')->first(); - if (! $syncTransaction) { + if (!$syncTransaction) { $now = Carbon::now(); $transactionSetting = $this->setting->newQuery()->make(); $syncTransaction = $this->syncSetting->newQuery()->create([ @@ -120,7 +120,7 @@ public function createDefaultSettings() } $syncSalesAccount = $this->syncSetting->newQuery()->where('action_name', 'SalesAccounts')->first(); - if (! $syncSalesAccount) { + if (!$syncSalesAccount) { $now = Carbon::now(); $salesAccountSetting = $this->setting->newQuery()->make(); $syncSalesAccount = $this->syncSetting->newQuery()->create([ diff --git a/src/backend/packages/inensus/spark-meter/src/Services/TariffService.php b/src/backend/packages/inensus/spark-meter/src/Services/TariffService.php index 479851ffe..f13f02f73 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/TariffService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/TariffService.php @@ -95,7 +95,7 @@ public function createSmTariff($tariff, $siteId) break; } } - if (! $tariffExists) { + if (!$tariffExists) { $modelTouString = ''; foreach ($tariff->tou as $key => $value) { $modelTouString .= $value->start.$value->end.floatval($value->value); diff --git a/src/backend/packages/inensus/spark-meter/src/Services/TransactionService.php b/src/backend/packages/inensus/spark-meter/src/Services/TransactionService.php index a6524b450..5df1ee641 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/TransactionService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/TransactionService.php @@ -174,7 +174,7 @@ public function sync() 'desc' )->first(); $organization = $this->sparkOrganization->newQuery()->first(); - if (! $organization) { + if (!$organization) { Log::info('Organization not found for Koios API'); return; @@ -208,14 +208,14 @@ public function sync() if ($count === 1) { break; } - if (! count($syncCheck)) { + if (!count($syncCheck)) { break; } collect($transactions)->filter(function ($transaction) { return $transaction['type'] === 'transaction'; })->each(function ($transaction) use ($syncCheck, $sparkCustomers, $sparkTariffs) { $siteTransaction = $syncCheck->firstWhere('site_id', $transaction['site']); - if (! $siteTransaction) { + if (!$siteTransaction) { return true; } switch ($transaction['state']) { @@ -237,12 +237,12 @@ public function sync() $transaction['transaction_id'] )->first(); - if (! $transactionRecord) { - if (! array_key_exists('customer', $transaction['to'])) { + if (!$transactionRecord) { + if (!array_key_exists('customer', $transaction['to'])) { return true; } $sparkTransaction = $this->createSparkTransaction($transaction); - if (! $transaction['reference_id']) { + if (!$transaction['reference_id']) { $thirdPartyTransaction = $this->createThirdPartyTransaction( $transaction, $sparkTransaction, @@ -254,7 +254,7 @@ public function sync() $sparkTransaction->customer_id ); - if (! $sparkCustomer) { + if (!$sparkCustomer) { return true; } $meterParameter = $sparkCustomer->mpmPerson->meters[0]; @@ -316,7 +316,7 @@ public function syncCheck() $credentials = $this->sparkCredentialService->getCredentials(); $sparkSites = $this->sparkSite->newQuery()->where('is_authenticated', 1)->where('is_online', 1)->get(); - if (! $credentials) { + if (!$credentials) { $message = 'No Credentials record found.'; throw new CredentialsNotFoundException($message); } @@ -326,12 +326,12 @@ public function syncCheck() } $siteSynchronized = $this->sparkSiteService->syncCheck(); - if (! $siteSynchronized['result']) { + if (!$siteSynchronized['result']) { $message = 'Site records are not up to date.'; throw new SitesNotUpToDateException($message); } - if (! $sparkSites->count()) { + if (!$sparkSites->count()) { $message = 'No online Site record found.'; throw new NoOnlineSiteRecordException($message); } diff --git a/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsMeterResetFeedbackHeader.php b/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsMeterResetFeedbackHeader.php index 8724b2c94..d683c5b7c 100644 --- a/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsMeterResetFeedbackHeader.php +++ b/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsMeterResetFeedbackHeader.php @@ -18,7 +18,7 @@ public function __construct($data) protected function getVariableValue($variable) { - if (! is_array($this->data)) { + if (!is_array($this->data)) { $person = $this->data->meterParameter->whereHasMorph('owner', [Person::class])->first()->owner()->first(); } else { try { diff --git a/src/backend/packages/inensus/spark-meter/src/Sms/Senders/MeterResetFeedback.php b/src/backend/packages/inensus/spark-meter/src/Sms/Senders/MeterResetFeedback.php index aecf2bad5..1fc1c8e03 100644 --- a/src/backend/packages/inensus/spark-meter/src/Sms/Senders/MeterResetFeedback.php +++ b/src/backend/packages/inensus/spark-meter/src/Sms/Senders/MeterResetFeedback.php @@ -23,7 +23,7 @@ class MeterResetFeedback extends SmsSender public function prepareBody() { - if (! is_array($this->data)) { + if (!is_array($this->data)) { try { $smsBody = $this->smsBodyService->getSmsBodyByReference('SparkSmsMeterResetFeedbackBody'); } catch (ModelNotFoundException $exception) { diff --git a/src/backend/packages/inensus/spark-meter/src/Tests/Unit/SmsNotifyTest.php b/src/backend/packages/inensus/spark-meter/src/Tests/Unit/SmsNotifyTest.php index 518286fe2..81eb04602 100644 --- a/src/backend/packages/inensus/spark-meter/src/Tests/Unit/SmsNotifyTest.php +++ b/src/backend/packages/inensus/spark-meter/src/Tests/Unit/SmsNotifyTest.php @@ -72,7 +72,7 @@ public function isLowBalanceNotifySend() return true; } if ( - ! $customer->mpmPerson->addresses || $customer->mpmPerson->addresses[0]->phone === null + !$customer->mpmPerson->addresses || $customer->mpmPerson->addresses[0]->phone === null || $customer->mpmPerson->addresses[0]->phone === '' ) { return true; @@ -124,11 +124,11 @@ public function isTransactionNotifySend() $notifyCustomer = $customers->filter(function ($customer) use ($sparkTransaction) { return $customer->customer_id == $sparkTransaction->customer_id; })->first(); - if (! $notifyCustomer) { + if (!$notifyCustomer) { return true; } if ( - ! $notifyCustomer->mpmPerson->addresses || $notifyCustomer->mpmPerson->addresses[0]->phone === null + !$notifyCustomer->mpmPerson->addresses || $notifyCustomer->mpmPerson->addresses[0]->phone === null || $notifyCustomer->mpmPerson->addresses[0]->phone === '' ) { return true; @@ -160,7 +160,7 @@ public function isMaxAttemptNotifySend() SmSyncSetting::query()->get()->each(function ($syncSetting) use ($syncActions) { $syncAction = $syncActions->where('sync_setting_id', $syncSetting->id)->first(); - if (! $syncAction) { + if (!$syncAction) { return true; } if ($syncAction->attempts >= $syncSetting->max_attempts) { @@ -170,7 +170,7 @@ public function isMaxAttemptNotifySend() 'owner', [User::class] )->first(); - if (! $adminAddress) { + if (!$adminAddress) { return true; } $data = [ diff --git a/src/backend/packages/inensus/steama-meter/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/steama-meter/src/Console/Commands/InstallPackage.php index 707cd7ced..3d993784f 100644 --- a/src/backend/packages/inensus/steama-meter/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/steama-meter/src/Console/Commands/InstallPackage.php @@ -59,7 +59,7 @@ public function handle(): void // $this->call('routes:generate'); // $this->call('sidebar:generate'); // $this->info('Package installed successfully..'); - if (! $this->siteService->checkLocationAvailability()) { + if (!$this->siteService->checkLocationAvailability()) { $this->warn('------------------------------'); $this->warn('Steamaco Meter package needs least one registered Cluster.'); $this->warn('If you have no Cluster, please navigate to #Locations# section and register your locations.'); diff --git a/src/backend/packages/inensus/steama-meter/src/Console/Commands/ReadHourlyMeterReadings.php b/src/backend/packages/inensus/steama-meter/src/Console/Commands/ReadHourlyMeterReadings.php index 3a644d039..4d4d6a366 100644 --- a/src/backend/packages/inensus/steama-meter/src/Console/Commands/ReadHourlyMeterReadings.php +++ b/src/backend/packages/inensus/steama-meter/src/Console/Commands/ReadHourlyMeterReadings.php @@ -24,7 +24,7 @@ public function __construct(private SteamaMeterReadingService $steamaMeterReadin public function handle(): void { - if (! $this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { + if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } diff --git a/src/backend/packages/inensus/steama-meter/src/Console/Commands/SteamaMeterDataSynchronizer.php b/src/backend/packages/inensus/steama-meter/src/Console/Commands/SteamaMeterDataSynchronizer.php index a7977a769..fd1eace4e 100644 --- a/src/backend/packages/inensus/steama-meter/src/Console/Commands/SteamaMeterDataSynchronizer.php +++ b/src/backend/packages/inensus/steama-meter/src/Console/Commands/SteamaMeterDataSynchronizer.php @@ -73,7 +73,7 @@ public function __construct( public function handle(): void { - if (! $this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { + if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } @@ -87,7 +87,7 @@ public function handle(): void try { $this->steamaSyncSettingservice->getSyncSettings()->each(function ($syncSetting) use ($syncActions) { $syncAction = $syncActions->where('sync_setting_id', $syncSetting->id)->first(); - if (! $syncAction) { + if (!$syncAction) { return true; } if ($syncAction->attempts >= $syncSetting->max_attempts) { @@ -95,7 +95,7 @@ public function handle(): void $syncAction->next_sync = $nextSync; $syncAction->save(); $cluster = $this->cluster->newQuery()->with('manager')->first(); - if (! $cluster) { + if (!$cluster) { return true; } $adminId = $cluster->manager->id; @@ -106,7 +106,7 @@ function ($q) use ($adminId) { $q->where('id', $adminId); } )->first(); - if (! $adminAddress) { + if (!$adminAddress) { return true; } $data = [ diff --git a/src/backend/packages/inensus/steama-meter/src/Console/Commands/SteamaSmsNotifier.php b/src/backend/packages/inensus/steama-meter/src/Console/Commands/SteamaSmsNotifier.php index 8a32c85a3..e615ddf9d 100644 --- a/src/backend/packages/inensus/steama-meter/src/Console/Commands/SteamaSmsNotifier.php +++ b/src/backend/packages/inensus/steama-meter/src/Console/Commands/SteamaSmsNotifier.php @@ -71,12 +71,12 @@ private function sendTransactionNotifySms($transactionMin, $smsNotifiedCustomers return $customer->customer_id == $steamaTransaction->customer_id; })->first(); - if (! $notifyCustomer) { + if (!$notifyCustomer) { return true; } if ( - ! $notifyCustomer->mpmPerson->addresses + !$notifyCustomer->mpmPerson->addresses || $notifyCustomer->mpmPerson->addresses[0]->phone === null || $notifyCustomer->mpmPerson->addresses[0]->phone === '' ) { @@ -113,7 +113,7 @@ private function sendLowBalanceWarningNotifySms($customers, $smsNotifiedCustomer return true; } if ( - ! $customer->mpmPerson->addresses || $customer->mpmPerson->addresses[0]->phone === null + !$customer->mpmPerson->addresses || $customer->mpmPerson->addresses[0]->phone === null || $customer->mpmPerson->addresses[0]->phone === '' ) { return true; @@ -132,7 +132,7 @@ private function sendLowBalanceWarningNotifySms($customers, $smsNotifiedCustomer public function handle(): void { - if (! $this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { + if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } diff --git a/src/backend/packages/inensus/steama-meter/src/Console/Commands/UpdatePackage.php b/src/backend/packages/inensus/steama-meter/src/Console/Commands/UpdatePackage.php index d06626907..f9fa8a7d5 100644 --- a/src/backend/packages/inensus/steama-meter/src/Console/Commands/UpdatePackage.php +++ b/src/backend/packages/inensus/steama-meter/src/Console/Commands/UpdatePackage.php @@ -76,7 +76,7 @@ private function deleteMigration(Filesystem $filesystem) $migrationFile = $filesystem->glob(database_path().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR.'*_create_steama_tables.php')[0]; $migration = DB::table('migrations') ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->first(); - if (! $migration) { + if (!$migration) { return false; } diff --git a/src/backend/packages/inensus/steama-meter/src/Helpers/ApiHelpers.php b/src/backend/packages/inensus/steama-meter/src/Helpers/ApiHelpers.php index 442e20fea..82fdd6d3d 100644 --- a/src/backend/packages/inensus/steama-meter/src/Helpers/ApiHelpers.php +++ b/src/backend/packages/inensus/steama-meter/src/Helpers/ApiHelpers.php @@ -17,7 +17,7 @@ public function __construct(Manufacturer $manufacturerModel) public function registerSparkMeterManufacturer() { $api = $this->manufacturer->newQuery()->where('api_name', 'SteamaMeterApi')->first(); - if (! $api) { + if (!$api) { $this->manufacturer->newQuery()->create([ 'name' => 'Steama Meters', 'website' => 'https://steama.co/', diff --git a/src/backend/packages/inensus/steama-meter/src/Http/Resources/SteamaCredentialResource.php b/src/backend/packages/inensus/steama-meter/src/Http/Resources/SteamaCredentialResource.php index 4d8f690c2..ad7259755 100644 --- a/src/backend/packages/inensus/steama-meter/src/Http/Resources/SteamaCredentialResource.php +++ b/src/backend/packages/inensus/steama-meter/src/Http/Resources/SteamaCredentialResource.php @@ -16,7 +16,8 @@ public function __construct(SteamaCredential $steamaCredential) /** * Transform the resource into an array. * - * @param Request $request + * @param Request $request + * * @return Request */ public function toArray($request) diff --git a/src/backend/packages/inensus/steama-meter/src/Http/Resources/SteamaResource.php b/src/backend/packages/inensus/steama-meter/src/Http/Resources/SteamaResource.php index 523c789e7..84df4c453 100644 --- a/src/backend/packages/inensus/steama-meter/src/Http/Resources/SteamaResource.php +++ b/src/backend/packages/inensus/steama-meter/src/Http/Resources/SteamaResource.php @@ -10,7 +10,8 @@ class SteamaResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request + * @param Request $request + * * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/steama-meter/src/Listeners/MeterParameterListener.php b/src/backend/packages/inensus/steama-meter/src/Listeners/MeterParameterListener.php index 60aad5c29..f97c93754 100644 --- a/src/backend/packages/inensus/steama-meter/src/Listeners/MeterParameterListener.php +++ b/src/backend/packages/inensus/steama-meter/src/Listeners/MeterParameterListener.php @@ -62,7 +62,7 @@ public function onParameterSaved(int $meterId) $steamaTariff = $this->stmTariff->newQuery()->whereHas('mpmTariff', function ($q) use ($tariffId) { $q->where('mpm_tariff_id', $tariffId); })->first(); - if (! $steamaTariff) { + if (!$steamaTariff) { $steamaTariff = $this->stmTariff->newQuery()->with('mpmTariff')->first(); $meterInfo->tariff_id = $steamaTariff->mpmTariff->id; $meterInfo->update(); @@ -74,13 +74,13 @@ public function onParameterSaved(int $meterId) ->whereHas('mpmPerson', function ($q) use ($customerId) { $q->where('id', $customerId); })->first(); - if (! $steamaCustomer) { + if (!$steamaCustomer) { $steamaCustomer = $this->stmCustomerService->createSteamaCustomer($meterInfo); } $steamaMeter = $this->stmMeter->newQuery()->whereHas('mpmMeter', function ($q) use ($meterId) { $q->where('id', $meterId); })->first(); - if (! $steamaMeter) { + if (!$steamaMeter) { $this->stmMeterService->creteSteamaMeter($meterInfo, $steamaCustomer); } $steamaMeter->customer_id = $steamaCustomer->customer_id; diff --git a/src/backend/packages/inensus/steama-meter/src/Listeners/SmsListener.php b/src/backend/packages/inensus/steama-meter/src/Listeners/SmsListener.php index bedc8286c..06b72534e 100644 --- a/src/backend/packages/inensus/steama-meter/src/Listeners/SmsListener.php +++ b/src/backend/packages/inensus/steama-meter/src/Listeners/SmsListener.php @@ -35,7 +35,7 @@ public function __construct( public function onSmsStored($sender, $message) { $steamaCustomer = $this->customerService->getSteamaCustomerWithPhone($sender); - if (! $steamaCustomer) { + if (!$steamaCustomer) { return; } $smsFeedbackWords = $this->smsFeedbackWordService->getSmsFeedbackWords(); diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaAgentService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaAgentService.php index 7794c8b80..6d3d4db44 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaAgentService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaAgentService.php @@ -86,7 +86,7 @@ public function getAgentsCount() public function createSteamaAgentCommission() { $agentCommission = $this->agentCommission->newQuery()->where('name', 'Steama Agent Comission')->first(); - if (! $agentCommission) { + if (!$agentCommission) { $agentCommission = $this->agentCommission->newQuery()->create([ 'name' => 'Steama Agent Comission', 'energy_commission' => 0, diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaMeterService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaMeterService.php index 9aef3289e..13e2d1e2c 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaMeterService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaMeterService.php @@ -197,7 +197,7 @@ public function createRelatedMeter($stmMeter) $connectionType = $stmCustomer->userType->mpmConnectionType; $connectionGroup = $this->connectionGroup->newQuery()->first(); - if (! $connectionGroup) { + if (!$connectionGroup) { $connectionGroup = $this->connectionGroup->newQuery()->create([ 'name' => 'default', ]); diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSiteLevelPaymentPlanTypeService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSiteLevelPaymentPlanTypeService.php index 8458dcd00..b93ee0489 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSiteLevelPaymentPlanTypeService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSiteLevelPaymentPlanTypeService.php @@ -26,7 +26,7 @@ public function createPaymentPlans() ]; foreach ($paymentPlans as $value) { $paymentPlanType = $this->paymentPlanType->newQuery()->where('name', $value)->first(); - if (! $paymentPlanType) { + if (!$paymentPlanType) { $this->paymentPlanType->newQuery()->create([ 'name' => $value, ]); diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSmsSettingService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSmsSettingService.php index 9a863585c..4ea598e94 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSmsSettingService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSmsSettingService.php @@ -20,7 +20,7 @@ public function __construct(SteamaSmsSetting $smsSetting, SteamaSetting $setting public function createDefaultSettings() { $smsTransaction = $this->smsSetting->newQuery()->where('state', 'Transactions')->first(); - if (! $smsTransaction) { + if (!$smsTransaction) { $smsSetting = $this->setting->newQuery()->make(); $smsTransaction = $this->smsSetting->newQuery()->create([ 'state' => 'Transactions', @@ -30,7 +30,7 @@ public function createDefaultSettings() $smsSetting->save(); } $smsLowBalanceWarning = $this->smsSetting->newQuery()->where('state', 'Low Balance Warning')->first(); - if (! $smsLowBalanceWarning) { + if (!$smsLowBalanceWarning) { $balanceSetting = $this->setting->newQuery()->make(); $smsLowBalanceWarning = $this->smsSetting->newQuery()->create([ 'state' => 'Low Balance Warning', diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSyncSettingService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSyncSettingService.php index 0c056270a..ee626ffc6 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSyncSettingService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSyncSettingService.php @@ -33,7 +33,7 @@ public function createDefaultSettings() $syncSite = $this->syncSetting->newQuery()->where('action_name', 'Sites')->first(); - if (! $syncSite) { + if (!$syncSite) { $now = Carbon::now(); $siteSetting = $this->setting->newQuery()->make(); $syncSite = $this->syncSetting->newQuery()->create([ @@ -51,7 +51,7 @@ public function createDefaultSettings() } $syncCustomer = $this->syncSetting->newQuery()->where('action_name', 'Customers')->first(); - if (! $syncCustomer) { + if (!$syncCustomer) { $now = Carbon::now(); $customerSetting = $this->setting->newQuery()->make(); $syncCustomer = $this->syncSetting->newQuery()->create([ @@ -69,7 +69,7 @@ public function createDefaultSettings() } $syncMeter = $this->syncSetting->newQuery()->where('action_name', 'Meters')->first(); - if (! $syncMeter) { + if (!$syncMeter) { $now = Carbon::now(); $meterSetting = $this->setting->newQuery()->make(); $syncMeter = $this->syncSetting->newQuery()->create([ @@ -87,7 +87,7 @@ public function createDefaultSettings() } $syncAgent = $this->syncSetting->newQuery()->where('action_name', 'Agents')->first(); - if (! $syncAgent) { + if (!$syncAgent) { $now = Carbon::now(); $agentSetting = $this->setting->newQuery()->make(); $syncAgent = $this->syncSetting->newQuery()->create([ @@ -105,7 +105,7 @@ public function createDefaultSettings() } $syncTransaction = $this->syncSetting->newQuery()->where('action_name', 'Transactions')->first(); - if (! $syncTransaction) { + if (!$syncTransaction) { $now = Carbon::now(); $transactionSetting = $this->setting->newQuery()->make(); $syncTransaction = $this->syncSetting->newQuery()->create([ diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaTariffService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaTariffService.php index fb2781dea..e0341571f 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaTariffService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaTariffService.php @@ -17,7 +17,7 @@ public function __construct(private readonly SteamaTariff $tariff, private reado public function createTariff() { $meterTariff = $this->meterTariff->newQuery()->where('name', 'Steama External Tariff')->first(); - if (! $meterTariff) { + if (!$meterTariff) { $meterTariff = $this->meterTariff->newQuery()->create([ 'name' => 'Steama External Tariff', 'price' => 0, diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaUserTypeService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaUserTypeService.php index 5d1fad63f..342b52736 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaUserTypeService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaUserTypeService.php @@ -38,14 +38,14 @@ public function createUserTypes($tariff) foreach ($connectionTypes as $key => $value) { $connectionType = $this->connectionType->newQuery()->where('name', $value)->first(); - if (! $connectionType) { + if (!$connectionType) { $connectionType = $this->connectionType->newQuery()->create([ 'name' => $value, ]); } $userType = $this->userType->newQuery()->where('name', $value)->first(); - if (! $userType) { + if (!$userType) { $this->userType->newQuery()->create([ 'mpm_connection_type_id' => $connectionType->id, 'name' => $value, @@ -54,7 +54,7 @@ public function createUserTypes($tariff) } $subConnectionType = $this->subConnectionType->newQuery()->where('name', $value)->first(); - if (! $subConnectionType) { + if (!$subConnectionType) { $this->subConnectionType->newQuery()->create([ 'name' => $value, 'connection_type_id' => $connectionType->id, diff --git a/src/backend/packages/inensus/steama-meter/src/Services/StemaSyncActionService.php b/src/backend/packages/inensus/steama-meter/src/Services/StemaSyncActionService.php index f409f80fa..f298b6146 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/StemaSyncActionService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/StemaSyncActionService.php @@ -32,7 +32,7 @@ public function getActionsNeedsToSync() public function updateSyncAction($syncAction, $syncSetting, $syncResult) { - if (! $syncResult) { + if (!$syncResult) { return $syncAction->update([ 'attempts' => $syncAction->attempts + 1, 'last_sync' => Carbon::now(), diff --git a/src/backend/packages/inensus/steama-meter/src/Tests/Unit/SmsNotifyTest.php b/src/backend/packages/inensus/steama-meter/src/Tests/Unit/SmsNotifyTest.php index 63dc36fc8..04413f28d 100644 --- a/src/backend/packages/inensus/steama-meter/src/Tests/Unit/SmsNotifyTest.php +++ b/src/backend/packages/inensus/steama-meter/src/Tests/Unit/SmsNotifyTest.php @@ -73,7 +73,7 @@ public function isLowBalanceNotifySend() return true; } if ( - ! $customer->mpmPerson->addresses || $customer->mpmPerson->addresses[0]->phone === null + !$customer->mpmPerson->addresses || $customer->mpmPerson->addresses[0]->phone === null || $customer->mpmPerson->addresses[0]->phone === '' ) { return true; @@ -125,11 +125,11 @@ public function isTransactionNotifySend() $notifyCustomer = $customers->filter(function ($customer) use ($steamaTransaction) { return $customer->customer_id == $steamaTransaction->customer_id; })->first(); - if (! $notifyCustomer) { + if (!$notifyCustomer) { return true; } if ( - ! $notifyCustomer->mpmPerson->addresses || $notifyCustomer->mpmPerson->addresses[0]->phone === null + !$notifyCustomer->mpmPerson->addresses || $notifyCustomer->mpmPerson->addresses[0]->phone === null || $notifyCustomer->mpmPerson->addresses[0]->phone === '' ) { return true; @@ -160,7 +160,7 @@ public function isMaxAttemptNotifySend() SteamaSyncSetting::query()->get()->each(function ($syncSetting) use ($syncActions, $newNextSync) { $syncAction = $syncActions->where('sync_setting_id', $syncSetting->id)->first(); - if (! $syncAction) { + if (!$syncAction) { return true; } if ($syncAction->attempts >= $syncSetting->max_attempts) { @@ -171,7 +171,7 @@ public function isMaxAttemptNotifySend() 'owner', [User::class] )->first(); - if (! $adminAddress) { + if (!$adminAddress) { return true; } $data = [ diff --git a/src/backend/packages/inensus/stron-meter/src/Console/Commands/UpdatePackage.php b/src/backend/packages/inensus/stron-meter/src/Console/Commands/UpdatePackage.php index 678cd37fe..ba3b5018c 100644 --- a/src/backend/packages/inensus/stron-meter/src/Console/Commands/UpdatePackage.php +++ b/src/backend/packages/inensus/stron-meter/src/Console/Commands/UpdatePackage.php @@ -50,7 +50,7 @@ private function deleteMigration(Filesystem $filesystem) $migrationFile = $filesystem->glob(database_path().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR.'*_create_calin_smart_tables.php')[0]; $migration = DB::table('migrations') ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->first(); - if (! $migration) { + if (!$migration) { return false; } diff --git a/src/backend/packages/inensus/stron-meter/src/Helpers/ApiHelpers.php b/src/backend/packages/inensus/stron-meter/src/Helpers/ApiHelpers.php index 466c78210..8592ca5db 100644 --- a/src/backend/packages/inensus/stron-meter/src/Helpers/ApiHelpers.php +++ b/src/backend/packages/inensus/stron-meter/src/Helpers/ApiHelpers.php @@ -17,7 +17,7 @@ public function __construct(Manufacturer $manufacturerModel) public function registerStronMeterManufacturer() { $api = $this->manufacturer->newQuery()->where('api_name', 'StronMeterApi')->first(); - if (! $api) { + if (!$api) { $this->manufacturer->newQuery()->create([ 'name' => 'Stron Meters', 'website' => 'http://www.stronsmart.com/', diff --git a/src/backend/packages/inensus/stron-meter/src/Http/Resources/StronCredentialResource.php b/src/backend/packages/inensus/stron-meter/src/Http/Resources/StronCredentialResource.php index cbb1a6911..9dcee0599 100644 --- a/src/backend/packages/inensus/stron-meter/src/Http/Resources/StronCredentialResource.php +++ b/src/backend/packages/inensus/stron-meter/src/Http/Resources/StronCredentialResource.php @@ -16,7 +16,8 @@ public function __construct(StronCredential $stronCredential) /** * Transform the resource into an array. * - * @param Request $request + * @param Request $request + * * @return Request */ public function toArray($request) diff --git a/src/backend/packages/inensus/stron-meter/src/Http/Resources/StronResource.php b/src/backend/packages/inensus/stron-meter/src/Http/Resources/StronResource.php index 132b88a68..ccacc4bc8 100644 --- a/src/backend/packages/inensus/stron-meter/src/Http/Resources/StronResource.php +++ b/src/backend/packages/inensus/stron-meter/src/Http/Resources/StronResource.php @@ -10,7 +10,8 @@ class StronResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request + * @param Request $request + * * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/sun-king-shs/src/Http/Resources/SunKingResource.php b/src/backend/packages/inensus/sun-king-shs/src/Http/Resources/SunKingResource.php index a5360b8bf..e7a541476 100644 --- a/src/backend/packages/inensus/sun-king-shs/src/Http/Resources/SunKingResource.php +++ b/src/backend/packages/inensus/sun-king-shs/src/Http/Resources/SunKingResource.php @@ -10,7 +10,8 @@ class SunKingResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request + * @param Request $request + * * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/sun-king-shs/src/Services/ManufacturerService.php b/src/backend/packages/inensus/sun-king-shs/src/Services/ManufacturerService.php index 0568b8944..0948e4470 100644 --- a/src/backend/packages/inensus/sun-king-shs/src/Services/ManufacturerService.php +++ b/src/backend/packages/inensus/sun-king-shs/src/Services/ManufacturerService.php @@ -13,7 +13,7 @@ public function __construct(private Manufacturer $manufacturer) public function register() { $api = $this->manufacturer->newQuery()->where('api_name', 'SunKingSHSApi')->first(); - if (! $api) { + if (!$api) { $this->manufacturer->newQuery()->create([ 'name' => 'SunKing SHS', 'type' => 'shs', diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/InstallPackage.php index 4d10d5c9b..599cae7df 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/InstallPackage.php @@ -103,7 +103,7 @@ private function generateRandomNumber(): string { $length = random_int(1, 10); $number = ''; - for ($i = 0; $i < $length; $i++) { + for ($i = 0; $i < $length; ++$i) { $number .= random_int(0, 9); } $number = ltrim($number, '0'); diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/TransactionStatusChecker.php b/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/TransactionStatusChecker.php index 84dab3d47..ea8f82ec2 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/TransactionStatusChecker.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/TransactionStatusChecker.php @@ -24,7 +24,7 @@ public function __construct(private SwiftaTransactionService $swiftaTransactionS public function handle(): void { - if (! $this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { + if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/UpdatePackage.php b/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/UpdatePackage.php index e8a1b6b2e..665bb0496 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/UpdatePackage.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/UpdatePackage.php @@ -67,7 +67,7 @@ private function deleteMigration(Filesystem $filesystem) $migrationFile = $filesystem->glob(database_path().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR.'*_create_swifta_payment_provider_tables.php')[0]; $migration = DB::table('migrations') ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->first(); - if (! $migration) { + if (!$migration) { return; } DB::table('migrations') @@ -116,7 +116,7 @@ private function generateRandomNumber(): string { $length = random_int(1, 10); $number = ''; - for ($i = 0; $i < $length; $i++) { + for ($i = 0; $i < $length; ++$i) { $number .= random_int(0, 9); } $number = ltrim($number, '0'); diff --git a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketExportController.php b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketExportController.php index b0ab396bf..3736287c9 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketExportController.php +++ b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketExportController.php @@ -29,8 +29,6 @@ public function index(Request $request): TicketResource /** * Generates a book keeping file and stores it. * - * - * * @throws \PhpOffice\PhpSpreadsheet\Exception */ public function outsource(Request $request): TicketResource diff --git a/src/backend/packages/inensus/ticket/src/Http/Controllers/WatcherController.php b/src/backend/packages/inensus/ticket/src/Http/Controllers/WatcherController.php index 7532d8230..47818725c 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Controllers/WatcherController.php +++ b/src/backend/packages/inensus/ticket/src/Http/Controllers/WatcherController.php @@ -48,7 +48,7 @@ public function store(): void $action = $content['action']; $actionType = $action['type']; - if (! $this->filterRequest($actionType)) { // there is no interest for that action + if (!$this->filterRequest($actionType)) { // there is no interest for that action Log::debug('action is not interesting'); return; @@ -60,7 +60,7 @@ public function store(): void /** * Checks if the request type is interesting or not. * - * @param string $type the request type + * @param string $type the request type */ private function filterRequest($type): bool { @@ -71,8 +71,6 @@ private function filterRequest($type): bool * Tries to match the given ticket id with an entry in the database * it should prevent, that any new ticket created directly in Trello. * - * - * * @throws ModelNotFoundException */ private function ticketMatcher(string $ticketId): Ticket diff --git a/src/backend/packages/inensus/ticket/src/Http/Resources/TicketResource.php b/src/backend/packages/inensus/ticket/src/Http/Resources/TicketResource.php index e2d7878be..024d08f73 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Resources/TicketResource.php +++ b/src/backend/packages/inensus/ticket/src/Http/Resources/TicketResource.php @@ -10,7 +10,8 @@ class TicketResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request + * @param Request $request + * * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/ticket/src/Models/TicketOutsourceReport.php b/src/backend/packages/inensus/ticket/src/Models/TicketOutsourceReport.php index bab763f8a..18f04c596 100644 --- a/src/backend/packages/inensus/ticket/src/Models/TicketOutsourceReport.php +++ b/src/backend/packages/inensus/ticket/src/Models/TicketOutsourceReport.php @@ -5,7 +5,7 @@ /** * Class OutsourceReport. * - * @property int $id + * @property int $id * @property string $date * @property string $path */ diff --git a/src/backend/packages/inensus/ticket/src/Models/TicketUser.php b/src/backend/packages/inensus/ticket/src/Models/TicketUser.php index 956e5d649..01e1f4dd1 100644 --- a/src/backend/packages/inensus/ticket/src/Models/TicketUser.php +++ b/src/backend/packages/inensus/ticket/src/Models/TicketUser.php @@ -7,8 +7,8 @@ * * @property string $user_name * @property string $user_tag - * @property int $out_source - * @property int $id + * @property int $out_source + * @property int $id */ class TicketUser extends BaseModel { diff --git a/src/backend/packages/inensus/ticket/src/Providers/TicketServiceProvider.php b/src/backend/packages/inensus/ticket/src/Providers/TicketServiceProvider.php index e357cc666..f2fbd7e73 100644 --- a/src/backend/packages/inensus/ticket/src/Providers/TicketServiceProvider.php +++ b/src/backend/packages/inensus/ticket/src/Providers/TicketServiceProvider.php @@ -32,7 +32,7 @@ public function publishConfigFiles() public function publishMigrations() { - if (! class_exists('CreateTicketingTables')) { + if (!class_exists('CreateTicketingTables')) { $timestamp = date('Y_m_d_His', time()); $this->publishes([ diff --git a/src/backend/packages/inensus/ticket/src/Services/TicketCommentService.php b/src/backend/packages/inensus/ticket/src/Services/TicketCommentService.php index 0326c4ff1..c657b3d02 100644 --- a/src/backend/packages/inensus/ticket/src/Services/TicketCommentService.php +++ b/src/backend/packages/inensus/ticket/src/Services/TicketCommentService.php @@ -10,7 +10,7 @@ class TicketCommentService public function __construct( private Person $person, private TicketComment $ticketComment, - private TicketUserService $ticketUserService + private TicketUserService $ticketUserService, ) { } @@ -46,7 +46,7 @@ static function ($q) use ($sender) { ->where('is_customer', 0) ->first(); - if ($person && ! $person->tickets->isEmpty()) { + if ($person && !$person->tickets->isEmpty()) { $ticketUser = $this->ticketUserService->findByPhone($sender); $this->createComment($person->tickets[0]->ticket_id, 'Sms Comment'.$message, $ticketUser->getId()); } diff --git a/src/backend/packages/inensus/ticket/src/Services/TicketOutsourceReportService.php b/src/backend/packages/inensus/ticket/src/Services/TicketOutsourceReportService.php index 3319c575d..276e0bed0 100644 --- a/src/backend/packages/inensus/ticket/src/Services/TicketOutsourceReportService.php +++ b/src/backend/packages/inensus/ticket/src/Services/TicketOutsourceReportService.php @@ -17,7 +17,7 @@ class TicketOutsourceReportService implements IBaseService { public function __construct( private TicketOutsourceReport $ticketOutsourceReport, - private Spreadsheet $spreadsheet + private Spreadsheet $spreadsheet, ) { } @@ -51,7 +51,7 @@ public function createExcelSheet($startDate, $endDate, $tickets) } $writer = new Xlsx($this->spreadsheet); $dirPath = storage_path('./outsourcing'); - if (! file_exists($dirPath)) { + if (!file_exists($dirPath)) { mkdir($dirPath, 0774, true); } try { diff --git a/src/backend/packages/inensus/viber-messaging/src/Console/Commands/UpdatePackage.php b/src/backend/packages/inensus/viber-messaging/src/Console/Commands/UpdatePackage.php index 62341a540..ae98722be 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Console/Commands/UpdatePackage.php +++ b/src/backend/packages/inensus/viber-messaging/src/Console/Commands/UpdatePackage.php @@ -52,7 +52,7 @@ private function deleteMigration(Filesystem $filesystem) '*_create_viber_tables.php')[0]; $migration = DB::table('migrations') ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->first(); - if (! $migration) { + if (!$migration) { return false; } diff --git a/src/backend/packages/inensus/viber-messaging/src/Http/Controllers/WebhookController.php b/src/backend/packages/inensus/viber-messaging/src/Http/Controllers/WebhookController.php index 3c56ebf24..5b951162e 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Http/Controllers/WebhookController.php +++ b/src/backend/packages/inensus/viber-messaging/src/Http/Controllers/WebhookController.php @@ -61,7 +61,7 @@ public function index(string $slug) $meter = Meter::query()->where('serial_number', $meterSerialNumber)->first(); - if (! $meter) { + if (!$meter) { $this->answerToCustomer($bot, $botSender, $event, $this->setMeterNotFoundMessage()); return; @@ -95,13 +95,13 @@ public function index(string $slug) } }) ->onText("|$resendInformationKey.*|si", function ($event) use ($bot, $botSender, $resendInformationKey) { - if (! $resendInformationKey) { + if (!$resendInformationKey) { return; } $meterSerial = $this->viberContactService->getByViberId($event->getSender() ->getId())->registered_meter_serial_number; - if (! $meterSerial) { + if (!$meterSerial) { $this->answerToCustomer($bot, $botSender, $event, $this->setNotRegisteredMessage()); return; @@ -109,7 +109,7 @@ public function index(string $slug) $transaction = Transaction::with('paymentHistories') ->where('message', $meterSerial)->latest()->first(); - if (! $transaction) { + if (!$transaction) { $this->answerToCustomer($bot, $botSender, $event, $this->setNoTransactionMessage($meterSerial)); return; diff --git a/src/backend/packages/inensus/viber-messaging/src/Http/Resources/ViberResource.php b/src/backend/packages/inensus/viber-messaging/src/Http/Resources/ViberResource.php index c7dd9d8bf..1f204d92d 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Http/Resources/ViberResource.php +++ b/src/backend/packages/inensus/viber-messaging/src/Http/Resources/ViberResource.php @@ -10,7 +10,8 @@ class ViberResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request + * @param Request $request + * * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/viber-messaging/src/Services/ViberCredentialService.php b/src/backend/packages/inensus/viber-messaging/src/Services/ViberCredentialService.php index bd544b9f8..f4995c7fa 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Services/ViberCredentialService.php +++ b/src/backend/packages/inensus/viber-messaging/src/Services/ViberCredentialService.php @@ -44,11 +44,11 @@ public function updateCredentials($data) ]); $credential->save(); - if (! $credential->has_webhook_created) { + if (!$credential->has_webhook_created) { $this->webhookService->createWebHook($credential); } - if (! $credential->deep_link) { + if (!$credential->deep_link) { $uri = $this->accountService->getAccountInfo($credential); $credential->deep_link = "viber://pa?chatURI=$uri&text=register+change_this_with_your_meter_serial_number"; $credential->save(); diff --git a/src/backend/packages/inensus/wave-money-payment-provider/database/migrations/create_wave_money_payment_provider_tables.php b/src/backend/packages/inensus/wave-money-payment-provider/database/migrations/create_wave_money_payment_provider_tables.php index 90104de84..8cc6bc9e2 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/database/migrations/create_wave_money_payment_provider_tables.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/database/migrations/create_wave_money_payment_provider_tables.php @@ -8,7 +8,7 @@ class CreateWaveMoneyPaymentProviderTables extends Migration { public function up() { - if (! Schema::hasTable('wave_money_transactions')) { + if (!Schema::hasTable('wave_money_transactions')) { Schema::create('wave_money_transactions', static function (Blueprint $table) { $table->increments('id'); $table->integer('status')->default(-2); @@ -23,7 +23,7 @@ public function up() $table->timestamps(); }); } - if (! Schema::hasTable('wave_money_credentials')) { + if (!Schema::hasTable('wave_money_credentials')) { Schema::create('wave_money_credentials', static function (Blueprint $table) { $table->increments('id'); $table->string('merchant_id')->nullable(); diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Console/Commands/InstallPackage.php index a64e17127..160b7cf0a 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Console/Commands/InstallPackage.php @@ -12,7 +12,7 @@ class InstallPackage extends Command protected $description = 'Install WaveMoneyPaymentProvider Package'; public function __construct( - private WaveMoneyCredentialService $credentialService + private WaveMoneyCredentialService $credentialService, ) { parent::__construct(); } diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Console/Commands/UpdatePackage.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Console/Commands/UpdatePackage.php index 48c5bca78..1d2fd6199 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Console/Commands/UpdatePackage.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Console/Commands/UpdatePackage.php @@ -52,7 +52,7 @@ private function deleteMigration(Filesystem $filesystem) '*_create_wave_money_payment_provider_tables.php')[0]; $migration = DB::table('migrations') ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->first(); - if (! $migration) { + if (!$migration) { return false; } diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Resources/WaveMoneyResource.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Resources/WaveMoneyResource.php index 3a8849a99..c66114fea 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Resources/WaveMoneyResource.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Resources/WaveMoneyResource.php @@ -10,7 +10,8 @@ class WaveMoneyResource extends JsonResource /** * Transform the resource into an array. * - * @param Request $request + * @param Request $request + * * @return array */ public function toArray($request) diff --git a/src/backend/packages/inensus/wavecom-payment-provider/src/Models/WaveComTransaction.php b/src/backend/packages/inensus/wavecom-payment-provider/src/Models/WaveComTransaction.php index 3ee90a069..34ecadbe2 100644 --- a/src/backend/packages/inensus/wavecom-payment-provider/src/Models/WaveComTransaction.php +++ b/src/backend/packages/inensus/wavecom-payment-provider/src/Models/WaveComTransaction.php @@ -14,11 +14,11 @@ use MPM\Transaction\FullySupportedTransactionInterface; /** - * @property int $id + * @property int $id * @property string $transaction_id * @property string $sender * @property string $message - * @property int $amount + * @property int $amount */ class WaveComTransaction extends BaseModel implements FullySupportedTransactionInterface, IRawTransaction { diff --git a/src/backend/tests/Feature/CityTest.php b/src/backend/tests/Feature/CityTest.php index fde6cb1f7..aea40f479 100644 --- a/src/backend/tests/Feature/CityTest.php +++ b/src/backend/tests/Feature/CityTest.php @@ -118,16 +118,16 @@ protected function createTestData($clusterCount = 1, $miniGridCount = 1, $cityCo 'cluster_id' => $cluster->id, ]); array_push($this->cityIds, $city->id); - $cityCount--; + --$cityCount; } $geographicalInformation->owner()->associate($miniGrid); $geographicalInformation->save(); array_push($this->miniGridIds, $miniGrid->id); - $miniGridCount--; + --$miniGridCount; } - $clusterCount--; + --$clusterCount; } } diff --git a/src/backend/tests/Feature/ClusterDashboardCacheTest.php b/src/backend/tests/Feature/ClusterDashboardCacheTest.php index 9a1e1c778..878f1fa0e 100644 --- a/src/backend/tests/Feature/ClusterDashboardCacheTest.php +++ b/src/backend/tests/Feature/ClusterDashboardCacheTest.php @@ -110,7 +110,7 @@ protected function createTestData($clusterCount = 1, $meterCount = 1, $transacti 'mini_grid_id' => $miniGrid->id, 'cluster_id' => $cluster->id, ]); - $clusterCount--; + --$clusterCount; while ($meterCount > 0) { $meter = MeterFactory::new()->create([ @@ -156,7 +156,7 @@ protected function createTestData($clusterCount = 1, $meterCount = 1, $transacti ]); $personAddress->owner()->associate($person); $personAddress->save(); - $meterCount--; + --$meterCount; while ($transactionCount > 0) { $vodacomTransaction = @@ -194,7 +194,7 @@ protected function createTestData($clusterCount = 1, $meterCount = 1, $transacti 'payer_type' => 'person', 'payer_id' => $person->id, ]); - $transactionCount--; + --$transactionCount; } } } diff --git a/src/backend/tests/Feature/ClusterRevenueTest.php b/src/backend/tests/Feature/ClusterRevenueTest.php index 6e23659ee..514bd7e99 100644 --- a/src/backend/tests/Feature/ClusterRevenueTest.php +++ b/src/backend/tests/Feature/ClusterRevenueTest.php @@ -202,7 +202,7 @@ protected function createTestData($clusterCount = 1, $meterCount = 1, $transacti 'mini_grid_id' => $miniGrid->id, 'cluster_id' => $cluster->id, ]); - $clusterCount--; + --$clusterCount; while ($meterCount > 0) { $meter = MeterFactory::new()->create([ @@ -248,7 +248,7 @@ protected function createTestData($clusterCount = 1, $meterCount = 1, $transacti ]); $personAddress->owner()->associate($person); $personAddress->save(); - $meterCount--; + --$meterCount; while ($transactionCount > 0) { $vodacomTransaction = @@ -286,7 +286,7 @@ protected function createTestData($clusterCount = 1, $meterCount = 1, $transacti 'payer_type' => 'person', 'payer_id' => $person->id, ]); - $transactionCount--; + --$transactionCount; } } } diff --git a/src/backend/tests/Feature/ClusterTest.php b/src/backend/tests/Feature/ClusterTest.php index d63c35d53..2d6fe8826 100644 --- a/src/backend/tests/Feature/ClusterTest.php +++ b/src/backend/tests/Feature/ClusterTest.php @@ -133,7 +133,7 @@ protected function createTestData($clusterCount = 1, $meterCount = 1, $transacti 'mini_grid_id' => $miniGrid->id, 'cluster_id' => $cluster->id, ]); - $clusterCount--; + --$clusterCount; while ($meterCount > 0) { $meter = MeterFactory::new()->create([ @@ -179,7 +179,7 @@ protected function createTestData($clusterCount = 1, $meterCount = 1, $transacti ]); $personAddress->owner()->associate($person); $personAddress->save(); - $meterCount--; + --$meterCount; while ($transactionCount > 0) { $vodacomTransaction = @@ -217,7 +217,7 @@ protected function createTestData($clusterCount = 1, $meterCount = 1, $transacti 'payer_type' => 'person', 'payer_id' => $person->id, ]); - $transactionCount--; + --$transactionCount; } } } diff --git a/src/backend/tests/Feature/ConnectionGroupTest.php b/src/backend/tests/Feature/ConnectionGroupTest.php index 307d64cb1..9784e1d2c 100644 --- a/src/backend/tests/Feature/ConnectionGroupTest.php +++ b/src/backend/tests/Feature/ConnectionGroupTest.php @@ -85,7 +85,7 @@ protected function createTestData($connectionGroupCount = 1) while ($connectionGroupCount > 0) { $connectionGroup = ConnectionGroupFactory::new()->create(); array_push($this->connectonGroupIds, $connectionGroup->id); - $connectionGroupCount--; + --$connectionGroupCount; } } } diff --git a/src/backend/tests/Feature/ConnectionTypeTest.php b/src/backend/tests/Feature/ConnectionTypeTest.php index ef63b6cb7..bb4b2fab8 100644 --- a/src/backend/tests/Feature/ConnectionTypeTest.php +++ b/src/backend/tests/Feature/ConnectionTypeTest.php @@ -85,7 +85,7 @@ protected function createTestData($connectionTypeCount = 1) while ($connectionTypeCount > 0) { $connectionType = ConnectionTypeFactory::new()->create(); array_push($this->connectonTypeIds, $connectionType->id); - $connectionTypeCount--; + --$connectionTypeCount; } } } diff --git a/src/backend/tests/Feature/CreateEnvironments.php b/src/backend/tests/Feature/CreateEnvironments.php index 688474c3e..43d8b9e46 100644 --- a/src/backend/tests/Feature/CreateEnvironments.php +++ b/src/backend/tests/Feature/CreateEnvironments.php @@ -192,7 +192,7 @@ protected function createCluster($clusterCount = 1) 'manager_id' => $this->user->id, ]); $this->clusters[] = $cluster; - $clusterCount--; + --$clusterCount; } if (count($this->clusters) > 0) { @@ -208,7 +208,7 @@ protected function createMiniGrid($miniGridCount = 1) 'name' => $this->faker->unique()->companySuffix, ]); $this->miniGrids[] = $miniGrid; - $miniGridCount--; + --$miniGridCount; } if (count($this->miniGrids) > 0) { @@ -226,7 +226,7 @@ protected function createCity($cityCount = 1) 'cluster_id' => $this->getRandomIdFromList($this->clusters), ]); $this->cities[] = $city; - $cityCount--; + --$cityCount; } if (count($this->cities) > 0) { @@ -292,7 +292,7 @@ protected function createMeterWithGeo(): void ]); $address->owner()->associate($meterParameter)->save(); $geographicalInformation->owner()->associate($meterParameter)->save(); - $meterCunt--; + --$meterCunt; } } @@ -347,9 +347,9 @@ protected function createMetersWithDifferentMeterTypes($meterCountPerMeterType = 'connection_type_id' => $this->connectionType->id, 'connection_group_id' => $this->connectionGroup->id, ]); - $meterCountPerMeterType--; + --$meterCountPerMeterType; } - $meterTypeCount--; + --$meterTypeCount; } } @@ -368,7 +368,7 @@ protected function createMeterManufacturer($manufacturerCount = 1): void $this->manufacturers[] = $manufacturer; - $manufacturerCount--; + --$manufacturerCount; } if (count($this->manufacturers) > 0) { $this->manufacturer = $this->manufacturers[0]; @@ -390,7 +390,7 @@ protected function createMeterTariff($meterTariffCount = 1, $withTimeOfUsage = f ]); } - $meterTariffCount--; + --$meterTariffCount; } if (count($this->meterTariffs) > 0) { $this->meterTariff = $this->meterTariffs[0]; @@ -411,12 +411,12 @@ protected function createConnectionType($connectionTypeCount = 1, $subConnection ]); $this->subConnectionTypes[] = $subConnectionType; - $subConnectionTypeCount--; + --$subConnectionTypeCount; } if (count($this->subConnectionTypes) > 0) { $this->subConnectionType = $this->subConnectionTypes[0]; } - $connectionTypeCount--; + --$connectionTypeCount; } if (count($this->connectonTypes) > 0) { $this->connectionType = $this->connectonTypes[0]; @@ -428,7 +428,7 @@ protected function createConnectionGroup($connectionGroupCount = 1): void while ($connectionGroupCount > 0) { $connectionGroup = ConnectionGroupFactory::new()->create(); $this->connectionGroups[] = $connectionGroup; - $connectionGroupCount--; + --$connectionGroupCount; } if (count($this->connectionGroups) > 0) { $this->connectionGroup = $this->connectionGroups[0]; @@ -441,7 +441,7 @@ protected function createMeterType($meterTypeCount = 1): void $meterType = MeterTypeFactory::new()->create(); $this->meterTypes[] = $meterType; - $meterTypeCount--; + --$meterTypeCount; } if (count($this->meterTypes) > 0) { @@ -483,7 +483,7 @@ protected function createMeter($meterCount = 1): void $address->owner()->associate($meterParameter)->save(); $geographicalInformation->owner()->associate($meterParameter)->save(); - $meterCount--; + --$meterCount; } } @@ -492,7 +492,7 @@ protected function createTarget($targetCount = 1): void while ($targetCount > 0) { $target = TargetFactory::new()->create(); $this->targets[] = $target; - $targetCount--; + --$targetCount; } if (count($this->targets) > 0) { $this->target = $this->targets[0]; @@ -507,7 +507,7 @@ protected function createSubTarget($subTargetCount = 1): void 'connection_id' => $this->getRandomIdFromList($this->connectionGroups), ]); $this->subTargets[] = $subTarget; - $subTargetCount--; + --$subTargetCount; } if (count($this->subTargets) > 0) { $this->subTarget = $this->subTargets[0]; @@ -530,7 +530,7 @@ protected function createPerson($personCount = 1, $isCustomer = 1) $address->owner()->associate($person)->save(); $address->save(); - $personCount--; + --$personCount; } if (count($this->people) > 0) { $this->person = $this->people[0]; @@ -562,7 +562,7 @@ protected function createAgentCommission($agentCommissionCount = 1) $agentCommission = AgentCommissionFactory::new()->create(); $this->agentCommissions[] = $agentCommission; - $agentCommissionCount--; + --$agentCommissionCount; } if (count($this->agentCommissions) > 0) { $this->agentCommission = $this->agentCommissions[0]; @@ -575,7 +575,7 @@ protected function createAssetType($assetTypeCount = 1) $assetType = AssetTypeFactory::new()->create(); $this->assetTypes[] = $assetType; - $assetTypeCount--; + --$assetTypeCount; } if (count($this->assetTypes) > 0) { $this->assetType = $this->assetTypes[0]; @@ -594,7 +594,7 @@ protected function createAssignedAppliances($applianceCount = 1) ]); $this->assignedAppliances[] = $assignedAppliance; - $applianceCount--; + --$applianceCount; } if (count($this->assignedAppliances) > 0) { $this->assignedAppliance = $this->assignedAppliances[0]; @@ -624,7 +624,7 @@ protected function createAgentSoldAppliance($soldApplianceCount = 1) 'creator_id' => $assignedAppliance->agent_id, ]); - $soldApplianceCount--; + --$soldApplianceCount; } if (count($this->soldAppliances) > 0) { $this->soldAppliance = $this->soldAppliances[0]; @@ -642,7 +642,7 @@ protected function createAgentReceipt($agentReceiptCount = 1, $amount = 50) ]); $this->agentReceipts[] = $agentReceipt; - $agentReceiptCount--; + --$agentReceiptCount; } if (count($this->agentReceipts) > 0) { $this->agentReceipt = $this->agentReceipts[0]; @@ -663,7 +663,7 @@ protected function createAgentBalanceHistory($agentBalanceHistoryCount = 1) ]); $this->agentBalanceHistories[] = $agentBalanceHistory; - $agentBalanceHistoryCount--; + --$agentBalanceHistoryCount; } if (count($this->agentBalanceHistories) > 0) { $this->agentBalanceHistory = $this->agentBalanceHistories[0]; @@ -681,7 +681,7 @@ protected function createAgentTransaction($agentTransactionCount = 1, $amount = 'message' => $meter->serial_number, ]); - if (! $agentId) { + if (!$agentId) { $agentId = $this->getRandomIdFromList($this->agents); } @@ -743,7 +743,7 @@ protected function createAgentTransaction($agentTransactionCount = 1, $amount = ]); $this->agentBalanceHistories[] = $agentBalanceHistory; - $agentTransactionCount--; + --$agentTransactionCount; } if (count($this->agentTransactions) > 0) { $this->agentTransaction = $this->agentTransactions[0]; @@ -766,7 +766,7 @@ protected function createPaymentHistory($paymentHistoryCount = 1, $amount = 100, 'payment_type' => $this->faker->randomElement(['appliance', 'energy', 'installment', 'access rate']), ]); - if (! $agentId) { + if (!$agentId) { $agentId = $this->getRandomIdFromList($this->agents); } @@ -785,7 +785,7 @@ protected function createPaymentHistory($paymentHistoryCount = 1, $amount = 100, ]); $this->agentBalanceHistories[] = $agentBalanceHistory; - $paymentHistoryCount--; + --$paymentHistoryCount; } if (count($this->paymentHistories) > 0) { $this->paymentHistory = $this->paymentHistories[0]; @@ -798,7 +798,7 @@ protected function createTicketCategory($ticketCategoryCount = 1) $ticketCategory = TicketCategoryFactory::new()->create(); $this->ticketCategories[] = $ticketCategory; - $ticketCategoryCount--; + --$ticketCategoryCount; } if (count($this->ticketCategories) > 0) { $this->ticketCategory = $this->ticketCategories[0]; @@ -831,7 +831,7 @@ protected function createTicket($ticketCount = 1, $status = 0, $customerId = nul ]); $this->tickets[] = $ticket; - $ticketCount--; + --$ticketCount; } if (count($this->tickets) > 0) { $this->ticket = $this->tickets[0]; @@ -868,7 +868,7 @@ protected function createTicketUser($ticketUserCount = 1, $tag = 'inensusinensus ]); $this->ticketUsers[] = $ticketUser; - $ticketUserCount--; + --$ticketUserCount; } if (count($this->ticketUsers) > 0) { $this->ticketUser = $this->ticketUsers[0]; diff --git a/src/backend/tests/Feature/MeterTest.php b/src/backend/tests/Feature/MeterTest.php index 96ff0e9d4..7fb73bb1d 100644 --- a/src/backend/tests/Feature/MeterTest.php +++ b/src/backend/tests/Feature/MeterTest.php @@ -75,7 +75,7 @@ public function testUserGetsMeterList() 'connection_type_id' => $this->connectionType->id, 'connection_group_id' => $this->connectionGroup->id, ]); - $meterCunt--; + --$meterCunt; } $response = $this->actingAs($this->user)->get('/api/meters'); $response->assertStatus(200); @@ -274,7 +274,7 @@ protected function createMeterWithGeo(): void ]); $address->owner()->associate($meterParameter)->save(); $geographicalInformation->owner()->associate($meterParameter)->save(); - $meterCunt--; + --$meterCunt; } } diff --git a/src/backend/tests/Feature/MiniGridRevenueTest.php b/src/backend/tests/Feature/MiniGridRevenueTest.php index 1778d89e4..92959e5d1 100644 --- a/src/backend/tests/Feature/MiniGridRevenueTest.php +++ b/src/backend/tests/Feature/MiniGridRevenueTest.php @@ -194,7 +194,7 @@ protected function createTestData($clusterCount = 1, $meterCount = 1, $transacti 'mini_grid_id' => $miniGrid->id, 'cluster_id' => $cluster->id, ]); - $clusterCount--; + --$clusterCount; while ($meterCount > 0) { $meter = MeterFactory::new()->create([ @@ -240,7 +240,7 @@ protected function createTestData($clusterCount = 1, $meterCount = 1, $transacti ]); $personAddress->owner()->associate($person); $personAddress->save(); - $meterCount--; + --$meterCount; while ($transactionCount > 0) { $vodacomTransaction = @@ -279,7 +279,7 @@ protected function createTestData($clusterCount = 1, $meterCount = 1, $transacti 'payer_type' => 'person', 'payer_id' => $person->id, ]); - $transactionCount--; + --$transactionCount; } } } diff --git a/src/backend/tests/Feature/MiniGridTest.php b/src/backend/tests/Feature/MiniGridTest.php index c6a7d7458..34ec2b034 100644 --- a/src/backend/tests/Feature/MiniGridTest.php +++ b/src/backend/tests/Feature/MiniGridTest.php @@ -124,9 +124,9 @@ protected function createTestData($clusterCount = 1, $miniGridCount = 1) 'cluster_id' => $cluster->id, ]); array_push($this->miniGridIds, $miniGrid->id); - $miniGridCount--; + --$miniGridCount; } - $clusterCount--; + --$clusterCount; } } diff --git a/src/backend/tests/Feature/SocialTariffPiggyBankTest.php b/src/backend/tests/Feature/SocialTariffPiggyBankTest.php index 22cfe95d9..92d1d5767 100644 --- a/src/backend/tests/Feature/SocialTariffPiggyBankTest.php +++ b/src/backend/tests/Feature/SocialTariffPiggyBankTest.php @@ -48,7 +48,7 @@ public function testAddPiggyBankBalance() $socialTariff = SocialTariff::first(); $socialBank = SocialTariffPiggyBank::first(); $savings = $socialBank->savings; - for ($i = 1; $i <= $socialTariff->maximum_stacked_energy / $socialTariff->daily_allowance; $i++) { + for ($i = 1; $i <= $socialTariff->maximum_stacked_energy / $socialTariff->daily_allowance; ++$i) { $job->handle(); if ($i % ($socialTariff->maximum_stacked_energy / $socialTariff->daily_allowance)) { $this->assertEquals($savings + ($socialTariff->daily_allowance * $i), $socialBank->fresh()->savings); diff --git a/src/backend/tests/RefreshMultipleDatabases.php b/src/backend/tests/RefreshMultipleDatabases.php index cd2d5b1e0..049c2b129 100644 --- a/src/backend/tests/RefreshMultipleDatabases.php +++ b/src/backend/tests/RefreshMultipleDatabases.php @@ -27,7 +27,7 @@ protected function refreshInMemoryDatabase() protected function refreshTestDatabase() { - if (! RefreshDatabaseState::$migrated) { + if (!RefreshDatabaseState::$migrated) { Artisan::call( 'migrate:fresh', ['--database' => 'micro_power_manager', '--path' => '/database/migrations/base'] diff --git a/src/backend/tests/TestCase.php b/src/backend/tests/TestCase.php index 8b6becf84..61dd33b7b 100644 --- a/src/backend/tests/TestCase.php +++ b/src/backend/tests/TestCase.php @@ -16,7 +16,7 @@ abstract class TestCase extends BaseTestCase */ protected function headers(?User $user = null) { - if (! $user) { + if (!$user) { $user = User::create([ 'name' => 'John Doe', 'email' => 'johndoe@example.com', From f733b06661c2b567153b6648dafb96f030bb370f Mon Sep 17 00:00:00 2001 From: mark8-1 Date: Tue, 26 Nov 2024 21:00:34 +0200 Subject: [PATCH 8/8] removed pint --- src/backend/.php-cs-fixer.dist.php | 16 ++- .../Commands/AbstractSharedCommand.php | 9 +- .../Console/Commands/AccessRateChecker.php | 6 +- .../app/Console/Commands/AddMeterAddress.php | 9 +- .../app/Console/Commands/AddPlugin.php | 9 +- .../Commands/AdminPasswordResetter.php | 9 +- .../app/Console/Commands/AssetRateChecker.php | 24 ++--- .../app/Console/Commands/BackupFull.php | 6 +- .../Console/Commands/BackupTenantDatabase.php | 6 +- .../app/Console/Commands/CalinMeterReader.php | 9 +- .../ClustersDashboardCacheDataGenerator.php | 6 +- .../Commands/CreateDummyCompanyWithData.php | 9 +- .../app/Console/Commands/DummyDataCreator.php | 18 ++-- .../Commands/EcosysCustomerDatabaseParser.php | 9 +- .../Commands/MailApplianceDebtsCommand.php | 6 +- .../Console/Commands/MakeMigrationTenant.php | 6 +- .../app/Console/Commands/MigrateTenant.php | 6 +- .../Console/Commands/MigrateTenantDrop.php | 6 +- .../Console/Commands/MigrateTenantFresh.php | 6 +- .../Console/Commands/MigrateTenantInstall.php | 6 +- .../Console/Commands/MigrateTenantRefresh.php | 6 +- .../Console/Commands/MigrateTenantReset.php | 6 +- .../Commands/MigrateTenantRollback.php | 6 +- .../Console/Commands/MigrateTenantStatus.php | 6 +- .../app/Console/Commands/ModelShowTenant.php | 6 +- .../Commands/OutsourceReportGenerator.php | 9 +- .../app/Console/Commands/PackageGenerator.php | 6 +- .../app/Console/Commands/ReportGenerator.php | 9 +- .../Commands/ResendRejectedMessages.php | 9 +- .../app/Console/Commands/RoutesGenerator.php | 15 +-- .../SendNonPayingCustomerMailCommand.php | 6 +- .../ShiftEcosysSHSdataForDeviceFeature.php | 9 +- src/backend/app/Console/Kernel.php | 9 +- src/backend/app/Events/AssetPersonCreated.php | 9 +- src/backend/app/Events/ClusterEvent.php | 9 +- src/backend/app/Events/HistoryEvent.php | 10 +- src/backend/app/Events/NewTicket.php | 9 +- src/backend/app/Events/PersonDeleting.php | 9 +- .../AccessRates/NoAccessRateFound.php | 4 +- .../ActiveSheetNotCreatedException.php | 4 +- .../Exceptions/AgentRiskBalanceExceeded.php | 4 +- .../CustomerGroup/CustomerGroupNotFound.php | 4 +- .../Device/DeviceIsNotAssignedToCustomer.php | 4 +- .../DownPaymentBiggerThanAmountException.php | 4 +- ...ymentBiggerThanAppliancePriceException.php | 4 +- .../DownPaymentNotFoundException.php | 4 +- .../app/Exceptions/GeoFormatException.php | 4 +- src/backend/app/Exceptions/Handler.php | 9 +- .../Exceptions/InvalidBingApiKeyException.php | 4 +- .../app/Exceptions/MailNotSentException.php | 4 +- .../ApiCallDoesNotSupportedException.php | 4 +- .../Manufacturer/MeterIsNotReadable.php | 4 +- .../MeterParameter/MeterParameterNotFound.php | 4 +- .../Meters/MeterIsNotAssignedToCustomer.php | 4 +- .../app/Exceptions/Meters/MeterIsNotInUse.php | 4 +- .../MissingSmsReferencesException.php | 4 +- .../NotificationSendFailedException.php | 4 +- ...ntAmountBiggerThanTotalRemainingAmount.php | 4 +- .../PaymentAmountSmallerThanZero.php | 4 +- .../PaymentProviderNotIdentified.php | 4 +- .../app/Exceptions/PurchaseNotProcessable.php | 4 +- .../SmsAndroidSettingNotExistingException.php | 4 +- .../SmsBodyParserNotExtendedException.php | 4 +- .../Exceptions/SmsTypeNotFoundException.php | 4 +- .../SpreadSheetNotCreatedException.php | 4 +- .../SpreadSheetNotSavedException.php | 4 +- .../app/Exceptions/Tariffs/TariffNotFound.php | 4 +- .../TransactionAmountNotEnoughException.php | 4 +- .../TransactionAmountNotFoundException.php | 4 +- .../TransactionFetchingException.php | 4 +- ...dForProcessingIncomingRequestException.php | 4 +- .../TransactionNotInitializedException.php | 4 +- .../app/Exceptions/TrelloAPIException.php | 4 +- .../UserAddressNorFoundException.php | 4 +- .../app/Exceptions/ValidationException.php | 4 +- .../Exceptions/VodacomHeartBeatException.php | 4 +- .../Exceptions/WeatherParametersMissing.php | 4 +- .../Exceptions/WeatherProviderUnreachable.php | 4 +- src/backend/app/Helpers/MailHelper.php | 15 +-- .../app/Helpers/MailHelperInterface.php | 3 +- src/backend/app/Helpers/MailHelperMock.php | 11 +- src/backend/app/Helpers/PasswordGenerator.php | 6 +- src/backend/app/Helpers/PowerConverter.php | 6 +- src/backend/app/Helpers/RelationsManager.php | 12 +-- .../Http/Controllers/AddressController.php | 12 +-- .../AgentAssignedApplianceWebController.php | 12 +-- .../AgentAssignedAppliancesController.php | 9 +- .../Http/Controllers/AgentAuthController.php | 21 ++-- .../Controllers/AgentBalanceController.php | 9 +- .../AgentBalanceHistoryController.php | 21 ++-- .../AgentBalanceHistoryWebController.php | 10 +- .../Controllers/AgentChargeWebController.php | 9 +- .../AgentCommissionWebController.php | 19 ++-- .../Controllers/AgentCustomerController.php | 12 +-- .../AgentCustomerTicketController.php | 10 +- ...AgentCustomersPaymentHistoryController.php | 12 +-- ...AgentDashboardBalanceHistoryController.php | 9 +- .../AgentDashboardBoxesController.php | 9 +- .../AgentDashboardRevenueController.php | 9 +- .../Controllers/AgentFirebaseController.php | 9 +- .../AgentReceiptDetailController.php | 4 +- .../Controllers/AgentReceiptWebController.php | 15 +-- .../AgentSoldApplianceController.php | 15 +-- .../AgentSoldApplianceWebController.php | 10 +- .../Controllers/AgentTicketController.php | 12 +-- .../AgentTransactionWebController.php | 10 +- .../AgentTransactionsController.php | 12 +-- .../Http/Controllers/AgentWebController.php | 27 ++--- .../Controllers/AirtelVoltTerraController.php | 6 +- .../AppliancePaymentController.php | 10 +- .../app/Http/Controllers/AssetController.php | 19 ++-- .../Controllers/AssetPersonController.php | 12 +-- .../Http/Controllers/AssetRateController.php | 6 +- .../Http/Controllers/AssetTypeController.php | 18 ++-- .../app/Http/Controllers/AuthController.php | 21 ++-- .../app/Http/Controllers/CityController.php | 18 ++-- .../Http/Controllers/ClusterController.php | 18 ++-- .../ClusterMiniGridRevenueController.php | 9 +- .../ClusterRevenueAnalysisController.php | 9 +- .../Controllers/ClusterRevenueController.php | 12 +-- .../ClustersDashboardCacheDataController.php | 15 +-- .../Http/Controllers/CompanyController.php | 12 +-- .../Controllers/ConnectionGroupController.php | 18 ++-- .../Controllers/ConnectionTypeController.php | 19 ++-- .../app/Http/Controllers/Controller.php | 3 +- .../Http/Controllers/CountryController.php | 12 +-- .../Controllers/CountryListController.php | 6 +- .../Http/Controllers/CurrencyController.php | 6 +- .../CustomerRegistrationAppController.php | 10 +- .../Http/Controllers/DailyTransactions.php | 12 +-- .../Controllers/DeviceAddressController.php | 9 +- .../app/Http/Controllers/DeviceController.php | 13 +-- .../app/Http/Controllers/EBikeController.php | 21 ++-- .../app/Http/Controllers/HomeController.php | 10 +- .../Controllers/MailSettingsController.php | 12 +-- .../Controllers/MainSettingsController.php | 13 +-- .../Controllers/MaintenanceUserController.php | 12 +-- .../Controllers/ManufacturerController.php | 15 +-- .../Controllers/MapSettingsController.php | 15 +-- .../MeterConsumptionController.php | 9 +- .../app/Http/Controllers/MeterController.php | 24 ++--- ...MeterGeographicalInformationController.php | 15 +-- .../MeterPaymentHistoryController.php | 9 +- .../Controllers/MeterRevenueController.php | 9 +- .../Controllers/MeterTariffController.php | 21 ++-- .../MeterTariffMeterParameterController.php | 15 +-- .../Http/Controllers/MeterTypeController.php | 19 ++-- .../Controllers/MeterTypeMeterController.php | 10 +- .../Http/Controllers/MiniGridController.php | 18 ++-- .../MiniGridDashboardCacheController.php | 16 +-- .../Controllers/MiniGridDeviceController.php | 9 +- .../Controllers/MiniGridRevenueController.php | 9 +- .../Http/Controllers/MpmPluginController.php | 10 +- .../OutstandingDebtsExportController.php | 9 +- .../Controllers/PaymentHistoryController.php | 24 ++--- .../Controllers/PersonAddressesController.php | 15 +-- .../app/Http/Controllers/PersonController.php | 15 +-- .../Controllers/PersonDocumentController.php | 4 +- .../Controllers/PersonMeterController.php | 9 +- .../app/Http/Controllers/PluginController.php | 12 +-- .../Controllers/ProtectedPageController.php | 6 +- .../RegistrationTailController.php | 13 +-- .../app/Http/Controllers/ReportController.php | 21 ++-- src/backend/app/Http/Controllers/Reports.php | 60 ++++------- .../Controllers/RestrictionController.php | 12 +-- .../Http/Controllers/RevenueController.php | 18 ++-- .../SmsAndroidSettingController.php | 18 ++-- .../SmsApplianceRemindRateController.php | 15 +-- .../Http/Controllers/SmsBodyController.php | 12 +-- .../app/Http/Controllers/SmsController.php | 36 +++---- .../SmsResendInformationKeyController.php | 12 +-- .../SmsVariableDefaultValueController.php | 9 +- .../Controllers/SolarHomeSystemController.php | 15 +-- .../SubConnectionTypeController.php | 16 +-- .../app/Http/Controllers/TargetController.php | 18 ++-- .../Controllers/TicketSettingsController.php | 13 +-- .../Controllers/TimeOfUsageController.php | 9 +- .../TransactionAdvancedController.php | 12 +-- .../Controllers/TransactionController.php | 15 +-- .../TransactionExportController.php | 6 +- .../TransactionProviderController.php | 9 +- .../Http/Controllers/UsageTypeController.php | 10 +- .../Controllers/UserAddressController.php | 15 +-- .../app/Http/Controllers/UserController.php | 18 ++-- .../Controllers/UserPasswordController.php | 12 +-- .../VodacomTransactionController.php | 6 +- src/backend/app/Http/Kernel.php | 3 +- src/backend/app/Http/Middleware/AdminJWT.php | 6 +- .../Middleware/AgentBalanceMiddleware.php | 9 +- .../app/Http/Middleware/CorsMiddleware.php | 6 +- .../app/Http/Middleware/EncryptCookies.php | 3 +- .../app/Http/Middleware/JwtMiddleware.php | 9 +- .../Middleware/RedirectIfAuthenticated.php | 6 +- .../Http/Middleware/RestrictionMiddleware.php | 12 +-- .../app/Http/Middleware/Transaction.php | 9 +- .../Http/Middleware/TransactionRequest.php | 6 +- .../app/Http/Middleware/TrimStrings.php | 3 +- .../app/Http/Middleware/TrustProxies.php | 3 +- ...serDefaultDatabaseConnectionMiddleware.php | 18 ++-- .../app/Http/Middleware/VerifyCsrfToken.php | 3 +- .../Requests/AdminResetPasswordRequest.php | 9 +- .../app/Http/Requests/AndroidAppRequest.php | 9 +- .../Http/Requests/AssetTypeCreateRequest.php | 9 +- .../Http/Requests/AssetTypeUpdateRequest.php | 9 +- src/backend/app/Http/Requests/CityRequest.php | 12 +-- .../app/Http/Requests/ClusterRequest.php | 9 +- .../Requests/CompanyRegistrationRequest.php | 6 +- .../app/Http/Requests/CountryRequest.php | 9 +- .../Http/Requests/CreateAddressRequest.php | 9 +- .../app/Http/Requests/CreateAdminRequest.php | 9 +- .../CreateAgentAssignedApplianceRequest.php | 9 +- .../CreateAgentBalanceHistoryRequest.php | 9 +- .../Requests/CreateAgentChargeRequest.php | 9 +- .../Requests/CreateAgentCommissionRequest.php | 9 +- .../Requests/CreateAgentReceiptRequest.php | 9 +- .../app/Http/Requests/CreateAgentRequest.php | 9 +- .../CreateAgentSoldApplianceRequest.php | 9 +- .../Requests/CreateAgentTicketRequest.php | 9 +- .../app/Http/Requests/CreateAssetRequest.php | 9 +- .../Requests/CreateConnectionGroupRequest.php | 9 +- .../app/Http/Requests/CreateTargetRequest.php | 18 ++-- .../app/Http/Requests/MailSettingsRequest.php | 9 +- .../app/Http/Requests/MaintenanceRequest.php | 21 ++-- .../app/Http/Requests/ManufacturerRequest.php | 9 +- .../Http/Requests/MeterParameterRequest.php | 9 +- .../app/Http/Requests/MeterRequest.php | 9 +- .../Http/Requests/MeterTypeCreateRequest.php | 9 +- .../Http/Requests/MeterTypeUpdateRequest.php | 9 +- .../app/Http/Requests/PersonRequest.php | 9 +- .../Requests/SmsAndroidSettingRequest.php | 6 +- .../SmsApplianceRemindRateRequest.php | 6 +- src/backend/app/Http/Requests/SmsRequest.php | 9 +- .../app/Http/Requests/StoreDeviceRequest.php | 9 +- .../app/Http/Requests/StoreEBikeRequest.php | 9 +- .../Http/Requests/StoreMiniGridRequest.php | 12 +-- .../app/Http/Requests/StoreSmsRequest.php | 9 +- .../Requests/StoreSolarHomeSystemRequest.php | 9 +- .../SubConnectionTypeCreateRequest.php | 9 +- .../app/Http/Requests/TariffCreateRequest.php | 12 +-- .../app/Http/Requests/UpdateAssetRequest.php | 9 +- .../app/Http/Requests/UpdateDeviceRequest.php | 9 +- .../app/Http/Requests/UpdateMeterRequest.php | 9 +- .../Http/Requests/UpdateMiniGridRequest.php | 6 +- .../Requests/UserChangePasswordRequest.php | 9 +- .../app/Http/Resources/ApiResource.php | 6 +- .../app/Http/Resources/MeterResource.php | 6 +- .../app/Http/Resources/MeterTypeResource.php | 6 +- .../Resources/SmsSearchResultResource.php | 6 +- .../app/Http/Resources/UserResource.php | 6 +- src/backend/app/Jobs/AbstractJob.php | 18 ++-- .../Jobs/ApplianceTransactionProcessor.php | 24 ++--- src/backend/app/Jobs/CreatePiggyBankEntry.php | 9 +- .../app/Jobs/EnergyTransactionProcessor.php | 33 ++---- src/backend/app/Jobs/HearthBeat.php | 10 +- src/backend/app/Jobs/MeterReader.php | 9 +- src/backend/app/Jobs/ProcessPayment.php | 9 +- src/backend/app/Jobs/SmsLoadBalancer.php | 12 +-- src/backend/app/Jobs/SmsProcessor.php | 9 +- .../app/Jobs/SocialTariffPiggyBankManager.php | 12 +-- src/backend/app/Jobs/TokenProcessor.php | 30 ++---- src/backend/app/Jobs/UpdatePiggyBankEntry.php | 9 +- src/backend/app/Lib/IManufacturerAPI.php | 3 +- src/backend/app/Lib/IMeterReader.php | 3 +- src/backend/app/Lib/ISmsProvider.php | 3 +- src/backend/app/Lib/ITransaction.php | 3 +- .../app/Listeners/AccessRateListener.php | 9 +- .../app/Listeners/ClusterGeoListener.php | 12 +-- src/backend/app/Listeners/HistoryListener.php | 12 +-- src/backend/app/Listeners/LogListener.php | 12 +-- src/backend/app/Listeners/MeterListener.php | 9 +- src/backend/app/Listeners/PaymentListener.php | 19 ++-- .../app/Listeners/PaymentPeriodListener.php | 12 +-- src/backend/app/Listeners/SmsListener.php | 9 +- .../app/Listeners/SoldApplianceListener.php | 12 +-- src/backend/app/Listeners/TokenListener.php | 12 +-- .../app/Listeners/TransactionListener.php | 15 +-- .../app/ManufacturerApi/CalinReadMeter.php | 28 ++--- src/backend/app/Misc/LoanDataContainer.php | 15 +-- .../app/Misc/SoldApplianceDataContainer.php | 18 ++-- .../app/Misc/TransactionDataContainer.php | 6 +- .../app/Models/AccessRate/AccessRate.php | 15 +-- .../Models/AccessRate/AccessRatePayment.php | 9 +- src/backend/app/Models/Address/Address.php | 30 ++---- .../Models/Address/HasAddressesInterface.php | 3 +- src/backend/app/Models/Admin.php | 4 +- src/backend/app/Models/Agent.php | 54 ++++------ .../app/Models/AgentAssignedAppliances.php | 15 +-- .../app/Models/AgentBalanceHistory.php | 12 +-- src/backend/app/Models/AgentCharge.php | 12 +-- src/backend/app/Models/AgentCommission.php | 9 +- src/backend/app/Models/AgentReceipt.php | 15 +-- src/backend/app/Models/AgentReceiptDetail.php | 6 +- src/backend/app/Models/AgentSoldAppliance.php | 9 +- src/backend/app/Models/Asset.php | 15 +-- src/backend/app/Models/AssetPerson.php | 21 ++-- src/backend/app/Models/AssetRate.php | 15 +-- src/backend/app/Models/AssetType.php | 6 +- src/backend/app/Models/Base/BaseModel.php | 6 +- src/backend/app/Models/Base/BaseModelCore.php | 6 +- src/backend/app/Models/City.php | 39 +++---- src/backend/app/Models/Cluster.php | 12 +-- src/backend/app/Models/Company.php | 18 ++-- src/backend/app/Models/CompanyDatabase.php | 21 ++-- src/backend/app/Models/CompanyJob.php | 6 +- src/backend/app/Models/ConnectionGroup.php | 9 +- src/backend/app/Models/ConnectionType.php | 18 ++-- src/backend/app/Models/Country.php | 9 +- src/backend/app/Models/CustomerGroup.php | 9 +- src/backend/app/Models/DatabaseProxy.php | 21 ++-- src/backend/app/Models/Device.php | 15 +-- src/backend/app/Models/EBike.php | 12 +-- .../app/Models/GeographicalInformation.php | 6 +- src/backend/app/Models/History.php | 6 +- src/backend/app/Models/Loan/Loan.php | 6 +- .../app/Models/Loan/LoanableInterface.php | 3 +- src/backend/app/Models/Log.php | 9 +- src/backend/app/Models/MailSettings.php | 4 +- src/backend/app/Models/MainSettings.php | 4 +- src/backend/app/Models/MaintenanceUsers.php | 12 +-- src/backend/app/Models/Manufacturer.php | 6 +- src/backend/app/Models/MapSettings.php | 4 +- src/backend/app/Models/Meter/Meter.php | 42 +++----- .../app/Models/Meter/MeterConsumption.php | 9 +- .../app/Models/Meter/MeterParameter.php | 33 ++---- src/backend/app/Models/Meter/MeterTariff.php | 24 ++--- src/backend/app/Models/Meter/MeterToken.php | 18 ++-- src/backend/app/Models/Meter/MeterType.php | 9 +- src/backend/app/Models/MiniGrid.php | 24 ++--- src/backend/app/Models/MpmPlugin.php | 6 +- .../app/Models/Payment/PaymentProfile.php | 4 +- src/backend/app/Models/PaymentHistory.php | 27 ++--- src/backend/app/Models/Person/Person.php | 42 +++----- src/backend/app/Models/PersonDocument.php | 6 +- src/backend/app/Models/Plugins.php | 3 +- src/backend/app/Models/ProtectedPage.php | 3 +- src/backend/app/Models/RegistrationTail.php | 3 +- src/backend/app/Models/Report.php | 4 +- src/backend/app/Models/Restriction.php | 6 +- src/backend/app/Models/Revenue.php | 3 +- .../app/Models/Role/RoleDefinition.php | 6 +- src/backend/app/Models/Role/RoleInterface.php | 3 +- src/backend/app/Models/Role/Roles.php | 9 +- src/backend/app/Models/Sms.php | 9 +- src/backend/app/Models/SmsAndroidSetting.php | 9 +- .../app/Models/SmsApplianceRemindRate.php | 6 +- src/backend/app/Models/SmsBody.php | 3 +- .../app/Models/SmsResendInformationKey.php | 3 +- .../app/Models/SmsVariableDefaultValue.php | 3 +- src/backend/app/Models/SocialTariff.php | 3 +- .../app/Models/SocialTariffPiggyBank.php | 9 +- src/backend/app/Models/SolarHomeSystem.php | 12 +-- src/backend/app/Models/SubConnectionType.php | 12 +-- src/backend/app/Models/SubTarget.php | 9 +- src/backend/app/Models/Subscription.php | 6 +- src/backend/app/Models/Target.php | 21 ++-- .../app/Models/TariffPricingComponent.php | 6 +- src/backend/app/Models/TicketSettings.php | 4 +- src/backend/app/Models/TimeOfUsage.php | 6 +- src/backend/app/Models/Token.php | 9 +- .../Models/Transaction/AgentTransaction.php | 18 ++-- .../Models/Transaction/AirtelTransaction.php | 15 +-- .../Models/Transaction/CashTransaction.php | 15 +-- .../Models/Transaction/IRawTransaction.php | 3 +- .../Models/Transaction/ISubTransaction.php | 3 +- .../Transaction/ThirdPartyTransaction.php | 12 +-- .../app/Models/Transaction/Transaction.php | 63 ++++------- .../Transaction/TransactionConflicts.php | 6 +- .../Models/Transaction/VodacomTransaction.php | 15 +-- src/backend/app/Models/Upgrade.php | 6 +- src/backend/app/Models/UsageType.php | 3 +- src/backend/app/Models/User.php | 45 +++----- .../app/Observers/AddressesObserver.php | 6 +- .../Observers/AgentBalanceHistoryObserver.php | 9 +- .../app/Observers/AgentChargeObserver.php | 9 +- src/backend/app/Observers/AgentObserver.php | 13 +-- .../app/Observers/AgentReceiptObserver.php | 9 +- .../Observers/AgentSoldApplianceObserver.php | 12 +-- .../app/Observers/MeterParameterObserver.php | 16 +-- src/backend/app/Observers/PersonObserver.php | 9 +- src/backend/app/PaymentHandler/AccessRate.php | 28 ++--- .../app/PaymentHandler/EnergyPayment.php | 4 +- .../app/Providers/AppServiceProvider.php | 9 +- .../app/Providers/AuthServiceProvider.php | 6 +- .../Providers/BroadcastServiceProvider.php | 6 +- .../app/Providers/EventServiceProvider.php | 6 +- .../app/Providers/HorizonServiceProvider.php | 9 +- .../app/Providers/RouteServiceProvider.php | 15 +-- .../app/Providers/ServicesProvider.php | 9 +- .../app/Providers/VodacomServiceProvider.php | 11 +- src/backend/app/Relations/BelongsToMorph.php | 12 +-- .../AbstractDashboardCacheDataService.php | 15 +-- .../app/Services/AbstractExportService.php | 27 ++--- ...actPaymentAggregatorTransactionService.php | 36 +++---- .../AccessRatePaymentHistoryService.php | 12 +-- .../app/Services/AccessRatePaymentService.php | 24 ++--- .../app/Services/AccessRateService.php | 24 ++--- .../AddressGeographicalInformationService.php | 12 +-- src/backend/app/Services/AddressesService.php | 39 +++---- .../Services/AgentAppliancePersonService.php | 12 +-- ...AssignedApplianceHistoryBalanceService.php | 12 +-- .../AgentAssignedApplianceService.php | 21 ++-- .../Services/AgentBalanceHistoryService.php | 45 +++----- .../AgentChargeHistoryBalanceService.php | 12 +-- .../app/Services/AgentChargeService.php | 21 ++-- .../AgentCommissionHistoryBalanceService.php | 12 +-- .../app/Services/AgentCommissionService.php | 21 ++-- .../app/Services/AgentCustomerService.php | 13 +-- .../AgentCustomersPaymentHistoryService.php | 18 ++-- .../Services/AgentReceiptDetailService.php | 24 ++--- .../AgentReceiptHistoryBalanceService.php | 12 +-- .../app/Services/AgentReceiptService.php | 27 ++--- src/backend/app/Services/AgentService.php | 36 +++---- .../Services/AgentSoldApplianceService.php | 21 ++-- .../app/Services/AgentTicketService.php | 12 +-- .../AgentTransactionHistoryBalanceService.php | 12 +-- .../app/Services/AgentTransactionService.php | 18 ++-- .../AgentTransactionTransactionService.php | 12 +-- .../app/Services/AppliancePaymentService.php | 33 ++---- .../app/Services/AppliancePersonService.php | 57 ++++------ .../ApplianceRatePaymentHistoryService.php | 12 +-- .../app/Services/ApplianceRateService.php | 42 +++----- .../app/Services/ApplianceTypeService.php | 18 ++-- src/backend/app/Services/AssetService.php | 22 ++-- .../app/Services/BingMapApiService.php | 12 +-- .../app/Services/CashTransactionService.php | 9 +- .../CityGeographicalInformationService.php | 12 +-- src/backend/app/Services/CityService.php | 27 ++--- .../app/Services/ClusterManagerService.php | 9 +- .../app/Services/ClusterMeterService.php | 10 +- .../app/Services/ClusterMiniGridService.php | 10 +- .../app/Services/ClusterPopulationService.php | 10 +- .../app/Services/ClusterRevenueService.php | 18 ++-- src/backend/app/Services/ClusterService.php | 42 +++----- .../Services/ClusterTransactionService.php | 10 +- .../ClustersDashboardCacheDataService.php | 6 +- .../app/Services/CompanyDatabaseService.php | 24 ++--- src/backend/app/Services/CompanyService.php | 27 ++--- .../app/Services/ConnectionGroupService.php | 21 ++-- .../app/Services/ConnectionTypeService.php | 24 ++--- src/backend/app/Services/CountryService.php | 24 ++--- .../app/Services/DatabaseProxyService.php | 22 ++-- src/backend/app/Services/FirebaseService.php | 6 +- .../GeographicalInformationService.php | 30 ++---- .../Interfaces/IAssignationService.php | 3 +- .../app/Services/Interfaces/IAssociative.php | 3 +- .../app/Services/Interfaces/IBaseService.php | 3 +- .../Services/Interfaces/ISettingsService.php | 3 +- src/backend/app/Services/MailService.php | 9 +- .../app/Services/MailSettingsService.php | 15 +-- .../app/Services/MainSettingsService.php | 21 ++-- .../app/Services/MaintenanceUserService.php | 24 ++--- .../Services/MaintenanceUserTicketService.php | 12 +-- .../Services/ManufacturerAddressService.php | 12 +-- .../app/Services/ManufacturerService.php | 27 ++--- .../app/Services/MeterConsumptionService.php | 24 ++--- .../MeterGeographicalInformationService.php | 9 +- .../Services/MeterParameterAddressService.php | 12 +-- .../app/Services/MeterParameterService.php | 12 +-- .../app/Services/MeterRevenueService.php | 9 +- src/backend/app/Services/MeterService.php | 36 +++---- .../MeterTariffMeterParameterService.php | 15 +-- .../app/Services/MeterTariffService.php | 21 ++-- .../MeterTokenPaymentHistoryService.php | 12 +-- .../app/Services/MeterTypeMeterService.php | 10 +- src/backend/app/Services/MeterTypeService.php | 22 ++-- .../MiniGridDashboardCacheDataService.php | 6 +- .../app/Services/MiniGridEnergyService.php | 10 +- ...MiniGridGeographicalInformationService.php | 12 +-- .../app/Services/MiniGridRevenueService.php | 12 +-- src/backend/app/Services/MiniGridService.php | 24 ++--- src/backend/app/Services/MpmPluginService.php | 21 ++-- .../app/Services/PaymentHistoryService.php | 18 ++-- src/backend/app/Services/PdfService.php | 9 +- src/backend/app/Services/PeriodService.php | 6 +- .../app/Services/PersonAddressService.php | 18 ++-- .../app/Services/PersonMeterService.php | 12 +-- .../Services/PersonPaymentHistoryService.php | 12 +-- src/backend/app/Services/PersonService.php | 60 ++++------- .../app/Services/PersonTicketService.php | 12 +-- src/backend/app/Services/PluginsService.php | 21 ++-- .../app/Services/RegistrationTailService.php | 30 ++---- .../app/Services/RestrictionService.php | 24 ++--- src/backend/app/Services/RevenueService.php | 6 +- src/backend/app/Services/RolesService.php | 18 ++-- src/backend/app/Services/SessionService.php | 12 +-- .../app/Services/SmsAndroidSettingService.php | 18 ++-- .../SmsApplianceRemindRateService.php | 18 ++-- src/backend/app/Services/SmsBodyService.php | 18 ++-- .../SmsResendInformationKeyService.php | 12 +-- src/backend/app/Services/SmsService.php | 27 ++--- .../SmsVariableDefaultValueService.php | 9 +- .../app/Services/SocialTariffService.php | 24 ++--- .../app/Services/SubConnectionTypeService.php | 24 ++--- src/backend/app/Services/SubTargetService.php | 21 ++-- src/backend/app/Services/TargetService.php | 19 ++-- .../TariffPricingComponentService.php | 27 ++--- .../app/Services/TicketSettingsService.php | 12 +-- .../app/Services/TimeOfUsageService.php | 21 ++-- src/backend/app/Services/TokenService.php | 21 ++-- .../TransactionPaymentHistoryService.php | 12 +-- .../Services/TransactionProviderService.php | 9 +- src/backend/app/Services/UsageTypeService.php | 21 ++-- .../app/Services/UserAddressService.php | 12 +-- .../Services/UserAppliancePersonService.php | 12 +-- src/backend/app/Services/UserService.php | 43 +++----- .../app/Services/UserTicketService.php | 12 +-- src/backend/app/Sms/AndroidGateway.php | 6 +- .../BodyParsers/AccessRateConfirmation.php | 9 +- .../app/Sms/BodyParsers/AssetRatePayment.php | 9 +- .../app/Sms/BodyParsers/AssetRateReminder.php | 9 +- .../Sms/BodyParsers/EnergyConfirmation.php | 9 +- .../BodyParsers/OverDueAssetRateReminder.php | 9 +- .../app/Sms/BodyParsers/PricingDetails.php | 12 +-- .../app/Sms/BodyParsers/ResendInformation.php | 9 +- ...sendInformationLastTransactionNotFound.php | 9 +- .../app/Sms/BodyParsers/SmsBodyParser.php | 9 +- .../app/Sms/BodyParsers/SmsReminderHeader.php | 9 +- .../SmsResendInformationHeader.php | 9 +- .../Sms/BodyParsers/SmsTransactionHeader.php | 9 +- .../app/Sms/Senders/AssetRateNotification.php | 3 +- src/backend/app/Sms/Senders/ManualSms.php | 6 +- .../Senders/OverDueAssetRateNotification.php | 3 +- .../Senders/ResendInformationNotification.php | 6 +- src/backend/app/Sms/Senders/SmsConfigs.php | 4 +- .../app/Sms/Senders/SmsConfigsCore.php | 3 +- src/backend/app/Sms/Senders/SmsSender.php | 33 ++---- .../Sms/Senders/TransactionConfirmation.php | 12 +-- src/backend/app/Sms/SmsTypes.php | 3 +- .../app/Traits/RestExceptionHandler.php | 24 ++--- .../app/Traits/ScheduledPluginCommand.php | 6 +- src/backend/app/Utils/AccessRatePayer.php | 15 +-- .../app/Utils/ApplianceInstallmentPayer.php | 27 ++--- src/backend/app/Utils/DummyCompany.php | 3 +- .../Utils/MinimumPurchaseAmountValidator.php | 6 +- .../app/Utils/TariffPriceCalculator.php | 18 ++-- .../CustomerRegistrationAppService.php | 9 +- .../Abstract/CreatorService.php | 9 +- .../Ecosys/CustomerDatabaseParser.php | 18 ++-- .../Ecosys/Services/AddressService.php | 12 +-- .../Services/AppliancePersonService.php | 21 ++-- .../Ecosys/Services/ApplianceService.php | 9 +- .../Ecosys/Services/CityService.php | 9 +- .../Services/ConnectionGroupService.php | 9 +- .../GeographicalInformationService.php | 9 +- .../Ecosys/Services/MeterParameterService.php | 9 +- .../Ecosys/Services/MeterService.php | 9 +- .../Ecosys/Services/PersonService.php | 15 +-- .../DatabaseProxyManagerService.php | 21 ++-- .../modules/Device/ClusterDeviceService.php | 16 +-- .../modules/Device/DeviceAddressService.php | 18 ++-- .../app/modules/Device/DeviceService.php | 30 ++---- .../modules/Device/MiniGridDeviceService.php | 13 +-- .../app/modules/EBike/EBikeDeviceService.php | 12 +-- .../app/modules/EBike/EBikeService.php | 27 ++--- .../app/modules/Meter/MeterDeviceService.php | 12 +-- .../OutstandingDebtsExportService.php | 27 ++--- .../Sharding/ApiCompanyResolverService.php | 13 +-- .../AndroidGatewayCallbackApiResolver.php | 6 +- .../ApiResolvers/ApiResolverInterface.php | 3 +- .../ApiResolvers/Data/ApiResolverMap.php | 9 +- .../ApiResolvers/DataExportResolver.php | 10 +- .../DownloadingReportsResolver.php | 6 +- .../ApiResolvers/JetsonApiResolver.php | 6 +- .../ApiResolvers/SwiftaPaymentApiResolver.php | 6 +- .../Sharding/ApiResolvers/TestApiResolver.php | 6 +- .../ViberMessagingApiResolver.php | 6 +- .../ApiResolvers/WaveMoneyApiResolver.php | 6 +- .../SolarHomeSystemDeviceService.php | 12 +-- .../SolarHomeSystemService.php | 25 ++--- .../app/modules/Target/TargetAssignable.php | 4 +- .../ApplianceTransactionService.php | 4 +- .../Transaction/EBikeTransactionService.php | 7 +- .../Export/TransactionExportService.php | 18 ++-- .../FullySupportedTransactionInterface.php | 3 +- .../Transaction/MeterTransactionService.php | 7 +- .../Provider/AgentTransactionProvider.php | 51 +++------ .../Provider/AirtelTransactionProvider.php | 46 +++----- .../Provider/AirtelVoltTerraProvider.php | 48 +++------ .../Provider/CashTransactionProvider.php | 45 +++----- .../Provider/ITransactionProvider.php | 3 +- .../Provider/TransactionAdapter.php | 6 +- .../Provider/VodacomTransactionProvider.php | 51 +++------ .../SolarHomeSystemTransactionService.php | 7 +- .../TransactionPaymentProcessor.php | 6 +- .../Transaction/TransactionService.php | 54 ++++------ .../modules/User/Events/UserCreatedEvent.php | 7 +- .../app/modules/User/UserEventSubscriber.php | 6 +- src/backend/app/modules/User/UserListener.php | 12 +-- src/backend/composer.json | 6 +- src/backend/composer.lock | 66 ------------ .../AccessRate/AccessRateFactory.php | 6 +- .../factories/AccessRatePaymentFactory.php | 6 +- .../factories/Address/AddressFactory.php | 6 +- .../AgentAssignedApplianceFactory.php | 6 +- .../factories/AgentBalanceHistoryFactory.php | 6 +- .../database/factories/AgentChargeFactory.php | 6 +- .../factories/AgentCommissionFactory.php | 6 +- .../database/factories/AgentFactory.php | 6 +- .../factories/AgentReceiptFactory.php | 6 +- .../factories/AgentSoldApplianceFactory.php | 6 +- .../factories/AgentTransactionFactory.php | 6 +- .../factories/AppliancePersonFactory.php | 6 +- .../database/factories/AssetFactory.php | 6 +- .../database/factories/AssetTypeFactory.php | 6 +- .../database/factories/CityFactory.php | 6 +- .../database/factories/ClusterFactory.php | 6 +- .../factories/CompanyDatabaseFactory.php | 6 +- .../database/factories/CompanyFactory.php | 9 +- .../factories/ConnectionGroupFactory.php | 6 +- .../factories/ConnectionTypeFactory.php | 6 +- .../database/factories/DeviceFactory.php | 6 +- .../GeographicalInformationFactory.php | 15 +-- .../factories/MainSettingsFactory.php | 6 +- .../factories/ManufacturerFactory.php | 12 +-- .../database/factories/Meter/MeterFactory.php | 6 +- .../factories/Meter/MeterTariffFactory.php | 6 +- .../factories/Meter/MeterTypeFactory.php | 9 +- .../factories/MeterConsumptionFactory.php | 6 +- .../factories/MeterParameterFactory.php | 6 +- .../database/factories/MeterTokenFactory.php | 6 +- .../database/factories/MiniGridFactory.php | 6 +- .../factories/PaymentHistoryFactory.php | 6 +- .../factories/Person/PersonFactory.php | 12 +-- .../SmsResendInformationKeyFactory.php | 6 +- .../factories/SolarHomeSystemFactory.php | 6 +- .../factories/SubConnectionTypeFactory.php | 6 +- .../database/factories/SubTargetFactory.php | 6 +- .../database/factories/TargetFactory.php | 6 +- .../database/factories/TicketBoardFactory.php | 6 +- .../database/factories/TicketCardFactory.php | 6 +- .../database/factories/TicketFactory.php | 6 +- .../factories/TicketOutsourceFactory.php | 6 +- .../TicketOutsourceReportFactory.php | 6 +- .../database/factories/TicketUserFactory.php | 6 +- .../database/factories/TimeOfUsageFactory.php | 6 +- .../database/factories/TransactionFactory.php | 6 +- .../database/factories/UserFactory.php | 9 +- .../factories/VodacomTransactionFactory.php | 6 +- ...22_03_10_120408_create_companies_table.php | 6 +- ..._134450_create_company_databases_table.php | 6 +- ...8_204649_create_database_proxies_table.php | 6 +- ..._06_21_102121_create_mpm_plugins_table.php | 6 +- ...21_122032_add_email_to_companies_table.php | 6 +- ...3903_add_tail_tag_to_mpm_plugins_table.php | 6 +- ...tallation_command_to_mpm_plugins_table.php | 6 +- ..._bulk_registration_to_mpm_plugin_table.php | 6 +- ...dd_viber_messaging_to_mpm_plugin_table.php | 6 +- ...email_field_for_database_proxies_table.php | 6 +- ...wave_money_payment_to_mpm_plugin_table.php | 6 +- .../2022_11_25_085948_create_jobs_table.php | 9 +- .../2022_11_25_091725_create_company_jobs.php | 6 +- ...000_add_micro_star_to_mpm_plugin_table.php | 6 +- ...00_add_root_class_to_mpm_plugins_table.php | 6 +- ...00000_add_sun_king_to_mpm_plugin_table.php | 6 +- ...24_110414_create_protected_pages_table.php | 6 +- ...ected_page_password_to_companies_table.php | 6 +- ...0000_add_gome_long_to_mpm_plugin_table.php | 6 +- ...121811_add_wavecom_to_mpm_plugin_table.php | 6 +- ...escription_column_in_mpm_plugins_table.php | 6 +- ...00000_add_daly_bms_to_mpm_plugin_table.php | 6 +- ..._000000_add_angaza_to_mpm_plugin_table.php | 6 +- ..._02_07_100345_create_usage_types_table.php | 6 +- ...usage_type_column_to_mpm_plugins_table.php | 6 +- ...nd_trace_columns_to_company_jobs_table.php | 6 +- .../2014_10_12_000000_create_users_table.php | 6 +- ...12_100000_create_password_resets_table.php | 6 +- ...5615_create_vodacom_transactions_table.php | 6 +- ...05_24_201051_create_transactions_table.php | 6 +- ...13335_create_airtel_transactions_table.php | 6 +- ..._131106_create_payment_histories_table.php | 6 +- ...5_25_131119_create_meter_tariffs_table.php | 6 +- ...18_05_29_071453_create_addresses_table.php | 6 +- ...create_geographical_informations_table.php | 6 +- ..._05_29_140926_create_meter_types_table.php | 6 +- .../2018_05_30_124521_create_meters_table.php | 6 +- ...5_31_071601_create_manufacturers_table.php | 6 +- .../2018_05_31_075346_create_cities_table.php | 6 +- ...18_05_31_075353_create_countries_table.php | 6 +- .../2018_06_01_141845_create_people_table.php | 6 +- .../2018_06_04_124637_create__roles_table.php | 6 +- ...06_07_155444_create_meter_tokens_table.php | 6 +- ...8_102610_create_meter_parameters_table.php | 6 +- .../2018_06_11_131951_create_sms_table.php | 6 +- ...352_create_transaction_conflicts_table.php | 6 +- ...06_28_080905_create_access_rates_table.php | 6 +- ...0914_create_access_rate_payments_table.php | 6 +- ..._07_11_075002_create_permission_tables.php | 6 +- .../2018_07_12_133700_create_loans_table.php | 6 +- ...18_07_12_134253_create_customers_table.php | 6 +- ...18_10_04_195503_create_histories_table.php | 6 +- ...110924_create_meter_consumptions_table.php | 6 +- ...2_123911_create_payment_profiles_table.php | 6 +- ...018_11_29_090603_create_clusters_table.php | 6 +- ...018_12_05_144906_create_revenues_table.php | 6 +- ...1_083717_create_connection_types_table.php | 6 +- ...2018_12_13_083722_create_targets_table.php | 6 +- ..._12_13_100738_create_sub_targets_table.php | 6 +- .../2019_04_19_083645_customer_group.php | 6 +- ...2438_create_sub_connection_types_table.php | 6 +- ..._103123_create_connection_groups_table.php | 6 +- .../2019_05_15_122118_reports.php | 6 +- ...9_06_24_160040_create_mini_grids_table.php | 6 +- ..._133655_create_maintenance_users_table.php | 6 +- ...019_11_06_121116_create_energies_table.php | 6 +- .../2019_11_15_102431_create_solars_table.php | 6 +- ...19_11_26_063009_create_batteries_table.php | 6 +- .../2019_12_16_090907_create_assets_table.php | 6 +- ..._12_16_091934_create_asset_types_table.php | 6 +- ...12_16_092044_create_asset_people_table.php | 6 +- ..._12_16_093223_create_asset_rates_table.php | 6 +- .../2020_01_27_135206_create_logs_table.php | 6 +- .../2020_04_05_233604_create_p_v_s_table.php | 6 +- ...04_19_234527_create_restrictions_table.php | 9 +- ...020_04_19_235421_create_upgrades_table.php | 9 +- ...4_20_001454_create_subscriptions_table.php | 6 +- .../2020_06_20_085555_weather_data.php | 6 +- ...create_tariff_pricing_components_table.php | 6 +- ..._21_194542_create_social_tariffs_table.php | 6 +- ...create_social_tariff_piggy_banks_table.php | 6 +- ...15405_add_total_price_to_meter_tariffs.php | 6 +- .../2020_07_12_192802_create_agents_table.php | 6 +- ...130601_create_agent_transactions_table.php | 6 +- ...6_create_agent_balance_histories_table.php | 6 +- ...create_agent_assigned_appliances_table.php | 6 +- ...811_create_agent_sold_appliances_table.php | 6 +- ..._083600_create_agent_commissions_table.php | 6 +- ..._25_155837_create_agent_receipts_table.php | 6 +- ...8_03_081836_create_agent_charges_table.php | 6 +- ...748_create_agent_receipt_details_table.php | 6 +- ..._02_072509_create_time_of_usages_table.php | 6 +- ..._19_122517_create_sub_menu_items_table.php | 6 +- ...0_10_19_122649_create_menu_items_table.php | 6 +- ...2020_10_29_170007_create_plugins_table.php | 6 +- ...2_17_144527_create_main_settings_table.php | 6 +- ...12_23_165814_create_map_settings_table.php | 6 +- ...ransaction_to_agent_transactions_table.php | 6 +- ...130412_create_third_party_transactions.php | 6 +- ...nsaction_to_vodacom_transactions_table.php | 6 +- ...ansaction_to_airtel_transactions_table.php | 6 +- ...05_234039_create_ticket_settings_table.php | 6 +- ..._122556_add_columns_to_batteries_table.php | 6 +- ...1_18_123245_add_columns_to_p_v_s_table.php | 6 +- .../2021_02_18_153556_create_sms_bodies.php | 6 +- ...556_create_sms_resend_information_keys.php | 6 +- ...6421_create_sms_appliance_remind_rates.php | 6 +- ..._03_140758_create_sms_android_settings.php | 6 +- ...706_create_sms_variable_default_values.php | 6 +- .../2021_03_2_1561251_update_sms_table.php | 6 +- ...8_add_additional_json_column_to_people.php | 6 +- ...8_104840_create_person_documents_table.php | 6 +- ...085817_update_meter_consumptions_table.php | 6 +- ...add_down_payment_to_asset_people_table.php | 6 +- ...rst_payment_date_to_asset_people_table.php | 6 +- ..._092522_create_cash_transactions_table.php | 6 +- ...2021_10_18_220817_create_mail_settings.php | 6 +- ...5_10_093215_update_meter_tariffs_table.php | 6 +- ..._10_101348_update_social_tariffs_table.php | 6 +- ...update_tariff_pricing_components_table.php | 6 +- ...update_social_tariff_piggy_banks_table.php | 6 +- ...05_10_102047_update_access_rates_table.php | 6 +- ...2214_update_access_rate_payments_table.php | 6 +- ...05_10_102507_update_asset_people_table.php | 6 +- ...05_10_102649_update_transactions_table.php | 6 +- ..._102805_update_payment_histories_table.php | 6 +- ..._05_19_102938_update_asset_types_table.php | 6 +- ..._add_connection_column_to_agents_table.php | 6 +- .../2022_06_21_090125_create_calin_tables.php | 6 +- ...06_21_090327_create_calin_smart_tables.php | 6 +- .../2022_06_21_090338_create_kelin_tables.php | 6 +- ..._create_mesomb_payment_provider_tables.php | 6 +- .../2022_06_21_090351_create_spark_tables.php | 6 +- ...2022_06_21_090402_create_steama_tables.php | 6 +- .../2022_06_21_090412_create_stron_tables.php | 6 +- ..._create_swifta_payment_provider_tables.php | 6 +- ..._092948_create_registration_tail_table.php | 6 +- ...2_07_20_101605_create_ticketing_tables.php | 9 +- ...000000_create_bulk_registration_tables.php | 6 +- ...0327_add_direction_column_to_sms_table.php | 6 +- ...945_add_gateway_id_column_to_sms_table.php | 6 +- ...123_add_dispatched_column_to_sms_table.php | 6 +- ...42319_add_attempts_column_to_sms_table.php | 6 +- ..._0000000_create_viber_messaging_tables.php | 6 +- ...purchase_amount_to_meter_tariffs_table.php | 6 +- ...ate_wave_money_payment_provider_tables.php | 6 +- ..._11_29_000000_create_micro_star_tables.php | 6 +- ...000_update_swifta_authentication_table.php | 6 +- .../2022_14_12_create_sun_king_tables.php | 6 +- ...3_15_092048_add_colums_to_solars_table.php | 6 +- .../2023_03_16_105024_update_solars_table.php | 6 +- ...update_data_type_values_energies_table.php | 6 +- ...update_data_type_values_energies_table.php | 6 +- ...023_04_02_121811_create_wavecom_tables.php | 6 +- ...421_add_api_type_to_table_transactions.php | 6 +- .../2023_04_26_223352_update_sms_table.php | 6 +- .../2023_06_02_create_gome_long_tables.php | 6 +- ...assets_asset_people_asset_types_tables.php | 6 +- ...pdate_sms_appliance_remind_rates_table.php | 7 +- ...074114_update_wavecom_wavemoney_tables.php | 7 +- ...2023_11_03_112202_create_devices_table.php | 6 +- ...120614_create_solar_home_systems_table.php | 6 +- ..._configuration_columns_to_meters_table.php | 6 +- ...07_update_action_field_type_logs_table.php | 7 +- ..._drop_geo_id_column_from_address_table.php | 6 +- ...add_type_column_to_manufacturers_table.php | 6 +- ..._id_column_to_solar_home_systems_table.php | 6 +- ...date_person_id_column_in_devices_table.php | 6 +- ..._device_serial_column_in_devices_table.php | 6 +- ...ber_column_in_solar_home_systems_table.php | 6 +- .../2023_11_17_095204_create_tokens_table.php | 6 +- ...ce_serial_column_to_asset_people_table.php | 6 +- ...ce_serial_column_in_asset_people_table.php | 6 +- .../2024_01_01_create_daly_bms_tables.php | 6 +- ...2024_01_02_124146_create_e_bikes_table.php | 6 +- .../2024_01_12_create_angaza_tables.php | 6 +- ...age_type_column_to_main_settings_table.php | 6 +- ..._usage_type_column_to_menu_items_table.php | 6 +- ...24_09_30_113302_remove_siderbar_tables.php | 6 +- ...0_23_153042_add_amount_to_agent_charge.php | 6 +- ...0_30_154625_create_notifications_table.php | 6 +- ...24_10_31_180458_remove_batteries_table.php | 6 +- ...024_10_31_180510_remove_energies_table.php | 6 +- ...524_remove_mini_grid_frequencies_table.php | 6 +- .../2024_10_31_180539_remove_pvs_table.php | 6 +- .../2024_10_31_180546_remove_solars_table.php | 6 +- ...10_31_180605_remove_weather_data_table.php | 6 +- ...2024_10_31_180852_remove_agent_tickets.php | 6 +- ...2024_10_31_181016_remove_city_clusters.php | 6 +- ...drop_data_stream_column_from_mini_grid.php | 6 +- src/backend/database/seeders/AgentSeeder.php | 34 +++--- .../database/seeders/ClusterSeeder.php | 6 +- .../database/seeders/CustomerSeeder.php | 36 +++---- .../database/seeders/DatabaseSeeder.php | 6 +- src/backend/database/seeders/MeterSeeder.php | 6 +- .../seeders/SolarHomeSystemSeeder.php | 6 +- src/backend/database/seeders/TenantSeeder.php | 9 +- src/backend/database/seeders/TicketSeeder.php | 6 +- .../src/Console/Commands/InstallPackage.php | 6 +- .../Exceptions/AngazaApiResponseException.php | 6 +- .../AngazaCredentialController.php | 13 +-- .../Http/Requests/AngazaCredentialRequest.php | 6 +- .../src/Http/Resources/AngazaResource.php | 6 +- .../src/Models/AngazaCredential.php | 12 +-- .../src/Models/AngazaTransaction.php | 3 +- .../src/Modules/Api/AngazaSHSApi.php | 12 +-- .../src/Modules/Api/ApiRequests.php | 15 +-- .../Providers/AngazaSHSServiceProvider.php | 21 ++-- .../src/Providers/EventServiceProvider.php | 6 +- .../src/Providers/ObserverServiceProvider.php | 6 +- .../src/Providers/RouteServiceProvider.php | 12 +-- .../src/Services/AngazaCredentialService.php | 21 ++-- .../src/Services/ManufacturerService.php | 10 +- .../create_bulk_registration_tables.php | 6 +- .../src/Console/Commands/InstallPackage.php | 21 ++-- .../src/Console/Commands/UpdatePackage.php | 27 ++--- .../Exceptions/ClusterNotFoundException.php | 4 +- .../src/Exceptions/CsvDataParserException.php | 4 +- .../src/Exceptions/GoogleMapsApiException.php | 6 +- .../src/Exceptions/Handler.php | 9 +- .../ManufacturerNotSupportedException.php | 4 +- .../Exceptions/MiniGridNotFoundException.php | 4 +- .../src/Exceptions/MissingDataException.php | 4 +- .../Exceptions/VillageNotFoundException.php | 4 +- .../src/Helpers/CsvDataProcessor.php | 15 +-- .../src/Helpers/CsvFileParser.php | 9 +- .../Helpers/GeographicalLocationFinder.php | 6 +- .../Http/Controllers/ImportCsvController.php | 9 +- .../src/Http/Requests/ImportCsvRequest.php | 9 +- .../src/Http/Resources/CsvData.php | 6 +- .../src/Models/BaseModel.php | 6 +- .../bulk-registration/src/Models/CsvData.php | 3 +- .../BulkRegistrationServiceProvider.php | 21 ++-- .../src/Providers/EventServiceProvider.php | 6 +- .../src/Providers/ObserverServiceProvider.php | 6 +- .../src/Providers/RouteServiceProvider.php | 12 +-- .../src/Services/AddressService.php | 15 +-- .../src/Services/ApplianceTypeService.php | 12 +-- .../src/Services/CityService.php | 9 +- .../src/Services/ClusterService.php | 9 +- .../src/Services/ConnectionGroupService.php | 9 +- .../src/Services/ConnectionTypeService.php | 9 +- .../src/Services/CreatorService.php | 9 +- .../src/Services/CsvDataService.php | 9 +- .../GeographicalInformationService.php | 12 +-- .../src/Services/ICreatorService.php | 3 +- .../src/Services/ManufacturerService.php | 9 +- .../src/Services/MeterParameterService.php | 9 +- .../src/Services/MeterService.php | 9 +- .../src/Services/MeterTypeService.php | 9 +- .../src/Services/MiniGridService.php | 9 +- .../src/Services/PersonDocumentService.php | 12 +-- .../src/Services/PersonService.php | 9 +- .../src/Services/TariffService.php | 9 +- .../src/Test/Feature/ImportCsv.php | 9 +- .../inensus/calin-meter/src/CalinMeterApi.php | 9 +- .../src/Console/Commands/InstallPackage.php | 18 ++-- .../src/Console/Commands/UpdatePackage.php | 24 ++--- .../Exceptions/CalinApiResponseException.php | 4 +- .../calin-meter/src/Helpers/ApiHelpers.php | 12 +-- .../Controllers/CalinCredentialController.php | 12 +-- .../Http/Requests/CalinCredentialRequest.php | 6 +- .../Http/Requests/CalinMeterApiRequests.php | 9 +- .../src/Http/Resources/CalinResource.php | 6 +- .../src/Models/CalinCredential.php | 3 +- .../src/Models/CalinTransaction.php | 24 ++--- .../Providers/CalinMeterServiceProvider.php | 21 ++-- .../src/Providers/EventServiceProvider.php | 6 +- .../src/Providers/ObserverServiceProvider.php | 6 +- .../src/Providers/RouteServiceProvider.php | 12 +-- .../src/Services/CalinCredentialService.php | 12 +-- .../src/Tests/Unit/TokenGenerationTest.php | 9 +- .../src/CalinSmartMeterApi.php | 9 +- .../src/Console/Commands/InstallPackage.php | 18 ++-- .../src/Console/Commands/UpdatePackage.php | 24 ++--- .../CalinSmartApiResponseException.php | 4 +- ...alinSmartCreadentialsNotFoundException.php | 4 +- .../src/Helpers/ApiHelpers.php | 12 +-- .../CalinSmartCredentialController.php | 12 +-- .../Requests/CalinSmartCredentialRequest.php | 6 +- .../Requests/CalinSmartMeterApiRequests.php | 6 +- .../src/Http/Resources/CalinSmartResource.php | 6 +- .../src/Models/CalinSmartCredential.php | 3 +- .../src/Models/CalinSmartTransaction.php | 24 ++--- .../CalinSmartMeterServiceProvider.php | 21 ++-- .../src/Providers/EventServiceProvider.php | 6 +- .../src/Providers/ObserverServiceProvider.php | 6 +- .../src/Providers/RouteServiceProvider.php | 12 +-- .../Services/CalinSmartCredentialService.php | 12 +-- .../src/Tests/Unit/TokenGenerationTest.php | 9 +- .../src/Console/Commands/CheckPayments.php | 9 +- .../src/Console/Commands/InstallPackage.php | 6 +- .../src/Console/Commands/SyncBikes.php | 9 +- .../DalyBmsApiResponseException.php | 6 +- .../DalyBmsCredentialController.php | 12 +-- .../Requests/DalyBmsCredentialRequest.php | 6 +- .../src/Http/Resources/DalyBmsResource.php | 6 +- .../daly-bms/src/Models/DalyBmsCredential.php | 18 ++-- .../daly-bms/src/Models/DalyBmsDevice.php | 3 +- .../src/Models/DalyBmsTransaction.php | 3 +- .../daly-bms/src/Modules/Api/ApiRequests.php | 15 +-- .../daly-bms/src/Modules/Api/DalyBmsApi.php | 21 ++-- .../src/Providers/DalyBmsServiceProvider.php | 18 ++-- .../src/Providers/EventServiceProvider.php | 6 +- .../src/Providers/ObserverServiceProvider.php | 6 +- .../src/Providers/RouteServiceProvider.php | 12 +-- .../src/Services/DalyBmsCredentialService.php | 21 ++-- .../src/Services/ManufacturerService.php | 10 +- .../GomeLongMeterDataSynchronizer.php | 6 +- .../src/Console/Commands/InstallPackage.php | 6 +- .../src/Exceptions/CronJobException.php | 4 +- .../GomeLongApiResponseException.php | 6 +- .../GomeLongCredentialController.php | 12 +-- .../Requests/GomeLongCredentialRequest.php | 6 +- .../src/Http/Resources/GomeLongResource.php | 6 +- .../src/Models/GomeLongCredential.php | 12 +-- .../src/Models/GomeLongTariff.php | 9 +- .../src/Models/GomeLongTransaction.php | 3 +- .../src/Modules/Api/ApiRequests.php | 12 +-- .../src/Modules/Api/GomeLongMeterApi.php | 12 +-- .../src/Observers/MeterTariffObserver.php | 15 +-- .../src/Providers/EventServiceProvider.php | 6 +- .../GomeLongMeterServiceProvider.php | 21 ++-- .../src/Providers/ObserverServiceProvider.php | 6 +- .../src/Providers/RouteServiceProvider.php | 12 +-- .../Services/GomeLongCredentialService.php | 18 ++-- .../src/Services/GomeLongTariffService.php | 21 ++-- .../src/Services/ManufacturerService.php | 10 +- .../Console/Commands/AccessTokenRefresher.php | 9 +- .../src/Console/Commands/DataSynchronizer.php | 6 +- .../src/Console/Commands/InstallPackage.php | 21 ++-- .../Commands/ReadDailyMeterConsumptions.php | 6 +- .../ReadMinutelyMeterConsumptions.php | 6 +- .../src/Console/Commands/UpdatePackage.php | 24 ++--- .../src/Exceptions/CronJobException.php | 4 +- .../KelinApiAuthenticationException.php | 4 +- .../KelinApiCredentialsNotFoundException.php | 4 +- .../Exceptions/KelinApiEmtyDataException.php | 4 +- .../Exceptions/KelinApiResponseException.php | 4 +- .../kelin-meter/src/Helpers/ApiHelpers.php | 15 +-- .../src/Http/Clients/KelinMeterApiClient.php | 12 +-- .../src/Http/Controllers/IBaseController.php | 3 +- .../Controllers/KelinCredentialController.php | 12 +-- .../Controllers/KelinCustomerController.php | 15 +-- .../KelinDailyConsumptionController.php | 9 +- .../Http/Controllers/KelinMeterController.php | 15 +-- .../KelinMinutelyConsumptionController.php | 9 +- .../Controllers/KelinSettingController.php | 9 +- .../Controllers/KelinStatusController.php | 12 +-- .../KelinSyncSettingController.php | 9 +- .../Http/Requests/KelinCredentialRequest.php | 6 +- .../Resources/DailyConsumptionCollection.php | 6 +- .../Resources/DailyConsumptionResource.php | 6 +- .../Resources/KelinCredentialResource.php | 9 +- .../Resources/KelinCustomerCollection.php | 6 +- .../Http/Resources/KelinCustomerResource.php | 6 +- .../Http/Resources/KelinMeterCollection.php | 6 +- .../src/Http/Resources/KelinMeterResource.php | 6 +- .../Resources/KelinMeterStatusResource.php | 6 +- .../src/Http/Resources/KelinResource.php | 6 +- .../Http/Resources/KelinSettingCollection.php | 6 +- .../Http/Resources/KelinSettingResource.php | 6 +- .../MinutelyConsumptionCollection.php | 6 +- .../Resources/MinutelyConsumptionResource.php | 6 +- .../inensus/kelin-meter/src/KelinMeterApi.php | 13 +-- .../src/Models/KelinCredential.php | 3 +- .../kelin-meter/src/Models/KelinCustomer.php | 9 +- .../kelin-meter/src/Models/KelinMeter.php | 9 +- .../src/Models/KelinMeterConsumption.php | 6 +- .../src/Models/KelinMeterDailyData.php | 3 +- .../src/Models/KelinMeterMinutelyData.php | 3 +- .../kelin-meter/src/Models/KelinSetting.php | 6 +- .../src/Models/KelinSyncAction.php | 6 +- .../src/Models/KelinSyncSetting.php | 9 +- .../src/Models/KelinTransaction.php | 24 ++--- .../kelin-meter/src/Models/SyncStatus.php | 3 +- .../src/Observers/PersonObserver.php | 6 +- .../src/Providers/EventServiceProvider.php | 6 +- .../Providers/KelinMeterServiceProvider.php | 21 ++-- .../src/Providers/ObserverServiceProvider.php | 6 +- .../src/Providers/RouteServiceProvider.php | 12 +-- .../src/Services/DailyConsumptionService.php | 9 +- .../src/Services/ISynchronizeService.php | 3 +- .../src/Services/KelinCredentialService.php | 15 +-- .../src/Services/KelinCustomerService.php | 24 ++--- .../src/Services/KelinMeterService.php | 30 ++---- .../src/Services/KelinMeterStatusService.php | 12 +-- .../src/Services/KelinSettingService.php | 9 +- .../src/Services/KelinSyncActionService.php | 18 ++-- .../src/Services/KelinSyncSettingService.php | 15 +-- .../Services/MinutelyConsumptionService.php | 9 +- .../Services/PackageInstallationService.php | 9 +- .../src/Tests/Feature/RechargeMeterTest.php | 9 +- .../src/Console/Commands/InstallPackage.php | 18 ++-- .../src/Console/Commands/UpdatePackage.php | 21 ++-- ...MustHaveOnlyOneConnectedMeterException.php | 4 +- ...ombPaymentPhoneNumberNotFoundException.php | 4 +- .../MesombStatusFailedException.php | 4 +- .../MesombPaymentProviderController.php | 6 +- .../src/Http/Kernel.php | 3 +- .../Middleware/MesombTransactionRequest.php | 6 +- .../MesombTransactionProcessingResource.php | 6 +- .../src/Listeners/TransactionListener.php | 12 +-- .../src/Models/BaseModel.php | 9 +- .../src/Models/MesombTransaction.php | 12 +-- .../src/Providers/EventServiceProvider.php | 6 +- .../src/Providers/MesombServiceProvider.php | 18 ++-- .../Providers/MesombTransactionProvider.php | 42 +++----- .../src/Providers/ObserverServiceProvider.php | 6 +- .../src/Providers/RouteServiceProvider.php | 12 +-- .../src/Services/MesomTransactionService.php | 12 +-- .../src/Tests/Feature/PaymentTests.php | 18 ++-- .../src/Tests/Unit/PaymentProcessTests.php | 18 ++-- .../src/Console/Commands/InstallPackage.php | 18 ++-- .../src/Console/Commands/UpdatePackage.php | 24 ++--- .../MicroStarApiResponseException.php | 6 +- .../MicroStarCertificateController.php | 12 +-- .../MicroStarCredentialController.php | 13 +-- .../Controllers/MicroStarTestController.php | 10 +- .../Requests/ImportCertificateRequest.php | 9 +- .../Requests/MicroStarCredentialRequest.php | 6 +- .../src/Http/Resources/MicroStarResource.php | 6 +- .../src/Models/MicroStarCredential.php | 9 +- .../src/Models/MicroStarTransaction.php | 24 ++--- .../src/Modules/Api/ApiRequests.php | 12 +-- .../src/Modules/Api/MicroStarMeterApi.php | 12 +-- .../Modules/Api/Utils/ResponseResolver.php | 9 +- .../src/Providers/EventServiceProvider.php | 6 +- .../MicroStarMeterServiceProvider.php | 21 ++-- .../src/Providers/ObserverServiceProvider.php | 6 +- .../src/Providers/RouteServiceProvider.php | 12 +-- .../src/Services/ManufacturerService.php | 10 +- .../Services/MicroStarCertificateService.php | 9 +- .../Services/MicroStarCredentialService.php | 15 +-- .../Commands/InstallSparkMeterPackage.php | 18 ++-- .../Commands/SparkMeterDataSynchronizer.php | 6 +- .../Commands/SparkMeterSmsNotifier.php | 12 +-- .../SparkMeterTransactionStatusCheck.php | 6 +- .../Commands/UpdateSparkMeterPackage.php | 24 ++--- .../CredentialsNotFoundException.php | 4 +- .../CredentialsNotUpToDateException.php | 4 +- .../src/Exceptions/CronJobException.php | 4 +- .../NoOnlineSiteRecordException.php | 4 +- .../Exceptions/SitesNotUpToDateException.php | 4 +- .../Exceptions/SparkAPIResponseException.php | 4 +- .../Exceptions/WrongCredentialsException.php | 4 +- .../src/Helpers/InsertSparkMeterApi.php | 6 +- .../src/Helpers/ResultStatusChecker.php | 6 +- .../src/Helpers/SmTableEncryption.php | 6 +- .../src/Http/Controllers/IBaseController.php | 3 +- .../Controllers/SmCredentialController.php | 12 +-- .../Http/Controllers/SmCustomerController.php | 24 ++--- .../Controllers/SmMeterModelController.php | 15 +-- .../Controllers/SmSalesAccountController.php | 18 ++-- .../Http/Controllers/SmSettingController.php | 9 +- .../src/Http/Controllers/SmSiteController.php | 21 ++-- .../Http/Controllers/SmSmsBodyController.php | 12 +-- .../Controllers/SmSmsFeedbackController.php | 12 +-- .../Controllers/SmSmsSettingController.php | 9 +- .../SmSmsVariableDefaultValueController.php | 9 +- .../Controllers/SmSyncSettingController.php | 9 +- .../Http/Controllers/SmTariffController.php | 24 ++--- .../src/Http/Requests/SmCredentialRequest.php | 9 +- .../src/Http/Requests/SmCustomerRequest.php | 9 +- .../src/Http/Requests/SmSiteRequest.php | 9 +- .../src/Http/Requests/SmTariffRequest.php | 9 +- .../Http/Requests/SparkMeterApiRequests.php | 30 ++---- .../SparkMeterCredentialResource.php | 12 +-- .../src/Http/Resources/SparkResource.php | 6 +- .../src/Listeners/MeterParameterListener.php | 9 +- .../spark-meter/src/Listeners/SmsListener.php | 9 +- .../src/Listeners/TransactionListener.php | 9 +- .../spark-meter/src/Models/BaseModel.php | 9 +- .../spark-meter/src/Models/SmCredential.php | 3 +- .../spark-meter/src/Models/SmCustomer.php | 9 +- .../spark-meter/src/Models/SmMeterModel.php | 9 +- .../spark-meter/src/Models/SmOrganization.php | 3 +- .../spark-meter/src/Models/SmSalesAccount.php | 6 +- .../spark-meter/src/Models/SmSetting.php | 12 +-- .../inensus/spark-meter/src/Models/SmSite.php | 6 +- .../spark-meter/src/Models/SmSmsBody.php | 3 +- .../src/Models/SmSmsFeedbackWord.php | 3 +- .../src/Models/SmSmsNotifiedCustomer.php | 6 +- .../spark-meter/src/Models/SmSmsSetting.php | 6 +- .../src/Models/SmSmsVariableDefaultValue.php | 3 +- .../spark-meter/src/Models/SmSyncAction.php | 6 +- .../spark-meter/src/Models/SmSyncSetting.php | 9 +- .../spark-meter/src/Models/SmTariff.php | 9 +- .../spark-meter/src/Models/SmTransaction.php | 30 ++---- .../spark-meter/src/Models/SyncStatus.php | 3 +- .../GeographicalInformationObserver.php | 9 +- .../src/Observers/MeterTariffObserver.php | 6 +- .../src/Observers/PersonObserver.php | 6 +- .../src/Providers/EventServiceProvider.php | 6 +- .../src/Providers/ObserverServiceProvider.php | 6 +- .../SparkMeterRouteServiceProvider.php | 12 +-- .../Providers/SparkMeterServiceProvider.php | 21 ++-- .../src/Services/CredentialService.php | 12 +-- .../src/Services/CustomerService.php | 63 ++++------- .../src/Services/ISynchronizeService.php | 3 +- .../src/Services/MeterModelService.php | 27 ++--- .../src/Services/OrganizationService.php | 12 +-- .../Services/PackageInstallationService.php | 6 +- .../spark-meter/src/Services/SiteService.php | 39 +++---- .../src/Services/SmSalesAccoutService.php | 21 ++-- .../src/Services/SmSettingService.php | 9 +- .../src/Services/SmSmsBodyService.php | 21 ++-- .../src/Services/SmSmsFeedbackWordService.php | 15 +-- .../Services/SmSmsNotifiedCustomerService.php | 15 +-- .../src/Services/SmSmsSettingService.php | 15 +-- .../SmSmsVariableDefaultValueService.php | 12 +-- .../src/Services/SmSyncActionService.php | 18 ++-- .../src/Services/SmSyncSettingService.php | 18 ++-- .../src/Services/TariffService.php | 42 +++----- .../src/Services/TransactionService.php | 30 ++---- .../SparkSmsBalanceFeedbackBody.php | 9 +- .../SparkSmsBalanceFeedbackHeader.php | 9 +- .../BodyParsers/SparkSmsLowBalanceBody.php | 9 +- .../BodyParsers/SparkSmsLowBalanceHeader.php | 9 +- .../SparkSmsMeterResetFailedFeedbackBody.php | 9 +- .../SparkSmsMeterResetFeedbackBody.php | 9 +- .../SparkSmsMeterResetFeedbackHeader.php | 9 +- .../src/Sms/Senders/BalanceFeedback.php | 3 +- .../Sms/Senders/LowBalanceLimitNotifier.php | 3 +- .../src/Sms/Senders/MeterResetFeedback.php | 6 +- .../src/Sms/Senders/SparkSmsConfig.php | 3 +- .../spark-meter/src/Sms/SparkSmsTypes.php | 3 +- .../inensus/spark-meter/src/SparkMeterApi.php | 9 +- .../spark-meter/src/Tests/Feature/SendSms.php | 21 ++-- .../src/Tests/Unit/SmsNotifyTest.php | 30 ++---- .../src/Console/Commands/InstallPackage.php | 18 ++-- .../Commands/ReadHourlyMeterReadings.php | 9 +- .../Commands/SteamaMeterDataSynchronizer.php | 6 +- .../Console/Commands/SteamaSmsNotifier.php | 12 +-- .../src/Console/Commands/UpdatePackage.php | 24 ++--- .../src/Exceptions/CronJobException.php | 4 +- .../src/Exceptions/ModelNotFoundException.php | 4 +- .../Exceptions/SteamaApiResponseException.php | 4 +- .../Exceptions/WrongCredentialsException.php | 4 +- .../steama-meter/src/Helpers/ApiHelpers.php | 15 +-- .../src/Http/Clients/SteamaMeterApiClient.php | 24 ++--- .../src/Http/Controllers/IBaseController.php | 3 +- .../Controllers/SteamaAgentController.php | 18 ++-- .../SteamaCredentialController.php | 12 +-- .../Controllers/SteamaCustomerController.php | 27 ++--- .../Controllers/SteamaMeterController.php | 18 ++-- .../Controllers/SteamaSettingController.php | 9 +- .../Http/Controllers/SteamaSiteController.php | 21 ++-- .../Controllers/SteamaSmsBodyController.php | 12 +-- .../SteamaSmsFeedbackController.php | 12 +-- .../SteamaSmsSettingController.php | 9 +- ...teamaSmsVariableDefaultValueController.php | 9 +- .../SteamaSyncSettingController.php | 9 +- .../SteamaTransactionController.php | 9 +- .../Http/Requests/SteamaCredentialRequest.php | 6 +- .../Http/Requests/SteamaCustomerRequest.php | 6 +- .../Resources/SteamaCredentialResource.php | 12 +-- .../src/Http/Resources/SteamaResource.php | 6 +- .../src/Listeners/MeterParameterListener.php | 9 +- .../src/Listeners/SmsListener.php | 9 +- .../steama-meter/src/Models/BaseModel.php | 9 +- .../steama-meter/src/Models/SteamaAgent.php | 9 +- .../Models/SteamaAssetRatesPaymentPlan.php | 3 +- .../src/Models/SteamaCredential.php | 3 +- .../src/Models/SteamaCustomer.php | 18 ++-- .../Models/SteamaCustomerBasisPaymentPlan.php | 33 ++---- .../Models/SteamaCustomerBasisTimeOfUsage.php | 3 +- .../src/Models/SteamaFlatRatePaymentPlan.php | 3 +- .../src/Models/SteamaHybridPaymentPlan.php | 3 +- .../steama-meter/src/Models/SteamaMeter.php | 9 +- .../src/Models/SteamaMeterType.php | 6 +- ...amaMinimumTopUpRequirementsPaymentPlan.php | 3 +- .../src/Models/SteamaPerKwhPaymentPlan.php | 3 +- .../steama-meter/src/Models/SteamaSetting.php | 12 +-- .../steama-meter/src/Models/SteamaSite.php | 12 +-- .../src/Models/SteamaSiteLevelPaymentPlan.php | 9 +- .../Models/SteamaSiteLevelPaymentPlanType.php | 3 +- .../steama-meter/src/Models/SteamaSmsBody.php | 3 +- .../src/Models/SteamaSmsFeedbackWord.php | 3 +- .../src/Models/SteamaSmsNotifiedCustomer.php | 6 +- .../src/Models/SteamaSmsSetting.php | 6 +- .../Models/SteamaSmsVariableDefaultValue.php | 3 +- .../Models/SteamaSubscriptionPaymentPlan.php | 3 +- .../src/Models/SteamaSyncAction.php | 6 +- .../src/Models/SteamaSyncSetting.php | 9 +- .../steama-meter/src/Models/SteamaTariff.php | 6 +- .../SteamaTariffOverridePaymentPlan.php | 3 +- .../src/Models/SteamaTransaction.php | 27 ++--- .../src/Models/SteamaUserType.php | 6 +- .../steama-meter/src/Models/SyncStatus.php | 3 +- .../GeographicalInformationObserver.php | 6 +- .../src/Observers/PersonObserver.php | 6 +- .../src/Providers/EventServiceProvider.php | 6 +- .../src/Providers/ObserverServiceProvider.php | 6 +- .../src/Providers/RouteServiceProvider.php | 12 +-- .../Providers/SteamaMeterServiceProvider.php | 21 ++-- .../src/Services/ISynchronizeService.php | 3 +- .../Services/PackageInstallationService.php | 9 +- .../src/Services/SteamaAgentService.php | 27 ++--- .../Services/SteamaBitharvesterService.php | 6 +- .../src/Services/SteamaCredentialService.php | 12 +-- .../src/Services/SteamaCustomerService.php | 63 ++++------- .../Services/SteamaMeterReadingService.php | 6 +- .../src/Services/SteamaMeterService.php | 36 +++---- .../src/Services/SteamaSettingService.php | 9 +- .../SteamaSiteLevelPaymentPlanTypeService.php | 9 +- .../src/Services/SteamaSiteService.php | 30 ++---- .../src/Services/SteamaSmsBodyService.php | 21 ++-- .../Services/SteamaSmsFeedbackWordService.php | 15 +-- .../SteamaSmsNotifiedCustomerService.php | 15 +-- .../src/Services/SteamaSmsSettingService.php | 15 +-- .../SteamaSmsVariableDefaultValueService.php | 12 +-- .../src/Services/SteamaSyncSettingService.php | 15 +-- .../src/Services/SteamaTariffService.php | 10 +- .../Services/SteamaTransactionsService.php | 30 ++---- .../src/Services/SteamaUserTypeService.php | 6 +- .../src/Services/StemaSyncActionService.php | 18 ++-- .../SteamaSmsBalanceFeedbackBody.php | 9 +- .../SteamaSmsBalanceFeedbackHeader.php | 9 +- .../BodyParsers/SteamaSmsLowBalanceBody.php | 9 +- .../BodyParsers/SteamaSmsLowBalanceHeader.php | 9 +- .../src/Sms/Senders/BalanceFeedback.php | 3 +- .../Sms/Senders/LowBalanceLimitNotifier.php | 3 +- .../src/Sms/Senders/SteamaSmsConfig.php | 3 +- .../steama-meter/src/Sms/SteamaSmsTypes.php | 3 +- .../steama-meter/src/SteamaMeterApi.php | 10 +- .../src/Tests/Feature/SendSms.php | 18 ++-- .../src/Tests/Unit/SmsNotifyTest.php | 30 ++---- .../src/Console/Commands/InstallPackage.php | 18 ++-- .../src/Console/Commands/UpdatePackage.php | 24 ++--- .../Exceptions/StronApiResponseException.php | 4 +- .../stron-meter/src/Helpers/ApiHelpers.php | 15 +-- .../Controllers/StronCredentialController.php | 12 +-- .../Http/Requests/StronCredentialRequest.php | 6 +- .../Http/Requests/StronMeterApiRequests.php | 9 +- .../Resources/StronCredentialResource.php | 12 +-- .../src/Http/Resources/StronResource.php | 6 +- .../src/Models/StronCredential.php | 3 +- .../src/Models/StronTransaction.php | 24 ++--- .../src/Providers/EventServiceProvider.php | 6 +- .../src/Providers/ObserverServiceProvider.php | 6 +- .../src/Providers/RouteServiceProvider.php | 12 +-- .../Providers/StronMeterServiceProvider.php | 21 ++-- .../src/Services/StronCredentialService.php | 12 +-- .../inensus/stron-meter/src/StronMeterApi.php | 9 +- .../src/Tests/Unit/TokenGenerationTest.php | 9 +- .../src/Console/Commands/InstallPackage.php | 18 ++-- .../SunKingApiResponseException.php | 6 +- .../SunKingCredentialController.php | 13 +-- .../Requests/SunKingCredentialRequest.php | 6 +- .../src/Http/Resources/SunKingResource.php | 6 +- .../src/Models/SunKingCredential.php | 21 ++-- .../src/Models/SunKingTransaction.php | 3 +- .../src/Modules/Api/ApiRequests.php | 15 +-- .../src/Modules/Api/SunKingSHSApi.php | 12 +-- .../src/Providers/EventServiceProvider.php | 6 +- .../src/Providers/ObserverServiceProvider.php | 6 +- .../src/Providers/RouteServiceProvider.php | 12 +-- .../Providers/SunKingSHSServiceProvider.php | 21 ++-- .../src/Services/ManufacturerService.php | 10 +- .../src/Services/SunKingCredentialService.php | 21 ++-- .../src/Console/Commands/InstallPackage.php | 24 ++--- .../Commands/TransactionStatusChecker.php | 9 +- .../src/Console/Commands/UpdatePackage.php | 30 ++---- .../Exceptions/CipherNotValidException.php | 4 +- .../CustomerAddressNotFoundException.php | 4 +- .../SwiftaValidationFailedException.php | 4 +- .../TransactionAmountDifferentException.php | 4 +- .../TransactionNotExistsException.php | 4 +- .../SwiftaAuthenticationController.php | 10 +- .../SwiftaPaymentProviderController.php | 13 +-- .../src/Http/Kernel.php | 3 +- .../src/Http/Middleware/SwiftaMiddleware.php | 9 +- .../SwiftaTransactionCallbackMiddleware.php | 10 +- .../SwiftaTransactionMiddleware.php | 6 +- .../Requests/SwiftaTransactionRequest.php | 6 +- .../Http/Requests/SwiftaValidationRequest.php | 6 +- .../src/Listeners/TransactionListener.php | 12 +-- .../src/Models/SwiftaAuthentication.php | 3 +- .../src/Models/SwiftaTransaction.php | 18 ++-- .../src/Providers/EventServiceProvider.php | 6 +- .../src/Providers/ObserverServiceProvider.php | 6 +- .../src/Providers/RouteServiceProvider.php | 12 +-- .../src/Providers/SwiftaServiceProvider.php | 18 ++-- .../Providers/SwiftaTransactionProvider.php | 45 +++----- .../Services/SwiftaAuthenticationService.php | 10 +- .../src/Services/SwiftaTransactionService.php | 33 ++---- .../src/Tests/Feature/TransactionTests.php | 18 ++-- .../src/Tests/Feature/ValidationTests.php | 30 ++---- .../src/Tests/Unit/PaymentProcessTests.php | 18 ++-- .../ticket/src/Exceptions/ApiUserNotFound.php | 4 +- .../TicketOwnerNotFoundException.php | 4 +- .../src/Factories/TicketCategoryFactory.php | 6 +- .../src/Http/Controllers/Controller.php | 3 +- .../Controllers/TicketAgentController.php | 10 +- .../Controllers/TicketCategoryController.php | 13 +-- .../Controllers/TicketCommentController.php | 10 +- .../src/Http/Controllers/TicketController.php | 16 +-- .../Controllers/TicketCustomerController.php | 12 +-- .../Controllers/TicketExportController.php | 15 +-- .../Http/Controllers/TicketUserController.php | 15 +-- .../Http/Controllers/WatcherController.php | 18 ++-- .../Http/Requests/TicketCategoryRequest.php | 6 +- .../Requests/TicketingUserExternalRequest.php | 12 +-- .../Http/Requests/TicketingUserRequest.php | 9 +- .../Http/Requests/UserTicketCreateRequest.php | 30 ++---- .../src/Http/Resources/TicketResource.php | 6 +- .../ticket/src/Interfaces/ITicketProvider.php | 3 +- .../inensus/ticket/src/Jobs/OutputJob.php | 9 +- .../inensus/ticket/src/Models/BaseModel.php | 4 +- .../inensus/ticket/src/Models/Ticket.php | 36 +++---- .../ticket/src/Models/TicketCategory.php | 6 +- .../ticket/src/Models/TicketComment.php | 9 +- .../ticket/src/Models/TicketOutsource.php | 6 +- .../src/Models/TicketOutsourceReport.php | 3 +- .../inensus/ticket/src/Models/TicketUser.php | 6 +- .../Providers/TicketRootServiceProvider.php | 12 +-- .../src/Providers/TicketServiceProvider.php | 15 +-- .../src/Services/TicketCategoryService.php | 21 ++-- .../src/Services/TicketCommentService.php | 12 +-- .../src/Services/TicketOutSourceService.php | 21 ++-- .../Services/TicketOutsourceReportService.php | 24 ++--- .../ticket/src/Services/TicketService.php | 30 ++---- .../ticket/src/Services/TicketUserService.php | 27 ++--- .../src/Console/Commands/InstallPackage.php | 18 ++-- .../src/Console/Commands/UpdatePackage.php | 24 ++--- .../Exceptions/MessageNotSentException.php | 4 +- .../Exceptions/WebhookNotCreatedException.php | 4 +- .../Controllers/ViberCredentialController.php | 12 +-- .../Http/Controllers/WebhookController.php | 24 ++--- .../Http/Requests/ViberCredentialRequest.php | 6 +- .../src/Http/Resources/ViberResource.php | 6 +- .../src/Models/ViberContact.php | 6 +- .../src/Models/ViberCredential.php | 3 +- .../src/Models/ViberMessage.php | 3 +- .../src/Providers/EventServiceProvider.php | 6 +- .../src/Providers/ObserverServiceProvider.php | 6 +- .../src/Providers/RouteServiceProvider.php | 12 +-- .../ViberMessagingServiceProvider.php | 21 ++-- .../src/Services/AccountService.php | 6 +- .../src/Services/ViberContactService.php | 33 ++---- .../src/Services/ViberCredentialService.php | 15 +-- .../src/Services/ViberMessageService.php | 21 ++-- .../src/Services/WebhookService.php | 6 +- .../viber-messaging/src/ViberGateway.php | 3 +- ...ate_wave_money_payment_provider_tables.php | 9 +- .../src/Console/Commands/InstallPackage.php | 18 ++-- .../src/Console/Commands/UpdatePackage.php | 24 ++--- .../Http/Controllers/WaveMoneyController.php | 12 +-- .../WaveMoneyCredentialController.php | 12 +-- ...WaveMoneyTransactionCallbackMiddleware.php | 10 +- .../WaveMoneyTransactionMiddleware.php | 6 +- .../TransactionCallbackRequestMapper.php | 6 +- .../Requests/TransactionInitializeRequest.php | 6 +- .../Requests/WaveMoneyCredentialRequest.php | 6 +- .../src/Http/Resources/WaveMoneyResource.php | 6 +- .../src/Models/WaveMoneyCredential.php | 21 ++-- .../src/Models/WaveMoneyTransaction.php | 51 +++------ .../src/Modules/Api/AbstractApi.php | 10 +- .../Api/Data/TransactionCallbackData.php | 57 ++++------ .../Exceptions/ApiRequestFailedException.php | 6 +- .../src/Modules/Api/RequestMethod.php | 3 +- .../Api/Resources/AbstractApiResource.php | 24 ++--- .../Resources/StartTransactionResource.php | 27 ++--- .../src/Modules/Api/WaveMoneyApi.php | 4 +- .../src/Modules/Api/WaveMoneyApiService.php | 9 +- .../WaveMoneyTransactionService.php | 33 ++---- .../src/Providers/EventServiceProvider.php | 6 +- .../src/Providers/ObserverServiceProvider.php | 6 +- .../src/Providers/RouteServiceProvider.php | 12 +-- ...aveMoneyPaymentProviderServiceProvider.php | 21 ++-- .../WaveMoneyTransactionProvider.php | 48 +++------ .../Services/WaveMoneyCredentialService.php | 15 +-- .../src/Console/Commands/InstallPackage.php | 6 +- .../WaveComTransactionController.php | 10 +- .../Requests/UploadTransactionRequest.php | 9 +- .../src/Models/WaveComTransaction.php | 51 +++------ .../src/Providers/EventServiceProvider.php | 6 +- .../src/Providers/ObserverServiceProvider.php | 6 +- .../src/Providers/RouteServiceProvider.php | 12 +-- .../Providers/WaveComTransactionProvider.php | 39 +++---- .../WavecomPaymentProviderServiceProvider.php | 21 ++-- .../src/Services/TransactionService.php | 16 +-- src/backend/pint.json | 9 -- src/backend/tests/CreatesApplication.php | 6 +- src/backend/tests/Feature/AddressTest.php | 12 +-- src/backend/tests/Feature/AgentAppTest.php | 63 ++++------- .../tests/Feature/AgentAppTicketsTest.php | 18 ++-- .../Feature/AgentAssignedApplianceWebTest.php | 12 +-- .../Feature/AgentBalanceHistoryWebTest.php | 9 +- src/backend/tests/Feature/AgentChargeTest.php | 9 +- .../tests/Feature/AgentCommissionTest.php | 18 ++-- .../tests/Feature/AgentReceiptTest.php | 15 +-- .../Feature/AgentSoldApplianceWebTest.php | 9 +- src/backend/tests/Feature/AgentTest.php | 27 ++--- .../tests/Feature/AgentTransactionWebTest.php | 9 +- src/backend/tests/Feature/CalinApiTest.php | 6 +- src/backend/tests/Feature/CityTest.php | 24 ++--- .../Feature/ClusterDashboardCacheTest.php | 18 ++-- .../tests/Feature/ClusterRevenueTest.php | 30 ++---- src/backend/tests/Feature/ClusterTest.php | 24 ++--- .../tests/Feature/ConnectionGroupTest.php | 21 ++-- .../tests/Feature/ConnectionTypeTest.php | 21 ++-- .../tests/Feature/CreateEnvironments.php | 102 ++++++------------ .../EnergyTransactionProcessorTest.php | 6 +- .../tests/Feature/ManufacturerTest.php | 15 +-- .../tests/Feature/MeterParameterTest.php | 9 +- src/backend/tests/Feature/MeterTariffTest.php | 36 +++---- src/backend/tests/Feature/MeterTest.php | 54 ++++------ src/backend/tests/Feature/MeterTypeTest.php | 21 ++-- .../tests/Feature/MiniGridRevenueTest.php | 27 ++--- src/backend/tests/Feature/MiniGridTest.php | 27 ++--- src/backend/tests/Feature/PersonTest.php | 36 +++---- src/backend/tests/Feature/SendSmsTest.php | 18 ++-- .../Feature/SocialTariffPiggyBankTest.php | 9 +- .../tests/Feature/SubConnectionTypeTest.php | 18 ++-- src/backend/tests/Feature/TargetTest.php | 15 +-- src/backend/tests/Feature/TicketTest.php | 39 +++---- src/backend/tests/Feature/TimeOfUsageTest.php | 9 +- .../tests/Feature/TokenProcessorTest.php | 6 +- .../tests/Feature/UserResourceTest.php | 21 ++-- .../tests/RefreshMultipleDatabases.php | 9 +- src/backend/tests/TestCase.php | 6 +- .../tests/Unit/AgentSellApplianceTest.php | 12 +-- .../tests/Unit/Exports/DailyTransactions.php | 7 +- src/backend/tests/Unit/SmsProcessorTest.php | 18 ++-- .../tests/Unit/Transaction/AccessRateTest.php | 21 ++-- .../Transaction/VodacomTransactionTest.php | 9 +- 1466 files changed, 5496 insertions(+), 11186 deletions(-) delete mode 100644 src/backend/pint.json diff --git a/src/backend/.php-cs-fixer.dist.php b/src/backend/.php-cs-fixer.dist.php index 3c7dfce40..a16b630b5 100644 --- a/src/backend/.php-cs-fixer.dist.php +++ b/src/backend/.php-cs-fixer.dist.php @@ -15,9 +15,23 @@ return (new PhpCsFixer\Config()) ->setRules([ '@Symfony' => true, - // customisation 'no_superfluous_phpdoc_tags' => false, 'yoda_style' => false, + 'method_chaining_indentation' => true, + 'braces_position' => [ + 'control_structures_opening_brace' => 'same_line', + 'functions_opening_brace' => 'same_line', + 'anonymous_functions_opening_brace' => 'same_line', + 'classes_opening_brace' => 'same_line', + 'anonymous_classes_opening_brace' => 'same_line', + 'allow_single_line_empty_anonymous_classes' => true, + 'allow_single_line_anonymous_functions' => true, + ], + 'method_argument_space' => [ + 'on_multiline' => 'ensure_fully_multiline', + ], + 'single_line_empty_body' => true, + ]) ->setFinder($finder) ; diff --git a/src/backend/app/Console/Commands/AbstractSharedCommand.php b/src/backend/app/Console/Commands/AbstractSharedCommand.php index 545559193..49b28024a 100644 --- a/src/backend/app/Console/Commands/AbstractSharedCommand.php +++ b/src/backend/app/Console/Commands/AbstractSharedCommand.php @@ -9,8 +9,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -abstract class AbstractSharedCommand extends Command -{ +abstract class AbstractSharedCommand extends Command { protected const EXECUTE_FOR_ONE = 1; protected const EXECUTE_FOR_ALL = 0; @@ -20,8 +19,7 @@ abstract class AbstractSharedCommand extends Command /** * Configure the command. */ - protected function configure(): void - { + protected function configure(): void { parent::configure(); $this->addOption( @@ -32,8 +30,7 @@ protected function configure(): void ); } - protected function execute(InputInterface $input, OutputInterface $output) - { + protected function execute(InputInterface $input, OutputInterface $output) { /** @var DatabaseProxyManagerService $databaseProxyManagerService */ $databaseProxyManagerService = app()->make(DatabaseProxyManagerService::class); diff --git a/src/backend/app/Console/Commands/AccessRateChecker.php b/src/backend/app/Console/Commands/AccessRateChecker.php index 940cd571c..b7b3737c2 100644 --- a/src/backend/app/Console/Commands/AccessRateChecker.php +++ b/src/backend/app/Console/Commands/AccessRateChecker.php @@ -5,14 +5,12 @@ use App\Models\AccessRate\AccessRatePayment; use Carbon\Carbon; -class AccessRateChecker extends AbstractSharedCommand -{ +class AccessRateChecker extends AbstractSharedCommand { protected $signature = 'accessrate:check'; protected $description = 'Updates the "debt" field, based on "due_date" field'; - public function runInCompanyScope(): void - { + public function runInCompanyScope(): void { // get all access-rate payments where due Date is <= today $accessRatePayments = AccessRatePayment::where('due_date', '<=', Carbon::now())->get(); diff --git a/src/backend/app/Console/Commands/AddMeterAddress.php b/src/backend/app/Console/Commands/AddMeterAddress.php index a8c983a18..874e67d39 100644 --- a/src/backend/app/Console/Commands/AddMeterAddress.php +++ b/src/backend/app/Console/Commands/AddMeterAddress.php @@ -5,19 +5,16 @@ use App\Models\Address\Address; use App\Models\Meter\MeterParameter; -class AddMeterAddress extends AbstractSharedCommand -{ +class AddMeterAddress extends AbstractSharedCommand { protected $signature = 'meters:addAddress'; protected $description = 'Creates an address entry for all every registered meter. Sets them all to village 1'; - public function __construct(private MeterParameter $meterParameter, private Address $address) - { + public function __construct(private MeterParameter $meterParameter, private Address $address) { parent::__construct(); } - public function runInCompanyScope(): void - { + public function runInCompanyScope(): void { $usedMeters = $this->meterParameter::all(); foreach ($usedMeters as $meter) { diff --git a/src/backend/app/Console/Commands/AddPlugin.php b/src/backend/app/Console/Commands/AddPlugin.php index 21a55c993..81bf9a84d 100644 --- a/src/backend/app/Console/Commands/AddPlugin.php +++ b/src/backend/app/Console/Commands/AddPlugin.php @@ -4,19 +4,16 @@ use App\Services\PluginsService; -class AddPlugin extends AbstractSharedCommand -{ +class AddPlugin extends AbstractSharedCommand { protected $signature = 'plugin:add {name} {composer_name} {description}'; protected $description = 'Plugin Details adding to database'; - public function __construct(private PluginsService $pluginsService) - { + public function __construct(private PluginsService $pluginsService) { parent::__construct(); } - public function runInCompanyScope(): void - { + public function runInCompanyScope(): void { $name = $this->argument('name'); $composer_name = $this->argument('composer_name'); $description = $this->argument('description'); diff --git a/src/backend/app/Console/Commands/AdminPasswordResetter.php b/src/backend/app/Console/Commands/AdminPasswordResetter.php index 30856ffbf..5ad795609 100644 --- a/src/backend/app/Console/Commands/AdminPasswordResetter.php +++ b/src/backend/app/Console/Commands/AdminPasswordResetter.php @@ -4,19 +4,16 @@ use App\Services\UserService; -class AdminPasswordResetter extends AbstractSharedCommand -{ +class AdminPasswordResetter extends AbstractSharedCommand { protected $signature = 'reset:admin-password'; protected $description = 'Reset forgotten password'; - public function __construct(private UserService $userService) - { + public function __construct(private UserService $userService) { parent::__construct(); } - public function runInCompanyScope(): void - { + public function runInCompanyScope(): void { $admin = $this->userService->resetAdminPassword(); $this->alert(' Please use following credentials to login: diff --git a/src/backend/app/Console/Commands/AssetRateChecker.php b/src/backend/app/Console/Commands/AssetRateChecker.php index b6b06646f..4a629962c 100644 --- a/src/backend/app/Console/Commands/AssetRateChecker.php +++ b/src/backend/app/Console/Commands/AssetRateChecker.php @@ -13,8 +13,7 @@ use Inensus\Ticket\Models\TicketCategory; use Inensus\Ticket\Services\TicketService; -class AssetRateChecker extends AbstractSharedCommand -{ +class AssetRateChecker extends AbstractSharedCommand { protected $signature = 'asset-rate:check'; protected $description = 'Checks if any asset rate is due and creates a ticket and reminds the customer'; @@ -30,14 +29,12 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { $this->remindUpComingRates(); $this->findOverDueRates(); } - private function remindUpComingRates(): void - { + private function remindUpComingRates(): void { $smsApplianceRemindRates = $this->getApplianceRemindRates(); $smsApplianceRemindRates->each(function ($smsApplianceRemindRate) { $dueAssetRates = $this->assetRate::with([ @@ -61,8 +58,7 @@ function ($q) { }); } - private function findOverDueRates(): void - { + private function findOverDueRates(): void { $smsApplianceRemindRates = $this->getApplianceRemindRates(); $smsApplianceRemindRates->each(function ($smsApplianceRemindRate) { $overDueRates = $this->assetRate::with(['assetPerson.asset', 'assetPerson.person.addresses']) @@ -79,14 +75,12 @@ private function findOverDueRates(): void }); } - private function sendReminderSms(AssetRate $assetRate): void - { + private function sendReminderSms(AssetRate $assetRate): void { $smsService = app()->make(SmsService::class); $smsService->sendSms($assetRate, SmsTypes::APPLIANCE_RATE, SmsConfigs::class); } - private function sendReminders($dueAssetRates, $smsType) - { + private function sendReminders($dueAssetRates, $smsType) { $dueAssetRates->each(function ($dueAssetRate) use ($smsType) { $this->sendReminderSms($dueAssetRate); if ($smsType === SmsTypes::OVER_DUE_APPLIANCE_RATE) { @@ -97,8 +91,7 @@ private function sendReminders($dueAssetRates, $smsType) }); } - private function createReminderTicket(AssetRate $assetRate, $overDue = false): void - { + private function createReminderTicket(AssetRate $assetRate, $overDue = false): void { $currency = $this->mainSettingsService->getAll()->first()->currency; // create ticket for customer service $creator = $this->user->newQuery()->firstOrCreate([ @@ -128,8 +121,7 @@ private function createReminderTicket(AssetRate $assetRate, $overDue = false): v ); } - private function getApplianceRemindRates(): Collection|array - { + private function getApplianceRemindRates(): Collection|array { return $this->smsApplianceRemindRateService->getApplianceRemindRates(); } } diff --git a/src/backend/app/Console/Commands/BackupFull.php b/src/backend/app/Console/Commands/BackupFull.php index 587a70596..cc71d9eaa 100644 --- a/src/backend/app/Console/Commands/BackupFull.php +++ b/src/backend/app/Console/Commands/BackupFull.php @@ -6,14 +6,12 @@ use Illuminate\Console\Command; -class BackupFull extends Command -{ +class BackupFull extends Command { protected $signature = 'backup:full'; protected $description = 'Run the backup for core base database and all tenant databases'; - public function handle(): void - { + public function handle(): void { $this->info('Starting backup for core database'); config(['database.connections.mysql' => config('database.connections.micro_power_manager')]); $this->call('backup:run', [ diff --git a/src/backend/app/Console/Commands/BackupTenantDatabase.php b/src/backend/app/Console/Commands/BackupTenantDatabase.php index c8cf57838..e3164e6b9 100644 --- a/src/backend/app/Console/Commands/BackupTenantDatabase.php +++ b/src/backend/app/Console/Commands/BackupTenantDatabase.php @@ -4,14 +4,12 @@ namespace App\Console\Commands; -class BackupTenantDatabase extends AbstractSharedCommand -{ +class BackupTenantDatabase extends AbstractSharedCommand { protected $signature = 'backup-tenant:run'; protected $description = 'Run the backup for provided tenant database(s)'; - public function handle() - { + public function handle() { $databaseName = config('database.connections.shard'); $this->info('Starting backup for tenant databases'); dump($this->arguments()); diff --git a/src/backend/app/Console/Commands/CalinMeterReader.php b/src/backend/app/Console/Commands/CalinMeterReader.php index 3fee9b062..99281a857 100644 --- a/src/backend/app/Console/Commands/CalinMeterReader.php +++ b/src/backend/app/Console/Commands/CalinMeterReader.php @@ -9,17 +9,14 @@ * Reads the daily consumptions of meters * Class CalinMeterReader. */ -class CalinMeterReader extends AbstractSharedCommand -{ +class CalinMeterReader extends AbstractSharedCommand { protected $signature = 'calinMeters:readOnline'; - public function __construct(private Meter $meter, private CalinReadMeter $calinReadMeter) - { + public function __construct(private Meter $meter, private CalinReadMeter $calinReadMeter) { parent::__construct(); } - public function runInCompanyScope(): void - { + public function runInCompanyScope(): void { $meters = $this->meter::whereHas( 'meterType', function ($q) { diff --git a/src/backend/app/Console/Commands/ClustersDashboardCacheDataGenerator.php b/src/backend/app/Console/Commands/ClustersDashboardCacheDataGenerator.php index a1202f9d5..7c57988d6 100644 --- a/src/backend/app/Console/Commands/ClustersDashboardCacheDataGenerator.php +++ b/src/backend/app/Console/Commands/ClustersDashboardCacheDataGenerator.php @@ -4,8 +4,7 @@ use App\Services\ClustersDashboardCacheDataService; -class ClustersDashboardCacheDataGenerator extends AbstractSharedCommand -{ +class ClustersDashboardCacheDataGenerator extends AbstractSharedCommand { protected $signature = 'update:cachedClustersDashboardData'; protected $description = 'Update Clusters Dashboard Data'; @@ -16,8 +15,7 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { $this->clustersDashboardCacheDataService->setData(); } } diff --git a/src/backend/app/Console/Commands/CreateDummyCompanyWithData.php b/src/backend/app/Console/Commands/CreateDummyCompanyWithData.php index eb1b5cfb1..0c35666ca 100644 --- a/src/backend/app/Console/Commands/CreateDummyCompanyWithData.php +++ b/src/backend/app/Console/Commands/CreateDummyCompanyWithData.php @@ -7,8 +7,7 @@ use Illuminate\Support\Facades\DB; use MPM\DatabaseProxy\DatabaseProxyManagerService; -class CreateDummyCompanyWithData extends Command -{ +class CreateDummyCompanyWithData extends Command { public const SQL_DUMMY_DATA_FILE_NAMES = [ 'dummy_agent_data.sql', 'dummy_data.sql', @@ -46,8 +45,7 @@ public function __construct( parent::__construct(); } - public function handle() - { + public function handle() { try { foreach (self::SQL_DUMMY_DATA_FILE_NAMES as $sqlFile) { $path = __DIR__.'/../../../database/dummyData/'.$sqlFile; @@ -67,8 +65,7 @@ public function handle() } } - private function importSqlDump($path, $databaseName) - { + private function importSqlDump($path, $databaseName) { try { DB::select("USE $databaseName"); $sql = file_get_contents($path); diff --git a/src/backend/app/Console/Commands/DummyDataCreator.php b/src/backend/app/Console/Commands/DummyDataCreator.php index 904af260c..6286e3371 100644 --- a/src/backend/app/Console/Commands/DummyDataCreator.php +++ b/src/backend/app/Console/Commands/DummyDataCreator.php @@ -24,8 +24,7 @@ use Inensus\WavecomPaymentProvider\Models\WaveComTransaction; use Inensus\WaveMoneyPaymentProvider\Models\WaveMoneyTransaction; -class DummyDataCreator extends AbstractSharedCommand -{ +class DummyDataCreator extends AbstractSharedCommand { protected $signature = 'dummy:create-data {amount} {--company-id=} {--type=}'; protected $description = 'creates dummy data for demo company'; @@ -62,8 +61,7 @@ public function __construct( parent::__construct(); } - public function handle() - { + public function handle() { $companyId = $this->option('company-id'); $type = $this->option('type') ?? 'transaction'; $amount = $this->argument('amount'); @@ -91,8 +89,7 @@ public function handle() } } - private function generateTransaction(): void - { + private function generateTransaction(): void { try { // get randomly a user $randomMeter = $this->meter::inRandomOrder()->with([ @@ -288,13 +285,11 @@ private function generateTransaction(): void } } - private function getTransactionTypeRandomlyFromTransactionTypes() - { + private function getTransactionTypeRandomlyFromTransactionTypes() { return $this->transactionTypes[array_rand($this->transactionTypes)]; } - private function generateTicket() - { + private function generateTicket() { $randomCategory = $this->ticketCategory->newQuery()->inRandomOrder()->first(); $fakeSentence = $this->generateFakeSentence(); $randomCreator = $this->user->inRandomOrder()->first(); @@ -342,8 +337,7 @@ private function generateTicket() } } - private function generateFakeSentence($minWords = 5, $maxWords = 15) - { + private function generateFakeSentence($minWords = 5, $maxWords = 15) { $loremIpsum = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.'; $words = explode(' ', $loremIpsum); diff --git a/src/backend/app/Console/Commands/EcosysCustomerDatabaseParser.php b/src/backend/app/Console/Commands/EcosysCustomerDatabaseParser.php index b0a3d5da4..3c294f13a 100644 --- a/src/backend/app/Console/Commands/EcosysCustomerDatabaseParser.php +++ b/src/backend/app/Console/Commands/EcosysCustomerDatabaseParser.php @@ -5,20 +5,17 @@ use Illuminate\Support\Facades\Log; use MPM\CustomBulkRegistration\Ecosys\CustomerDatabaseParser; -class EcosysCustomerDatabaseParser extends AbstractSharedCommand -{ +class EcosysCustomerDatabaseParser extends AbstractSharedCommand { // --company-id=36 protected $signature = 'ecosys:db-file-parser {--company-id=}'; protected $description = 'custom database file parser for ecosys'; - public function __construct(private CustomerDatabaseParser $customerDatabaseParser) - { + public function __construct(private CustomerDatabaseParser $customerDatabaseParser) { parent::__construct(); } - public function handle(): void - { + public function handle(): void { $this->info('Command started'); Log::info('command running w '.$this->option('company-id')); $result = $this->customerDatabaseParser->insertFromCsv(); diff --git a/src/backend/app/Console/Commands/MailApplianceDebtsCommand.php b/src/backend/app/Console/Commands/MailApplianceDebtsCommand.php index d4c93a855..2902e4332 100644 --- a/src/backend/app/Console/Commands/MailApplianceDebtsCommand.php +++ b/src/backend/app/Console/Commands/MailApplianceDebtsCommand.php @@ -5,14 +5,12 @@ use App\Services\ApplianceRateService; use MPM\OutstandingDebts\OutstandingDebtsExportService; -class MailApplianceDebtsCommand extends AbstractSharedCommand -{ +class MailApplianceDebtsCommand extends AbstractSharedCommand { protected $signature = 'mail:appliance-debts'; protected $description = 'Send mail to customers with appliance debts'; - public function handle(ApplianceRateService $applianceRateService, OutstandingDebtsExportService $outstandingDebtsExportService): void - { + public function handle(ApplianceRateService $applianceRateService, OutstandingDebtsExportService $outstandingDebtsExportService): void { $applianceDebtHavingCustomerCount = $applianceRateService->queryOutstandingDebtsByApplianceRates()->count(); // do not send mail if there is no customer with appliance debt if ($applianceDebtHavingCustomerCount > 0) { diff --git a/src/backend/app/Console/Commands/MakeMigrationTenant.php b/src/backend/app/Console/Commands/MakeMigrationTenant.php index 3e8755ee3..b27584c94 100644 --- a/src/backend/app/Console/Commands/MakeMigrationTenant.php +++ b/src/backend/app/Console/Commands/MakeMigrationTenant.php @@ -4,14 +4,12 @@ use Illuminate\Console\Command; -class MakeMigrationTenant extends Command -{ +class MakeMigrationTenant extends Command { protected $signature = 'make:migration-tenant {migration-name}'; protected $description = 'Create new migration file for tenant database(s)'; - public function handle() - { + public function handle() { $migrationName = $this->argument('migration-name'); $this->call('make:migration', [ 'name' => $migrationName, diff --git a/src/backend/app/Console/Commands/MigrateTenant.php b/src/backend/app/Console/Commands/MigrateTenant.php index 1db9e3480..e0352d971 100644 --- a/src/backend/app/Console/Commands/MigrateTenant.php +++ b/src/backend/app/Console/Commands/MigrateTenant.php @@ -2,14 +2,12 @@ namespace App\Console\Commands; -class MigrateTenant extends AbstractSharedCommand -{ +class MigrateTenant extends AbstractSharedCommand { protected $signature = 'migrate-tenant {--company-id=}'; protected $description = 'Run the database migrations on provided tenant database(s)'; - public function handle() - { + public function handle() { $this->call('optimize:clear'); $this->call('migrate', [ '--database' => 'shard', diff --git a/src/backend/app/Console/Commands/MigrateTenantDrop.php b/src/backend/app/Console/Commands/MigrateTenantDrop.php index c534396d0..9a1ca6cea 100644 --- a/src/backend/app/Console/Commands/MigrateTenantDrop.php +++ b/src/backend/app/Console/Commands/MigrateTenantDrop.php @@ -6,14 +6,12 @@ use Illuminate\Console\Command; use Illuminate\Support\Facades\DB; -class MigrateTenantDrop extends Command -{ +class MigrateTenantDrop extends Command { protected $signature = 'migrate-tenant:drop-demo-company'; protected $description = 'Drop all tables on the Demo tenant database'; - public function handle() - { + public function handle() { $this->call('optimize:clear'); $database = DummyCompany::DUMMY_COMPANY_DATABASE_NAME; DB::statement("DROP DATABASE `$database`"); diff --git a/src/backend/app/Console/Commands/MigrateTenantFresh.php b/src/backend/app/Console/Commands/MigrateTenantFresh.php index f80de63bd..31e3c2de3 100644 --- a/src/backend/app/Console/Commands/MigrateTenantFresh.php +++ b/src/backend/app/Console/Commands/MigrateTenantFresh.php @@ -2,14 +2,12 @@ namespace App\Console\Commands; -class MigrateTenantFresh extends AbstractSharedCommand -{ +class MigrateTenantFresh extends AbstractSharedCommand { protected $signature = 'migrate-tenant:fresh {--company-id=}'; protected $description = 'Drop all tables and re-run all migrations on provided tenant database(s)'; - public function handle() - { + public function handle() { $this->call('optimize:clear'); $this->call('migrate:fresh', [ '--database' => 'shard', diff --git a/src/backend/app/Console/Commands/MigrateTenantInstall.php b/src/backend/app/Console/Commands/MigrateTenantInstall.php index 0028f4396..c96eff549 100644 --- a/src/backend/app/Console/Commands/MigrateTenantInstall.php +++ b/src/backend/app/Console/Commands/MigrateTenantInstall.php @@ -2,14 +2,12 @@ namespace App\Console\Commands; -class MigrateTenantInstall extends AbstractSharedCommand -{ +class MigrateTenantInstall extends AbstractSharedCommand { protected $signature = 'migrate-tenant:install {--company-id=}'; protected $description = 'Create the migration repository on provided tenant database(s)'; - public function handle() - { + public function handle() { $this->call('optimize:clear'); $this->call('migrate:install', [ '--database' => 'shard', diff --git a/src/backend/app/Console/Commands/MigrateTenantRefresh.php b/src/backend/app/Console/Commands/MigrateTenantRefresh.php index 35c4f256f..beb7259fa 100644 --- a/src/backend/app/Console/Commands/MigrateTenantRefresh.php +++ b/src/backend/app/Console/Commands/MigrateTenantRefresh.php @@ -2,14 +2,12 @@ namespace App\Console\Commands; -class MigrateTenantRefresh extends AbstractSharedCommand -{ +class MigrateTenantRefresh extends AbstractSharedCommand { protected $signature = 'migrate-tenant:refresh {--company-id=}'; protected $description = 'Reset and re-run all migrations on provided tenant database(s)'; - public function handle() - { + public function handle() { $this->call('optimize:clear'); $this->call('migrate:refresh', [ '--database' => 'shard', diff --git a/src/backend/app/Console/Commands/MigrateTenantReset.php b/src/backend/app/Console/Commands/MigrateTenantReset.php index 199f228c6..1e7fbd041 100644 --- a/src/backend/app/Console/Commands/MigrateTenantReset.php +++ b/src/backend/app/Console/Commands/MigrateTenantReset.php @@ -2,14 +2,12 @@ namespace App\Console\Commands; -class MigrateTenantReset extends AbstractSharedCommand -{ +class MigrateTenantReset extends AbstractSharedCommand { protected $signature = 'migrate-tenant:reset {--company-id=}'; protected $description = 'Rollback all database migrations on provided tenant database(s)'; - public function handle() - { + public function handle() { $this->call('optimize:clear'); $this->call('migrate:reset', [ '--database' => 'shard', diff --git a/src/backend/app/Console/Commands/MigrateTenantRollback.php b/src/backend/app/Console/Commands/MigrateTenantRollback.php index 116a34dd7..622bd269a 100644 --- a/src/backend/app/Console/Commands/MigrateTenantRollback.php +++ b/src/backend/app/Console/Commands/MigrateTenantRollback.php @@ -2,14 +2,12 @@ namespace App\Console\Commands; -class MigrateTenantRollback extends AbstractSharedCommand -{ +class MigrateTenantRollback extends AbstractSharedCommand { protected $signature = 'migrate-tenant:rollback {--company-id=}'; protected $description = 'Rollback the last database migration on provided tenant database(s)'; - public function handle() - { + public function handle() { $this->call('optimize:clear'); $this->call('migrate:rollback', [ '--database' => 'shard', diff --git a/src/backend/app/Console/Commands/MigrateTenantStatus.php b/src/backend/app/Console/Commands/MigrateTenantStatus.php index a613a0f9f..5f173d2cf 100644 --- a/src/backend/app/Console/Commands/MigrateTenantStatus.php +++ b/src/backend/app/Console/Commands/MigrateTenantStatus.php @@ -2,14 +2,12 @@ namespace App\Console\Commands; -class MigrateTenantStatus extends AbstractSharedCommand -{ +class MigrateTenantStatus extends AbstractSharedCommand { protected $signature = 'migrate-tenant:status {--company-id=}'; protected $description = 'Show the status of each migrations on provided tenant database(s)'; - public function handle() - { + public function handle() { $this->call('optimize:clear'); $this->call('migrate:status', [ '--database' => 'shard', diff --git a/src/backend/app/Console/Commands/ModelShowTenant.php b/src/backend/app/Console/Commands/ModelShowTenant.php index 45c011286..3b1fdb2ad 100644 --- a/src/backend/app/Console/Commands/ModelShowTenant.php +++ b/src/backend/app/Console/Commands/ModelShowTenant.php @@ -5,8 +5,7 @@ use Illuminate\Console\Command; use MPM\DatabaseProxy\DatabaseProxyManagerService; -class ModelShowTenant extends Command -{ +class ModelShowTenant extends Command { /** * The name and signature of the console command. * @@ -38,8 +37,7 @@ public function __construct( * * @return int */ - public function handle() - { + public function handle() { $this->databaseProxyManagerService->buildDatabaseConnectionDummyCompany(); $this->call('model:show', [ diff --git a/src/backend/app/Console/Commands/OutsourceReportGenerator.php b/src/backend/app/Console/Commands/OutsourceReportGenerator.php index 954efe84e..ac3e1ed9f 100644 --- a/src/backend/app/Console/Commands/OutsourceReportGenerator.php +++ b/src/backend/app/Console/Commands/OutsourceReportGenerator.php @@ -7,19 +7,16 @@ use PhpOffice\PhpSpreadsheet\Writer\Exception; use PhpOffice\PhpSpreadsheet\Writer\Xlsx; -class OutsourceReportGenerator extends AbstractSharedCommand -{ +class OutsourceReportGenerator extends AbstractSharedCommand { protected $signature = 'reports:outsource {--start-date=}'; protected $description = 'Create outsources reports'; - public function __construct(private TicketExportController $reports) - { + public function __construct(private TicketExportController $reports) { parent::__construct(); } - public function runInCompanyScope(): void - { + public function runInCompanyScope(): void { if ($this->option('start-date') !== '') { $toDay = Carbon::parse($this->option('start-date'))->format('Y-m-d'); } else { diff --git a/src/backend/app/Console/Commands/PackageGenerator.php b/src/backend/app/Console/Commands/PackageGenerator.php index 45a864a1c..cb6817d5e 100644 --- a/src/backend/app/Console/Commands/PackageGenerator.php +++ b/src/backend/app/Console/Commands/PackageGenerator.php @@ -4,14 +4,12 @@ use Illuminate\Console\Command; -class PackageGenerator extends Command -{ +class PackageGenerator extends Command { protected $signature = 'micropowermanager:new-package {package-name}'; protected $description = 'Clones package development starter pack'; - public function handle(): void - { + public function handle(): void { $packageNameArg = $this->argument('package-name'); $packageName = strtolower($packageNameArg); $nameSpace = ''; diff --git a/src/backend/app/Console/Commands/ReportGenerator.php b/src/backend/app/Console/Commands/ReportGenerator.php index d0e663c65..f01eb0568 100644 --- a/src/backend/app/Console/Commands/ReportGenerator.php +++ b/src/backend/app/Console/Commands/ReportGenerator.php @@ -5,19 +5,16 @@ use App\Http\Controllers\Reports; use Carbon\Carbon; -class ReportGenerator extends AbstractSharedCommand -{ +class ReportGenerator extends AbstractSharedCommand { protected $signature = 'reports:city-revenue {type} {--start-date=} {--company-id=}'; protected $description = 'Creates city revenue reports'; - public function __construct(private Reports $reports) - { + public function __construct(private Reports $reports) { parent::__construct(); } - public function handle(): void - { + public function handle(): void { $startDay = Carbon::now()->format('Y-m-d'); if ($this->option('start-date') != '') { $toDay = Carbon::parse($this->option('start-date'))->format('Y-m-d'); diff --git a/src/backend/app/Console/Commands/ResendRejectedMessages.php b/src/backend/app/Console/Commands/ResendRejectedMessages.php index 70be32c90..67f880735 100644 --- a/src/backend/app/Console/Commands/ResendRejectedMessages.php +++ b/src/backend/app/Console/Commands/ResendRejectedMessages.php @@ -7,8 +7,7 @@ use Illuminate\Console\Command; use Illuminate\Support\Facades\Log; -class ResendRejectedMessages extends AbstractSharedCommand -{ +class ResendRejectedMessages extends AbstractSharedCommand { /** * The name and signature of the console command. * @@ -28,13 +27,11 @@ class ResendRejectedMessages extends AbstractSharedCommand * * @return void */ - public function __construct(private Sms $sms) - { + public function __construct(private Sms $sms) { parent::__construct(); } - public function handle(): void - { + public function handle(): void { $amountToSend = $this->argument('amount'); $messagesToSend = $this->sms ->where('direction', 1) diff --git a/src/backend/app/Console/Commands/RoutesGenerator.php b/src/backend/app/Console/Commands/RoutesGenerator.php index 844ceb047..1bd80e32b 100644 --- a/src/backend/app/Console/Commands/RoutesGenerator.php +++ b/src/backend/app/Console/Commands/RoutesGenerator.php @@ -2,14 +2,12 @@ namespace App\Console\Commands; -class RoutesGenerator extends AbstractSharedCommand -{ +class RoutesGenerator extends AbstractSharedCommand { protected $signature = 'routes:generate'; protected $description = 'Generates new routes from packages'; - public function runInCompanyScope(): void - { + public function runInCompanyScope(): void { $routeTmp = 'storage/skeletons/routes.tmp'; fopen($routeTmp, 'w'); @@ -29,8 +27,7 @@ public function runInCompanyScope(): void } } - private function createPluginRoutesTmp(string $src, string $coreRoutesTmp): void - { + private function createPluginRoutesTmp(string $src, string $coreRoutesTmp): void { $packageRoutes = $src.'/js/routes.js'; $packageRoutesTmp = $src.'/js/routes.tmp'; fopen($packageRoutesTmp, 'w'); @@ -43,8 +40,7 @@ private function createPluginRoutesTmp(string $src, string $coreRoutesTmp): void /** * @return void */ - private function removeLine(string $packageRoutesTmp, string $type) - { + private function removeLine(string $packageRoutesTmp, string $type) { $lines = file($packageRoutesTmp); if ($type === 'first') { array_shift($lines); @@ -57,8 +53,7 @@ private function removeLine(string $packageRoutesTmp, string $type) file_put_contents($packageRoutesTmp, $file); } - private function appendLines(string $packageRoutesTmp, $coreRoutesTmp): void - { + private function appendLines(string $packageRoutesTmp, $coreRoutesTmp): void { $lines = file($packageRoutesTmp); $tmp = fopen($coreRoutesTmp, 'a+'); $counter = 1; diff --git a/src/backend/app/Console/Commands/SendNonPayingCustomerMailCommand.php b/src/backend/app/Console/Commands/SendNonPayingCustomerMailCommand.php index bacc02240..560728626 100644 --- a/src/backend/app/Console/Commands/SendNonPayingCustomerMailCommand.php +++ b/src/backend/app/Console/Commands/SendNonPayingCustomerMailCommand.php @@ -12,8 +12,7 @@ use Carbon\CarbonImmutable; use Illuminate\Support\Collection; -class SendNonPayingCustomerMailCommand extends AbstractSharedCommand -{ +class SendNonPayingCustomerMailCommand extends AbstractSharedCommand { private const EMAIL_TEMPLATE = 'templates.mail.non_paying_mail'; private const REPORT_TEMPLATE = 'templates.mail.non_paying_pdf'; @@ -34,8 +33,7 @@ public function __construct( parent::__construct(); } - public function runInCompanyScope(): void - { + public function runInCompanyScope(): void { $startDate = $this->option('start-date') ? CarbonImmutable::make( $this->option('start-date') ) : CarbonImmutable::make('first day of last month'); diff --git a/src/backend/app/Console/Commands/ShiftEcosysSHSdataForDeviceFeature.php b/src/backend/app/Console/Commands/ShiftEcosysSHSdataForDeviceFeature.php index 47408f0b6..9ad4bc6a5 100644 --- a/src/backend/app/Console/Commands/ShiftEcosysSHSdataForDeviceFeature.php +++ b/src/backend/app/Console/Commands/ShiftEcosysSHSdataForDeviceFeature.php @@ -9,8 +9,7 @@ use App\Models\SolarHomeSystem; use Illuminate\Support\Facades\DB; -class ShiftEcosysSHSdataForDeviceFeature extends AbstractSharedCommand -{ +class ShiftEcosysSHSdataForDeviceFeature extends AbstractSharedCommand { // --company-id=36 protected $signature = 'ecosys:shift-data {--company-id=}'; @@ -26,13 +25,11 @@ class ShiftEcosysSHSdataForDeviceFeature extends AbstractSharedCommand 3 => 2, ]; - public function __construct() - { + public function __construct() { parent::__construct(); } - public function handle() - { + public function handle() { $this->info('Command started'); $this->info('command running w '.$this->option('company-id')); $manufacturer = Manufacturer::query()->where('name', 'SunKing SHS')->first(); diff --git a/src/backend/app/Console/Kernel.php b/src/backend/app/Console/Kernel.php index 79e49cc57..e93540ca5 100644 --- a/src/backend/app/Console/Kernel.php +++ b/src/backend/app/Console/Kernel.php @@ -23,8 +23,7 @@ use Inensus\WavecomPaymentProvider\Console\Commands\InstallPackage as InstallWaveComPackage; use Inensus\WaveMoneyPaymentProvider\Console\Commands\InstallPackage as InstallWaveMoneyPaymentProviderPackage; -class Kernel extends ConsoleKernel -{ +class Kernel extends ConsoleKernel { /** * The Artisan commands provided by your application. * @@ -56,8 +55,7 @@ class Kernel extends ConsoleKernel * * @return void */ - protected function schedule(Schedule $schedule) - { + protected function schedule(Schedule $schedule) { $schedule->command('reports:city-revenue weekly')->weeklyOn(1, '3:00'); $schedule->command('reports:city-revenue monthly')->monthlyOn(1, '3:00'); $schedule->command('reports:outsource')->monthlyOn(1, '3:30'); @@ -75,8 +73,7 @@ protected function schedule(Schedule $schedule) * * @return void */ - protected function commands() - { + protected function commands() { $this->load(__DIR__.'/Commands'); include base_path('routes/console.php'); diff --git a/src/backend/app/Events/AssetPersonCreated.php b/src/backend/app/Events/AssetPersonCreated.php index 04117796c..15b005cf8 100644 --- a/src/backend/app/Events/AssetPersonCreated.php +++ b/src/backend/app/Events/AssetPersonCreated.php @@ -8,8 +8,7 @@ use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Queue\SerializesModels; -class AssetPersonCreated -{ +class AssetPersonCreated { use Dispatchable; use InteractsWithSockets; use SerializesModels; @@ -19,16 +18,14 @@ class AssetPersonCreated */ private $assetPerson; - public function __construct(AssetPerson $assetPerson) - { + public function __construct(AssetPerson $assetPerson) { $this->assetPerson = $assetPerson; } /** * Get the channels the event should broadcast on. */ - public function broadcastOn(): PrivateChannel - { + public function broadcastOn(): PrivateChannel { return new PrivateChannel('assetPerson.created'); } } diff --git a/src/backend/app/Events/ClusterEvent.php b/src/backend/app/Events/ClusterEvent.php index 2d41070f9..53a3092ec 100644 --- a/src/backend/app/Events/ClusterEvent.php +++ b/src/backend/app/Events/ClusterEvent.php @@ -9,8 +9,7 @@ use Illuminate\Queue\SerializesModels; use Illuminate\Support\Facades\Log; -class ClusterEvent -{ +class ClusterEvent { use Dispatchable; use InteractsWithSockets; use SerializesModels; @@ -33,8 +32,7 @@ class ClusterEvent /** * Create a new event instance. */ - public function __construct(Cluster $cluster, string $type, $data) - { + public function __construct(Cluster $cluster, string $type, $data) { Log::debug('cluster event created'); $this->cluster = $cluster; $this->type = $type; @@ -44,8 +42,7 @@ public function __construct(Cluster $cluster, string $type, $data) /** * Get the channels the event should broadcast on. */ - public function broadcastOn(): PrivateChannel - { + public function broadcastOn(): PrivateChannel { return new PrivateChannel('clusters'); } } diff --git a/src/backend/app/Events/HistoryEvent.php b/src/backend/app/Events/HistoryEvent.php index 554c286f0..cd7f14bd7 100644 --- a/src/backend/app/Events/HistoryEvent.php +++ b/src/backend/app/Events/HistoryEvent.php @@ -9,8 +9,7 @@ use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Queue\SerializesModels; -class HistoryEvent implements ShouldBroadcast -{ +class HistoryEvent implements ShouldBroadcast { use Dispatchable; use InteractsWithSockets; use SerializesModels; @@ -18,15 +17,12 @@ class HistoryEvent implements ShouldBroadcast /** * Create a new event instance. */ - public function __construct(private readonly History $historyModel) - { - } + public function __construct(private readonly History $historyModel) {} /** * Get the channels the event should broadcast on. */ - public function broadcastOn(): PrivateChannel - { + public function broadcastOn(): PrivateChannel { return new PrivateChannel('histories'); } } diff --git a/src/backend/app/Events/NewTicket.php b/src/backend/app/Events/NewTicket.php index 6fe38ee99..2455b25f6 100644 --- a/src/backend/app/Events/NewTicket.php +++ b/src/backend/app/Events/NewTicket.php @@ -9,8 +9,7 @@ use Illuminate\Queue\SerializesModels; use Inensus\Ticket\Models\Ticket; -class NewTicket implements ShouldBroadcast -{ +class NewTicket implements ShouldBroadcast { use Dispatchable; use InteractsWithSockets; use SerializesModels; @@ -18,8 +17,7 @@ class NewTicket implements ShouldBroadcast /** * Create a new event instance. */ - public function __construct(private Ticket $ticket) - { + public function __construct(private Ticket $ticket) { $this->ticket = $ticket; } @@ -28,8 +26,7 @@ public function __construct(private Ticket $ticket) * * @return PrivateChannel */ - public function broadcastOn() - { + public function broadcastOn() { return new PrivateChannel('ticketcreated'); } } diff --git a/src/backend/app/Events/PersonDeleting.php b/src/backend/app/Events/PersonDeleting.php index 06dca7bf3..bc781030e 100644 --- a/src/backend/app/Events/PersonDeleting.php +++ b/src/backend/app/Events/PersonDeleting.php @@ -8,8 +8,7 @@ use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Queue\SerializesModels; -class PersonDeleting -{ +class PersonDeleting { use Dispatchable; use InteractsWithSockets; use SerializesModels; @@ -21,16 +20,14 @@ class PersonDeleting * * @return void */ - public function __construct(Person $person) - { + public function __construct(Person $person) { $this->person = $person; } /** * Get the channels the event should broadcast on. */ - public function broadcastOn(): PrivateChannel - { + public function broadcastOn(): PrivateChannel { return new PrivateChannel('person.deleted'); } } diff --git a/src/backend/app/Exceptions/AccessRates/NoAccessRateFound.php b/src/backend/app/Exceptions/AccessRates/NoAccessRateFound.php index d6235e778..e2ee7b607 100644 --- a/src/backend/app/Exceptions/AccessRates/NoAccessRateFound.php +++ b/src/backend/app/Exceptions/AccessRates/NoAccessRateFound.php @@ -2,6 +2,4 @@ namespace App\Exceptions\AccessRates; -class NoAccessRateFound extends \Exception -{ -} +class NoAccessRateFound extends \Exception {} diff --git a/src/backend/app/Exceptions/ActiveSheetNotCreatedException.php b/src/backend/app/Exceptions/ActiveSheetNotCreatedException.php index 15050ae28..00ab89f41 100644 --- a/src/backend/app/Exceptions/ActiveSheetNotCreatedException.php +++ b/src/backend/app/Exceptions/ActiveSheetNotCreatedException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class ActiveSheetNotCreatedException extends \Exception -{ -} +class ActiveSheetNotCreatedException extends \Exception {} diff --git a/src/backend/app/Exceptions/AgentRiskBalanceExceeded.php b/src/backend/app/Exceptions/AgentRiskBalanceExceeded.php index 0d3dabe95..ab293d85d 100644 --- a/src/backend/app/Exceptions/AgentRiskBalanceExceeded.php +++ b/src/backend/app/Exceptions/AgentRiskBalanceExceeded.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class AgentRiskBalanceExceeded extends \Exception -{ -} +class AgentRiskBalanceExceeded extends \Exception {} diff --git a/src/backend/app/Exceptions/CustomerGroup/CustomerGroupNotFound.php b/src/backend/app/Exceptions/CustomerGroup/CustomerGroupNotFound.php index ad4f23d0f..42aa2753a 100644 --- a/src/backend/app/Exceptions/CustomerGroup/CustomerGroupNotFound.php +++ b/src/backend/app/Exceptions/CustomerGroup/CustomerGroupNotFound.php @@ -2,6 +2,4 @@ namespace App\Exceptions\CustomerGroup; -class CustomerGroupNotFound extends \Exception -{ -} +class CustomerGroupNotFound extends \Exception {} diff --git a/src/backend/app/Exceptions/Device/DeviceIsNotAssignedToCustomer.php b/src/backend/app/Exceptions/Device/DeviceIsNotAssignedToCustomer.php index 2bc75c1b8..f84ec75f0 100644 --- a/src/backend/app/Exceptions/Device/DeviceIsNotAssignedToCustomer.php +++ b/src/backend/app/Exceptions/Device/DeviceIsNotAssignedToCustomer.php @@ -2,6 +2,4 @@ namespace App\Exceptions\Device; -class DeviceIsNotAssignedToCustomer extends \Exception -{ -} +class DeviceIsNotAssignedToCustomer extends \Exception {} diff --git a/src/backend/app/Exceptions/DownPaymentBiggerThanAmountException.php b/src/backend/app/Exceptions/DownPaymentBiggerThanAmountException.php index 27781ada7..8d61ef9e9 100644 --- a/src/backend/app/Exceptions/DownPaymentBiggerThanAmountException.php +++ b/src/backend/app/Exceptions/DownPaymentBiggerThanAmountException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class DownPaymentBiggerThanAmountException extends \Exception -{ -} +class DownPaymentBiggerThanAmountException extends \Exception {} diff --git a/src/backend/app/Exceptions/DownPaymentBiggerThanAppliancePriceException.php b/src/backend/app/Exceptions/DownPaymentBiggerThanAppliancePriceException.php index 390707fee..7841d0b5b 100644 --- a/src/backend/app/Exceptions/DownPaymentBiggerThanAppliancePriceException.php +++ b/src/backend/app/Exceptions/DownPaymentBiggerThanAppliancePriceException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class DownPaymentBiggerThanAppliancePriceException extends \Exception -{ -} +class DownPaymentBiggerThanAppliancePriceException extends \Exception {} diff --git a/src/backend/app/Exceptions/DownPaymentNotFoundException.php b/src/backend/app/Exceptions/DownPaymentNotFoundException.php index 40aca906f..ad5558551 100644 --- a/src/backend/app/Exceptions/DownPaymentNotFoundException.php +++ b/src/backend/app/Exceptions/DownPaymentNotFoundException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class DownPaymentNotFoundException extends \Exception -{ -} +class DownPaymentNotFoundException extends \Exception {} diff --git a/src/backend/app/Exceptions/GeoFormatException.php b/src/backend/app/Exceptions/GeoFormatException.php index 983c839ff..97898c940 100644 --- a/src/backend/app/Exceptions/GeoFormatException.php +++ b/src/backend/app/Exceptions/GeoFormatException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class GeoFormatException extends \Exception -{ -} +class GeoFormatException extends \Exception {} diff --git a/src/backend/app/Exceptions/Handler.php b/src/backend/app/Exceptions/Handler.php index 05b8317c0..0ed09f91c 100644 --- a/src/backend/app/Exceptions/Handler.php +++ b/src/backend/app/Exceptions/Handler.php @@ -9,8 +9,7 @@ use Illuminate\Http\Response; use Illuminate\Support\Facades\Log; -class Handler extends ExceptionHandler -{ +class Handler extends ExceptionHandler { use RestExceptionHandler; /** @@ -36,8 +35,7 @@ class Handler extends ExceptionHandler * * @return void */ - public function report(\Throwable $exception) - { + public function report(\Throwable $exception) { Log::critical(get_class($exception), ['message' => $exception->getMessage(), 'trace' => array_slice($exception->getTrace(), 0, 10)]); parent::report($exception); } @@ -50,8 +48,7 @@ public function report(\Throwable $exception) * * @return \Illuminate\Http\JsonResponse */ - public function render($request, \Exception|\Throwable $exception) - { + public function render($request, \Exception|\Throwable $exception) { // api request outputs are json if (preg_match('/.*\.local\/api.*/', $request->url()) || preg_match('/.*\.com\/api.*/', $request->url())) { return $this->getJsonResponseForException($request, $exception); diff --git a/src/backend/app/Exceptions/InvalidBingApiKeyException.php b/src/backend/app/Exceptions/InvalidBingApiKeyException.php index 1de422650..76a1e6db7 100644 --- a/src/backend/app/Exceptions/InvalidBingApiKeyException.php +++ b/src/backend/app/Exceptions/InvalidBingApiKeyException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class InvalidBingApiKeyException extends \Exception -{ -} +class InvalidBingApiKeyException extends \Exception {} diff --git a/src/backend/app/Exceptions/MailNotSentException.php b/src/backend/app/Exceptions/MailNotSentException.php index 3d1906639..44dac52ea 100644 --- a/src/backend/app/Exceptions/MailNotSentException.php +++ b/src/backend/app/Exceptions/MailNotSentException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class MailNotSentException extends \Exception -{ -} +class MailNotSentException extends \Exception {} diff --git a/src/backend/app/Exceptions/Manufacturer/ApiCallDoesNotSupportedException.php b/src/backend/app/Exceptions/Manufacturer/ApiCallDoesNotSupportedException.php index 545df482e..4e40fbc1b 100644 --- a/src/backend/app/Exceptions/Manufacturer/ApiCallDoesNotSupportedException.php +++ b/src/backend/app/Exceptions/Manufacturer/ApiCallDoesNotSupportedException.php @@ -2,6 +2,4 @@ namespace App\Exceptions\Manufacturer; -class ApiCallDoesNotSupportedException extends \Exception -{ -} +class ApiCallDoesNotSupportedException extends \Exception {} diff --git a/src/backend/app/Exceptions/Manufacturer/MeterIsNotReadable.php b/src/backend/app/Exceptions/Manufacturer/MeterIsNotReadable.php index 0ba7e64fc..fc34249d1 100644 --- a/src/backend/app/Exceptions/Manufacturer/MeterIsNotReadable.php +++ b/src/backend/app/Exceptions/Manufacturer/MeterIsNotReadable.php @@ -2,6 +2,4 @@ namespace App\Exceptions\Manufacturer; -class MeterIsNotReadable extends \Exception -{ -} +class MeterIsNotReadable extends \Exception {} diff --git a/src/backend/app/Exceptions/MeterParameter/MeterParameterNotFound.php b/src/backend/app/Exceptions/MeterParameter/MeterParameterNotFound.php index e6626356f..c1aaa2541 100644 --- a/src/backend/app/Exceptions/MeterParameter/MeterParameterNotFound.php +++ b/src/backend/app/Exceptions/MeterParameter/MeterParameterNotFound.php @@ -2,6 +2,4 @@ namespace App\Exceptions\MeterParameter; -class MeterParameterNotFound extends \Exception -{ -} +class MeterParameterNotFound extends \Exception {} diff --git a/src/backend/app/Exceptions/Meters/MeterIsNotAssignedToCustomer.php b/src/backend/app/Exceptions/Meters/MeterIsNotAssignedToCustomer.php index 654c62302..a4eac9638 100644 --- a/src/backend/app/Exceptions/Meters/MeterIsNotAssignedToCustomer.php +++ b/src/backend/app/Exceptions/Meters/MeterIsNotAssignedToCustomer.php @@ -2,6 +2,4 @@ namespace App\Exceptions\Meters; -class MeterIsNotAssignedToCustomer extends \Exception -{ -} +class MeterIsNotAssignedToCustomer extends \Exception {} diff --git a/src/backend/app/Exceptions/Meters/MeterIsNotInUse.php b/src/backend/app/Exceptions/Meters/MeterIsNotInUse.php index 07b393f18..f5889877f 100644 --- a/src/backend/app/Exceptions/Meters/MeterIsNotInUse.php +++ b/src/backend/app/Exceptions/Meters/MeterIsNotInUse.php @@ -2,6 +2,4 @@ namespace App\Exceptions\Meters; -class MeterIsNotInUse extends \Exception -{ -} +class MeterIsNotInUse extends \Exception {} diff --git a/src/backend/app/Exceptions/MissingSmsReferencesException.php b/src/backend/app/Exceptions/MissingSmsReferencesException.php index 1d8433f92..194b81871 100644 --- a/src/backend/app/Exceptions/MissingSmsReferencesException.php +++ b/src/backend/app/Exceptions/MissingSmsReferencesException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class MissingSmsReferencesException extends \Exception -{ -} +class MissingSmsReferencesException extends \Exception {} diff --git a/src/backend/app/Exceptions/NotificationSendFailedException.php b/src/backend/app/Exceptions/NotificationSendFailedException.php index 92a565e89..51c61ae21 100644 --- a/src/backend/app/Exceptions/NotificationSendFailedException.php +++ b/src/backend/app/Exceptions/NotificationSendFailedException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class NotificationSendFailedException extends \Exception -{ -} +class NotificationSendFailedException extends \Exception {} diff --git a/src/backend/app/Exceptions/PaymentAmountBiggerThanTotalRemainingAmount.php b/src/backend/app/Exceptions/PaymentAmountBiggerThanTotalRemainingAmount.php index cb54ff880..677de17a8 100644 --- a/src/backend/app/Exceptions/PaymentAmountBiggerThanTotalRemainingAmount.php +++ b/src/backend/app/Exceptions/PaymentAmountBiggerThanTotalRemainingAmount.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class PaymentAmountBiggerThanTotalRemainingAmount extends \Exception -{ -} +class PaymentAmountBiggerThanTotalRemainingAmount extends \Exception {} diff --git a/src/backend/app/Exceptions/PaymentAmountSmallerThanZero.php b/src/backend/app/Exceptions/PaymentAmountSmallerThanZero.php index 24ac1608b..df6a1a9f0 100644 --- a/src/backend/app/Exceptions/PaymentAmountSmallerThanZero.php +++ b/src/backend/app/Exceptions/PaymentAmountSmallerThanZero.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class PaymentAmountSmallerThanZero extends \Exception -{ -} +class PaymentAmountSmallerThanZero extends \Exception {} diff --git a/src/backend/app/Exceptions/PaymentProviderNotIdentified.php b/src/backend/app/Exceptions/PaymentProviderNotIdentified.php index 2329b28cf..dfe162a50 100644 --- a/src/backend/app/Exceptions/PaymentProviderNotIdentified.php +++ b/src/backend/app/Exceptions/PaymentProviderNotIdentified.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class PaymentProviderNotIdentified extends \Exception -{ -} +class PaymentProviderNotIdentified extends \Exception {} diff --git a/src/backend/app/Exceptions/PurchaseNotProcessable.php b/src/backend/app/Exceptions/PurchaseNotProcessable.php index 532d80829..616376ab8 100644 --- a/src/backend/app/Exceptions/PurchaseNotProcessable.php +++ b/src/backend/app/Exceptions/PurchaseNotProcessable.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class PurchaseNotProcessable extends \Exception -{ -} +class PurchaseNotProcessable extends \Exception {} diff --git a/src/backend/app/Exceptions/SmsAndroidSettingNotExistingException.php b/src/backend/app/Exceptions/SmsAndroidSettingNotExistingException.php index 68734f748..2255ebfa2 100644 --- a/src/backend/app/Exceptions/SmsAndroidSettingNotExistingException.php +++ b/src/backend/app/Exceptions/SmsAndroidSettingNotExistingException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class SmsAndroidSettingNotExistingException extends \Exception -{ -} +class SmsAndroidSettingNotExistingException extends \Exception {} diff --git a/src/backend/app/Exceptions/SmsBodyParserNotExtendedException.php b/src/backend/app/Exceptions/SmsBodyParserNotExtendedException.php index d1d728b80..6c51bbf00 100644 --- a/src/backend/app/Exceptions/SmsBodyParserNotExtendedException.php +++ b/src/backend/app/Exceptions/SmsBodyParserNotExtendedException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class SmsBodyParserNotExtendedException extends \Exception -{ -} +class SmsBodyParserNotExtendedException extends \Exception {} diff --git a/src/backend/app/Exceptions/SmsTypeNotFoundException.php b/src/backend/app/Exceptions/SmsTypeNotFoundException.php index af2112275..72bf5e6e6 100644 --- a/src/backend/app/Exceptions/SmsTypeNotFoundException.php +++ b/src/backend/app/Exceptions/SmsTypeNotFoundException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class SmsTypeNotFoundException extends \Exception -{ -} +class SmsTypeNotFoundException extends \Exception {} diff --git a/src/backend/app/Exceptions/SpreadSheetNotCreatedException.php b/src/backend/app/Exceptions/SpreadSheetNotCreatedException.php index 4d2144d5d..03bf69994 100644 --- a/src/backend/app/Exceptions/SpreadSheetNotCreatedException.php +++ b/src/backend/app/Exceptions/SpreadSheetNotCreatedException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class SpreadSheetNotCreatedException extends \Exception -{ -} +class SpreadSheetNotCreatedException extends \Exception {} diff --git a/src/backend/app/Exceptions/SpreadSheetNotSavedException.php b/src/backend/app/Exceptions/SpreadSheetNotSavedException.php index a2e4d6bdf..4cd121be1 100644 --- a/src/backend/app/Exceptions/SpreadSheetNotSavedException.php +++ b/src/backend/app/Exceptions/SpreadSheetNotSavedException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class SpreadSheetNotSavedException extends \Exception -{ -} +class SpreadSheetNotSavedException extends \Exception {} diff --git a/src/backend/app/Exceptions/Tariffs/TariffNotFound.php b/src/backend/app/Exceptions/Tariffs/TariffNotFound.php index 361c1168a..3bdb79c3d 100644 --- a/src/backend/app/Exceptions/Tariffs/TariffNotFound.php +++ b/src/backend/app/Exceptions/Tariffs/TariffNotFound.php @@ -2,6 +2,4 @@ namespace App\Exceptions\Tariffs; -class TariffNotFound extends \Exception -{ -} +class TariffNotFound extends \Exception {} diff --git a/src/backend/app/Exceptions/TransactionAmountNotEnoughException.php b/src/backend/app/Exceptions/TransactionAmountNotEnoughException.php index 539125a97..a73731e7b 100644 --- a/src/backend/app/Exceptions/TransactionAmountNotEnoughException.php +++ b/src/backend/app/Exceptions/TransactionAmountNotEnoughException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class TransactionAmountNotEnoughException extends \Exception -{ -} +class TransactionAmountNotEnoughException extends \Exception {} diff --git a/src/backend/app/Exceptions/TransactionAmountNotFoundException.php b/src/backend/app/Exceptions/TransactionAmountNotFoundException.php index c8d2dcb1f..c1e3e959b 100644 --- a/src/backend/app/Exceptions/TransactionAmountNotFoundException.php +++ b/src/backend/app/Exceptions/TransactionAmountNotFoundException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class TransactionAmountNotFoundException extends \Exception -{ -} +class TransactionAmountNotFoundException extends \Exception {} diff --git a/src/backend/app/Exceptions/TransactionFetchingException.php b/src/backend/app/Exceptions/TransactionFetchingException.php index 04e2b11d1..1342ac6b5 100644 --- a/src/backend/app/Exceptions/TransactionFetchingException.php +++ b/src/backend/app/Exceptions/TransactionFetchingException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class TransactionFetchingException extends \Exception -{ -} +class TransactionFetchingException extends \Exception {} diff --git a/src/backend/app/Exceptions/TransactionIsInvalidForProcessingIncomingRequestException.php b/src/backend/app/Exceptions/TransactionIsInvalidForProcessingIncomingRequestException.php index 7e676b2f7..c3072f9d0 100644 --- a/src/backend/app/Exceptions/TransactionIsInvalidForProcessingIncomingRequestException.php +++ b/src/backend/app/Exceptions/TransactionIsInvalidForProcessingIncomingRequestException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class TransactionIsInvalidForProcessingIncomingRequestException extends \Exception -{ -} +class TransactionIsInvalidForProcessingIncomingRequestException extends \Exception {} diff --git a/src/backend/app/Exceptions/TransactionNotInitializedException.php b/src/backend/app/Exceptions/TransactionNotInitializedException.php index 72bb1fb9a..4f1a18b22 100644 --- a/src/backend/app/Exceptions/TransactionNotInitializedException.php +++ b/src/backend/app/Exceptions/TransactionNotInitializedException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class TransactionNotInitializedException extends \Exception -{ -} +class TransactionNotInitializedException extends \Exception {} diff --git a/src/backend/app/Exceptions/TrelloAPIException.php b/src/backend/app/Exceptions/TrelloAPIException.php index 7ef91cb43..0d4efe486 100644 --- a/src/backend/app/Exceptions/TrelloAPIException.php +++ b/src/backend/app/Exceptions/TrelloAPIException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class TrelloAPIException extends \Exception -{ -} +class TrelloAPIException extends \Exception {} diff --git a/src/backend/app/Exceptions/UserAddressNorFoundException.php b/src/backend/app/Exceptions/UserAddressNorFoundException.php index 719bcbecc..ab0988f00 100644 --- a/src/backend/app/Exceptions/UserAddressNorFoundException.php +++ b/src/backend/app/Exceptions/UserAddressNorFoundException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class UserAddressNorFoundException extends \Exception -{ -} +class UserAddressNorFoundException extends \Exception {} diff --git a/src/backend/app/Exceptions/ValidationException.php b/src/backend/app/Exceptions/ValidationException.php index f71d1829e..3fdeb2d7a 100644 --- a/src/backend/app/Exceptions/ValidationException.php +++ b/src/backend/app/Exceptions/ValidationException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class ValidationException extends \Exception -{ -} +class ValidationException extends \Exception {} diff --git a/src/backend/app/Exceptions/VodacomHeartBeatException.php b/src/backend/app/Exceptions/VodacomHeartBeatException.php index 11b8f4871..0eb591ca4 100644 --- a/src/backend/app/Exceptions/VodacomHeartBeatException.php +++ b/src/backend/app/Exceptions/VodacomHeartBeatException.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class VodacomHeartBeatException extends \Exception -{ -} +class VodacomHeartBeatException extends \Exception {} diff --git a/src/backend/app/Exceptions/WeatherParametersMissing.php b/src/backend/app/Exceptions/WeatherParametersMissing.php index 872494fcc..7dbd55f3d 100644 --- a/src/backend/app/Exceptions/WeatherParametersMissing.php +++ b/src/backend/app/Exceptions/WeatherParametersMissing.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class WeatherParametersMissing extends \Exception -{ -} +class WeatherParametersMissing extends \Exception {} diff --git a/src/backend/app/Exceptions/WeatherProviderUnreachable.php b/src/backend/app/Exceptions/WeatherProviderUnreachable.php index 06f5e6c76..ca2e60999 100644 --- a/src/backend/app/Exceptions/WeatherProviderUnreachable.php +++ b/src/backend/app/Exceptions/WeatherProviderUnreachable.php @@ -2,6 +2,4 @@ namespace App\Exceptions; -class WeatherProviderUnreachable extends \Exception -{ -} +class WeatherProviderUnreachable extends \Exception {} diff --git a/src/backend/app/Helpers/MailHelper.php b/src/backend/app/Helpers/MailHelper.php index c9c92e998..1214ca07b 100644 --- a/src/backend/app/Helpers/MailHelper.php +++ b/src/backend/app/Helpers/MailHelper.php @@ -6,8 +6,7 @@ use PHPMailer\PHPMailer\Exception as PHPMailerException; use PHPMailer\PHPMailer\PHPMailer; -class MailHelper implements MailHelperInterface -{ +class MailHelper implements MailHelperInterface { /** * @var PHPMailer */ @@ -15,15 +14,13 @@ class MailHelper implements MailHelperInterface private $mailSettings; - public function __construct(PHPMailer $mailer) - { + public function __construct(PHPMailer $mailer) { $this->mailer = $mailer; $this->mailSettings = config('mail.mailers.strato'); $this->configure(); } - private function configure(): void - { + private function configure(): void { $this->mailer->Host = $this->mailSettings['host']; $this->mailer->Port = $this->mailSettings['port']; $this->mailer->SMTPSecure = $this->mailSettings['smtp_secure']; @@ -40,8 +37,7 @@ private function configure(): void * @throws MailNotSentException * @throws PHPMailerException */ - public function sendPlain($to, $title, $body, $attachment = null): void - { + public function sendPlain($to, $title, $body, $attachment = null): void { // don't send any mails while testing if (config('app.env') === 'local') { return; @@ -65,8 +61,7 @@ public function sendPlain($to, $title, $body, $attachment = null): void } } - public function sendViaTemplate(string $to, string $title, string $templatePath, ?array $variables = null, ?string $attachmentPath = null): void - { + public function sendViaTemplate(string $to, string $title, string $templatePath, ?array $variables = null, ?string $attachmentPath = null): void { // don't send any mails while testing if (config('app.env') === 'demo') { return; diff --git a/src/backend/app/Helpers/MailHelperInterface.php b/src/backend/app/Helpers/MailHelperInterface.php index 4817d0744..552e55762 100644 --- a/src/backend/app/Helpers/MailHelperInterface.php +++ b/src/backend/app/Helpers/MailHelperInterface.php @@ -5,8 +5,7 @@ use App\Exceptions\MailNotSentException; use PHPMailer\PHPMailer\Exception as PHPMailerException; -interface MailHelperInterface -{ +interface MailHelperInterface { /** * @param null $attachment * diff --git a/src/backend/app/Helpers/MailHelperMock.php b/src/backend/app/Helpers/MailHelperMock.php index 0db3ea1a5..3e037f4f4 100644 --- a/src/backend/app/Helpers/MailHelperMock.php +++ b/src/backend/app/Helpers/MailHelperMock.php @@ -5,19 +5,14 @@ use App\Exceptions\MailNotSentException; use PHPMailer\PHPMailer\Exception as PHPMailerException; -class MailHelperMock implements MailHelperInterface -{ +class MailHelperMock implements MailHelperInterface { /** * @param null $attachment * * @throws MailNotSentException * @throws PHPMailerException */ - public function sendPlain($to, $title, $body, $attachment = null): void - { - } + public function sendPlain($to, $title, $body, $attachment = null): void {} - public function sendViaTemplate(string $to, string $title, string $templatePath, ?array $variables = null, ?string $attachmentPath = null): void - { - } + public function sendViaTemplate(string $to, string $title, string $templatePath, ?array $variables = null, ?string $attachmentPath = null): void {} } diff --git a/src/backend/app/Helpers/PasswordGenerator.php b/src/backend/app/Helpers/PasswordGenerator.php index 3b7307928..607cf46a8 100644 --- a/src/backend/app/Helpers/PasswordGenerator.php +++ b/src/backend/app/Helpers/PasswordGenerator.php @@ -2,10 +2,8 @@ namespace App\Helpers; -class PasswordGenerator -{ - public static function generatePassword($passwordLength = 5): int - { +class PasswordGenerator { + public static function generatePassword($passwordLength = 5): int { return random_int(10 ** ($passwordLength - 1), (10 ** $passwordLength) - 1); } } diff --git a/src/backend/app/Helpers/PowerConverter.php b/src/backend/app/Helpers/PowerConverter.php index 181ba96ac..727a8dd7f 100644 --- a/src/backend/app/Helpers/PowerConverter.php +++ b/src/backend/app/Helpers/PowerConverter.php @@ -2,8 +2,7 @@ namespace App\Helpers; -class PowerConverter -{ +class PowerConverter { private static $powerUnits = [ 'W' => 1, 'kW' => 1000, @@ -16,8 +15,7 @@ class PowerConverter /** * @param int|string $power */ - public static function convert($power, $powerUnit, string $expectedUnit = 'Wh') - { + public static function convert($power, $powerUnit, string $expectedUnit = 'Wh') { return $power * self::$powerUnits[$powerUnit] / self::$powerUnits[$expectedUnit]; } } diff --git a/src/backend/app/Helpers/RelationsManager.php b/src/backend/app/Helpers/RelationsManager.php index a9ee86ac7..b759daa4e 100644 --- a/src/backend/app/Helpers/RelationsManager.php +++ b/src/backend/app/Helpers/RelationsManager.php @@ -11,8 +11,7 @@ use Illuminate\Database\Eloquent\Relations\MorphOne; use Illuminate\Database\Eloquent\Relations\MorphTo; -trait RelationsManager -{ +trait RelationsManager { protected static $relationsList = []; protected static $relationsInitialized = false; @@ -28,8 +27,7 @@ trait RelationsManager 'morphmany' => MorphMany::class, ]; - public static function getAllRelations($type = null): array - { + public static function getAllRelations($type = null): array { if (!self::$relationsInitialized) { self::initAllRelations(); } @@ -40,8 +38,7 @@ public static function getAllRelations($type = null): array } } - protected static function initAllRelations(): void - { + protected static function initAllRelations(): void { self::$relationsInitialized = true; $reflect = new \ReflectionClass(static::class); @@ -57,8 +54,7 @@ protected static function initAllRelations(): void } } - public static function withAll($type = null): array - { + public static function withAll($type = null): array { $relations = array_flatten(static::getAllRelations($type)); return $relations; diff --git a/src/backend/app/Http/Controllers/AddressController.php b/src/backend/app/Http/Controllers/AddressController.php index fa76d322e..ce15d8bb4 100644 --- a/src/backend/app/Http/Controllers/AddressController.php +++ b/src/backend/app/Http/Controllers/AddressController.php @@ -7,22 +7,18 @@ use App\Services\PersonAddressService; use App\Services\PersonService; -class AddressController extends Controller -{ +class AddressController extends Controller { public function __construct( private AddressesService $addressService, private PersonService $personService, private PersonAddressService $personAddressService, - ) { - } + ) {} - public function index(): ApiResource - { + public function index(): ApiResource { return ApiResource::make($this->addressService->getAll()); } - public function show($id): ApiResource - { + public function show($id): ApiResource { return ApiResource::make($this->addressService->getById($id)); } } diff --git a/src/backend/app/Http/Controllers/AgentAssignedApplianceWebController.php b/src/backend/app/Http/Controllers/AgentAssignedApplianceWebController.php index ebc4a6f3a..16dcbdc9a 100644 --- a/src/backend/app/Http/Controllers/AgentAssignedApplianceWebController.php +++ b/src/backend/app/Http/Controllers/AgentAssignedApplianceWebController.php @@ -8,12 +8,10 @@ use App\Services\AgentAssignedApplianceService; use Illuminate\Http\Request; -class AgentAssignedApplianceWebController extends Controller -{ +class AgentAssignedApplianceWebController extends Controller { public function __construct( private AgentAssignedApplianceService $agentAssignedApplianceService, - ) { - } + ) {} /** * Store a newly created resource in storage. @@ -25,8 +23,7 @@ public function __construct( * * @return ApiResource */ - public function store(CreateAgentAssignedApplianceRequest $request) - { + public function store(CreateAgentAssignedApplianceRequest $request) { $assignedApplianceData = $request->only([ 'agent_id', 'user_id', @@ -44,8 +41,7 @@ public function store(CreateAgentAssignedApplianceRequest $request) * * @return ApiResource */ - public function index($agentId, Request $request) - { + public function index($agentId, Request $request) { $limit = $request->input('per_page'); return ApiResource::make($this->agentAssignedApplianceService->getAll($limit, $agentId)); diff --git a/src/backend/app/Http/Controllers/AgentAssignedAppliancesController.php b/src/backend/app/Http/Controllers/AgentAssignedAppliancesController.php index 7dc39a7bc..cb6e4b7d3 100644 --- a/src/backend/app/Http/Controllers/AgentAssignedAppliancesController.php +++ b/src/backend/app/Http/Controllers/AgentAssignedAppliancesController.php @@ -12,21 +12,18 @@ * @group Agent-Appliances * Class AgentAssignedApplianceController */ -class AgentAssignedAppliancesController extends Controller -{ +class AgentAssignedAppliancesController extends Controller { public function __construct( private AgentAssignedApplianceService $agentAssignedApplianceService, private AgentService $agentService, - ) { - } + ) {} /** * List for Android-APP. * * @return ApiResource */ - public function index(Request $request) - { + public function index(Request $request) { $agent = $this->agentService->getByAuthenticatedUser(); $limit = $request->input('per_page'); diff --git a/src/backend/app/Http/Controllers/AgentAuthController.php b/src/backend/app/Http/Controllers/AgentAuthController.php index 001ecb8e3..75a8a7cbb 100644 --- a/src/backend/app/Http/Controllers/AgentAuthController.php +++ b/src/backend/app/Http/Controllers/AgentAuthController.php @@ -12,13 +12,11 @@ * Class AgentAuthController * Responsible for AgentAPP-API-Call authentications. */ -class AgentAuthController extends Controller -{ +class AgentAuthController extends Controller { /** * Create a new AuthController instance. */ - public function __construct(private AgentService $agentService) - { + public function __construct(private AgentService $agentService) { $this->middleware('auth:agent_api', ['except' => ['login']]); } @@ -30,8 +28,7 @@ public function __construct(private AgentService $agentService) * * @return JsonResponse */ - public function login(Request $request) - { + public function login(Request $request) { $credentials = $request->only(['email', 'password']); if (!$token = auth('agent_api')->setTTL(525600)->attempt($credentials)) { @@ -51,8 +48,7 @@ public function login(Request $request) * * @return JsonResponse */ - public function me() - { + public function me() { return response()->json(auth('agent_api')->user()); } @@ -61,8 +57,7 @@ public function me() * * @return JsonResponse */ - public function logout() - { + public function logout() { auth('agent_api')->logout(); return response()->json(['message' => 'Successfully logged out']); @@ -74,8 +69,7 @@ public function logout() * * @return JsonResponse */ - public function refresh() - { + public function refresh() { return $this->respondWithToken(auth('agent_api')->refresh()); } @@ -86,8 +80,7 @@ public function refresh() * * @return JsonResponse */ - protected function respondWithToken($token) - { + protected function respondWithToken($token) { return response()->json( [ 'access_token' => $token, diff --git a/src/backend/app/Http/Controllers/AgentBalanceController.php b/src/backend/app/Http/Controllers/AgentBalanceController.php index 6725fb5e5..78f4a9b24 100644 --- a/src/backend/app/Http/Controllers/AgentBalanceController.php +++ b/src/backend/app/Http/Controllers/AgentBalanceController.php @@ -5,15 +5,12 @@ use App\Services\AgentService; use Illuminate\Http\Request; -class AgentBalanceController extends Controller -{ +class AgentBalanceController extends Controller { public function __construct( private AgentService $agentService, - ) { - } + ) {} - public function show(Request $request) - { + public function show(Request $request) { $agent = $this->agentService->getByAuthenticatedUser(); return $this->agentService->getAgentBalance($agent); diff --git a/src/backend/app/Http/Controllers/AgentBalanceHistoryController.php b/src/backend/app/Http/Controllers/AgentBalanceHistoryController.php index 8a9867071..1521d2dc7 100644 --- a/src/backend/app/Http/Controllers/AgentBalanceHistoryController.php +++ b/src/backend/app/Http/Controllers/AgentBalanceHistoryController.php @@ -9,20 +9,17 @@ use App\Services\AgentBalanceHistoryService; use Illuminate\Http\Request; -class AgentBalanceHistoryController extends Controller -{ +class AgentBalanceHistoryController extends Controller { private $agentBalanceHistoryService; - public function __construct(AgentBalanceHistoryService $agentBalanceHistoryService) - { + public function __construct(AgentBalanceHistoryService $agentBalanceHistoryService) { $this->agentBalanceHistoryService = $agentBalanceHistoryService; } /** * Store a newly created resource in storage. */ - public function store(Agent $agent, CreateAgentBalanceHistoryRequest $request): ApiResource - { + public function store(Agent $agent, CreateAgentBalanceHistoryRequest $request): ApiResource { $agentBalanceHistory = $this->agentBalanceHistoryService->create( $agent, $request->only( @@ -40,25 +37,19 @@ public function store(Agent $agent, CreateAgentBalanceHistoryRequest $request): * * @return void */ - public function show(AgentBalanceHistory $agent_balance_history) - { - } + public function show(AgentBalanceHistory $agent_balance_history) {} /** * Update the specified resource in storage. * * @return void */ - public function update(Request $request, AgentBalanceHistory $agent_balance_history) - { - } + public function update(Request $request, AgentBalanceHistory $agent_balance_history) {} /** * Remove the specified resource from storage. * * @return void */ - public function destroy(AgentBalanceHistory $agent_balance_history) - { - } + public function destroy(AgentBalanceHistory $agent_balance_history) {} } diff --git a/src/backend/app/Http/Controllers/AgentBalanceHistoryWebController.php b/src/backend/app/Http/Controllers/AgentBalanceHistoryWebController.php index e943a7ec4..d5d7bd34a 100644 --- a/src/backend/app/Http/Controllers/AgentBalanceHistoryWebController.php +++ b/src/backend/app/Http/Controllers/AgentBalanceHistoryWebController.php @@ -6,14 +6,10 @@ use App\Services\AgentBalanceHistoryService; use Illuminate\Http\Request; -class AgentBalanceHistoryWebController extends Controller -{ - public function __construct(private AgentBalanceHistoryService $agentBalanceHistoryService) - { - } +class AgentBalanceHistoryWebController extends Controller { + public function __construct(private AgentBalanceHistoryService $agentBalanceHistoryService) {} - public function index($agentId, Request $request) - { + public function index($agentId, Request $request) { $limit = $request->input('per_page'); return ApiResource::make($this->agentBalanceHistoryService->getAll($limit, $agentId)); diff --git a/src/backend/app/Http/Controllers/AgentChargeWebController.php b/src/backend/app/Http/Controllers/AgentChargeWebController.php index 15de11c83..642c602e1 100644 --- a/src/backend/app/Http/Controllers/AgentChargeWebController.php +++ b/src/backend/app/Http/Controllers/AgentChargeWebController.php @@ -6,15 +6,12 @@ use App\Http\Resources\ApiResource; use App\Services\AgentChargeService; -class AgentChargeWebController extends Controller -{ +class AgentChargeWebController extends Controller { public function __construct( private AgentChargeService $agentChargeService, - ) { - } + ) {} - public function store(CreateAgentChargeRequest $request): ApiResource - { + public function store(CreateAgentChargeRequest $request): ApiResource { $userId = auth('api')->user()->id; $agentChargeData = [ diff --git a/src/backend/app/Http/Controllers/AgentCommissionWebController.php b/src/backend/app/Http/Controllers/AgentCommissionWebController.php index f7dd9b25b..feecc8f8e 100644 --- a/src/backend/app/Http/Controllers/AgentCommissionWebController.php +++ b/src/backend/app/Http/Controllers/AgentCommissionWebController.php @@ -7,17 +7,13 @@ use App\Services\AgentCommissionService; use Illuminate\Http\Request; -class AgentCommissionWebController extends Controller -{ - public function __construct(private AgentCommissionService $agentCommissionService) - { - } +class AgentCommissionWebController extends Controller { + public function __construct(private AgentCommissionService $agentCommissionService) {} /** * Display a listing of the resource. */ - public function index(Request $request): ApiResource - { + public function index(Request $request): ApiResource { $limit = $request->input('per_page'); return ApiResource::make($this->agentCommissionService->getAll($limit)); @@ -28,8 +24,7 @@ public function index(Request $request): ApiResource * * @return ApiResource */ - public function store(CreateAgentCommissionRequest $request) - { + public function store(CreateAgentCommissionRequest $request) { $commissionData = $request->only(['name', 'energy_commission', 'appliance_commission', 'risk_balance']); return ApiResource::make($this->agentCommissionService->create($commissionData)); @@ -38,8 +33,7 @@ public function store(CreateAgentCommissionRequest $request) /** * Update the specified resource in storage. */ - public function update($agentCommissionId, CreateAgentCommissionRequest $request): ApiResource - { + public function update($agentCommissionId, CreateAgentCommissionRequest $request): ApiResource { $agentCommission = $this->agentCommissionService->getById($agentCommissionId); return ApiResource::make($this->agentCommissionService->update($agentCommission, $request->all())); @@ -48,8 +42,7 @@ public function update($agentCommissionId, CreateAgentCommissionRequest $request /** * Remove the specified resource from storage. */ - public function destroy($agentCommissionId): ApiResource - { + public function destroy($agentCommissionId): ApiResource { $agentCommission = $this->agentCommissionService->getById($agentCommissionId); return ApiResource::make($this->agentCommissionService->delete($agentCommission)); diff --git a/src/backend/app/Http/Controllers/AgentCustomerController.php b/src/backend/app/Http/Controllers/AgentCustomerController.php index a1bd5774d..6be2762a4 100644 --- a/src/backend/app/Http/Controllers/AgentCustomerController.php +++ b/src/backend/app/Http/Controllers/AgentCustomerController.php @@ -7,28 +7,24 @@ use App\Services\AgentService; use Illuminate\Http\Request; -class AgentCustomerController extends Controller -{ +class AgentCustomerController extends Controller { public function __construct( private AgentCustomerService $agentCustomerService, private AgentService $agentService, - ) { - } + ) {} /** * Display a listing of the resource. * * @return ApiResource */ - public function index(Request $request) - { + public function index(Request $request) { $agent = $this->agentService->getByAuthenticatedUser(); return ApiResource::make($this->agentCustomerService->list($agent)); } - public function search(Request $request): ApiResource - { + public function search(Request $request): ApiResource { $term = $request->input('term'); $limit = $request->input('paginate', 15); $agent = $this->agentService->getByAuthenticatedUser(); diff --git a/src/backend/app/Http/Controllers/AgentCustomerTicketController.php b/src/backend/app/Http/Controllers/AgentCustomerTicketController.php index d10413907..688db4275 100644 --- a/src/backend/app/Http/Controllers/AgentCustomerTicketController.php +++ b/src/backend/app/Http/Controllers/AgentCustomerTicketController.php @@ -7,14 +7,10 @@ use Illuminate\Http\Request; use Inensus\Ticket\Services\TicketService; -class AgentCustomerTicketController extends Controller -{ - public function __construct(private AgentService $agentService, private TicketService $ticketService) - { - } +class AgentCustomerTicketController extends Controller { + public function __construct(private AgentService $agentService, private TicketService $ticketService) {} - public function show($customerId, Request $request): ApiResource - { + public function show($customerId, Request $request): ApiResource { $agent = $this->agentService->getByAuthenticatedUser(); $limit = $request->input('per_page'); $status = null; diff --git a/src/backend/app/Http/Controllers/AgentCustomersPaymentHistoryController.php b/src/backend/app/Http/Controllers/AgentCustomersPaymentHistoryController.php index da8dcd519..5981f0a18 100644 --- a/src/backend/app/Http/Controllers/AgentCustomersPaymentHistoryController.php +++ b/src/backend/app/Http/Controllers/AgentCustomersPaymentHistoryController.php @@ -5,16 +5,13 @@ use App\Services\AgentCustomersPaymentHistoryService; use App\Services\AgentService; -class AgentCustomersPaymentHistoryController extends Controller -{ +class AgentCustomersPaymentHistoryController extends Controller { public function __construct( private AgentService $agentService, private AgentCustomersPaymentHistoryService $agentCustomersPaymentHistoryService, - ) { - } + ) {} - public function show(int $customerId, string $period, $limit = null, $order = 'ASC') - { + public function show(int $customerId, string $period, $limit = null, $order = 'ASC') { return $this->agentCustomersPaymentHistoryService->getPaymentFlowByCustomerId( $period, $customerId, @@ -23,8 +20,7 @@ public function show(int $customerId, string $period, $limit = null, $order = 'A ); } - public function index(string $period, $limit = null, $order = 'ASC') - { + public function index(string $period, $limit = null, $order = 'ASC') { $agent = $this->agentService->getByAuthenticatedUser(); return $this->agentCustomersPaymentHistoryService->getPaymentFlows($period, $agent->id, $limit, $order); diff --git a/src/backend/app/Http/Controllers/AgentDashboardBalanceHistoryController.php b/src/backend/app/Http/Controllers/AgentDashboardBalanceHistoryController.php index 434d4de10..48512c20d 100644 --- a/src/backend/app/Http/Controllers/AgentDashboardBalanceHistoryController.php +++ b/src/backend/app/Http/Controllers/AgentDashboardBalanceHistoryController.php @@ -8,17 +8,14 @@ use Illuminate\Http\Request; use Illuminate\Http\Response; -class AgentDashboardBalanceHistoryController extends Controller -{ +class AgentDashboardBalanceHistoryController extends Controller { public function __construct( private AgentService $agentService, private AgentBalanceHistoryService $agentBalanceHistoryService, private AgentReceiptService $agentReceiptService, - ) { - } + ) {} - public function show(Request $request, Response $response) - { + public function show(Request $request, Response $response) { $agent = $this->agentService->getByAuthenticatedUser(); $lastReceiptDate = $this->agentReceiptService->getLastReceiptDate($agent); diff --git a/src/backend/app/Http/Controllers/AgentDashboardBoxesController.php b/src/backend/app/Http/Controllers/AgentDashboardBoxesController.php index 00ce9eec1..059f41517 100644 --- a/src/backend/app/Http/Controllers/AgentDashboardBoxesController.php +++ b/src/backend/app/Http/Controllers/AgentDashboardBoxesController.php @@ -8,17 +8,14 @@ use Illuminate\Http\Request; use Illuminate\Http\Response; -class AgentDashboardBoxesController extends Controller -{ +class AgentDashboardBoxesController extends Controller { public function __construct( private AgentService $agentService, private AgentBalanceHistoryService $agentBalanceHistoryService, private AgentReceiptService $agentReceiptService, - ) { - } + ) {} - public function show(Request $request, Response $response) - { + public function show(Request $request, Response $response) { $agent = $this->agentService->getByAuthenticatedUser(); $lastReceipt = $this->agentReceiptService->getLastReceipt($agent->id); $average = $this->agentBalanceHistoryService->getTransactionAverage($agent, $lastReceipt); diff --git a/src/backend/app/Http/Controllers/AgentDashboardRevenueController.php b/src/backend/app/Http/Controllers/AgentDashboardRevenueController.php index a6f16fee1..b9932bf9a 100644 --- a/src/backend/app/Http/Controllers/AgentDashboardRevenueController.php +++ b/src/backend/app/Http/Controllers/AgentDashboardRevenueController.php @@ -7,16 +7,13 @@ use Illuminate\Http\Request; use Illuminate\Http\Response; -class AgentDashboardRevenueController extends Controller -{ +class AgentDashboardRevenueController extends Controller { public function __construct( private AgentService $agentService, private AgentBalanceHistoryService $agentBalanceHistoryService, - ) { - } + ) {} - public function show(Request $request, Response $response) - { + public function show(Request $request, Response $response) { $agent = $this->agentService->getByAuthenticatedUser(); return $this->agentBalanceHistoryService->getAgentRevenuesWeekly($agent); diff --git a/src/backend/app/Http/Controllers/AgentFirebaseController.php b/src/backend/app/Http/Controllers/AgentFirebaseController.php index 0a14c5b57..fad2783c5 100644 --- a/src/backend/app/Http/Controllers/AgentFirebaseController.php +++ b/src/backend/app/Http/Controllers/AgentFirebaseController.php @@ -6,15 +6,12 @@ use App\Services\AgentService; use Illuminate\Http\Request; -class AgentFirebaseController extends Controller -{ +class AgentFirebaseController extends Controller { public function __construct( private AgentService $agentService, - ) { - } + ) {} - public function update(Request $request): ApiResource - { + public function update(Request $request): ApiResource { $agent = $this->agentService->getByAuthenticatedUser(); return ApiResource::make($this->agentService->setFirebaseToken($agent, $request->input('fire_base_token'))); diff --git a/src/backend/app/Http/Controllers/AgentReceiptDetailController.php b/src/backend/app/Http/Controllers/AgentReceiptDetailController.php index 26a7d1a51..6b4f26a3b 100644 --- a/src/backend/app/Http/Controllers/AgentReceiptDetailController.php +++ b/src/backend/app/Http/Controllers/AgentReceiptDetailController.php @@ -2,6 +2,4 @@ namespace App\Http\Controllers; -class AgentReceiptDetailController extends Controller -{ -} +class AgentReceiptDetailController extends Controller {} diff --git a/src/backend/app/Http/Controllers/AgentReceiptWebController.php b/src/backend/app/Http/Controllers/AgentReceiptWebController.php index 82b185264..62e4bc0fa 100644 --- a/src/backend/app/Http/Controllers/AgentReceiptWebController.php +++ b/src/backend/app/Http/Controllers/AgentReceiptWebController.php @@ -8,21 +8,18 @@ use App\Services\AgentReceiptService; use Illuminate\Http\Request; -class AgentReceiptWebController extends Controller -{ +class AgentReceiptWebController extends Controller { public function __construct( private AgentReceiptService $agentReceiptService, private AgentBalanceHistoryService $agentBalanceHistoryService, - ) { - } + ) {} /** * Display a listing of the resource. * * @return ApiResource */ - public function show($agentId, Request $request) - { + public function show($agentId, Request $request) { $limit = $request->input('per_page'); return ApiResource::make($this->agentReceiptService->getAll($limit, $agentId)); @@ -33,8 +30,7 @@ public function show($agentId, Request $request) * * @return ApiResource */ - public function index(Request $request) - { + public function index(Request $request) { $limit = $request->input('per_page'); return ApiResource::make($this->agentReceiptService->getAll($limit)); @@ -47,8 +43,7 @@ public function index(Request $request) * * @return ApiResource */ - public function store(CreateAgentReceiptRequest $request) - { + public function store(CreateAgentReceiptRequest $request) { $userId = auth('api')->user()->id; $agentId = $request->input('agent_id'); $lastBalanceHistory = $this->agentBalanceHistoryService->getLastAgentBalanceHistory($agentId); diff --git a/src/backend/app/Http/Controllers/AgentSoldApplianceController.php b/src/backend/app/Http/Controllers/AgentSoldApplianceController.php index 1bc2d62d1..213144349 100644 --- a/src/backend/app/Http/Controllers/AgentSoldApplianceController.php +++ b/src/backend/app/Http/Controllers/AgentSoldApplianceController.php @@ -8,26 +8,22 @@ use App\Services\AgentSoldApplianceService; use Illuminate\Http\Request; -class AgentSoldApplianceController extends Controller -{ +class AgentSoldApplianceController extends Controller { public const FOR_APP = true; public function __construct( private AgentSoldApplianceService $agentSoldApplianceService, private AgentService $agentService, - ) { - } + ) {} - public function index(Request $request) - { + public function index(Request $request) { $agent = $this->agentService->getByAuthenticatedUser(); $limit = $request->input('per_page'); return ApiResource::make($this->agentSoldApplianceService->getAll($limit, $agent->id, null, self::FOR_APP)); } - public function show($customerId, Request $request): ApiResource - { + public function show($customerId, Request $request): ApiResource { $agent = $this->agentService->getByAuthenticatedUser(); return ApiResource::make($this->agentSoldApplianceService->getById($agent->id, $customerId)); @@ -38,8 +34,7 @@ public function show($customerId, Request $request): ApiResource * * @return ApiResource */ - public function store(CreateAgentSoldApplianceRequest $request) - { + public function store(CreateAgentSoldApplianceRequest $request) { $soldApplianceData = $request->only(['person_id', 'agent_assigned_appliance_id']); return ApiResource::make($this->agentSoldApplianceService->create($soldApplianceData)); diff --git a/src/backend/app/Http/Controllers/AgentSoldApplianceWebController.php b/src/backend/app/Http/Controllers/AgentSoldApplianceWebController.php index 2ca847494..e913e7f74 100644 --- a/src/backend/app/Http/Controllers/AgentSoldApplianceWebController.php +++ b/src/backend/app/Http/Controllers/AgentSoldApplianceWebController.php @@ -6,14 +6,10 @@ use App\Services\AgentSoldApplianceService; use Illuminate\Http\Request; -class AgentSoldApplianceWebController extends Controller -{ - public function __construct(private AgentSoldApplianceService $agentSoldApplianceService) - { - } +class AgentSoldApplianceWebController extends Controller { + public function __construct(private AgentSoldApplianceService $agentSoldApplianceService) {} - public function index($agentId, Request $request): ApiResource - { + public function index($agentId, Request $request): ApiResource { $limit = $request->input('per_page'); return ApiResource::make($this->agentSoldApplianceService->getAll($limit, $agentId)); diff --git a/src/backend/app/Http/Controllers/AgentTicketController.php b/src/backend/app/Http/Controllers/AgentTicketController.php index f7c0283f8..e410625dc 100644 --- a/src/backend/app/Http/Controllers/AgentTicketController.php +++ b/src/backend/app/Http/Controllers/AgentTicketController.php @@ -14,8 +14,7 @@ use Inensus\Ticket\Services\TicketService; use Inensus\Ticket\Services\TicketUserService; -class AgentTicketController extends Controller -{ +class AgentTicketController extends Controller { private $board; private $card; @@ -32,20 +31,17 @@ public function __construct( // $this->card = $this->cardService->initalizeList($this->board); } - public function index(Request $request): ApiResource - { + public function index(Request $request): ApiResource { $agent = $this->agentService->getByAuthenticatedUser(); return ApiResource::make($this->ticketService->getForAgent($agent->id)); } - public function show($ticketId, Request $request): ApiResource - { + public function show($ticketId, Request $request): ApiResource { return ApiResource::make($this->ticketService->getById($ticketId)); } - public function store(CreateAgentTicketRequest $request): TicketResource - { + public function store(CreateAgentTicketRequest $request): TicketResource { $ticketData = $request->only([ 'owner_id', 'due_date', diff --git a/src/backend/app/Http/Controllers/AgentTransactionWebController.php b/src/backend/app/Http/Controllers/AgentTransactionWebController.php index 34fa60bf9..1f19af7f2 100644 --- a/src/backend/app/Http/Controllers/AgentTransactionWebController.php +++ b/src/backend/app/Http/Controllers/AgentTransactionWebController.php @@ -6,14 +6,10 @@ use App\Services\AgentTransactionService; use Illuminate\Http\Request; -class AgentTransactionWebController extends Controller -{ - public function __construct(private AgentTransactionService $agentTransactionService) - { - } +class AgentTransactionWebController extends Controller { + public function __construct(private AgentTransactionService $agentTransactionService) {} - public function index($agentId, Request $request): ApiResource - { + public function index($agentId, Request $request): ApiResource { $limit = $request->input('per_page'); return ApiResource::make($this->agentTransactionService->getAll($limit, $agentId)); diff --git a/src/backend/app/Http/Controllers/AgentTransactionsController.php b/src/backend/app/Http/Controllers/AgentTransactionsController.php index f4c747da3..75d033cc1 100644 --- a/src/backend/app/Http/Controllers/AgentTransactionsController.php +++ b/src/backend/app/Http/Controllers/AgentTransactionsController.php @@ -7,26 +7,22 @@ use App\Services\AgentTransactionService; use Illuminate\Http\Request; -class AgentTransactionsController extends Controller -{ +class AgentTransactionsController extends Controller { public const FOR_APP = true; public function __construct( private AgentTransactionService $agentTransactionService, private AgentService $agentService, - ) { - } + ) {} - public function index(Request $request): ApiResource - { + public function index(Request $request): ApiResource { $agent = $this->agentService->getByAuthenticatedUser(); $limit = $request->input('per_page'); return ApiResource::make($this->agentTransactionService->getAll($limit, $agent->id, self::FOR_APP)); } - public function show($customerId, Request $request): ApiResource - { + public function show($customerId, Request $request): ApiResource { $agent = $this->agentService->getByAuthenticatedUser(); return ApiResource::make($this->agentTransactionService->getById($agent->id, $customerId)); diff --git a/src/backend/app/Http/Controllers/AgentWebController.php b/src/backend/app/Http/Controllers/AgentWebController.php index 5554868ba..3b816b4ee 100644 --- a/src/backend/app/Http/Controllers/AgentWebController.php +++ b/src/backend/app/Http/Controllers/AgentWebController.php @@ -15,8 +15,7 @@ use Illuminate\Http\Request; use Illuminate\Http\Response; -class AgentWebController extends Controller -{ +class AgentWebController extends Controller { public function __construct( private AgentService $agentService, private AddressesService $addressService, @@ -25,23 +24,19 @@ public function __construct( private CountryService $countryService, private CompanyDatabaseService $companyDatabaseService, private DatabaseProxyService $databaseProxyService, - ) { - } + ) {} - public function index(Request $request): ApiResource - { + public function index(Request $request): ApiResource { $limit = $request->input('per_page'); return ApiResource::make($this->agentService->getAll($limit)); } - public function show($agentId, Request $request): ApiResource - { + public function show($agentId, Request $request): ApiResource { return ApiResource::make($this->agentService->getById($agentId)); } - public function store(CreateAgentRequest $request): ApiResource - { + public function store(CreateAgentRequest $request): ApiResource { $addressData = $this->addressService->createAddressDataFromRequest($request); $personData = $this->personService->createPersonDataFromRequest($request); $country = $this->countryService->getByCode($request->get('nationality')); @@ -75,23 +70,20 @@ public function store(CreateAgentRequest $request): ApiResource )); } - public function update($agentId, Request $request): ApiResource - { + public function update($agentId, Request $request): ApiResource { $agent = $this->agentService->getById($agentId); $agentData = $request->all(); return ApiResource::make($this->agentService->update($agent, $agentData, $this->personService)); } - public function destroy($agentId, Request $request): ApiResource - { + public function destroy($agentId, Request $request): ApiResource { $agent = $this->agentService->getById($agentId); return ApiResource::make($this->agentService->delete($agent)); } - public function search(Request $request): ApiResource - { + public function search(Request $request): ApiResource { $term = $request->input('term'); $paginate = $request->input('paginate', 1); @@ -101,8 +93,7 @@ public function search(Request $request): ApiResource /** * @return Response */ - public function resetPassword(Request $request, Response $response) - { + public function resetPassword(Request $request, Response $response) { $responseMessage = $this->agentService->resetPassword($request->input('email')); if ($responseMessage === 'Invalid email.') { diff --git a/src/backend/app/Http/Controllers/AirtelVoltTerraController.php b/src/backend/app/Http/Controllers/AirtelVoltTerraController.php index 044b2f5f2..b8b99790b 100644 --- a/src/backend/app/Http/Controllers/AirtelVoltTerraController.php +++ b/src/backend/app/Http/Controllers/AirtelVoltTerraController.php @@ -5,10 +5,8 @@ use App\Jobs\ProcessPayment; // WorkAround for only VOLTTERRA -class AirtelVoltTerraController extends Controller -{ - public function store($meterSerial, $amount) - { +class AirtelVoltTerraController extends Controller { + public function store($meterSerial, $amount) { $tempFile = tempnam(sys_get_temp_dir(), 'response'); try { $provider = resolve('AirtelVoltTerra'); diff --git a/src/backend/app/Http/Controllers/AppliancePaymentController.php b/src/backend/app/Http/Controllers/AppliancePaymentController.php index b134182ef..f7f1c1978 100644 --- a/src/backend/app/Http/Controllers/AppliancePaymentController.php +++ b/src/backend/app/Http/Controllers/AppliancePaymentController.php @@ -8,14 +8,10 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; -class AppliancePaymentController extends Controller -{ - public function __construct(private AppliancePaymentService $appliancePaymentService) - { - } +class AppliancePaymentController extends Controller { + public function __construct(private AppliancePaymentService $appliancePaymentService) {} - public function store(AssetPerson $appliancePerson, Request $request): ApiResource - { + public function store(AssetPerson $appliancePerson, Request $request): ApiResource { try { DB::connection('shard')->beginTransaction(); $this->appliancePaymentService->getPaymentForAppliance($request, $appliancePerson); diff --git a/src/backend/app/Http/Controllers/AssetController.php b/src/backend/app/Http/Controllers/AssetController.php index 43e25f463..741ecc52d 100644 --- a/src/backend/app/Http/Controllers/AssetController.php +++ b/src/backend/app/Http/Controllers/AssetController.php @@ -9,36 +9,29 @@ use App\Services\AssetService; use Illuminate\Http\Request; -class AssetController extends Controller -{ - public function __construct(private AssetService $assetService) - { - } +class AssetController extends Controller { + public function __construct(private AssetService $assetService) {} /** * Display a listing of the resource. */ - public function index(Request $request): ApiResource - { + public function index(Request $request): ApiResource { return ApiResource::make($this->assetService->getAssets($request)); } - public function store(CreateAssetRequest $request): ApiResource - { + public function store(CreateAssetRequest $request): ApiResource { $this->assetService->createAsset($request); return ApiResource::make($this->assetService->getAssets($request)); } - public function update(UpdateAssetRequest $request, Asset $asset): ApiResource - { + public function update(UpdateAssetRequest $request, Asset $asset): ApiResource { $this->assetService->updateAsset($request, $asset); return ApiResource::make($this->assetService->getAssets($request)); } - public function destroy(Asset $asset): ApiResource - { + public function destroy(Asset $asset): ApiResource { return ApiResource::make($this->assetService->deleteAsset($asset)); } } diff --git a/src/backend/app/Http/Controllers/AssetPersonController.php b/src/backend/app/Http/Controllers/AssetPersonController.php index b12416855..29de758a3 100644 --- a/src/backend/app/Http/Controllers/AssetPersonController.php +++ b/src/backend/app/Http/Controllers/AssetPersonController.php @@ -21,8 +21,7 @@ use MPM\Device\DeviceAddressService; use MPM\Device\DeviceService; -class AssetPersonController extends Controller -{ +class AssetPersonController extends Controller { public function __construct( private AssetPerson $assetPerson, private AppliancePersonService $assetPersonService, @@ -36,8 +35,7 @@ public function __construct( private CashTransactionService $cashTransactionService, private AssetService $applianceService, private ApplianceRateService $applianceRateService, - ) { - } + ) {} /** * Store a newly created resource in storage. @@ -138,8 +136,7 @@ public function store( /** * Display the specified resource. */ - public function index(Person $person, Request $request): ApiResource - { + public function index(Person $person, Request $request): ApiResource { $assets = $this->assetPerson::with('asset.assetType', 'rates.logs', 'logs.owner') ->where('person_id', $person->id) ->get(); @@ -147,8 +144,7 @@ public function index(Person $person, Request $request): ApiResource return ApiResource::make($assets); } - public function show($applianceId): ApiResource - { + public function show($applianceId): ApiResource { $appliance = $this->assetPersonService->getApplianceDetails($applianceId); return ApiResource::make($appliance); diff --git a/src/backend/app/Http/Controllers/AssetRateController.php b/src/backend/app/Http/Controllers/AssetRateController.php index fde4078e7..3e903827d 100644 --- a/src/backend/app/Http/Controllers/AssetRateController.php +++ b/src/backend/app/Http/Controllers/AssetRateController.php @@ -8,8 +8,7 @@ use App\Services\CashTransactionService; use Illuminate\Http\Request; -class AssetRateController extends Controller -{ +class AssetRateController extends Controller { /** * Update the specified resource in storage. * @@ -30,8 +29,7 @@ public function __construct( $this->applianceRateService = $applianceRateService; } - public function update(Request $request, AssetRate $applianceRate): ApiResource - { + public function update(Request $request, AssetRate $applianceRate): ApiResource { $cost = $request->get('cost'); $newCost = $request->get('newCost'); $creatorId = $request->get('admin_id'); diff --git a/src/backend/app/Http/Controllers/AssetTypeController.php b/src/backend/app/Http/Controllers/AssetTypeController.php index dad942212..863ca39f1 100644 --- a/src/backend/app/Http/Controllers/AssetTypeController.php +++ b/src/backend/app/Http/Controllers/AssetTypeController.php @@ -10,8 +10,7 @@ use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Http\Request; -class AssetTypeController extends Controller -{ +class AssetTypeController extends Controller { use SoftDeletes; /** @@ -19,24 +18,21 @@ class AssetTypeController extends Controller */ private $applianceTypeService; - public function __construct(ApplianceTypeService $applianceTypeService) - { + public function __construct(ApplianceTypeService $applianceTypeService) { $this->applianceTypeService = $applianceTypeService; } /** * Display a listing of the resource. */ - public function index(Request $request): ApiResource - { + public function index(Request $request): ApiResource { return new ApiResource($this->applianceTypeService->getApplianceTypes($request)); } /** * Store a newly created resource in storage. */ - public function store(AssetTypeCreateRequest $request): ApiResource - { + public function store(AssetTypeCreateRequest $request): ApiResource { $appliance = $this->applianceTypeService->createApplianceType($request); return new ApiResource($appliance); @@ -45,8 +41,7 @@ public function store(AssetTypeCreateRequest $request): ApiResource /** * Update the specified resource in storage. */ - public function update(AssetTypeUpdateRequest $request, AssetType $assetType): ApiResource - { + public function update(AssetTypeUpdateRequest $request, AssetType $assetType): ApiResource { $appliance = $this->applianceTypeService->updateApplianceType($request, $assetType); return new ApiResource($appliance); @@ -57,8 +52,7 @@ public function update(AssetTypeUpdateRequest $request, AssetType $assetType): A * * @throws \Exception */ - public function destroy(AssetType $assetType): ApiResource - { + public function destroy(AssetType $assetType): ApiResource { return new ApiResource( $this->applianceTypeService->deleteApplianceType($assetType) ); diff --git a/src/backend/app/Http/Controllers/AuthController.php b/src/backend/app/Http/Controllers/AuthController.php index 5c0a69433..aa8c21d0c 100644 --- a/src/backend/app/Http/Controllers/AuthController.php +++ b/src/backend/app/Http/Controllers/AuthController.php @@ -9,15 +9,13 @@ * Class AuthController * Responsible for API-Call authentications. */ -class AuthController extends Controller -{ +class AuthController extends Controller { /** * Create a new AuthController instance. * * @return void */ - public function __construct() - { + public function __construct() { $this->middleware('auth:api', ['except' => ['login']]); } @@ -27,8 +25,7 @@ public function __construct() * @bodyParam email string required * @bodyParam password string required */ - public function login() - { + public function login() { $credentials = request(['email', 'password']); if (!$token = auth('api')->attempt($credentials)) { @@ -43,8 +40,7 @@ public function login() * * @return JsonResponse */ - public function me() - { + public function me() { return response()->json(auth('api')->user()); } @@ -53,8 +49,7 @@ public function me() * * @return JsonResponse */ - public function logout() - { + public function logout() { auth('api')->logout(); return response()->json(['message' => 'Successfully logged out']); @@ -67,8 +62,7 @@ public function logout() * * @return JsonResponse */ - public function refresh() - { + public function refresh() { return $this->respondWithToken(auth()->refresh()); } @@ -79,8 +73,7 @@ public function refresh() * * @return JsonResponse */ - protected function respondWithToken($token) - { + protected function respondWithToken($token) { return response()->json( [ 'access_token' => $token, diff --git a/src/backend/app/Http/Controllers/CityController.php b/src/backend/app/Http/Controllers/CityController.php index e2be57a09..e3416292c 100644 --- a/src/backend/app/Http/Controllers/CityController.php +++ b/src/backend/app/Http/Controllers/CityController.php @@ -9,24 +9,20 @@ use App\Services\GeographicalInformationService; use Illuminate\Http\Request; -class CityController extends Controller -{ +class CityController extends Controller { public function __construct( private CityService $cityService, private GeographicalInformationService $geographicalInformationService, private CityGeographicalInformationService $cityGeographicalInformationService, - ) { - } + ) {} - public function index(Request $request): ApiResource - { + public function index(Request $request): ApiResource { $limit = $request->get('limit'); return ApiResource::make($this->cityService->getAll($limit)); } - public function show($cityId, Request $request): ApiResource - { + public function show($cityId, Request $request): ApiResource { $relation = $request->get('relation'); if ($relation) { @@ -36,16 +32,14 @@ public function show($cityId, Request $request): ApiResource return ApiResource::make($this->cityService->getById($cityId)); } - public function update($cityId, CityRequest $request): ApiResource - { + public function update($cityId, CityRequest $request): ApiResource { $city = $this->cityService->getById($cityId); $cityData = $request->only(['name', 'mini_grid_id', 'cluster_id', 'country_id']); return ApiResource::make($this->cityService->update($city, $cityData)); } - public function store(CityRequest $request): ApiResource - { + public function store(CityRequest $request): ApiResource { $data = $request->validationData(); $city = $this->cityService->create($data); $geographicalInformation = $this->geographicalInformationService->make($data); diff --git a/src/backend/app/Http/Controllers/ClusterController.php b/src/backend/app/Http/Controllers/ClusterController.php index aa968b833..1902a0dc2 100644 --- a/src/backend/app/Http/Controllers/ClusterController.php +++ b/src/backend/app/Http/Controllers/ClusterController.php @@ -10,29 +10,25 @@ use App\Services\ClusterTransactionService; use Illuminate\Http\Request; -class ClusterController extends Controller -{ +class ClusterController extends Controller { public function __construct( private ClusterService $clusterService, private ClusterMeterService $clusterMetersService, private ClusterTransactionService $clusterTransactionsService, private ClusterPopulationService $clusterPopulationService, - ) { - } + ) {} /** * @throws \Exception */ - public function index(Request $request): ApiResource - { + public function index(Request $request): ApiResource { return ApiResource::make($this->clusterService->getAll()); } /** * @throws \Exception */ - public function show($clusterId, Request $request): ApiResource - { + public function show($clusterId, Request $request): ApiResource { $dateRange = $this->clusterService->getDateRangeFromRequest($request->get('start_date'), $request->get('end_date')); $cluster = $this->clusterService->getById($clusterId); @@ -45,13 +41,11 @@ public function show($clusterId, Request $request): ApiResource )); } - public function showGeo($clusterId): ApiResource - { + public function showGeo($clusterId): ApiResource { return ApiResource::make(['geo_data' => $this->clusterService->getGeoLocationById($clusterId)]); } - public function store(ClusterRequest $request): ApiResource - { + public function store(ClusterRequest $request): ApiResource { $clusterData = $request->only(['name', 'manager_id', 'geo_data']); return ApiResource::make($this->clusterService->create($clusterData)); diff --git a/src/backend/app/Http/Controllers/ClusterMiniGridRevenueController.php b/src/backend/app/Http/Controllers/ClusterMiniGridRevenueController.php index cc58a8509..6d821f5db 100644 --- a/src/backend/app/Http/Controllers/ClusterMiniGridRevenueController.php +++ b/src/backend/app/Http/Controllers/ClusterMiniGridRevenueController.php @@ -6,15 +6,12 @@ use App\Services\ClusterRevenueService; use Illuminate\Http\Request; -class ClusterMiniGridRevenueController extends Controller -{ +class ClusterMiniGridRevenueController extends Controller { public function __construct( private ClusterRevenueService $clusterRevenueService, - ) { - } + ) {} - public function show($clusterId, Request $request): ApiResource - { + public function show($clusterId, Request $request): ApiResource { $startDate = $request->input('startDate') ?? date('Y-01-01'); $endDate = $request->input('endDate') ?? date('Y-m-t'); $period = $request->input('period') ?? 'monthly'; diff --git a/src/backend/app/Http/Controllers/ClusterRevenueAnalysisController.php b/src/backend/app/Http/Controllers/ClusterRevenueAnalysisController.php index 648ce6866..0bbda5223 100644 --- a/src/backend/app/Http/Controllers/ClusterRevenueAnalysisController.php +++ b/src/backend/app/Http/Controllers/ClusterRevenueAnalysisController.php @@ -8,17 +8,14 @@ use App\Services\ConnectionTypeService; use Illuminate\Http\Request; -class ClusterRevenueAnalysisController extends Controller -{ +class ClusterRevenueAnalysisController extends Controller { public function __construct( private ClusterService $clusterService, private ClusterRevenueService $clusterRevenueService, private ConnectionTypeService $connectionTypeService, - ) { - } + ) {} - public function show($clusterId, Request $request): ApiResource - { + public function show($clusterId, Request $request): ApiResource { /** * !!!! * To group revenue by city -> connection type diff --git a/src/backend/app/Http/Controllers/ClusterRevenueController.php b/src/backend/app/Http/Controllers/ClusterRevenueController.php index c17d2cbaa..03dbb962e 100644 --- a/src/backend/app/Http/Controllers/ClusterRevenueController.php +++ b/src/backend/app/Http/Controllers/ClusterRevenueController.php @@ -12,8 +12,7 @@ use App\Services\PeriodService; use Illuminate\Http\Request; -class ClusterRevenueController extends Controller -{ +class ClusterRevenueController extends Controller { public function __construct( private ClusterService $clusterService, private ClusterRevenueService $clusterRevenueService, @@ -22,11 +21,9 @@ public function __construct( private ClusterTransactionService $clusterTransactionService, private ClusterPopulationService $clusterPopulationService, private PeriodService $periodService, - ) { - } + ) {} - public function index(Request $request): ApiResource - { + public function index(Request $request): ApiResource { $dates = $this->clusterRevenueService->setDatesForRequest($request->get('startDate'), $request->get('endDate')); $startDate = $dates['startDate']; @@ -46,8 +43,7 @@ public function index(Request $request): ApiResource ); } - public function show($clusterId, Request $request): ApiResource - { + public function show($clusterId, Request $request): ApiResource { $dateRange = $this->clusterRevenueService->setDateRangeForRequest($request->get('startDate'), $request->get('endDate')); $cluster = $this->clusterService->getById($clusterId); diff --git a/src/backend/app/Http/Controllers/ClustersDashboardCacheDataController.php b/src/backend/app/Http/Controllers/ClustersDashboardCacheDataController.php index fe1b2b170..f997e8279 100644 --- a/src/backend/app/Http/Controllers/ClustersDashboardCacheDataController.php +++ b/src/backend/app/Http/Controllers/ClustersDashboardCacheDataController.php @@ -6,25 +6,20 @@ use App\Services\ClustersDashboardCacheDataService; use Illuminate\Http\Request; -class ClustersDashboardCacheDataController extends Controller -{ +class ClustersDashboardCacheDataController extends Controller { public function __construct( private ClustersDashboardCacheDataService $clustersDashboardCacheDataService, - ) { - } + ) {} - public function index() - { + public function index() { return ApiResource::make($this->clustersDashboardCacheDataService->getData()); } - public function show($clusterId) - { + public function show($clusterId) { return ApiResource::make($this->clustersDashboardCacheDataService->getDataById($clusterId)); } - public function update(Request $request) - { + public function update(Request $request) { $fromDate = $request->query('from'); $toDate = $request->query('to'); diff --git a/src/backend/app/Http/Controllers/CompanyController.php b/src/backend/app/Http/Controllers/CompanyController.php index 8b6f0c889..fc84204fd 100644 --- a/src/backend/app/Http/Controllers/CompanyController.php +++ b/src/backend/app/Http/Controllers/CompanyController.php @@ -16,8 +16,7 @@ use Illuminate\Support\Facades\Artisan; use MPM\DatabaseProxy\DatabaseProxyManagerService; -class CompanyController extends Controller -{ +class CompanyController extends Controller { public function __construct( private CompanyService $companyService, private CompanyDatabaseService $companyDatabaseService, @@ -27,11 +26,9 @@ public function __construct( private MpmPluginService $mpmPluginService, private RegistrationTailService $registrationTailService, private MainSettingsService $mainSettingsService, - ) { - } + ) {} - public function store(CompanyRegistrationRequest $request): JsonResponse - { + public function store(CompanyRegistrationRequest $request): JsonResponse { $companyData = $request->only(['name', 'address', 'phone', 'email', 'country_id', 'protected_page_password']); $adminData = $request->input('user'); $plugins = $request->input('plugins'); @@ -109,8 +106,7 @@ function () use ($company, $plugins) { ); } - public function get($email): ApiResource - { + public function get($email): ApiResource { $databaseProxy = $this->databaseProxyManagerService->findByEmail($email); return ApiResource::make($this->companyService->getByDatabaseProxy($databaseProxy)); diff --git a/src/backend/app/Http/Controllers/ConnectionGroupController.php b/src/backend/app/Http/Controllers/ConnectionGroupController.php index 66694b28b..ca568c7ab 100644 --- a/src/backend/app/Http/Controllers/ConnectionGroupController.php +++ b/src/backend/app/Http/Controllers/ConnectionGroupController.php @@ -7,34 +7,28 @@ use App\Services\ConnectionGroupService; use Illuminate\Http\Request; -class ConnectionGroupController -{ +class ConnectionGroupController { public function __construct( private ConnectionGroupService $connectionGroupService, - ) { - } + ) {} - public function index(Request $request): ApiResource - { + public function index(Request $request): ApiResource { $limit = $request->input('per_page'); return ApiResource::make($this->connectionGroupService->getAll($limit)); } - public function show($connectionGroupId, Request $request): ApiResource - { + public function show($connectionGroupId, Request $request): ApiResource { return ApiResource::make($this->connectionGroupService->getById($connectionGroupId)); } - public function store(CreateConnectionGroupRequest $request): ApiResource - { + public function store(CreateConnectionGroupRequest $request): ApiResource { $connectionGroupData = $request->all(); return new ApiResource($this->connectionGroupService->create($connectionGroupData)); } - public function update($connectionGroupId, CreateConnectionGroupRequest $request): ApiResource - { + public function update($connectionGroupId, CreateConnectionGroupRequest $request): ApiResource { $connectionGroup = $this->connectionGroupService->getById($connectionGroupId); $connectionGroupData = $request->all(); diff --git a/src/backend/app/Http/Controllers/ConnectionTypeController.php b/src/backend/app/Http/Controllers/ConnectionTypeController.php index 105d13fa1..f24494b1d 100644 --- a/src/backend/app/Http/Controllers/ConnectionTypeController.php +++ b/src/backend/app/Http/Controllers/ConnectionTypeController.php @@ -6,21 +6,16 @@ use App\Services\ConnectionTypeService; use Illuminate\Http\Request; -class ConnectionTypeController extends Controller -{ - public function __construct(private ConnectionTypeService $connectionTypeService) - { - } +class ConnectionTypeController extends Controller { + public function __construct(private ConnectionTypeService $connectionTypeService) {} - public function index(Request $request): ApiResource - { + public function index(Request $request): ApiResource { $limit = $request->get('limit'); return ApiResource::make($this->connectionTypeService->getAll($limit)); } - public function show($connectionTypeId, Request $request): ApiResource - { + public function show($connectionTypeId, Request $request): ApiResource { $meterCountRelation = $request->input('meter_count'); if ($meterCountRelation) { @@ -30,15 +25,13 @@ public function show($connectionTypeId, Request $request): ApiResource return ApiResource::make($this->connectionTypeService->getById($connectionTypeId)); } - public function store(Request $request): ApiResource - { + public function store(Request $request): ApiResource { $connectionTypeData = $request->all(); return ApiResource::make($this->connectionTypeService->create($connectionTypeData)); } - public function update($connectionTypeId, Request $request): ApiResource - { + public function update($connectionTypeId, Request $request): ApiResource { $connectionTypeData = $request->all(); $connectionType = $this->connectionTypeService->getById($connectionTypeId); diff --git a/src/backend/app/Http/Controllers/Controller.php b/src/backend/app/Http/Controllers/Controller.php index ce1176ddb..59b8faae6 100644 --- a/src/backend/app/Http/Controllers/Controller.php +++ b/src/backend/app/Http/Controllers/Controller.php @@ -7,8 +7,7 @@ use Illuminate\Foundation\Validation\ValidatesRequests; use Illuminate\Routing\Controller as BaseController; -class Controller extends BaseController -{ +class Controller extends BaseController { use AuthorizesRequests; use DispatchesJobs; use ValidatesRequests; diff --git a/src/backend/app/Http/Controllers/CountryController.php b/src/backend/app/Http/Controllers/CountryController.php index ec99ba65c..7a7aa9796 100644 --- a/src/backend/app/Http/Controllers/CountryController.php +++ b/src/backend/app/Http/Controllers/CountryController.php @@ -7,10 +7,8 @@ use App\Models\Country; use Illuminate\Support\Facades\Config; -class CountryController extends Controller -{ - public function index(): ApiResource - { +class CountryController extends Controller { + public function index(): ApiResource { return new ApiResource( Country::query()->paginate( Config::get('services.pagination') @@ -18,13 +16,11 @@ public function index(): ApiResource ); } - public function show(Country $country): ApiResource - { + public function show(Country $country): ApiResource { return ApiResource::make($country); } - public function store(CountryRequest $request): ApiResource - { + public function store(CountryRequest $request): ApiResource { return ApiResource::make(Country::query()->create(request()->only(['country_name', 'country_code']))); } } diff --git a/src/backend/app/Http/Controllers/CountryListController.php b/src/backend/app/Http/Controllers/CountryListController.php index 62b5c1919..e13202b86 100644 --- a/src/backend/app/Http/Controllers/CountryListController.php +++ b/src/backend/app/Http/Controllers/CountryListController.php @@ -5,10 +5,8 @@ use App\Http\Resources\ApiResource; use Illuminate\Support\Facades\Storage; -class CountryListController extends Controller -{ - public function index(): ApiResource - { +class CountryListController extends Controller { + public function index(): ApiResource { $country = Storage::disk('local')->get('countries.json'); $country = json_decode($country, true); diff --git a/src/backend/app/Http/Controllers/CurrencyController.php b/src/backend/app/Http/Controllers/CurrencyController.php index aaed9f8a3..fc6b523f8 100644 --- a/src/backend/app/Http/Controllers/CurrencyController.php +++ b/src/backend/app/Http/Controllers/CurrencyController.php @@ -5,10 +5,8 @@ use App\Http\Resources\ApiResource; use Illuminate\Support\Facades\Storage; -class CurrencyController extends Controller -{ - public function index(): ApiResource - { +class CurrencyController extends Controller { + public function index(): ApiResource { $currency = Storage::disk('local')->get('currency.json'); $currency = json_decode($currency, true); diff --git a/src/backend/app/Http/Controllers/CustomerRegistrationAppController.php b/src/backend/app/Http/Controllers/CustomerRegistrationAppController.php index 29039e8ff..a7490beff 100644 --- a/src/backend/app/Http/Controllers/CustomerRegistrationAppController.php +++ b/src/backend/app/Http/Controllers/CustomerRegistrationAppController.php @@ -8,14 +8,10 @@ use Illuminate\Support\Facades\Log; use MPM\Apps\CustomerRegistration\CustomerRegistrationAppService; -class CustomerRegistrationAppController extends Controller -{ - public function __construct(private CustomerRegistrationAppService $customerRegistrationAppService) - { - } +class CustomerRegistrationAppController extends Controller { + public function __construct(private CustomerRegistrationAppService $customerRegistrationAppService) {} - public function store(AndroidAppRequest $request) - { + public function store(AndroidAppRequest $request) { try { DB::connection('shard')->beginTransaction(); $person = $this->customerRegistrationAppService->createCustomer($request); diff --git a/src/backend/app/Http/Controllers/DailyTransactions.php b/src/backend/app/Http/Controllers/DailyTransactions.php index dd8607ca5..2dfba1011 100644 --- a/src/backend/app/Http/Controllers/DailyTransactions.php +++ b/src/backend/app/Http/Controllers/DailyTransactions.php @@ -10,8 +10,7 @@ * * @group Export */ -class DailyTransactions extends Controller -{ +class DailyTransactions extends Controller { /** * The used transaction model. * @@ -19,13 +18,11 @@ class DailyTransactions extends Controller */ private $transaction; - public function __construct(Transaction $transaction) - { + public function __construct(Transaction $transaction) { $this->transaction = $transaction; } - public function getDailyReport(Request $request) - { + public function getDailyReport(Request $request) { $date = $request->get('date') ?? date('Y-m-d'); $transactions = $this->transaction::with('originalTransaction')->whereDate('created_at', $date)->get(); @@ -77,8 +74,7 @@ public function getDailyReport(Request $request) return $this->downloadCSV($transactionOutput, $date.'-transactions'); } - private function downloadCSV(array $transactionData, string $fileName) - { + private function downloadCSV(array $transactionData, string $fileName) { if (count($transactionData) === 0) { // to prevent to download an empty file return null; } diff --git a/src/backend/app/Http/Controllers/DeviceAddressController.php b/src/backend/app/Http/Controllers/DeviceAddressController.php index d608d1f36..c34c8211c 100644 --- a/src/backend/app/Http/Controllers/DeviceAddressController.php +++ b/src/backend/app/Http/Controllers/DeviceAddressController.php @@ -7,16 +7,13 @@ use MPM\Device\DeviceAddressService; use MPM\Device\DeviceService; -class DeviceAddressController extends Controller -{ +class DeviceAddressController extends Controller { public function __construct( private DeviceAddressService $deviceAddressService, private DeviceService $deviceService, - ) { - } + ) {} - public function update(Request $request) - { + public function update(Request $request) { $creatorId = auth('api')->user()->id; $devices = $request->all(); foreach ($devices as $deviceData) { diff --git a/src/backend/app/Http/Controllers/DeviceController.php b/src/backend/app/Http/Controllers/DeviceController.php index f51150283..e5882de3f 100644 --- a/src/backend/app/Http/Controllers/DeviceController.php +++ b/src/backend/app/Http/Controllers/DeviceController.php @@ -7,19 +7,14 @@ use App\Models\Device; use MPM\Device\DeviceService; -class DeviceController extends Controller -{ - public function __construct(private DeviceService $deviceService) - { - } +class DeviceController extends Controller { + public function __construct(private DeviceService $deviceService) {} - public function index() - { + public function index() { return ApiResource::make($this->deviceService->getAll()); } - public function update(Device $device, UpdateDeviceRequest $request): ApiResource - { + public function update(Device $device, UpdateDeviceRequest $request): ApiResource { $creatorId = auth('api')->user()->id; $previousOwner = $device->person_id; $newOwner = $request->input('person_id'); diff --git a/src/backend/app/Http/Controllers/EBikeController.php b/src/backend/app/Http/Controllers/EBikeController.php index 893e7c334..9cedced8b 100644 --- a/src/backend/app/Http/Controllers/EBikeController.php +++ b/src/backend/app/Http/Controllers/EBikeController.php @@ -11,26 +11,22 @@ use MPM\EBike\EBikeDeviceService; use MPM\EBike\EBikeService; -class EBikeController extends Controller -{ +class EBikeController extends Controller { public function __construct( private DeviceService $deviceService, private EBikeService $eBikeService, private EBikeDeviceService $eBikeDeviceService, private ManufacturerService $manufacturerService, private AppliancePersonService $appliancePersonService, - ) { - } + ) {} - public function index(Request $request): ApiResource - { + public function index(Request $request): ApiResource { $limit = $request->input('per_page'); return ApiResource::make($this->eBikeService->getAll($limit)); } - public function store(StoreEBikeRequest $request) - { + public function store(StoreEBikeRequest $request) { $eBikeData = $request->all(); $deviceData = [ 'device_serial' => $eBikeData['serial_number'], @@ -47,21 +43,18 @@ public function store(StoreEBikeRequest $request) return ApiResource::make($eBike->load(['manufacturer', 'appliance', 'device.person'])); } - public function search(Request $request): ApiResource - { + public function search(Request $request): ApiResource { $term = $request->input('term'); $paginate = $request->input('paginate') ?? 1; return ApiResource::make($this->eBikeService->search($term, $paginate)); } - public function show(string $serialNumber): ApiResource - { + public function show(string $serialNumber): ApiResource { return ApiResource::make($this->eBikeService->getBySerialNumber($serialNumber)); } - public function switch(Request $request): ApiResource - { + public function switch(Request $request): ApiResource { $serialNumber = $request->input('serial_number'); $manufacturerName = $request->input('manufacturer_name'); $status = $request->input('status'); diff --git a/src/backend/app/Http/Controllers/HomeController.php b/src/backend/app/Http/Controllers/HomeController.php index 9a0fbe2ab..e74aaefba 100644 --- a/src/backend/app/Http/Controllers/HomeController.php +++ b/src/backend/app/Http/Controllers/HomeController.php @@ -2,24 +2,20 @@ namespace App\Http\Controllers; -class HomeController extends Controller -{ +class HomeController extends Controller { /** * Create a new controller instance. * * @return void */ - public function __construct() - { - } + public function __construct() {} /** * Show the application dashboard. * * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ - public function index() - { + public function index() { return view('layouts.app'); } } diff --git a/src/backend/app/Http/Controllers/MailSettingsController.php b/src/backend/app/Http/Controllers/MailSettingsController.php index e9f97bcd4..65e0fc14b 100644 --- a/src/backend/app/Http/Controllers/MailSettingsController.php +++ b/src/backend/app/Http/Controllers/MailSettingsController.php @@ -7,8 +7,7 @@ use App\Models\MailSettings; use App\Services\MailSettingsService; -class MailSettingsController extends Controller -{ +class MailSettingsController extends Controller { /** * @MailSettings */ @@ -24,18 +23,15 @@ public function __construct( $this->mailSettingsService = $mailSettingsService; } - public function index(): ApiResource - { + public function index(): ApiResource { return new ApiResource($this->mailSettingsService->list()); } - public function update(MailSettingsRequest $request, MailSettings $mailSettings): ApiResource - { + public function update(MailSettingsRequest $request, MailSettings $mailSettings): ApiResource { return new ApiResource($this->mailSettingsService->update($request, $mailSettings)); } - public function store(MailSettingsRequest $request): ApiResource - { + public function store(MailSettingsRequest $request): ApiResource { return new ApiResource($this->mailSettingsService->create($request)); } } diff --git a/src/backend/app/Http/Controllers/MainSettingsController.php b/src/backend/app/Http/Controllers/MainSettingsController.php index 7147e3728..0213172ad 100644 --- a/src/backend/app/Http/Controllers/MainSettingsController.php +++ b/src/backend/app/Http/Controllers/MainSettingsController.php @@ -7,19 +7,14 @@ use App\Services\MainSettingsService; use Illuminate\Http\Request; -class MainSettingsController extends Controller -{ - public function __construct(private MainSettingsService $mainSettingsService) - { - } +class MainSettingsController extends Controller { + public function __construct(private MainSettingsService $mainSettingsService) {} - public function index(): ApiResource - { + public function index(): ApiResource { return ApiResource::make($this->mainSettingsService->getAll()->first()); } - public function update(MainSettings $mainSettings, Request $request): ApiResource - { + public function update(MainSettings $mainSettings, Request $request): ApiResource { $mainSettingsData = $request->only([ 'site_title', 'company_name', diff --git a/src/backend/app/Http/Controllers/MaintenanceUserController.php b/src/backend/app/Http/Controllers/MaintenanceUserController.php index 84ef0def0..c5f5d002d 100644 --- a/src/backend/app/Http/Controllers/MaintenanceUserController.php +++ b/src/backend/app/Http/Controllers/MaintenanceUserController.php @@ -11,8 +11,7 @@ use Illuminate\Http\JsonResponse; use Inensus\BulkRegistration\Services\AddressService; -class MaintenanceUserController extends Controller -{ +class MaintenanceUserController extends Controller { private $roles; public function __construct( @@ -20,18 +19,15 @@ public function __construct( private Person $person, private PersonService $personService, private AddressService $addressService, - ) { - } + ) {} - public function index(): ApiResource - { + public function index(): ApiResource { $maintenance_user_list = $this->maintenanceUsers::with('person')->get(); return new ApiResource($maintenance_user_list); } - public function store(MaintenanceRequest $request): JsonResponse - { + public function store(MaintenanceRequest $request): JsonResponse { $phone = $request->get('phone'); try { diff --git a/src/backend/app/Http/Controllers/ManufacturerController.php b/src/backend/app/Http/Controllers/ManufacturerController.php index 5f909de41..4a0be1e4c 100644 --- a/src/backend/app/Http/Controllers/ManufacturerController.php +++ b/src/backend/app/Http/Controllers/ManufacturerController.php @@ -10,20 +10,17 @@ use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; -class ManufacturerController extends Controller -{ +class ManufacturerController extends Controller { public function __construct( private ManufacturerService $manufacturerService, private ManufacturerAddressService $manufacturerAddressService, private AddressesService $addressService, - ) { - } + ) {} /** * Display a listing of the resource. */ - public function index(Request $request): ApiResource - { + public function index(Request $request): ApiResource { $limit = $request->input('per_page'); return ApiResource::make($this->manufacturerService->getAll($limit)); @@ -32,8 +29,7 @@ public function index(Request $request): ApiResource /** * Store a newly created resource in storage. */ - public function store(ManufacturerRequest $request): JsonResponse - { + public function store(ManufacturerRequest $request): JsonResponse { $manufacturerData = $this->manufacturerService->createManufacturerDataFromRequest($request); $addressData = $this->addressService->createAddressDataFromRequest($request); $manufacturer = $this->manufacturerService->create($manufacturerData); @@ -51,8 +47,7 @@ public function store(ManufacturerRequest $request): JsonResponse * * @param int $manufacturerId */ - public function show($manufacturerId): ApiResource - { + public function show($manufacturerId): ApiResource { return ApiResource::make($this->manufacturerService->getById($manufacturerId)); } } diff --git a/src/backend/app/Http/Controllers/MapSettingsController.php b/src/backend/app/Http/Controllers/MapSettingsController.php index 64c51411a..412fbad5f 100644 --- a/src/backend/app/Http/Controllers/MapSettingsController.php +++ b/src/backend/app/Http/Controllers/MapSettingsController.php @@ -7,22 +7,18 @@ use App\Models\MapSettings; use App\Services\BingMapApiService; -class MapSettingsController extends Controller -{ +class MapSettingsController extends Controller { private $bingMapApiService; - public function __construct(BingMapApiService $bingMapApiService) - { + public function __construct(BingMapApiService $bingMapApiService) { $this->bingMapApiService = $bingMapApiService; } - public function index(): ApiResource - { + public function index(): ApiResource { return new ApiResource(MapSettings::all()); } - public function update($id): ApiResource - { + public function update($id): ApiResource { $mapSettings = MapSettings::query() ->updateOrCreate( ['id' => $id], @@ -38,8 +34,7 @@ public function update($id): ApiResource return new ApiResource([$mapSettings->fresh()]); } - public function checkBingApiKey($key): ApiResource - { + public function checkBingApiKey($key): ApiResource { try { $apiAuthentication = $this->bingMapApiService->checkAuthenticationKey($key); } catch (InvalidBingApiKeyException $exception) { diff --git a/src/backend/app/Http/Controllers/MeterConsumptionController.php b/src/backend/app/Http/Controllers/MeterConsumptionController.php index feea6e282..12635e259 100644 --- a/src/backend/app/Http/Controllers/MeterConsumptionController.php +++ b/src/backend/app/Http/Controllers/MeterConsumptionController.php @@ -6,13 +6,11 @@ use App\Services\MeterConsumptionService; use App\Services\MeterService; -class MeterConsumptionController extends Controller -{ +class MeterConsumptionController extends Controller { public function __construct( private MeterService $meterService, private MeterConsumptionService $meterConsumptionService, - ) { - } + ) {} /** * Consumption List @@ -25,8 +23,7 @@ public function __construct( * * @responseFile responses/meters/meter.consumption.list.json */ - public function show($serialNumber, $start, $end): ApiResource - { + public function show($serialNumber, $start, $end): ApiResource { $meter = $this->meterService->getBySerialNumber($serialNumber); return ApiResource::make($this->meterConsumptionService->getByMeter($meter, $start, $end)); diff --git a/src/backend/app/Http/Controllers/MeterController.php b/src/backend/app/Http/Controllers/MeterController.php index a8668ddbc..6c7276623 100644 --- a/src/backend/app/Http/Controllers/MeterController.php +++ b/src/backend/app/Http/Controllers/MeterController.php @@ -11,12 +11,10 @@ use Illuminate\Http\Request; use Illuminate\Validation\ValidationException; -class MeterController extends Controller -{ +class MeterController extends Controller { public function __construct( private MeterService $meterService, - ) { - } + ) {} /** * List @@ -28,8 +26,7 @@ public function __construct( * * @responseFile responses/meters/meters.list.json */ - public function index(Request $request): ApiResource - { + public function index(Request $request): ApiResource { $inUse = $request->input('in_use'); $limit = $request->input('limit', config('settings.paginate')); @@ -48,8 +45,7 @@ public function index(Request $request): ApiResource * * @throws ValidationException */ - public function store(MeterRequest $request) - { + public function store(MeterRequest $request) { $meterData = (array) $request->all(); return ApiResource::make($this->meterService->create($meterData)); @@ -69,8 +65,7 @@ public function store(MeterRequest $request) * * @responseFile responses/meters/meter.detail.json */ - public function show(string $serialNumber): ApiResource - { + public function show(string $serialNumber): ApiResource { return ApiResource::make($this->meterService->getBySerialNumber($serialNumber)); } @@ -84,8 +79,7 @@ public function show(string $serialNumber): ApiResource * * @responseFile responses/meters/meters.search.json */ - public function search(): ApiResource - { + public function search(): ApiResource { $term = request('term'); $paginate = request('paginate') ?? 1; @@ -98,15 +92,13 @@ public function search(): ApiResource * * @urlParam meterId. The ID of the meter to be delete */ - public function destroy($meterId): JsonResponse - { + public function destroy($meterId): JsonResponse { $this->meterService->getById($meterId); return response()->json(null, 204); } - public function update(UpdateMeterRequest $request, Meter $meter): ApiResource - { + public function update(UpdateMeterRequest $request, Meter $meter): ApiResource { $creatorId = auth('api')->user()->id; $previousDataOfMeter = json_encode($meter->toArray()); $updatedMeter = $this->meterService->update($meter, $request->validated()); diff --git a/src/backend/app/Http/Controllers/MeterGeographicalInformationController.php b/src/backend/app/Http/Controllers/MeterGeographicalInformationController.php index ede227cb4..d643f5988 100644 --- a/src/backend/app/Http/Controllers/MeterGeographicalInformationController.php +++ b/src/backend/app/Http/Controllers/MeterGeographicalInformationController.php @@ -10,15 +10,13 @@ use App\Services\PersonMeterService; use Illuminate\Http\Request; -class MeterGeographicalInformationController extends Controller -{ +class MeterGeographicalInformationController extends Controller { public function __construct( private MeterGeographicalInformationService $meterGeographicalInformationService, private PersonMeterService $personMeterService, private CityService $cityService, private MeterService $meterService, - ) { - } + ) {} /** * List with geo and access rate @@ -29,8 +27,7 @@ public function __construct( * * @responseFile responses/meters/meters.geo.list.json */ - public function index($miniGridId): ApiResource - { + public function index($miniGridId): ApiResource { $cityIds = $this->cityService->getCityIdsByMiniGridId($miniGridId); // we can get city id only by address if ($miniGridId === null) { @@ -57,8 +54,7 @@ public function index($miniGridId): ApiResource * * @responseFile responses/people/person.meter.list.json */ - public function show(int $personId): ApiResource - { + public function show(int $personId): ApiResource { return ApiResource::make($this->personMeterService->getPersonMetersGeographicalInformation($personId)); } @@ -72,8 +68,7 @@ public function show(int $personId): ApiResource * * @param Meter $meter */ - public function update(Request $request): ApiResource - { + public function update(Request $request): ApiResource { $meters = $request->all(); return ApiResource::make($this->meterGeographicalInformationService->updateGeographicalInformation($meters)); diff --git a/src/backend/app/Http/Controllers/MeterPaymentHistoryController.php b/src/backend/app/Http/Controllers/MeterPaymentHistoryController.php index 59a7c453c..0b3cebd19 100644 --- a/src/backend/app/Http/Controllers/MeterPaymentHistoryController.php +++ b/src/backend/app/Http/Controllers/MeterPaymentHistoryController.php @@ -5,15 +5,12 @@ use App\Http\Resources\ApiResource; use App\Services\PaymentHistoryService; -class MeterPaymentHistoryController -{ +class MeterPaymentHistoryController { public function __construct( private PaymentHistoryService $paymentHistoryService, - ) { - } + ) {} - public function show(string $serialNumber) - { + public function show(string $serialNumber) { $paginate = request('paginate') ?? 50; return ApiResource::make($this->paymentHistoryService->getBySerialNumber($serialNumber, $paginate)); diff --git a/src/backend/app/Http/Controllers/MeterRevenueController.php b/src/backend/app/Http/Controllers/MeterRevenueController.php index d9029a988..19ad98e9f 100644 --- a/src/backend/app/Http/Controllers/MeterRevenueController.php +++ b/src/backend/app/Http/Controllers/MeterRevenueController.php @@ -5,12 +5,10 @@ use App\Http\Resources\ApiResource; use App\Services\MeterRevenueService; -class MeterRevenueController extends Controller -{ +class MeterRevenueController extends Controller { public function __construct( private MeterRevenueService $meterRevenueService, - ) { - } + ) {} /** * Revenue @@ -22,8 +20,7 @@ public function __construct( * * @responseFile responses/meters/meter.revenue.json */ - public function show(string $serialNumber): ApiResource - { + public function show(string $serialNumber): ApiResource { $revenue = $this->meterRevenueService->getBySerialNumber($serialNumber); return ApiResource::make(['revenue' => $revenue]); diff --git a/src/backend/app/Http/Controllers/MeterTariffController.php b/src/backend/app/Http/Controllers/MeterTariffController.php index 6c5c21c8e..cc1fc7a44 100644 --- a/src/backend/app/Http/Controllers/MeterTariffController.php +++ b/src/backend/app/Http/Controllers/MeterTariffController.php @@ -9,12 +9,10 @@ use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; -class MeterTariffController extends Controller -{ +class MeterTariffController extends Controller { public function __construct( private MeterTariffService $meterTariffService, - ) { - } + ) {} /** * List @@ -23,8 +21,7 @@ public function __construct( * * @responseFile responses/tariffs/tariffs.list.json */ - public function index(Request $request): ApiResource - { + public function index(Request $request): ApiResource { $limit = $request->get('limit'); return ApiResource::make($this->meterTariffService->getAll($limit)); @@ -39,8 +36,7 @@ public function index(Request $request): ApiResource * * @param MeterTariff $tariff */ - public function show(Request $request, $meterTariffId): ApiResource - { + public function show(Request $request, $meterTariffId): ApiResource { return ApiResource::make($this->meterTariffService->getById($meterTariffId)); } @@ -54,8 +50,7 @@ public function show(Request $request, $meterTariffId): ApiResource * * @return ApiResource */ - public function store(TariffCreateRequest $request): JsonResponse - { + public function store(TariffCreateRequest $request): JsonResponse { $meterTariffData = $request->only(['name', 'factor', 'currency', 'price', 'minimum_purchase_amount']); $newTariff = $this->meterTariffService->create($meterTariffData); @@ -65,8 +60,7 @@ public function store(TariffCreateRequest $request): JsonResponse return ApiResource::make($this->meterTariffService->getById($newTariff->id))->response()->setStatusCode(201); } - public function update($meterTariffId, TariffCreateRequest $request): ApiResource - { + public function update($meterTariffId, TariffCreateRequest $request): ApiResource { $meterTariff = $this->meterTariffService->getById($meterTariffId); $meterTariffData = [ 'name' => $request->input('name'), @@ -84,8 +78,7 @@ public function update($meterTariffId, TariffCreateRequest $request): ApiResourc return ApiResource::make($meterTariff); } - public function destroy($meterTariffId): ?bool - { + public function destroy($meterTariffId): ?bool { $meterTariff = $this->meterTariffService->getById($meterTariffId); return $this->meterTariffService->delete($meterTariff); diff --git a/src/backend/app/Http/Controllers/MeterTariffMeterParameterController.php b/src/backend/app/Http/Controllers/MeterTariffMeterParameterController.php index 35fd15a9e..7117d7dd6 100644 --- a/src/backend/app/Http/Controllers/MeterTariffMeterParameterController.php +++ b/src/backend/app/Http/Controllers/MeterTariffMeterParameterController.php @@ -5,30 +5,25 @@ use App\Http\Resources\ApiResource; use App\Services\MeterTariffMeterParameterService; -class MeterTariffMeterParameterController extends Controller -{ +class MeterTariffMeterParameterController extends Controller { public function __construct( private MeterTariffMeterParameterService $meterTariffMeterParameterService, - ) { - } + ) {} /** * Display a list of meters which using a particular tariff. */ - public function show($meterTariffId): ApiResource - { + public function show($meterTariffId): ApiResource { return ApiResource::make($this->meterTariffMeterParameterService->getCountById($meterTariffId)); } - public function update($meterTariffId, int $changeId): ApiResource - { + public function update($meterTariffId, int $changeId): ApiResource { $result = $this->meterTariffMeterParameterService->changeMetersTariff($meterTariffId, $changeId); return ApiResource::make($result); } - public function updateForMeter($meterSerial, $tariffId): ApiResource - { + public function updateForMeter($meterSerial, $tariffId): ApiResource { $result = $this->meterTariffMeterParameterService->changeMeterTariff($meterSerial, $tariffId); return ApiResource::make($result); diff --git a/src/backend/app/Http/Controllers/MeterTypeController.php b/src/backend/app/Http/Controllers/MeterTypeController.php index 703c7b72f..e7e3fdff5 100644 --- a/src/backend/app/Http/Controllers/MeterTypeController.php +++ b/src/backend/app/Http/Controllers/MeterTypeController.php @@ -13,21 +13,17 @@ * @group MeterTypes * Class MeterTypeController */ -class MeterTypeController extends Controller -{ +class MeterTypeController extends Controller { use SoftDeletes; - public function __construct(private MeterTypeService $meterTypeService) - { - } + public function __construct(private MeterTypeService $meterTypeService) {} /** * List. * * @responseFile responses/metertypes/meter.types.list.json */ - public function index(Request $request): ApiResource - { + public function index(Request $request): ApiResource { $limit = $request->get('limit'); return ApiResource::make($this->meterTypeService->getAll($limit)); @@ -43,8 +39,7 @@ public function index(Request $request): ApiResource * * @return ApiResource */ - public function store(MeterTypeCreateRequest $request) - { + public function store(MeterTypeCreateRequest $request) { $meterTypeData = $request->only(['online', 'phase', 'max_current']); return ApiResource::make($this->meterTypeService->create($meterTypeData)); @@ -57,8 +52,7 @@ public function store(MeterTypeCreateRequest $request) * * @param int $meterTypeId */ - public function show($meterTypeId): ApiResource - { + public function show($meterTypeId): ApiResource { return ApiResource::make($this->meterTypeService->getById($meterTypeId)); } @@ -74,8 +68,7 @@ public function show($meterTypeId): ApiResource * * @param int $meterTypeId */ - public function update(MeterTypeUpdateRequest $request, $meterTypeId): ApiResource - { + public function update(MeterTypeUpdateRequest $request, $meterTypeId): ApiResource { $meterType = $this->meterTypeService->getById($meterTypeId); $meterTypeData = $request->only(['online', 'phase', 'max_current']); diff --git a/src/backend/app/Http/Controllers/MeterTypeMeterController.php b/src/backend/app/Http/Controllers/MeterTypeMeterController.php index 62a4130df..fb6f4faec 100644 --- a/src/backend/app/Http/Controllers/MeterTypeMeterController.php +++ b/src/backend/app/Http/Controllers/MeterTypeMeterController.php @@ -6,11 +6,8 @@ use App\Services\MeterTypeMeterService; use Illuminate\Http\Request; -class MeterTypeMeterController extends Controller -{ - public function __construct(private MeterTypeMeterService $meterTypeMeterService) - { - } +class MeterTypeMeterController extends Controller { + public function __construct(private MeterTypeMeterService $meterTypeMeterService) {} /** * List with Meters @@ -22,8 +19,7 @@ public function __construct(private MeterTypeMeterService $meterTypeMeterService * * @return ApiResource */ - public function show(Request $request, $meterTypeId) - { + public function show(Request $request, $meterTypeId) { return ApiResource::make($this->meterTypeMeterService->getByIdWithMeters($meterTypeId)); } } diff --git a/src/backend/app/Http/Controllers/MiniGridController.php b/src/backend/app/Http/Controllers/MiniGridController.php index 1c117f8b2..554bb3fcd 100644 --- a/src/backend/app/Http/Controllers/MiniGridController.php +++ b/src/backend/app/Http/Controllers/MiniGridController.php @@ -11,20 +11,17 @@ use App\Services\MiniGridService; use Illuminate\Http\Request; -class MiniGridController extends Controller -{ +class MiniGridController extends Controller { public function __construct( private MiniGridService $miniGridService, private GeographicalInformationService $geographicalInformationService, private MiniGridGeographicalInformationService $miniGridGeographicalInformationService, - ) { - } + ) {} /** * List. */ - public function index(Request $request): ApiResource - { + public function index(Request $request): ApiResource { $limit = $request->input('per_page'); return ApiResource::make($this->miniGridService->getAll($limit)); @@ -37,8 +34,7 @@ public function index(Request $request): ApiResource * * @param int $id */ - public function show($miniGridId, Request $request): ApiResource - { + public function show($miniGridId, Request $request): ApiResource { $relation = $request->get('relation'); if ((int) $relation === 1) { @@ -48,8 +44,7 @@ public function show($miniGridId, Request $request): ApiResource } } - public function store(StoreMiniGridRequest $request): ApiResource - { + public function store(StoreMiniGridRequest $request): ApiResource { $data = $request->validationData(); $miniGrid = $this->miniGridService->create($request->only(['name', 'cluster_id'])); $geographicalInformation = $this->geographicalInformationService->make(['points' => $data['geo_data']]); @@ -68,8 +63,7 @@ public function store(StoreMiniGridRequest $request): ApiResource * * @param MiniGrid $miniGrid */ - public function update($miniGridId, UpdateMiniGridRequest $request): ApiResource - { + public function update($miniGridId, UpdateMiniGridRequest $request): ApiResource { $miniGrid = $this->miniGridService->getById($miniGridId); return ApiResource::make($this->miniGridService->getById($miniGridId)); diff --git a/src/backend/app/Http/Controllers/MiniGridDashboardCacheController.php b/src/backend/app/Http/Controllers/MiniGridDashboardCacheController.php index b3747c48b..1ca08e61c 100644 --- a/src/backend/app/Http/Controllers/MiniGridDashboardCacheController.php +++ b/src/backend/app/Http/Controllers/MiniGridDashboardCacheController.php @@ -6,24 +6,18 @@ use App\Services\MiniGridDashboardCacheDataService; use Illuminate\Http\Request; -class MiniGridDashboardCacheController extends Controller -{ - public function __construct(private MiniGridDashboardCacheDataService $miniGridDashboardCacheDataService) - { - } +class MiniGridDashboardCacheController extends Controller { + public function __construct(private MiniGridDashboardCacheDataService $miniGridDashboardCacheDataService) {} - public function index(): ApiResource - { + public function index(): ApiResource { return ApiResource::make($this->miniGridDashboardCacheDataService->getData()); } - public function show($miniGridId): ApiResource - { + public function show($miniGridId): ApiResource { return ApiResource::make($this->miniGridDashboardCacheDataService->getDataById($miniGridId)); } - public function update(Request $request): array - { + public function update(Request $request): array { $fromDate = $request->query('from'); $toDate = $request->query('to'); diff --git a/src/backend/app/Http/Controllers/MiniGridDeviceController.php b/src/backend/app/Http/Controllers/MiniGridDeviceController.php index 0b5f2d485..1d13334fe 100644 --- a/src/backend/app/Http/Controllers/MiniGridDeviceController.php +++ b/src/backend/app/Http/Controllers/MiniGridDeviceController.php @@ -6,15 +6,12 @@ use Illuminate\Http\Request; use MPM\Device\MiniGridDeviceService; -class MiniGridDeviceController extends Controller -{ +class MiniGridDeviceController extends Controller { public function __construct( private MiniGridDeviceService $miniGridDeviceService, - ) { - } + ) {} - public function index(Request $request, $miniGridId): ApiResource - { + public function index(Request $request, $miniGridId): ApiResource { return ApiResource::make($this->miniGridDeviceService->getDevicesByMiniGridId($miniGridId)); } } diff --git a/src/backend/app/Http/Controllers/MiniGridRevenueController.php b/src/backend/app/Http/Controllers/MiniGridRevenueController.php index ae683213f..6f6f8df50 100644 --- a/src/backend/app/Http/Controllers/MiniGridRevenueController.php +++ b/src/backend/app/Http/Controllers/MiniGridRevenueController.php @@ -7,16 +7,13 @@ use App\Services\MiniGridRevenueService; use Illuminate\Http\Request; -class MiniGridRevenueController -{ +class MiniGridRevenueController { public function __construct( private MeterService $meterService, private MiniGridRevenueService $miniGridRevenueService, - ) { - } + ) {} - public function show($miniGridId, Request $request): ApiResource - { + public function show($miniGridId, Request $request): ApiResource { $startDate = $request->get('startDate'); $endDate = $request->get('endDate'); diff --git a/src/backend/app/Http/Controllers/MpmPluginController.php b/src/backend/app/Http/Controllers/MpmPluginController.php index 7581190d5..3a2d58258 100644 --- a/src/backend/app/Http/Controllers/MpmPluginController.php +++ b/src/backend/app/Http/Controllers/MpmPluginController.php @@ -6,14 +6,10 @@ use App\Services\MpmPluginService; use Illuminate\Http\Request; -class MpmPluginController extends Controller -{ - public function __construct(private MpmPluginService $mpmPluginService) - { - } +class MpmPluginController extends Controller { + public function __construct(private MpmPluginService $mpmPluginService) {} - public function index(Request $request): ApiResource - { + public function index(Request $request): ApiResource { $limit = $request->get('limit'); return ApiResource::make($this->mpmPluginService->getAll($limit)); diff --git a/src/backend/app/Http/Controllers/OutstandingDebtsExportController.php b/src/backend/app/Http/Controllers/OutstandingDebtsExportController.php index 8191980f0..d2c92048c 100644 --- a/src/backend/app/Http/Controllers/OutstandingDebtsExportController.php +++ b/src/backend/app/Http/Controllers/OutstandingDebtsExportController.php @@ -8,15 +8,12 @@ use MPM\OutstandingDebts\OutstandingDebtsExportService; use Symfony\Component\HttpFoundation\BinaryFileResponse; -class OutstandingDebtsExportController -{ +class OutstandingDebtsExportController { public function __construct( private OutstandingDebtsExportService $outstandingDebtsExportService, - ) { - } + ) {} - public function download(): BinaryFileResponse - { + public function download(): BinaryFileResponse { $path = $this->outstandingDebtsExportService->createReport(CarbonImmutable::now()); return response()->download($path); diff --git a/src/backend/app/Http/Controllers/PaymentHistoryController.php b/src/backend/app/Http/Controllers/PaymentHistoryController.php index b0996318b..6a6cd1910 100644 --- a/src/backend/app/Http/Controllers/PaymentHistoryController.php +++ b/src/backend/app/Http/Controllers/PaymentHistoryController.php @@ -14,8 +14,7 @@ * @group Payment-History * Class PaymentHistoryController */ -class PaymentHistoryController -{ +class PaymentHistoryController { /** * @var PaymentHistory */ @@ -24,8 +23,7 @@ class PaymentHistoryController /** * PaymentHistoryController constructor. */ - public function __construct(PaymentHistory $history) - { + public function __construct(PaymentHistory $history) { $this->history = $history; } @@ -42,8 +40,7 @@ public function __construct(PaymentHistory $history) * * @return array */ - public function show(int $payerId, string $period, $limit = null, $order = 'ASC') - { + public function show(int $payerId, string $period, $limit = null, $order = 'ASC') { $period = strtoupper($period); switch ($period) { case 'D': @@ -81,8 +78,7 @@ public function show(int $payerId, string $period, $limit = null, $order = 'ASC' * * @throws \Exception */ - public function getPaymentPeriod(Person $person) - { + public function getPaymentPeriod(Person $person) { $payments = $person->payments()->latest()->take(10)->get(); $difference = 'no data available'; @@ -105,8 +101,7 @@ public function getPaymentPeriod(Person $person) * * **/ - public function byYear(int $personId, ?int $year = null): array - { + public function byYear(int $personId, ?int $year = null): array { $year = $year ?? (int) date('Y'); $payments = $this->history->getPaymentFlow('person', $personId, $year); $paymentFlow = array_fill(0, 11, 0); @@ -127,8 +122,7 @@ public function byYear(int $personId, ?int $year = null): array * * @return ApiResource */ - public function debts($personId) - { + public function debts($personId) { $accessRateDebt = 0; $meters = Device::query()->with('device') ->whereHasMorph( @@ -156,8 +150,7 @@ public function debts($personId) * * @throws \Exception */ - public function getPaymentRange(): ApiResource - { + public function getPaymentRange(): ApiResource { $begin = request('begin'); // Y-m-d $end = request('end'); // Y-m- d // create a sequence of dates @@ -183,8 +176,7 @@ public function getPaymentRange(): ApiResource * * @psalm-return array */ - public function preparePaymentFlow($payments): array - { + public function preparePaymentFlow($payments): array { $flowList = []; foreach ($payments as $payment) { $flowList[$payment['aperiod']][$payment['payment_type']] = $payment['amount']; diff --git a/src/backend/app/Http/Controllers/PersonAddressesController.php b/src/backend/app/Http/Controllers/PersonAddressesController.php index 0735a8215..b8421f601 100644 --- a/src/backend/app/Http/Controllers/PersonAddressesController.php +++ b/src/backend/app/Http/Controllers/PersonAddressesController.php @@ -9,14 +9,12 @@ use App\Services\PersonAddressService; use App\Services\PersonService; -class PersonAddressesController extends Controller -{ +class PersonAddressesController extends Controller { public function __construct( private AddressesService $addressService, private PersonService $personService, private PersonAddressService $personAddressService, - ) { - } + ) {} /** * Addresses @@ -28,15 +26,13 @@ public function __construct( * * @apiResourceModel \App\Models\Person\Person */ - public function show(int $personId): ApiResource - { + public function show(int $personId): ApiResource { $person = $this->personService->getById($personId); return ApiResource::make($this->personAddressService->getPersonAddresses($person)); } - public function store(int $personId, CreateAddressRequest $request): ApiResource - { + public function store(int $personId, CreateAddressRequest $request): ApiResource { $person = $this->personService->getById($personId); $addressData = $this->addressService->createAddressDataFromRequest($request); $address = $this->addressService->make($addressData); @@ -53,8 +49,7 @@ public function store(int $personId, CreateAddressRequest $request): ApiResource return new ApiResource($this->addressService->getStoredAddressWithCityRelation($address->id)); } - public function update(int $personId, CreateAddressRequest $request): ApiResource - { + public function update(int $personId, CreateAddressRequest $request): ApiResource { $person = $this->personService->getById($personId); $address = $this->addressService->getById($request->input('id') ?? -1); $addressData = $this->addressService->createAddressDataFromRequest($request); diff --git a/src/backend/app/Http/Controllers/PersonController.php b/src/backend/app/Http/Controllers/PersonController.php index 9336d6da8..07c8ce79b 100644 --- a/src/backend/app/Http/Controllers/PersonController.php +++ b/src/backend/app/Http/Controllers/PersonController.php @@ -19,16 +19,14 @@ * * @group People */ -class PersonController extends Controller -{ +class PersonController extends Controller { public function __construct( private AddressesService $addressService, private PersonService $personService, private PersonAddressService $personAddressService, private MaintenanceUserService $maintenanceUserService, private CountryService $countryService, - ) { - } + ) {} /** * List customer/other @@ -38,8 +36,7 @@ public function __construct( * * @responseFile responses/people/people.list.json */ - public function index(Request $request): ApiResource - { + public function index(Request $request): ApiResource { $customerType = $request->input('is_customer', 1); $limit = $request->input('limit', config('settings.paginate')); @@ -58,16 +55,14 @@ public function index(Request $request): ApiResource * * @responseFile responses/people/people.detail.json */ - public function show(int $personId): ApiResource - { + public function show(int $personId): ApiResource { return ApiResource::make($this->personService->getDetails($personId, true)); } /** * Create. */ - public function store(PersonRequest $request): JsonResponse - { + public function store(PersonRequest $request): JsonResponse { try { $customerType = $request->input('customer_type'); $addressData = $this->addressService->createAddressDataFromRequest($request); diff --git a/src/backend/app/Http/Controllers/PersonDocumentController.php b/src/backend/app/Http/Controllers/PersonDocumentController.php index 3b029547a..7a8c8d23d 100644 --- a/src/backend/app/Http/Controllers/PersonDocumentController.php +++ b/src/backend/app/Http/Controllers/PersonDocumentController.php @@ -2,6 +2,4 @@ namespace App\Http\Controllers; -class PersonDocumentController extends Controller -{ -} +class PersonDocumentController extends Controller {} diff --git a/src/backend/app/Http/Controllers/PersonMeterController.php b/src/backend/app/Http/Controllers/PersonMeterController.php index 30c2e6e24..ff2748258 100644 --- a/src/backend/app/Http/Controllers/PersonMeterController.php +++ b/src/backend/app/Http/Controllers/PersonMeterController.php @@ -5,12 +5,10 @@ use App\Http\Resources\ApiResource; use App\Services\PersonMeterService; -class PersonMeterController -{ +class PersonMeterController { public function __construct( private PersonMeterService $personMeterService, - ) { - } + ) {} /** * @group People @@ -21,8 +19,7 @@ public function __construct( * * @responseFile responses/people/person.meter.tariff.json */ - public function show(int $personId): ApiResource - { + public function show(int $personId): ApiResource { return ApiResource::make($this->personMeterService->getPersonMeters($personId)); } } diff --git a/src/backend/app/Http/Controllers/PluginController.php b/src/backend/app/Http/Controllers/PluginController.php index d3ca01642..1c602b284 100644 --- a/src/backend/app/Http/Controllers/PluginController.php +++ b/src/backend/app/Http/Controllers/PluginController.php @@ -10,23 +10,19 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Artisan; -class PluginController extends Controller -{ +class PluginController extends Controller { public function __construct( private PluginsService $pluginsService, private MpmPluginService $mpmPluginService, private CompanyDatabaseService $companyDatabaseService, private RegistrationTailService $registrationTailService, - ) { - } + ) {} - public function index(Request $request): ApiResource - { + public function index(Request $request): ApiResource { return ApiResource::make($this->pluginsService->getAll()); } - public function update(Request $request, $mpmPluginId): ApiResource - { + public function update(Request $request, $mpmPluginId): ApiResource { $plugin = $this->pluginsService->getByMpmPluginId($mpmPluginId); $mpmPlugin = $this->mpmPluginService->getById($mpmPluginId); $registrationTail = $this->registrationTailService->getFirst(); diff --git a/src/backend/app/Http/Controllers/ProtectedPageController.php b/src/backend/app/Http/Controllers/ProtectedPageController.php index 750610d51..20ec8f6a3 100644 --- a/src/backend/app/Http/Controllers/ProtectedPageController.php +++ b/src/backend/app/Http/Controllers/ProtectedPageController.php @@ -5,10 +5,8 @@ use App\Http\Resources\ApiResource; use App\Models\ProtectedPage; -class ProtectedPageController -{ - public function index(): ApiResource - { +class ProtectedPageController { + public function index(): ApiResource { return ApiResource::make(ProtectedPage::query()->get()); } } diff --git a/src/backend/app/Http/Controllers/RegistrationTailController.php b/src/backend/app/Http/Controllers/RegistrationTailController.php index aa753aa42..3c66bc56f 100644 --- a/src/backend/app/Http/Controllers/RegistrationTailController.php +++ b/src/backend/app/Http/Controllers/RegistrationTailController.php @@ -7,19 +7,14 @@ use App\Services\RegistrationTailService; use Illuminate\Http\Request; -class RegistrationTailController extends Controller -{ - public function __construct(private RegistrationTailService $registrationTailService) - { - } +class RegistrationTailController extends Controller { + public function __construct(private RegistrationTailService $registrationTailService) {} - public function index(): ApiResource - { + public function index(): ApiResource { return ApiResource::make($this->registrationTailService->getAll()); } - public function update(RegistrationTail $registrationTail, Request $request): ApiResource - { + public function update(RegistrationTail $registrationTail, Request $request): ApiResource { $tail = $request->input('tail'); $registrationTailData = [ 'tail' => $tail, diff --git a/src/backend/app/Http/Controllers/ReportController.php b/src/backend/app/Http/Controllers/ReportController.php index 75ea04362..67959acb2 100644 --- a/src/backend/app/Http/Controllers/ReportController.php +++ b/src/backend/app/Http/Controllers/ReportController.php @@ -6,20 +6,17 @@ use App\Models\Report; use Illuminate\Http\Request; -class ReportController -{ +class ReportController { /** * @var Report */ private $report; - public function __construct(Report $report) - { + public function __construct(Report $report) { $this->report = $report; } - public function download($id) - { + public function download($id) { if (!$id) { return; } @@ -28,8 +25,7 @@ public function download($id) return response()->download(explode('*', $report->path)[0]); } - public function index(Request $request): ApiResource - { + public function index(Request $request): ApiResource { $type = $request->get('type'); $startDate = $request->get('startDate'); $endDate = $request->get('endDate'); @@ -43,19 +39,16 @@ public function index(Request $request): ApiResource return new ApiResource($reports); } - private function getWeeklyReports($startDate, $endDate) - { + private function getWeeklyReports($startDate, $endDate) { return $this->report->where('type', 'weekly')->paginate(15); } - private function getMonthlyReports($startDate, $endDate) - { + private function getMonthlyReports($startDate, $endDate) { return $this->report->where('type', 'monthly') ->paginate(15); } - private function getAllReports($startDate, $endDate) - { + private function getAllReports($startDate, $endDate) { return $this->report->paginate(15); } } diff --git a/src/backend/app/Http/Controllers/Reports.php b/src/backend/app/Http/Controllers/Reports.php index 13ff37ea2..b4dcd24da 100644 --- a/src/backend/app/Http/Controllers/Reports.php +++ b/src/backend/app/Http/Controllers/Reports.php @@ -30,8 +30,7 @@ * * @group Export */ -class Reports -{ +class Reports { private array $totalSold = []; private array $connectionTypeCells = []; @@ -49,11 +48,9 @@ public function __construct( private City $city, private Target $target, private Report $report, - ) { - } + ) {} - private function monthlyTargetRibbon(Worksheet $sheet): void - { + private function monthlyTargetRibbon(Worksheet $sheet): void { $sheet->setCellValue('a5', 'Category'); $sheet->mergeCells('c5:e5'); $sheet->setCellValue('c5', 'No. of CUSTOMERS connected'); @@ -110,8 +107,7 @@ private function monthlyTargetRibbon(Worksheet $sheet): void } } - private function addTargetConnectionGroups(Worksheet $sheet): void - { + private function addTargetConnectionGroups(Worksheet $sheet): void { $column = 'A'; $subColumn = 'B'; $row = 7; @@ -140,14 +136,12 @@ private function addTargetConnectionGroups(Worksheet $sheet): void /** * Re-create the spreadsheet. */ - private function initSheet(): void - { + private function initSheet(): void { $this->spreadsheet = new Spreadsheet(); $this->totalSold = []; } - public function generateWithJob($startDate, $endDate, $reportType): void - { + public function generateWithJob($startDate, $endDate, $reportType): void { try { $cities = $this->city->newQuery()->get(); foreach ($cities as $city) { @@ -166,16 +160,14 @@ public function generateWithJob($startDate, $endDate, $reportType): void /** * @throws \PhpOffice\PhpSpreadsheet\Exception */ - private function fillBackground(Worksheet $sheet, string $coordinate, string $color): void - { + private function fillBackground(Worksheet $sheet, string $coordinate, string $color): void { $sheet->getStyle($coordinate)->getFill()->setFillType(Fill::FILL_SOLID)->setStartColor(new Color($color)); } /** * @throws \PhpOffice\PhpSpreadsheet\Exception */ - private function styleSheet(Worksheet $sheet, string $column, ?string $border, ?string $color): void - { + private function styleSheet(Worksheet $sheet, string $column, ?string $border, ?string $color): void { $style = $sheet->getStyle($column); if ($border !== null) { @@ -189,8 +181,7 @@ private function styleSheet(Worksheet $sheet, string $column, ?string $border, ? /** * @throws \PhpOffice\PhpSpreadsheet\Exception */ - private function addStaticText(Worksheet $sheet, string $dateRange): void - { + private function addStaticText(Worksheet $sheet, string $dateRange): void { $this->styleSheet($sheet, 'A1:L4', Border::BORDER_THIN, null); $this->fillBackground($sheet, 'A1:A5', 'FFFABF8F'); $this->fillBackground($sheet, 'A3:L3', 'FFFABF8F'); @@ -270,8 +261,7 @@ public function generateXls( * * @throws CustomerGroupNotFound */ - private function addTransactions(Worksheet $sheet, $transactions, $addPurchaseBreakDown = true): void - { + private function addTransactions(Worksheet $sheet, $transactions, $addPurchaseBreakDown = true): void { $sheetIndex = 0; $balance = 0; @@ -361,8 +351,7 @@ private function purchaseBreakDown( /** * @throws CustomerGroupNotFound */ - private function getConnectionGroupColumn(string $connectionGroupName): string - { + private function getConnectionGroupColumn(string $connectionGroupName): string { if ( array_key_exists( $connectionGroupName, @@ -374,8 +363,7 @@ private function getConnectionGroupColumn(string $connectionGroupName): string throw new CustomerGroupNotFound($connectionGroupName.' not found'); } - private function storeConnectionGroupColumn(string $connectionGroup, string $column): void - { + private function storeConnectionGroupColumn(string $connectionGroup, string $column): void { $this->connectionTypeCells[$connectionGroup] = $column; } @@ -422,8 +410,7 @@ private function addConnectionGroupsToXLS( } } - private function addSoldTotal(string $connectionGroupName, array $amount, $unit = null): void - { + private function addSoldTotal(string $connectionGroupName, array $amount, $unit = null): void { if (!array_key_exists($connectionGroupName, $this->totalSold)) { $this->totalSold[$connectionGroupName] = [ 'energy' => 0, @@ -444,8 +431,7 @@ private function addSoldTotal(string $connectionGroupName, array $amount, $unit * @throws CustomerGroupNotFound * @throws \PhpOffice\PhpSpreadsheet\Exception */ - private function addSoldSummary(Worksheet $sheet): void - { + private function addSoldSummary(Worksheet $sheet): void { // place total sold 1 row below the last transaction $index = $this->lastIndex + 1; if (\count($this->totalSold) === 0) { @@ -482,8 +468,7 @@ private function addSoldSummary(Worksheet $sheet): void /** * @psalm-return Generator */ - private function excelColumnRange(string $lower, string $upper): \Generator - { + private function excelColumnRange(string $lower, string $upper): \Generator { ++$upper; for ($i = $lower; $i !== $upper; ++$i) { yield $i; @@ -582,8 +567,7 @@ static function ($q) { /** * Total number of customer groups until given date. */ - private function getCustomerGroupCountPerMonth(string $date): void - { + private function getCustomerGroupCountPerMonth(string $date): void { $connectionGroupsCount = MeterParameter::query() ->selectRaw('Count(id) as total, connection_group_id') ->with('connectionGroup') @@ -601,8 +585,7 @@ private function getCustomerGroupCountPerMonth(string $date): void } } - private function getCustomerGroupEnergyUsagePerMonth(array $dates): void - { + private function getCustomerGroupEnergyUsagePerMonth(array $dates): void { foreach ($this->monthlyTargetDatas as $connectionName => $targetData) { $customerGroupRevenue = $this->sumOfTransactions($targetData['connection_id'], $dates); foreach ($customerGroupRevenue as $groupRevenue) { @@ -629,8 +612,7 @@ private function getCustomerGroupEnergyUsagePerMonth(array $dates): void } } - public function sumOfTransactions($connectionGroupId, array $dateRange): array - { + public function sumOfTransactions($connectionGroupId, array $dateRange): array { return Transaction::query() ->selectRaw(' meter_parameters.connection_group_id, @@ -656,8 +638,7 @@ static function ($q) { ->get()->toArray(); } - private function addTargetsToXls(Worksheet $sheet): void - { + private function addTargetsToXls(Worksheet $sheet): void { foreach ($this->monthlyTargetDatas as $subConnection => $monthlyTargetData) { $row = $this->subConnectionRows[$subConnection]; if (!$row) { @@ -670,8 +651,7 @@ private function addTargetsToXls(Worksheet $sheet): void } } - private function addStoredTargets(Worksheet $sheet, int $cityId, $endDate): void - { + private function addStoredTargets(Worksheet $sheet, int $cityId, $endDate): void { $targetData = $this->target::with('subTargets.connectionType') ->where('target_date', '>', $endDate) ->where('owner_type', 'mini-grid') diff --git a/src/backend/app/Http/Controllers/RestrictionController.php b/src/backend/app/Http/Controllers/RestrictionController.php index f23f22a94..77bb9b418 100644 --- a/src/backend/app/Http/Controllers/RestrictionController.php +++ b/src/backend/app/Http/Controllers/RestrictionController.php @@ -12,8 +12,7 @@ use Illuminate\Http\Response; use Illuminate\Support\Facades\Log; -class RestrictionController extends Controller -{ +class RestrictionController extends Controller { /** * @var Restriction */ @@ -24,14 +23,12 @@ class RestrictionController extends Controller */ private $httpClient; - public function __construct(Restriction $restriction, Client $httpClient) - { + public function __construct(Restriction $restriction, Client $httpClient) { $this->restriction = $restriction; $this->httpClient = $httpClient; } - public function store(Request $request, Response $response): Response - { + public function store(Request $request, Response $response): Response { $productId = $request->input('product_id'); $token = $request->input('token'); $type = $request->input('type'); @@ -102,8 +99,7 @@ public function store(Request $request, Response $response): Response /** * @throws PurchaseNotProcessable */ - private function updateRestriction(string $target, int $toAdd = 1): void - { + private function updateRestriction(string $target, int $toAdd = 1): void { try { $restriction = $this->restriction->where('target', $target)->firstOrFail(); $restriction->limit += $toAdd; diff --git a/src/backend/app/Http/Controllers/RevenueController.php b/src/backend/app/Http/Controllers/RevenueController.php index a1e1c144f..79bfb376f 100644 --- a/src/backend/app/Http/Controllers/RevenueController.php +++ b/src/backend/app/Http/Controllers/RevenueController.php @@ -17,8 +17,7 @@ use Inensus\Ticket\Models\Ticket; use Inensus\Ticket\Models\TicketCategory; -class RevenueController extends Controller -{ +class RevenueController extends Controller { public function __construct( private Ticket $ticket, private TicketCategory $label, @@ -27,11 +26,9 @@ public function __construct( private RevenueService $revenueService, private MeterRevenueService $meterRevenueService, private Target $target, - ) { - } + ) {} - public function ticketData($id): ApiResource - { + public function ticketData($id): ApiResource { $begin = date_create('2018-08-01'); $end = date_create(); $end->add(new \DateInterval('P1D')); @@ -68,8 +65,7 @@ public function ticketData($id): ApiResource return ApiResource::make($result); } - public function trending($id, Request $request): ApiResource - { + public function trending($id, Request $request): ApiResource { // the array which holds the final response $startDate = $request->input('startDate') ?? date('Y-01-01'); $end = $request->input('endDate') ?? date('Y-m-d'); @@ -119,8 +115,7 @@ public function trending($id, Request $request): ApiResource * * @return array|mixed */ - public function revenueData(Request $request): ApiResource - { + public function revenueData(Request $request): ApiResource { $startDate = date('Y-m-d', strtotime($request->get('start_date') ?? '2018-01-01')); $endDate = Carbon::parse(date('Y-m-d', strtotime($request->get('end_date') ?? '2018-12-31')))->endOfDay(); $targetTypeId = $request->get('target_type_id'); // cluster or mini-grid id @@ -238,8 +233,7 @@ public function revenueData(Request $request): ApiResource ); } - private function reformatPeriod($period): string - { + private function reformatPeriod($period): string { return substr_replace($period, '-', 4, 0); } } diff --git a/src/backend/app/Http/Controllers/SmsAndroidSettingController.php b/src/backend/app/Http/Controllers/SmsAndroidSettingController.php index cb106ed7a..e13674e2c 100644 --- a/src/backend/app/Http/Controllers/SmsAndroidSettingController.php +++ b/src/backend/app/Http/Controllers/SmsAndroidSettingController.php @@ -7,33 +7,27 @@ use App\Models\SmsAndroidSetting; use App\Services\SmsAndroidSettingService; -class SmsAndroidSettingController extends Controller -{ - public function __construct(private SmsAndroidSettingService $smsAndroidSettingService) - { +class SmsAndroidSettingController extends Controller { + public function __construct(private SmsAndroidSettingService $smsAndroidSettingService) { $this->smsAndroidSettingService = $smsAndroidSettingService; } - public function index(): ApiResource - { + public function index(): ApiResource { return ApiResource::make($this->smsAndroidSettingService->getSmsAndroidSetting()); } - public function store(SmsAndroidSettingRequest $request): ApiResource - { + public function store(SmsAndroidSettingRequest $request): ApiResource { return ApiResource::make($this->smsAndroidSettingService->createSmsAndroidSetting($request->input('token'))); } - public function update(SmsAndroidSetting $smsAndroidSetting, SmsAndroidSettingRequest $request): ApiResource - { + public function update(SmsAndroidSetting $smsAndroidSetting, SmsAndroidSettingRequest $request): ApiResource { return ApiResource::make($this->smsAndroidSettingService->updateSmsAndroidSetting( $smsAndroidSetting, $request->input('token') )); } - public function destroy(SmsAndroidSetting $smsAndroidSetting): ApiResource - { + public function destroy(SmsAndroidSetting $smsAndroidSetting): ApiResource { return ApiResource::make($this->smsAndroidSettingService->deleteSmsAndroidSetting($smsAndroidSetting)); } } diff --git a/src/backend/app/Http/Controllers/SmsApplianceRemindRateController.php b/src/backend/app/Http/Controllers/SmsApplianceRemindRateController.php index 197e58b8c..7180151ec 100644 --- a/src/backend/app/Http/Controllers/SmsApplianceRemindRateController.php +++ b/src/backend/app/Http/Controllers/SmsApplianceRemindRateController.php @@ -8,27 +8,22 @@ use App\Services\SmsApplianceRemindRateService; use Illuminate\Http\Request; -class SmsApplianceRemindRateController extends Controller -{ +class SmsApplianceRemindRateController extends Controller { private $smsApplianceRemindService; - public function __construct(SmsApplianceRemindRateService $smsApplianceRemindService) - { + public function __construct(SmsApplianceRemindRateService $smsApplianceRemindService) { $this->smsApplianceRemindService = $smsApplianceRemindService; } - public function index(): ApiResource - { + public function index(): ApiResource { return new ApiResource($this->smsApplianceRemindService->getApplianceRemindRatesWithAppliances()); } - public function store(SmsApplianceRemindRateRequest $request): ApiResource - { + public function store(SmsApplianceRemindRateRequest $request): ApiResource { return new ApiResource($this->smsApplianceRemindService->createApplianceRemindRate($request->all())); } - public function update(SmsApplianceRemindRate $smsApplianceRemindRate, Request $request): ApiResource - { + public function update(SmsApplianceRemindRate $smsApplianceRemindRate, Request $request): ApiResource { return new ApiResource($this->smsApplianceRemindService->updateApplianceRemindRate( $smsApplianceRemindRate, $request->all() diff --git a/src/backend/app/Http/Controllers/SmsBodyController.php b/src/backend/app/Http/Controllers/SmsBodyController.php index 6e423dd07..8d751d06d 100644 --- a/src/backend/app/Http/Controllers/SmsBodyController.php +++ b/src/backend/app/Http/Controllers/SmsBodyController.php @@ -6,22 +6,18 @@ use App\Services\SmsBodyService; use Illuminate\Http\Request; -class SmsBodyController extends Controller -{ +class SmsBodyController extends Controller { private $smsBodyService; - public function __construct(SmsBodyService $smsBodyService) - { + public function __construct(SmsBodyService $smsBodyService) { $this->smsBodyService = $smsBodyService; } - public function index(): ApiResource - { + public function index(): ApiResource { return new ApiResource($this->smsBodyService->getSmsBodies()); } - public function update(Request $request): ApiResource - { + public function update(Request $request): ApiResource { return new ApiResource($this->smsBodyService->updateSmsBodies($request->all())); } } diff --git a/src/backend/app/Http/Controllers/SmsController.php b/src/backend/app/Http/Controllers/SmsController.php index 7915f09a6..a480c7408 100644 --- a/src/backend/app/Http/Controllers/SmsController.php +++ b/src/backend/app/Http/Controllers/SmsController.php @@ -18,19 +18,16 @@ use Illuminate\Support\Facades\Log; use Inensus\Ticket\Services\TicketCommentService; -class SmsController extends Controller -{ +class SmsController extends Controller { public function __construct( private Sms $sms, private Person $person, private MeterParameter $meterParameter, private SmsService $smsService, private TicketCommentService $commentService, - ) { - } + ) {} - public function index(): ApiResource - { + public function index(): ApiResource { $list = $this->sms::with('address.owner') ->orderBy('id', 'DESC') ->select('receiver', DB::raw('count(*) as total')) @@ -43,8 +40,7 @@ public function index(): ApiResource /** * @return void */ - public function storeBulk(Request $request) - { + public function storeBulk(Request $request) { $type = $request->get('type'); $receivers = $request->get('receivers'); $message = $request->get('message'); @@ -159,8 +155,7 @@ function ($q) use ($receivers) { } } - public function store(StoreSmsRequest $request): ApiResource - { + public function store(StoreSmsRequest $request): ApiResource { $sender = $request->get('sender'); $message = $request->get('message'); $smsData = [ @@ -183,8 +178,7 @@ public function store(StoreSmsRequest $request): ApiResource return new ApiResource($sms); } - public function storeAndSend(SmsRequest $request): ApiResource - { + public function storeAndSend(SmsRequest $request): ApiResource { $personId = $request->get('person_id'); $message = $request->get('message'); $senderId = $request->get('senderId'); @@ -220,8 +214,7 @@ static function ($q) { * * @param string $uuid */ - public function updateForDelivered($uuid): void - { + public function updateForDelivered($uuid): void { try { Log::info('Sms has delivered successfully', ['uuid' => $uuid]); $sms = $this->sms->where('uuid', $uuid)->firstOrFail(); @@ -238,8 +231,7 @@ public function updateForDelivered($uuid): void } } - public function updateForFailed($uuid): void - { + public function updateForFailed($uuid): void { try { Log::warning('Sending Sms failed on AndroidGateway', ['uuid' => $uuid]); $sms = $this->sms->where('uuid', $uuid)->firstOrFail(); @@ -256,8 +248,7 @@ public function updateForFailed($uuid): void } } - public function updateForSent($uuid): void - { + public function updateForSent($uuid): void { try { Log::warning('Sms has sent successfully', ['uuid' => $uuid]); $sms = $this->sms->where('uuid', $uuid)->firstOrFail(); @@ -274,8 +265,7 @@ public function updateForSent($uuid): void } } - public function show($person_id): ApiResource - { + public function show($person_id): ApiResource { $personAddresses = $this->person::with( [ 'addresses' => function ($q) { @@ -291,15 +281,13 @@ public function show($person_id): ApiResource return new ApiResource($smses); } - public function byPhone($phone): ApiResource - { + public function byPhone($phone): ApiResource { $smses = $this->sms->where('receiver', $phone)->get(); return new ApiResource($smses); } - public function search($search) - { + public function search($search) { // search in people $list = $this->person::with('addresses') ->whereHas( diff --git a/src/backend/app/Http/Controllers/SmsResendInformationKeyController.php b/src/backend/app/Http/Controllers/SmsResendInformationKeyController.php index aa7fba348..1fc3f8f76 100644 --- a/src/backend/app/Http/Controllers/SmsResendInformationKeyController.php +++ b/src/backend/app/Http/Controllers/SmsResendInformationKeyController.php @@ -7,22 +7,18 @@ use App\Services\SmsResendInformationKeyService; use Illuminate\Http\Request; -class SmsResendInformationKeyController extends Controller -{ +class SmsResendInformationKeyController extends Controller { private $smsResendInformationKeyService; - public function __construct(SmsResendInformationKeyService $smsResendInformationKeyService) - { + public function __construct(SmsResendInformationKeyService $smsResendInformationKeyService) { $this->smsResendInformationKeyService = $smsResendInformationKeyService; } - public function index(): ApiResource - { + public function index(): ApiResource { return new ApiResource($this->smsResendInformationKeyService->getResendInformationKeys()); } - public function update(SmsResendInformationKey $smsResendInformationKey, Request $request): ApiResource - { + public function update(SmsResendInformationKey $smsResendInformationKey, Request $request): ApiResource { return new ApiResource($this->smsResendInformationKeyService->updateResendInformationKey( $smsResendInformationKey, $request->all() diff --git a/src/backend/app/Http/Controllers/SmsVariableDefaultValueController.php b/src/backend/app/Http/Controllers/SmsVariableDefaultValueController.php index 0dec1a448..e35dc0bb5 100644 --- a/src/backend/app/Http/Controllers/SmsVariableDefaultValueController.php +++ b/src/backend/app/Http/Controllers/SmsVariableDefaultValueController.php @@ -5,17 +5,14 @@ use App\Http\Resources\ApiResource; use App\Services\SmsVariableDefaultValueService; -class SmsVariableDefaultValueController extends Controller -{ +class SmsVariableDefaultValueController extends Controller { private $smsVariableDefaultSValueService; - public function __construct(SmsVariableDefaultValueService $smsVariableDefaultSValueService) - { + public function __construct(SmsVariableDefaultValueService $smsVariableDefaultSValueService) { $this->smsVariableDefaultSValueService = $smsVariableDefaultSValueService; } - public function index(): ApiResource - { + public function index(): ApiResource { return new ApiResource($this->smsVariableDefaultSValueService->getSmsVariableDefaultValues()); } } diff --git a/src/backend/app/Http/Controllers/SolarHomeSystemController.php b/src/backend/app/Http/Controllers/SolarHomeSystemController.php index fc09ce18a..7f9245781 100644 --- a/src/backend/app/Http/Controllers/SolarHomeSystemController.php +++ b/src/backend/app/Http/Controllers/SolarHomeSystemController.php @@ -9,24 +9,20 @@ use MPM\SolarHomeSystem\SolarHomeSystemDeviceService; use MPM\SolarHomeSystem\SolarHomeSystemService; -class SolarHomeSystemController extends Controller -{ +class SolarHomeSystemController extends Controller { public function __construct( private DeviceService $deviceService, private SolarHomeSystemService $solarHomeSystemService, private SolarHomeSystemDeviceService $solarHomeSystemDeviceService, - ) { - } + ) {} - public function index(Request $request): ApiResource - { + public function index(Request $request): ApiResource { $limit = $request->input('per_page'); return ApiResource::make($this->solarHomeSystemService->getAll($limit)); } - public function store(StoreSolarHomeSystemRequest $request) - { + public function store(StoreSolarHomeSystemRequest $request) { $solarHomeSystemData = $request->all(); $deviceData = [ 'device_serial' => $solarHomeSystemData['serial_number'], @@ -43,8 +39,7 @@ public function store(StoreSolarHomeSystemRequest $request) return ApiResource::make($solarHomeSystem->load(['manufacturer', 'appliance', 'device.person'])); } - public function search(Request $request): ApiResource - { + public function search(Request $request): ApiResource { $term = $request->input('term'); $paginate = $request->input('paginate') ?? 1; diff --git a/src/backend/app/Http/Controllers/SubConnectionTypeController.php b/src/backend/app/Http/Controllers/SubConnectionTypeController.php index 999e8c88f..5cfa14141 100644 --- a/src/backend/app/Http/Controllers/SubConnectionTypeController.php +++ b/src/backend/app/Http/Controllers/SubConnectionTypeController.php @@ -8,14 +8,10 @@ use App\Services\SubConnectionTypeService; use Illuminate\Http\Request; -class SubConnectionTypeController extends Controller -{ - public function __construct(private SubConnectionTypeService $subConnectionTypeService) - { - } +class SubConnectionTypeController extends Controller { + public function __construct(private SubConnectionTypeService $subConnectionTypeService) {} - public function index(Request $request, $connectionTypeId = null): ApiResource - { + public function index(Request $request, $connectionTypeId = null): ApiResource { $limit = $request->get('limit'); if ($connectionTypeId !== null) { @@ -28,8 +24,7 @@ public function index(Request $request, $connectionTypeId = null): ApiResource /** * Show the form for creating a new resource. */ - public function store(SubConnectionTypeCreateRequest $request): ApiResource - { + public function store(SubConnectionTypeCreateRequest $request): ApiResource { $subConnectionTypeData = $request->only(['name', 'connection_type_id', 'tariff_id']); return ApiResource::make($this->subConnectionTypeService->create($subConnectionTypeData)); @@ -40,8 +35,7 @@ public function store(SubConnectionTypeCreateRequest $request): ApiResource * * @param SubConnectionType $subConnectionType */ - public function update(Request $request, $subConnectionTypeId): ApiResource - { + public function update(Request $request, $subConnectionTypeId): ApiResource { $subConnectionType = $this->subConnectionTypeService->getById($subConnectionTypeId); $subConnectionTypeData = $request->only(['name', 'tariff_id']); diff --git a/src/backend/app/Http/Controllers/TargetController.php b/src/backend/app/Http/Controllers/TargetController.php index e2210c432..956ff77a8 100644 --- a/src/backend/app/Http/Controllers/TargetController.php +++ b/src/backend/app/Http/Controllers/TargetController.php @@ -10,30 +10,25 @@ use App\Services\TargetService; use Illuminate\Http\Request; -class TargetController extends Controller -{ +class TargetController extends Controller { public function __construct( private TargetService $targetService, private ClusterService $clusterService, private MiniGridService $miniGridService, private SubTargetService $subTargetService, - ) { - } + ) {} - public function index(Request $request): ApiResource - { + public function index(Request $request): ApiResource { $limit = $request->input('limit', 15); return ApiResource::make($this->targetService->getAll($limit)); } - public function show($targetId): ApiResource - { + public function show($targetId): ApiResource { return ApiResource::make($this->targetService->getById($targetId)); } - public function getSlotsForDate(Request $request): ApiResource - { + public function getSlotsForDate(Request $request): ApiResource { $date = $request->input('date'); $lastDayOfMonth = date('Y-m-t', strtotime($date)); $firstDayOfMonth = date('Y-m-1', strtotime($date)); @@ -42,8 +37,7 @@ public function getSlotsForDate(Request $request): ApiResource return ApiResource::make($this->targetService->getTakenSlots($targetData)); } - public function store(CreateTargetRequest $request): ApiResource - { + public function store(CreateTargetRequest $request): ApiResource { $targetData = [ 'period' => $request->getPeriod(), 'targetForType' => $request->getTargetForType(), diff --git a/src/backend/app/Http/Controllers/TicketSettingsController.php b/src/backend/app/Http/Controllers/TicketSettingsController.php index f39318abd..edb292d13 100644 --- a/src/backend/app/Http/Controllers/TicketSettingsController.php +++ b/src/backend/app/Http/Controllers/TicketSettingsController.php @@ -6,19 +6,14 @@ use App\Models\TicketSettings; use Illuminate\Http\Request; -class TicketSettingsController extends Controller -{ - public function __construct(private TicketSettings $ticketSettings) - { - } +class TicketSettingsController extends Controller { + public function __construct(private TicketSettings $ticketSettings) {} - public function index(): ApiResource - { + public function index(): ApiResource { return new ApiResource(TicketSettings::all()); } - public function update(Request $request): ApiResource - { + public function update(Request $request): ApiResource { $ticketSettings = $this->ticketSettings::query()->updateOrCreate( [ 'id' => $request->input('id'), diff --git a/src/backend/app/Http/Controllers/TimeOfUsageController.php b/src/backend/app/Http/Controllers/TimeOfUsageController.php index c86a30adc..d34a288af 100644 --- a/src/backend/app/Http/Controllers/TimeOfUsageController.php +++ b/src/backend/app/Http/Controllers/TimeOfUsageController.php @@ -5,16 +5,13 @@ use App\Services\MeterTariffService; use App\Services\TimeOfUsageService; -class TimeOfUsageController extends Controller -{ +class TimeOfUsageController extends Controller { public function __construct( private TimeOfUsageService $timeOfUsageService, private MeterTariffService $meterTariffService, - ) { - } + ) {} - public function destroy($timeOfUsageId): ?bool - { + public function destroy($timeOfUsageId): ?bool { $timeOfUsage = $this->timeOfUsageService->getById($timeOfUsageId); $result = $this->timeOfUsageService->delete($timeOfUsage); diff --git a/src/backend/app/Http/Controllers/TransactionAdvancedController.php b/src/backend/app/Http/Controllers/TransactionAdvancedController.php index 897c3da39..6f8e2fcf2 100644 --- a/src/backend/app/Http/Controllers/TransactionAdvancedController.php +++ b/src/backend/app/Http/Controllers/TransactionAdvancedController.php @@ -6,15 +6,12 @@ use Illuminate\Http\Request; use MPM\Transaction\TransactionService; -class TransactionAdvancedController extends Controller -{ +class TransactionAdvancedController extends Controller { public function __construct( private TransactionService $transactionService, - ) { - } + ) {} - public function searchAdvanced(Request $request): ApiResource - { + public function searchAdvanced(Request $request): ApiResource { $type = $request->input('deviceType') ?: 'meter'; $serialNumber = $request->input('serial_number'); $tariffId = $request->input('tariff'); @@ -36,8 +33,7 @@ public function searchAdvanced(Request $request): ApiResource )); } - public function compare($period): array - { + public function compare($period): array { $comparisonPeriod = $this->transactionService->determinePeriod($period); // get transactions for both current and previous periods $transactions = $this->transactionService->getByComparisonPeriod($comparisonPeriod); diff --git a/src/backend/app/Http/Controllers/TransactionController.php b/src/backend/app/Http/Controllers/TransactionController.php index cd966524f..9c6b9d12f 100644 --- a/src/backend/app/Http/Controllers/TransactionController.php +++ b/src/backend/app/Http/Controllers/TransactionController.php @@ -8,29 +8,24 @@ use MPM\Transaction\Provider\ITransactionProvider; use MPM\Transaction\TransactionService; -class TransactionController extends Controller -{ +class TransactionController extends Controller { public function __construct( private TransactionService $transactionService, - ) { - } + ) {} - public function index(): ApiResource - { + public function index(): ApiResource { $limit = \request()->get('per_page') ?? 15; return ApiResource::make($this->transactionService->getAll($limit)); } - public function show(int $id): ApiResource - { + public function show(int $id): ApiResource { $transaction = $this->transactionService->getById($id); return ApiResource::make($transaction); } - public function store(Request $request): void - { + public function store(Request $request): void { /** * @var ITransactionProvider $transactionProvider */ diff --git a/src/backend/app/Http/Controllers/TransactionExportController.php b/src/backend/app/Http/Controllers/TransactionExportController.php index 96576a19b..2694373de 100644 --- a/src/backend/app/Http/Controllers/TransactionExportController.php +++ b/src/backend/app/Http/Controllers/TransactionExportController.php @@ -7,13 +7,11 @@ use MPM\Transaction\TransactionService; use Symfony\Component\HttpFoundation\BinaryFileResponse; -class TransactionExportController -{ +class TransactionExportController { public function __construct( private TransactionService $transactionService, private TransactionExportService $transactionExportService, - ) { - } + ) {} public function download( Request $request, diff --git a/src/backend/app/Http/Controllers/TransactionProviderController.php b/src/backend/app/Http/Controllers/TransactionProviderController.php index f698a70e8..41f9eb739 100644 --- a/src/backend/app/Http/Controllers/TransactionProviderController.php +++ b/src/backend/app/Http/Controllers/TransactionProviderController.php @@ -5,17 +5,14 @@ use App\Http\Resources\ApiResource; use App\Services\TransactionProviderService; -class TransactionProviderController extends Controller -{ +class TransactionProviderController extends Controller { private $transactionProviderService; - public function __construct(TransactionProviderService $transactionProviderService) - { + public function __construct(TransactionProviderService $transactionProviderService) { $this->transactionProviderService = $transactionProviderService; } - public function index(): ApiResource - { + public function index(): ApiResource { return new ApiResource($this->transactionProviderService->getTransactionProviders()); } } diff --git a/src/backend/app/Http/Controllers/UsageTypeController.php b/src/backend/app/Http/Controllers/UsageTypeController.php index c1381c68f..0925534ee 100644 --- a/src/backend/app/Http/Controllers/UsageTypeController.php +++ b/src/backend/app/Http/Controllers/UsageTypeController.php @@ -6,14 +6,10 @@ use App\Services\UsageTypeService; use Illuminate\Http\Request; -class UsageTypeController extends Controller -{ - public function __construct(private UsageTypeService $usageTypeService) - { - } +class UsageTypeController extends Controller { + public function __construct(private UsageTypeService $usageTypeService) {} - public function index(Request $request): ApiResource - { + public function index(Request $request): ApiResource { return ApiResource::make($this->usageTypeService->getAll()); } } diff --git a/src/backend/app/Http/Controllers/UserAddressController.php b/src/backend/app/Http/Controllers/UserAddressController.php index 5c307f398..d1f6c6c3a 100644 --- a/src/backend/app/Http/Controllers/UserAddressController.php +++ b/src/backend/app/Http/Controllers/UserAddressController.php @@ -8,29 +8,24 @@ use App\Services\UserAddressService; use Illuminate\Http\Request; -class UserAddressController extends Controller -{ +class UserAddressController extends Controller { private $userAddressService; - public function __construct(UserAddressService $userAddressService) - { + public function __construct(UserAddressService $userAddressService) { $this->userAddressService = $userAddressService; } - public function store(User $user, CreateAddressRequest $request): ApiResource - { + public function store(User $user, CreateAddressRequest $request): ApiResource { return new ApiResource($this->userAddressService->update($user, $request->all())); } - public function admin(User $user, Request $request) - { + public function admin(User $user, Request $request) { $address = $user->addressDetails()->first(); return new ApiResource($address); } - public function update(User $user, CreateAddressRequest $request) - { + public function update(User $user, CreateAddressRequest $request) { return new ApiResource($this->userAddressService->update($user, $request->all())); } } diff --git a/src/backend/app/Http/Controllers/UserController.php b/src/backend/app/Http/Controllers/UserController.php index ac6d13a98..837f6daac 100644 --- a/src/backend/app/Http/Controllers/UserController.php +++ b/src/backend/app/Http/Controllers/UserController.php @@ -10,24 +10,20 @@ use App\Services\UserService; use Illuminate\Http\Request; -class UserController extends Controller -{ +class UserController extends Controller { public function __construct( private UserService $userService, private DatabaseProxyService $databaseProxyService, private CompanyDatabaseService $companyDatabaseService, - ) { - } + ) {} - public function index(Request $request): ApiResource - { + public function index(Request $request): ApiResource { $users = $this->userService->list(); return new ApiResource($users); } - public function store(CreateAdminRequest $request) - { + public function store(CreateAdminRequest $request) { $user = $this->userService->create($request->only(['name', 'password', 'email'])); $companyDatabase = $this->companyDatabaseService->findByCompanyId($user->getCompanyId()); $databaseProxyData = [ @@ -40,13 +36,11 @@ public function store(CreateAdminRequest $request) return ApiResource::make($user->toArray()); } - public function show(User $user) - { + public function show(User $user) { return new ApiResource($this->userService->get($user->id)); } - public function update(User $user, Request $request): ApiResource - { + public function update(User $user, Request $request): ApiResource { $this->userService->update($user, $request->all()); return new ApiResource($user->fresh()); diff --git a/src/backend/app/Http/Controllers/UserPasswordController.php b/src/backend/app/Http/Controllers/UserPasswordController.php index 960b86cb6..04c4b9622 100644 --- a/src/backend/app/Http/Controllers/UserPasswordController.php +++ b/src/backend/app/Http/Controllers/UserPasswordController.php @@ -9,17 +9,14 @@ use App\Services\UserService; use Illuminate\Http\Response; -class UserPasswordController extends Controller -{ +class UserPasswordController extends Controller { private $userService; - public function __construct(UserService $userService) - { + public function __construct(UserService $userService) { $this->userService = $userService; } - public function forgotPassword(AdminResetPasswordRequest $request, Response $response): Response - { + public function forgotPassword(AdminResetPasswordRequest $request, Response $response): Response { if (!$this->userService->resetPassword($request->input('email'))) { return $response->setStatusCode(422)->setContent( [ @@ -41,8 +38,7 @@ public function forgotPassword(AdminResetPasswordRequest $request, Response $res ); } - public function update(User $user, UserChangePasswordRequest $changePasswordRequest) - { + public function update(User $user, UserChangePasswordRequest $changePasswordRequest) { return new ApiResource($this->userService->update($user, $changePasswordRequest->all())); } } diff --git a/src/backend/app/Http/Controllers/VodacomTransactionController.php b/src/backend/app/Http/Controllers/VodacomTransactionController.php index 621326fde..7e4935b60 100644 --- a/src/backend/app/Http/Controllers/VodacomTransactionController.php +++ b/src/backend/app/Http/Controllers/VodacomTransactionController.php @@ -5,13 +5,11 @@ use App\Models\Transaction\VodacomTransaction; use Illuminate\Http\Request; -class VodacomTransactionController extends Controller -{ +class VodacomTransactionController extends Controller { /** * Store a newly created resource in storage. */ - public function store(Request $request): void - { + public function store(Request $request): void { // get Transaction object $transactionData = request('transaction')->transaction; diff --git a/src/backend/app/Http/Kernel.php b/src/backend/app/Http/Kernel.php index d1dae17bc..f9f458f33 100644 --- a/src/backend/app/Http/Kernel.php +++ b/src/backend/app/Http/Kernel.php @@ -30,8 +30,7 @@ use Illuminate\Session\Middleware\StartSession; use Illuminate\View\Middleware\ShareErrorsFromSession; -class Kernel extends HttpKernel -{ +class Kernel extends HttpKernel { /** * The application's global HTTP middleware stack. * diff --git a/src/backend/app/Http/Middleware/AdminJWT.php b/src/backend/app/Http/Middleware/AdminJWT.php index 0ceac6d63..becefc19f 100644 --- a/src/backend/app/Http/Middleware/AdminJWT.php +++ b/src/backend/app/Http/Middleware/AdminJWT.php @@ -4,10 +4,8 @@ use Illuminate\Http\Request; -class AdminJWT -{ - public function handle(Request $request, \Closure $next) - { +class AdminJWT { + public function handle(Request $request, \Closure $next) { return $next($request); } } diff --git a/src/backend/app/Http/Middleware/AgentBalanceMiddleware.php b/src/backend/app/Http/Middleware/AgentBalanceMiddleware.php index 1553ccc2a..e99da167d 100644 --- a/src/backend/app/Http/Middleware/AgentBalanceMiddleware.php +++ b/src/backend/app/Http/Middleware/AgentBalanceMiddleware.php @@ -11,14 +11,12 @@ use App\Services\AgentTransactionService; use Illuminate\Database\Eloquent\ModelNotFoundException; -class AgentBalanceMiddleware -{ +class AgentBalanceMiddleware { public function __construct( private AgentService $agentService, private AgentAssignedApplianceService $agentAssignedApplianceService, private AgentTransactionService $agentTransactionService, - ) { - } + ) {} /** * Handle an incoming request. @@ -27,8 +25,7 @@ public function __construct( * * @return mixed */ - public function handle($request, \Closure $next) - { + public function handle($request, \Closure $next) { $routeName = request()->route()->getName(); $agent = $this->agentService->getByAuthenticatedUser(); $commission = $agent->commission()->first(); diff --git a/src/backend/app/Http/Middleware/CorsMiddleware.php b/src/backend/app/Http/Middleware/CorsMiddleware.php index b3135fe27..a5a48f695 100644 --- a/src/backend/app/Http/Middleware/CorsMiddleware.php +++ b/src/backend/app/Http/Middleware/CorsMiddleware.php @@ -4,10 +4,8 @@ use Illuminate\Http\Request; -class CorsMiddleware -{ - public function handle(Request $request, \Closure $next) - { +class CorsMiddleware { + public function handle(Request $request, \Closure $next) { $accessControlRequestMethod = $request->header('access-control-request-method'); $accessControlRequestHeaders = $request->header('access-control-request-headers'); diff --git a/src/backend/app/Http/Middleware/EncryptCookies.php b/src/backend/app/Http/Middleware/EncryptCookies.php index 50d0fe796..5768e90e2 100644 --- a/src/backend/app/Http/Middleware/EncryptCookies.php +++ b/src/backend/app/Http/Middleware/EncryptCookies.php @@ -4,8 +4,7 @@ use Illuminate\Cookie\Middleware\EncryptCookies as Middleware; -class EncryptCookies extends Middleware -{ +class EncryptCookies extends Middleware { /** * The names of the cookies that should not be encrypted. * diff --git a/src/backend/app/Http/Middleware/JwtMiddleware.php b/src/backend/app/Http/Middleware/JwtMiddleware.php index 6cdffcf62..ea3063c4b 100644 --- a/src/backend/app/Http/Middleware/JwtMiddleware.php +++ b/src/backend/app/Http/Middleware/JwtMiddleware.php @@ -13,13 +13,11 @@ use Tymon\JWTAuth\Facades\JWTAuth; use Tymon\JWTAuth\Http\Middleware\BaseMiddleware; -class JwtMiddleware extends BaseMiddleware -{ +class JwtMiddleware extends BaseMiddleware { /** * Handle an incoming request. */ - public function handle(Request $request, \Closure $next, string $type = 'user'): mixed - { + public function handle(Request $request, \Closure $next, string $type = 'user'): mixed { try { // @phpstan-ignore-next-line as no methods are defined on the facade its failing to resolve the function $id = JWTAuth::parseToken()->getPayload()->get('sub'); @@ -53,8 +51,7 @@ public function handle(Request $request, \Closure $next, string $type = 'user'): return $next($request); } - private function generateResponse(string $message, $status = 400): JsonResponse - { + private function generateResponse(string $message, $status = 400): JsonResponse { return response()->json(['data' => ['message' => $message, 'status' => $status]]); } } diff --git a/src/backend/app/Http/Middleware/RedirectIfAuthenticated.php b/src/backend/app/Http/Middleware/RedirectIfAuthenticated.php index 34e232eff..b4fb94931 100644 --- a/src/backend/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/src/backend/app/Http/Middleware/RedirectIfAuthenticated.php @@ -5,8 +5,7 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; -class RedirectIfAuthenticated -{ +class RedirectIfAuthenticated { /** * Handle an incoming request. * @@ -15,8 +14,7 @@ class RedirectIfAuthenticated * * @return mixed */ - public function handle($request, \Closure $next, $guard = null) - { + public function handle($request, \Closure $next, $guard = null) { if (Auth::guard($guard)->check()) { return redirect('/home'); } diff --git a/src/backend/app/Http/Middleware/RestrictionMiddleware.php b/src/backend/app/Http/Middleware/RestrictionMiddleware.php index 1436dba1c..7c2013ea8 100644 --- a/src/backend/app/Http/Middleware/RestrictionMiddleware.php +++ b/src/backend/app/Http/Middleware/RestrictionMiddleware.php @@ -12,14 +12,12 @@ /** * Class RestrictionMiddleware. */ -class RestrictionMiddleware -{ +class RestrictionMiddleware { public function __construct( private RestrictionService $restrictionService, private MaintenanceUserService $maintenanceUserService, private MiniGridService $miniGridService, - ) { - } + ) {} /** * Handle an incoming request. @@ -29,8 +27,7 @@ public function __construct( * * @return mixed */ - public function handle($request, \Closure $next, $target) - { + public function handle($request, \Closure $next, $target) { try { $restriction = $this->restrictionService->getRestrictionForTarget($target); $restrictionResult = $this->handleRestriction($restriction->limit, $target, $request); @@ -55,8 +52,7 @@ public function handle($request, \Closure $next, $target) return $next($request); } - private function handleRestriction(int $limit, $target, Request $request): bool - { + private function handleRestriction(int $limit, $target, Request $request): bool { if ($target === 'maintenance-user') { if ($this->maintenanceUserService->getMaintenanceUsersCount() >= $limit) { return false; diff --git a/src/backend/app/Http/Middleware/Transaction.php b/src/backend/app/Http/Middleware/Transaction.php index cd954e78d..4e46449a4 100644 --- a/src/backend/app/Http/Middleware/Transaction.php +++ b/src/backend/app/Http/Middleware/Transaction.php @@ -8,10 +8,8 @@ use Illuminate\Support\Facades\Log; use MPM\Transaction\Provider\ITransactionProvider; -class Transaction -{ - public function handle(Request $request, \Closure $next): mixed - { +class Transaction { + public function handle(Request $request, \Closure $next): mixed { try { $request->attributes->add(['transactionProcessor' => $this->determineSender($request)]); } catch (PaymentProviderNotIdentified $e) { @@ -21,8 +19,7 @@ public function handle(Request $request, \Closure $next): mixed return $next($request); } - private function determineSender(Request $request): ITransactionProvider - { + private function determineSender(Request $request): ITransactionProvider { if ( preg_match('/\/vodacom/', $request->url()) && \in_array($request->ip(), Config::get('services.vodacom.ips')) diff --git a/src/backend/app/Http/Middleware/TransactionRequest.php b/src/backend/app/Http/Middleware/TransactionRequest.php index 1591edcf1..b7e43cc23 100644 --- a/src/backend/app/Http/Middleware/TransactionRequest.php +++ b/src/backend/app/Http/Middleware/TransactionRequest.php @@ -6,8 +6,7 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Log; -class TransactionRequest -{ +class TransactionRequest { /** * Handle an incoming request. * @@ -15,8 +14,7 @@ class TransactionRequest * * @return mixed */ - public function handle($request, \Closure $next) - { + public function handle($request, \Closure $next) { $transactionProvider = $request->attributes->get('transactionProcessor'); try { $transactionProvider->validateRequest($request->getContent()); diff --git a/src/backend/app/Http/Middleware/TrimStrings.php b/src/backend/app/Http/Middleware/TrimStrings.php index 5a50e7b5c..da8416469 100644 --- a/src/backend/app/Http/Middleware/TrimStrings.php +++ b/src/backend/app/Http/Middleware/TrimStrings.php @@ -4,8 +4,7 @@ use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware; -class TrimStrings extends Middleware -{ +class TrimStrings extends Middleware { /** * The names of the attributes that should not be trimmed. * diff --git a/src/backend/app/Http/Middleware/TrustProxies.php b/src/backend/app/Http/Middleware/TrustProxies.php index fc0fa6e36..dd7bd8369 100644 --- a/src/backend/app/Http/Middleware/TrustProxies.php +++ b/src/backend/app/Http/Middleware/TrustProxies.php @@ -5,8 +5,7 @@ use Illuminate\Http\Middleware\TrustProxies as Middleware; use Illuminate\Http\Request; -class TrustProxies extends Middleware -{ +class TrustProxies extends Middleware { /** * The trusted proxies for this application. * diff --git a/src/backend/app/Http/Middleware/UserDefaultDatabaseConnectionMiddleware.php b/src/backend/app/Http/Middleware/UserDefaultDatabaseConnectionMiddleware.php index 7a8216a46..09cf672df 100644 --- a/src/backend/app/Http/Middleware/UserDefaultDatabaseConnectionMiddleware.php +++ b/src/backend/app/Http/Middleware/UserDefaultDatabaseConnectionMiddleware.php @@ -15,25 +15,21 @@ * The goal is to have the database connection on each incomming http request. * This will save querying in each model the correct database connection string. */ -class UserDefaultDatabaseConnectionMiddleware -{ +class UserDefaultDatabaseConnectionMiddleware { public function __construct( private DatabaseProxyManagerService $databaseProxyManager, private ApiCompanyResolverService $apiCompanyResolverService, private ApiResolverMap $apiResolverMap, - ) { - } + ) {} - public function handle($request, \Closure $next) - { + public function handle($request, \Closure $next) { if ($request instanceof Request) { return $this->handleApiRequest($request, $next); } throw new ValidationException('was not able to handle the request'); } - private function handleApiRequest(Request $request, \Closure $next) - { + private function handleApiRequest(Request $request, \Closure $next) { // REMOVE THIS WHEN THE TESTS ARE FIXED if ($request->path() === 'api/micro-star-meters/test' && $request->isMethod('get')) { return $next($request); @@ -97,8 +93,7 @@ private function handleApiRequest(Request $request, \Closure $next) }); } - private function resolveThirdPartyApi(string $requestPath): bool - { + private function resolveThirdPartyApi(string $requestPath): bool { foreach ($this->apiResolverMap->getResolvableApis() as $apiPath) { if (Str::startsWith(Str::lower($requestPath), Str::lower($apiPath))) { return true; @@ -108,8 +103,7 @@ private function resolveThirdPartyApi(string $requestPath): bool return false; } - private function isAgentApp(string $path): bool - { + private function isAgentApp(string $path): bool { return Str::startsWith($path, 'api/app/'); } } diff --git a/src/backend/app/Http/Middleware/VerifyCsrfToken.php b/src/backend/app/Http/Middleware/VerifyCsrfToken.php index 4c029cf39..fd2a511ed 100644 --- a/src/backend/app/Http/Middleware/VerifyCsrfToken.php +++ b/src/backend/app/Http/Middleware/VerifyCsrfToken.php @@ -4,8 +4,7 @@ use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware; -class VerifyCsrfToken extends Middleware -{ +class VerifyCsrfToken extends Middleware { /** * The URIs that should be excluded from CSRF verification. * diff --git a/src/backend/app/Http/Requests/AdminResetPasswordRequest.php b/src/backend/app/Http/Requests/AdminResetPasswordRequest.php index ee25ab8cb..51a3cf18b 100644 --- a/src/backend/app/Http/Requests/AdminResetPasswordRequest.php +++ b/src/backend/app/Http/Requests/AdminResetPasswordRequest.php @@ -4,23 +4,20 @@ use Illuminate\Foundation\Http\FormRequest; -class AdminResetPasswordRequest extends FormRequest -{ +class AdminResetPasswordRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } /** * Get the validation rules that apply to the request. */ - public function rules(): array - { + public function rules(): array { return [ 'email' => 'required', ]; diff --git a/src/backend/app/Http/Requests/AndroidAppRequest.php b/src/backend/app/Http/Requests/AndroidAppRequest.php index 51c0111c1..1da1c92b3 100644 --- a/src/backend/app/Http/Requests/AndroidAppRequest.php +++ b/src/backend/app/Http/Requests/AndroidAppRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class AndroidAppRequest extends FormRequest -{ +class AndroidAppRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -21,8 +19,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { return [ 'name' => 'required|min:3', 'surname' => 'required|min:3', diff --git a/src/backend/app/Http/Requests/AssetTypeCreateRequest.php b/src/backend/app/Http/Requests/AssetTypeCreateRequest.php index 79cf11f11..7575bfea7 100644 --- a/src/backend/app/Http/Requests/AssetTypeCreateRequest.php +++ b/src/backend/app/Http/Requests/AssetTypeCreateRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class AssetTypeCreateRequest extends FormRequest -{ +class AssetTypeCreateRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -21,8 +19,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { return [ 'name' => 'required|min:3', ]; diff --git a/src/backend/app/Http/Requests/AssetTypeUpdateRequest.php b/src/backend/app/Http/Requests/AssetTypeUpdateRequest.php index 89e1c328b..698412f95 100644 --- a/src/backend/app/Http/Requests/AssetTypeUpdateRequest.php +++ b/src/backend/app/Http/Requests/AssetTypeUpdateRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class AssetTypeUpdateRequest extends FormRequest -{ +class AssetTypeUpdateRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -21,8 +19,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { return [ 'name' => 'sometimes|min:4', ]; diff --git a/src/backend/app/Http/Requests/CityRequest.php b/src/backend/app/Http/Requests/CityRequest.php index 895dab314..a72d859f3 100644 --- a/src/backend/app/Http/Requests/CityRequest.php +++ b/src/backend/app/Http/Requests/CityRequest.php @@ -5,8 +5,7 @@ use App\Models\City; use Illuminate\Foundation\Http\FormRequest; -class CityRequest extends FormRequest -{ +class CityRequest extends FormRequest { private const PARAM_NAME = 'name'; private const PARAM_MINI_GRID = 'mini_grid_id'; @@ -18,24 +17,21 @@ class CityRequest extends FormRequest /** * Determine if the user is authorized to make this request. */ - public function authorize(): bool - { + public function authorize(): bool { return true; } /** * Get the validation rules that apply to the request. */ - public function rules(): array - { + public function rules(): array { return [ 'name' => 'required', 'mini_grid_id' => 'required', ]; } - public function getCity(): City - { + public function getCity(): City { $city = new City(); $city->setName($this->input(self::PARAM_NAME)); $city->setCountryId($this->input(self::PARAM_COUNTRY_ID, 0)); diff --git a/src/backend/app/Http/Requests/ClusterRequest.php b/src/backend/app/Http/Requests/ClusterRequest.php index a2cab730a..06a69d5a8 100644 --- a/src/backend/app/Http/Requests/ClusterRequest.php +++ b/src/backend/app/Http/Requests/ClusterRequest.php @@ -14,21 +14,18 @@ * @bodyParam cities array[int] required. The id's of the cities which belong to the cluster. * @bodyParam manager_id int required. The id of the user who is responsible for the cluster. */ -class ClusterRequest extends FormRequest -{ +class ClusterRequest extends FormRequest { /** * Determine if the user is authorized to make this request. */ - public function authorize(): bool - { + public function authorize(): bool { return true; } /** * Get the validation rules that apply to the request. */ - public function rules(): array - { + public function rules(): array { return [ 'name' => 'required', 'geo_type' => 'required', diff --git a/src/backend/app/Http/Requests/CompanyRegistrationRequest.php b/src/backend/app/Http/Requests/CompanyRegistrationRequest.php index 96fe645ff..c7b673405 100644 --- a/src/backend/app/Http/Requests/CompanyRegistrationRequest.php +++ b/src/backend/app/Http/Requests/CompanyRegistrationRequest.php @@ -4,13 +4,11 @@ use Illuminate\Foundation\Http\FormRequest; -class CompanyRegistrationRequest extends FormRequest -{ +class CompanyRegistrationRequest extends FormRequest { /** * Get the validation rules that apply to the request. */ - public function rules(): array - { + public function rules(): array { return [ 'name' => 'required', 'address' => 'required', diff --git a/src/backend/app/Http/Requests/CountryRequest.php b/src/backend/app/Http/Requests/CountryRequest.php index 10fc06b54..a75db722a 100644 --- a/src/backend/app/Http/Requests/CountryRequest.php +++ b/src/backend/app/Http/Requests/CountryRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class CountryRequest extends FormRequest -{ +class CountryRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -21,8 +19,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { return [ 'country_name' => 'required', 'country_code' => 'required|min:2', diff --git a/src/backend/app/Http/Requests/CreateAddressRequest.php b/src/backend/app/Http/Requests/CreateAddressRequest.php index 43bcadb33..2545a38d7 100644 --- a/src/backend/app/Http/Requests/CreateAddressRequest.php +++ b/src/backend/app/Http/Requests/CreateAddressRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class CreateAddressRequest extends FormRequest -{ +class CreateAddressRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -23,8 +21,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { return [ 'city_id' => 'required', ]; diff --git a/src/backend/app/Http/Requests/CreateAdminRequest.php b/src/backend/app/Http/Requests/CreateAdminRequest.php index 667f1a508..a327037ce 100644 --- a/src/backend/app/Http/Requests/CreateAdminRequest.php +++ b/src/backend/app/Http/Requests/CreateAdminRequest.php @@ -7,15 +7,13 @@ /** * Class CreateUserRequest. */ -class CreateAdminRequest extends FormRequest -{ +class CreateAdminRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -24,8 +22,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { return [ 'email' => 'required', 'name' => 'required|min:3', diff --git a/src/backend/app/Http/Requests/CreateAgentAssignedApplianceRequest.php b/src/backend/app/Http/Requests/CreateAgentAssignedApplianceRequest.php index 392835105..8c24ec848 100644 --- a/src/backend/app/Http/Requests/CreateAgentAssignedApplianceRequest.php +++ b/src/backend/app/Http/Requests/CreateAgentAssignedApplianceRequest.php @@ -5,15 +5,13 @@ use App\Services\SessionService; use Illuminate\Foundation\Http\FormRequest; -class CreateAgentAssignedApplianceRequest extends FormRequest -{ +class CreateAgentAssignedApplianceRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -22,8 +20,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { $sessionService = app()->make(SessionService::class); $database = $sessionService->getAuthenticatedUserDatabaseName(); diff --git a/src/backend/app/Http/Requests/CreateAgentBalanceHistoryRequest.php b/src/backend/app/Http/Requests/CreateAgentBalanceHistoryRequest.php index 336ae2def..2b33ac65f 100644 --- a/src/backend/app/Http/Requests/CreateAgentBalanceHistoryRequest.php +++ b/src/backend/app/Http/Requests/CreateAgentBalanceHistoryRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class CreateAgentBalanceHistoryRequest extends FormRequest -{ +class CreateAgentBalanceHistoryRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -21,8 +19,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { return [ 'amount' => 'required|regex:/^\d*(\.\d{1,2})?$/', ]; diff --git a/src/backend/app/Http/Requests/CreateAgentChargeRequest.php b/src/backend/app/Http/Requests/CreateAgentChargeRequest.php index 42cc83112..2b2d884e6 100644 --- a/src/backend/app/Http/Requests/CreateAgentChargeRequest.php +++ b/src/backend/app/Http/Requests/CreateAgentChargeRequest.php @@ -5,15 +5,13 @@ use App\Services\SessionService; use Illuminate\Foundation\Http\FormRequest; -class CreateAgentChargeRequest extends FormRequest -{ +class CreateAgentChargeRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -22,8 +20,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { // TODO: Change on UI. user_id is not required. $sessionService = app()->make(SessionService::class); $database = $sessionService->getAuthenticatedUserDatabaseName(); diff --git a/src/backend/app/Http/Requests/CreateAgentCommissionRequest.php b/src/backend/app/Http/Requests/CreateAgentCommissionRequest.php index 5ddcc15bb..726a6c8e6 100644 --- a/src/backend/app/Http/Requests/CreateAgentCommissionRequest.php +++ b/src/backend/app/Http/Requests/CreateAgentCommissionRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class CreateAgentCommissionRequest extends FormRequest -{ +class CreateAgentCommissionRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -21,8 +19,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { return [ 'name' => 'required', 'energy_commission' => 'required|numeric', diff --git a/src/backend/app/Http/Requests/CreateAgentReceiptRequest.php b/src/backend/app/Http/Requests/CreateAgentReceiptRequest.php index dbf38fbe4..d6d29434b 100644 --- a/src/backend/app/Http/Requests/CreateAgentReceiptRequest.php +++ b/src/backend/app/Http/Requests/CreateAgentReceiptRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class CreateAgentReceiptRequest extends FormRequest -{ +class CreateAgentReceiptRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -21,8 +19,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { return [ 'agent_id' => 'required', 'amount' => 'required', diff --git a/src/backend/app/Http/Requests/CreateAgentRequest.php b/src/backend/app/Http/Requests/CreateAgentRequest.php index 949d62fd0..e62fd4f80 100644 --- a/src/backend/app/Http/Requests/CreateAgentRequest.php +++ b/src/backend/app/Http/Requests/CreateAgentRequest.php @@ -7,15 +7,13 @@ /** * Class CreateUserRequest. */ -class CreateAgentRequest extends FormRequest -{ +class CreateAgentRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -24,8 +22,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { return [ 'email' => 'required', 'name' => 'required|min:3', diff --git a/src/backend/app/Http/Requests/CreateAgentSoldApplianceRequest.php b/src/backend/app/Http/Requests/CreateAgentSoldApplianceRequest.php index 771577c50..2b035155f 100644 --- a/src/backend/app/Http/Requests/CreateAgentSoldApplianceRequest.php +++ b/src/backend/app/Http/Requests/CreateAgentSoldApplianceRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class CreateAgentSoldApplianceRequest extends FormRequest -{ +class CreateAgentSoldApplianceRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -21,8 +19,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { return [ 'person_id' => 'required', 'down_payment' => 'required|numeric', diff --git a/src/backend/app/Http/Requests/CreateAgentTicketRequest.php b/src/backend/app/Http/Requests/CreateAgentTicketRequest.php index 1a3f8f5f7..63ce0e8f7 100644 --- a/src/backend/app/Http/Requests/CreateAgentTicketRequest.php +++ b/src/backend/app/Http/Requests/CreateAgentTicketRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class CreateAgentTicketRequest extends FormRequest -{ +class CreateAgentTicketRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -21,8 +19,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { return [ 'owner_id' => 'required', 'title' => 'required', diff --git a/src/backend/app/Http/Requests/CreateAssetRequest.php b/src/backend/app/Http/Requests/CreateAssetRequest.php index 6e2dd8980..fd73ccdeb 100644 --- a/src/backend/app/Http/Requests/CreateAssetRequest.php +++ b/src/backend/app/Http/Requests/CreateAssetRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class CreateAssetRequest extends FormRequest -{ +class CreateAssetRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -21,8 +19,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { return [ 'asset_type_id' => 'required', 'name' => 'required|min:3', diff --git a/src/backend/app/Http/Requests/CreateConnectionGroupRequest.php b/src/backend/app/Http/Requests/CreateConnectionGroupRequest.php index ec17857a4..a7752eaf6 100644 --- a/src/backend/app/Http/Requests/CreateConnectionGroupRequest.php +++ b/src/backend/app/Http/Requests/CreateConnectionGroupRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class CreateConnectionGroupRequest extends FormRequest -{ +class CreateConnectionGroupRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -21,8 +19,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { return [ 'name' => 'required|string', ]; diff --git a/src/backend/app/Http/Requests/CreateTargetRequest.php b/src/backend/app/Http/Requests/CreateTargetRequest.php index 64f47a0ef..44e687123 100644 --- a/src/backend/app/Http/Requests/CreateTargetRequest.php +++ b/src/backend/app/Http/Requests/CreateTargetRequest.php @@ -5,15 +5,13 @@ use Carbon\CarbonImmutable; use Illuminate\Foundation\Http\FormRequest; -class CreateTargetRequest extends FormRequest -{ +class CreateTargetRequest extends FormRequest { /** * Get the validation rules that apply to the request. * * @return array */ - public function rules() - { + public function rules() { return [ 'data' => 'required', 'period' => 'required', @@ -22,23 +20,19 @@ public function rules() ]; } - public function getTargetForType(): string - { + public function getTargetForType(): string { return $this->input('targetForType'); } - public function getTargetForId(): int - { + public function getTargetForId(): int { return $this->input('targetForId'); } - public function getData(): array - { + public function getData(): array { return $this->input('data'); } - public function getPeriod(): CarbonImmutable - { + public function getPeriod(): CarbonImmutable { return CarbonImmutable::parse($this->input('period')); } } diff --git a/src/backend/app/Http/Requests/MailSettingsRequest.php b/src/backend/app/Http/Requests/MailSettingsRequest.php index 52beefa29..e61088711 100644 --- a/src/backend/app/Http/Requests/MailSettingsRequest.php +++ b/src/backend/app/Http/Requests/MailSettingsRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class MailSettingsRequest extends FormRequest -{ +class MailSettingsRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -21,8 +19,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { return [ 'mail_host' => 'required|min:5', 'mail_port' => 'required|numeric', diff --git a/src/backend/app/Http/Requests/MaintenanceRequest.php b/src/backend/app/Http/Requests/MaintenanceRequest.php index 2246d187f..d6b3a9892 100644 --- a/src/backend/app/Http/Requests/MaintenanceRequest.php +++ b/src/backend/app/Http/Requests/MaintenanceRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class MaintenanceRequest extends FormRequest -{ +class MaintenanceRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -21,8 +19,7 @@ public function authorize() * * @return array# */ - public function rules() - { + public function rules() { return [ 'title' => 'sometimes|string', 'name' => 'required|min:3', @@ -38,23 +35,19 @@ public function rules() ]; } - public function getCityId(): int - { + public function getCityId(): int { return $this->input('city_id'); } - public function getPhone(): ?string - { + public function getPhone(): ?string { return $this->input('phone'); } - public function getStreet(): ?string - { + public function getStreet(): ?string { return $this->input('street'); } - public function getEmail(): ?string - { + public function getEmail(): ?string { return $this->input('email'); } } diff --git a/src/backend/app/Http/Requests/ManufacturerRequest.php b/src/backend/app/Http/Requests/ManufacturerRequest.php index 91fb06a7d..18dc98425 100644 --- a/src/backend/app/Http/Requests/ManufacturerRequest.php +++ b/src/backend/app/Http/Requests/ManufacturerRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class ManufacturerRequest extends FormRequest -{ +class ManufacturerRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -21,8 +19,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { return [ 'name' => 'required|string', 'phone' => 'sometimes|string', diff --git a/src/backend/app/Http/Requests/MeterParameterRequest.php b/src/backend/app/Http/Requests/MeterParameterRequest.php index 317b17459..4e98a4900 100644 --- a/src/backend/app/Http/Requests/MeterParameterRequest.php +++ b/src/backend/app/Http/Requests/MeterParameterRequest.php @@ -12,15 +12,13 @@ * @bodyParam customer_id int required * @bodyParam geo_points string required */ -class MeterParameterRequest extends FormRequest -{ +class MeterParameterRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -29,8 +27,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { return [ 'meter_id' => 'required', 'tariff_id' => 'required', diff --git a/src/backend/app/Http/Requests/MeterRequest.php b/src/backend/app/Http/Requests/MeterRequest.php index a30012173..dd74aa141 100644 --- a/src/backend/app/Http/Requests/MeterRequest.php +++ b/src/backend/app/Http/Requests/MeterRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class MeterRequest extends FormRequest -{ +class MeterRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -21,8 +19,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { return [ 'serial_number' => 'required|string', 'manufacturer_id' => 'required', diff --git a/src/backend/app/Http/Requests/MeterTypeCreateRequest.php b/src/backend/app/Http/Requests/MeterTypeCreateRequest.php index 04a87c5cc..edcc21304 100644 --- a/src/backend/app/Http/Requests/MeterTypeCreateRequest.php +++ b/src/backend/app/Http/Requests/MeterTypeCreateRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class MeterTypeCreateRequest extends FormRequest -{ +class MeterTypeCreateRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -21,8 +19,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { return [ 'max_current' => 'required|numeric|min:1', 'phase' => 'required|numeric|min:1', diff --git a/src/backend/app/Http/Requests/MeterTypeUpdateRequest.php b/src/backend/app/Http/Requests/MeterTypeUpdateRequest.php index 67db6466b..9370fd5e7 100644 --- a/src/backend/app/Http/Requests/MeterTypeUpdateRequest.php +++ b/src/backend/app/Http/Requests/MeterTypeUpdateRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class MeterTypeUpdateRequest extends FormRequest -{ +class MeterTypeUpdateRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -21,8 +19,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { return [ 'max_current' => 'required|numeric|min:1', 'phase' => 'required|numeric|min:1', diff --git a/src/backend/app/Http/Requests/PersonRequest.php b/src/backend/app/Http/Requests/PersonRequest.php index dd97fdd6f..b17556a4c 100644 --- a/src/backend/app/Http/Requests/PersonRequest.php +++ b/src/backend/app/Http/Requests/PersonRequest.php @@ -17,15 +17,13 @@ * @bodyParam phone string. Example: +1111 * @bodyParam nationality string. Example: Earth Citizen */ -class PersonRequest extends FormRequest -{ +class PersonRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -34,8 +32,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { return [ 'title' => 'sometimes|string', 'name' => 'required|min:3', diff --git a/src/backend/app/Http/Requests/SmsAndroidSettingRequest.php b/src/backend/app/Http/Requests/SmsAndroidSettingRequest.php index 946bbe39d..b5c2244e3 100644 --- a/src/backend/app/Http/Requests/SmsAndroidSettingRequest.php +++ b/src/backend/app/Http/Requests/SmsAndroidSettingRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class SmsAndroidSettingRequest extends FormRequest -{ +class SmsAndroidSettingRequest extends FormRequest { /** * Get the validation rules that apply to the request. * * @return array */ - public function rules() - { + public function rules() { return [ 'token' => 'required', ]; diff --git a/src/backend/app/Http/Requests/SmsApplianceRemindRateRequest.php b/src/backend/app/Http/Requests/SmsApplianceRemindRateRequest.php index f7ac4c5ab..e694b5595 100644 --- a/src/backend/app/Http/Requests/SmsApplianceRemindRateRequest.php +++ b/src/backend/app/Http/Requests/SmsApplianceRemindRateRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class SmsApplianceRemindRateRequest extends FormRequest -{ +class SmsApplianceRemindRateRequest extends FormRequest { /** * Get the validation rules that apply to the request. * * @return array */ - public function rules() - { + public function rules() { return [ 'appliance_type_id' => 'required', 'overdue_remind_rate' => 'required', diff --git a/src/backend/app/Http/Requests/SmsRequest.php b/src/backend/app/Http/Requests/SmsRequest.php index 18c4bc7e2..96098e5bf 100644 --- a/src/backend/app/Http/Requests/SmsRequest.php +++ b/src/backend/app/Http/Requests/SmsRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class SmsRequest extends FormRequest -{ +class SmsRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -21,8 +19,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { return [ 'message' => 'required', 'person_id' => 'required_without_all:phone', diff --git a/src/backend/app/Http/Requests/StoreDeviceRequest.php b/src/backend/app/Http/Requests/StoreDeviceRequest.php index 0d4becedf..955852107 100644 --- a/src/backend/app/Http/Requests/StoreDeviceRequest.php +++ b/src/backend/app/Http/Requests/StoreDeviceRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class StoreDeviceRequest extends FormRequest -{ +class StoreDeviceRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -21,8 +19,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { return [ ]; } diff --git a/src/backend/app/Http/Requests/StoreEBikeRequest.php b/src/backend/app/Http/Requests/StoreEBikeRequest.php index 0e23a6f9b..b71e1eeff 100644 --- a/src/backend/app/Http/Requests/StoreEBikeRequest.php +++ b/src/backend/app/Http/Requests/StoreEBikeRequest.php @@ -4,13 +4,11 @@ use Illuminate\Foundation\Http\FormRequest; -class StoreEBikeRequest extends FormRequest -{ +class StoreEBikeRequest extends FormRequest { /** * Determine if the user is authorized to make this request. */ - public function authorize(): bool - { + public function authorize(): bool { return true; } @@ -19,8 +17,7 @@ public function authorize(): bool * * @return array */ - public function rules() - { + public function rules() { return [ 'serial_number' => 'required|min:8|max:15|unique:shard.devices,device_serial', 'manufacturer_id' => 'required|exists:shard.manufacturers,id', diff --git a/src/backend/app/Http/Requests/StoreMiniGridRequest.php b/src/backend/app/Http/Requests/StoreMiniGridRequest.php index e8c1ddf71..77fcbea56 100644 --- a/src/backend/app/Http/Requests/StoreMiniGridRequest.php +++ b/src/backend/app/Http/Requests/StoreMiniGridRequest.php @@ -5,8 +5,7 @@ use App\Models\MiniGrid; use Illuminate\Foundation\Http\FormRequest; -class StoreMiniGridRequest extends FormRequest -{ +class StoreMiniGridRequest extends FormRequest { public const PARAM_CLUSTER_ID = 'cluster_id'; public const PARAM_NAME = 'name'; @@ -16,8 +15,7 @@ class StoreMiniGridRequest extends FormRequest * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -26,8 +24,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { return [ 'name' => 'required|min:3', 'cluster_id' => 'required', @@ -35,8 +32,7 @@ public function rules() ]; } - public function getMiniGrid(): MiniGrid - { + public function getMiniGrid(): MiniGrid { $miniGrid = new MiniGrid(); $miniGrid->setClusterId($this->input(self::PARAM_CLUSTER_ID)); $miniGrid->setName($this->input(self::PARAM_NAME)); diff --git a/src/backend/app/Http/Requests/StoreSmsRequest.php b/src/backend/app/Http/Requests/StoreSmsRequest.php index 8dd149640..53f946063 100644 --- a/src/backend/app/Http/Requests/StoreSmsRequest.php +++ b/src/backend/app/Http/Requests/StoreSmsRequest.php @@ -4,15 +4,12 @@ use Illuminate\Foundation\Http\FormRequest; -class StoreSmsRequest extends FormRequest -{ - public function authorize(): bool - { +class StoreSmsRequest extends FormRequest { + public function authorize(): bool { return true; } - public function rules(): array - { + public function rules(): array { return [ 'sender' => 'required', 'message' => 'required', diff --git a/src/backend/app/Http/Requests/StoreSolarHomeSystemRequest.php b/src/backend/app/Http/Requests/StoreSolarHomeSystemRequest.php index b8d85e41c..b8383b35a 100644 --- a/src/backend/app/Http/Requests/StoreSolarHomeSystemRequest.php +++ b/src/backend/app/Http/Requests/StoreSolarHomeSystemRequest.php @@ -4,13 +4,11 @@ use Illuminate\Foundation\Http\FormRequest; -class StoreSolarHomeSystemRequest extends FormRequest -{ +class StoreSolarHomeSystemRequest extends FormRequest { /** * Determine if the user is authorized to make this request. */ - public function authorize(): bool - { + public function authorize(): bool { return true; } @@ -19,8 +17,7 @@ public function authorize(): bool * * @return array */ - public function rules() - { + public function rules() { return [ 'serial_number' => 'required|min:8|max:11|unique:shard.devices,device_serial', 'manufacturer_id' => 'required|exists:shard.manufacturers,id', diff --git a/src/backend/app/Http/Requests/SubConnectionTypeCreateRequest.php b/src/backend/app/Http/Requests/SubConnectionTypeCreateRequest.php index fd4be7cfb..798ba94d2 100644 --- a/src/backend/app/Http/Requests/SubConnectionTypeCreateRequest.php +++ b/src/backend/app/Http/Requests/SubConnectionTypeCreateRequest.php @@ -4,21 +4,18 @@ use Illuminate\Foundation\Http\FormRequest; -class SubConnectionTypeCreateRequest extends FormRequest -{ +class SubConnectionTypeCreateRequest extends FormRequest { /** * Determine if the user is authorized to make this request. */ - public function authorize(): bool - { + public function authorize(): bool { return true; } /** * Get the validation rules that apply to the request. */ - public function rules(): array - { + public function rules(): array { return [ 'name' => 'required|min:3', 'connection_type_id' => 'required|numeric', diff --git a/src/backend/app/Http/Requests/TariffCreateRequest.php b/src/backend/app/Http/Requests/TariffCreateRequest.php index 463688322..8ac415b98 100644 --- a/src/backend/app/Http/Requests/TariffCreateRequest.php +++ b/src/backend/app/Http/Requests/TariffCreateRequest.php @@ -7,15 +7,13 @@ use Illuminate\Http\JsonResponse; use Illuminate\Validation\ValidationException; -class TariffCreateRequest extends FormRequest -{ +class TariffCreateRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -24,8 +22,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { return [ 'name' => 'required', 'price' => 'required|numeric', // 100 times of original price to support 2 decimal numbers. @@ -40,8 +37,7 @@ public function rules() ]; } - protected function failedValidation(Validator $validator) - { + protected function failedValidation(Validator $validator) { $response = new JsonResponse( [ 'data' => [], diff --git a/src/backend/app/Http/Requests/UpdateAssetRequest.php b/src/backend/app/Http/Requests/UpdateAssetRequest.php index f09eebdac..84a6da0a7 100644 --- a/src/backend/app/Http/Requests/UpdateAssetRequest.php +++ b/src/backend/app/Http/Requests/UpdateAssetRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class UpdateAssetRequest extends FormRequest -{ +class UpdateAssetRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -21,8 +19,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { return [ 'asset_type_id' => 'sometimes', 'name' => 'sometimes|min:4', diff --git a/src/backend/app/Http/Requests/UpdateDeviceRequest.php b/src/backend/app/Http/Requests/UpdateDeviceRequest.php index 94da0486a..7801d3532 100644 --- a/src/backend/app/Http/Requests/UpdateDeviceRequest.php +++ b/src/backend/app/Http/Requests/UpdateDeviceRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class UpdateDeviceRequest extends FormRequest -{ +class UpdateDeviceRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -21,8 +19,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { return [ 'id' => 'required|numeric', 'person_id' => 'required|numeric', diff --git a/src/backend/app/Http/Requests/UpdateMeterRequest.php b/src/backend/app/Http/Requests/UpdateMeterRequest.php index 26f40d0c3..400d5c292 100644 --- a/src/backend/app/Http/Requests/UpdateMeterRequest.php +++ b/src/backend/app/Http/Requests/UpdateMeterRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class UpdateMeterRequest extends FormRequest -{ +class UpdateMeterRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -21,8 +19,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { return [ 'id' => 'required|numeric', 'serial_number' => 'sometimes|string', diff --git a/src/backend/app/Http/Requests/UpdateMiniGridRequest.php b/src/backend/app/Http/Requests/UpdateMiniGridRequest.php index d628382d8..ea754791a 100644 --- a/src/backend/app/Http/Requests/UpdateMiniGridRequest.php +++ b/src/backend/app/Http/Requests/UpdateMiniGridRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class UpdateMiniGridRequest extends FormRequest -{ +class UpdateMiniGridRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } } diff --git a/src/backend/app/Http/Requests/UserChangePasswordRequest.php b/src/backend/app/Http/Requests/UserChangePasswordRequest.php index 491f1dc84..5c14a63a3 100644 --- a/src/backend/app/Http/Requests/UserChangePasswordRequest.php +++ b/src/backend/app/Http/Requests/UserChangePasswordRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class UserChangePasswordRequest extends FormRequest -{ +class UserChangePasswordRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -21,8 +19,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { return [ 'password' => 'required|min:5|max:15', 'confirm_password' => 'required|same:password', diff --git a/src/backend/app/Http/Resources/ApiResource.php b/src/backend/app/Http/Resources/ApiResource.php index 5016dea38..3a651eb44 100644 --- a/src/backend/app/Http/Resources/ApiResource.php +++ b/src/backend/app/Http/Resources/ApiResource.php @@ -5,8 +5,7 @@ use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\JsonResource; -class ApiResource extends JsonResource -{ +class ApiResource extends JsonResource { /** * Transform the resource into an array. * @@ -14,8 +13,7 @@ class ApiResource extends JsonResource * * @return array */ - public function toArray($request) - { + public function toArray($request) { return parent::toArray($request); } } diff --git a/src/backend/app/Http/Resources/MeterResource.php b/src/backend/app/Http/Resources/MeterResource.php index 4eba9a77d..0b1202044 100644 --- a/src/backend/app/Http/Resources/MeterResource.php +++ b/src/backend/app/Http/Resources/MeterResource.php @@ -5,8 +5,7 @@ use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\JsonResource; -class MeterResource extends JsonResource -{ +class MeterResource extends JsonResource { /** * Transform the resource into an array. * @@ -14,8 +13,7 @@ class MeterResource extends JsonResource * * @return array */ - public function toArray($request) - { + public function toArray($request) { return parent::toArray($request); } } diff --git a/src/backend/app/Http/Resources/MeterTypeResource.php b/src/backend/app/Http/Resources/MeterTypeResource.php index 0f79f0186..51cd2eea4 100644 --- a/src/backend/app/Http/Resources/MeterTypeResource.php +++ b/src/backend/app/Http/Resources/MeterTypeResource.php @@ -5,8 +5,7 @@ use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\JsonResource; -class MeterTypeResource extends JsonResource -{ +class MeterTypeResource extends JsonResource { /** * Transform the resource into an array. * @@ -14,8 +13,7 @@ class MeterTypeResource extends JsonResource * * @return array */ - public function toArray($request) - { + public function toArray($request) { return parent::toArray($request); } } diff --git a/src/backend/app/Http/Resources/SmsSearchResultResource.php b/src/backend/app/Http/Resources/SmsSearchResultResource.php index 8080af841..cc773bbc2 100644 --- a/src/backend/app/Http/Resources/SmsSearchResultResource.php +++ b/src/backend/app/Http/Resources/SmsSearchResultResource.php @@ -12,15 +12,13 @@ * @property string $surname * @property Collection $addresses */ -class SmsSearchResultResource extends JsonResource -{ +class SmsSearchResultResource extends JsonResource { /** * Transform the resource into an array. * * @param Request $request */ - public function toArray($request): array - { + public function toArray($request): array { return [ 'id' => $this->id, 'display' => $this->name.' '.$this->surname, diff --git a/src/backend/app/Http/Resources/UserResource.php b/src/backend/app/Http/Resources/UserResource.php index 9aa7c241a..22155bb3d 100644 --- a/src/backend/app/Http/Resources/UserResource.php +++ b/src/backend/app/Http/Resources/UserResource.php @@ -5,8 +5,7 @@ use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\JsonResource; -class UserResource extends JsonResource -{ +class UserResource extends JsonResource { /** * Transform the resource into an array. * @@ -14,8 +13,7 @@ class UserResource extends JsonResource * * @return array */ - public function toArray($request) - { + public function toArray($request) { return parent::toArray($request); } } diff --git a/src/backend/app/Jobs/AbstractJob.php b/src/backend/app/Jobs/AbstractJob.php index f814d1fa0..7e33ba799 100644 --- a/src/backend/app/Jobs/AbstractJob.php +++ b/src/backend/app/Jobs/AbstractJob.php @@ -11,8 +11,7 @@ use Illuminate\Queue\SerializesModels; use MPM\DatabaseProxy\DatabaseProxyManagerService; -abstract class AbstractJob implements ShouldQueue -{ +abstract class AbstractJob implements ShouldQueue { use Dispatchable; use InteractsWithQueue; use Queueable; @@ -26,8 +25,7 @@ abstract class AbstractJob implements ShouldQueue abstract public function executeJob(); - public function __construct($jobName) - { + public function __construct($jobName) { $this->afterCommit = true; $this->companyId = app()->make(UserService::class)->getCompanyId(); @@ -41,8 +39,7 @@ public function __construct($jobName) ); } - public function handle() - { + public function handle() { $this->setJobUuid($this->job->uuid()); $databaseProxyManager = app()->make(DatabaseProxyManagerService::class); $databaseProxyManager->runForCompany($this->companyId, function () { @@ -52,20 +49,17 @@ public function handle() $this->setJobStatus(CompanyJob::STATUS_SUCCESS); } - public function failed(?\Throwable $t = null) - { + public function failed(?\Throwable $t = null) { $trace = $t !== null ? explode('#15', $t->getTraceAsString(), 1000)[0] : null; $this->setJobStatus(CompanyJob::STATUS_FAILED, $t?->getMessage(), $trace); } - protected function setJobUuid($jobUuid) - { + protected function setJobUuid($jobUuid) { $this->companyJob->job_uuid = $jobUuid; $this->companyJob->save(); } - protected function setJobStatus($status, ?string $message = null, ?string $trace = null) - { + protected function setJobStatus($status, ?string $message = null, ?string $trace = null) { $this->companyJob->status = $status; $this->companyJob->message = $message; $this->companyJob->trace = $trace; diff --git a/src/backend/app/Jobs/ApplianceTransactionProcessor.php b/src/backend/app/Jobs/ApplianceTransactionProcessor.php index 030a8c5f9..ce8b483bd 100644 --- a/src/backend/app/Jobs/ApplianceTransactionProcessor.php +++ b/src/backend/app/Jobs/ApplianceTransactionProcessor.php @@ -8,14 +8,12 @@ use App\Models\Transaction\Transaction; use Illuminate\Support\Facades\Log; -class ApplianceTransactionProcessor extends AbstractJob -{ +class ApplianceTransactionProcessor extends AbstractJob { private Transaction $transaction; protected const TYPE = 'deferred_payment'; - public function __construct(private int $transactionId) - { + public function __construct(private int $transactionId) { $this->afterCommit = true; parent::__construct(get_class($this)); } @@ -23,8 +21,7 @@ public function __construct(private int $transactionId) /** * @throws TransactionNotInitializedException */ - public function executeJob() - { + public function executeJob() { $this->initializeTransaction(); $container = $this->initializeTransactionDataContainer(); @@ -38,15 +35,13 @@ public function executeJob() } } - private function initializeTransaction() - { + private function initializeTransaction() { $this->transaction = Transaction::query()->find($this->transactionId); $this->transaction->type = 'deferred_payment'; $this->transaction->save(); } - private function initializeTransactionDataContainer(): TransactionDataContainer - { + private function initializeTransactionDataContainer(): TransactionDataContainer { try { return TransactionDataContainer::initialize($this->transaction); } catch (\Exception $e) { @@ -55,16 +50,14 @@ private function initializeTransactionDataContainer(): TransactionDataContainer } } - private function checkForMinimumPurchaseAmount(TransactionDataContainer $container): void - { + private function checkForMinimumPurchaseAmount(TransactionDataContainer $container): void { $minimumPurchaseAmount = $container->installmentCost; if ($container->amount < $minimumPurchaseAmount) { throw new TransactionAmountNotEnoughException("Minimum purchase amount not reached for {$container->device->device_serial}"); } } - private function payApplianceInstallments(TransactionDataContainer $container): TransactionDataContainer - { + private function payApplianceInstallments(TransactionDataContainer $container): TransactionDataContainer { $applianceInstallmentPayer = resolve('ApplianceInstallmentPayer'); $applianceInstallmentPayer->initialize($container); $applianceInstallmentPayer->payInstallmentsForDevice($container); @@ -73,8 +66,7 @@ private function payApplianceInstallments(TransactionDataContainer $container): return $container; } - private function processToken(TransactionDataContainer $transactionData): void - { + private function processToken(TransactionDataContainer $transactionData): void { $kWhToBeCharged = 0.0; $transactionData->chargedEnergy = round($kWhToBeCharged, 1); diff --git a/src/backend/app/Jobs/CreatePiggyBankEntry.php b/src/backend/app/Jobs/CreatePiggyBankEntry.php index 7cdb3d95e..5b93be0fa 100644 --- a/src/backend/app/Jobs/CreatePiggyBankEntry.php +++ b/src/backend/app/Jobs/CreatePiggyBankEntry.php @@ -4,15 +4,12 @@ use App\Models\Meter\MeterParameter; -class CreatePiggyBankEntry extends AbstractJob -{ - public function __construct(private MeterParameter $meterParameter) - { +class CreatePiggyBankEntry extends AbstractJob { + public function __construct(private MeterParameter $meterParameter) { parent::__construct(get_class($this)); } - public function executeJob() - { + public function executeJob() { if ($socialTariff = $this->meterParameter->tariff()->first()->socialTariff) { $this->meterParameter->socialTariffPiggyBank()->create( [ diff --git a/src/backend/app/Jobs/EnergyTransactionProcessor.php b/src/backend/app/Jobs/EnergyTransactionProcessor.php index 4f8cb3be7..020213ce4 100644 --- a/src/backend/app/Jobs/EnergyTransactionProcessor.php +++ b/src/backend/app/Jobs/EnergyTransactionProcessor.php @@ -8,14 +8,12 @@ use App\Models\Transaction\Transaction; use Illuminate\Support\Facades\Log; -class EnergyTransactionProcessor extends AbstractJob -{ +class EnergyTransactionProcessor extends AbstractJob { private Transaction $transaction; protected const TYPE = 'energy'; - public function __construct(private $transactionId) - { + public function __construct(private $transactionId) { $this->afterCommit = true; parent::__construct(get_class($this)); } @@ -27,8 +25,7 @@ public function __construct(private $transactionId) * * @throws TransactionNotInitializedException */ - public function executeJob() - { + public function executeJob() { $this->initializeTransaction(); $container = $this->initializeTransactionDataContainer(); @@ -48,15 +45,13 @@ public function executeJob() } } - private function initializeTransaction() - { + private function initializeTransaction() { $this->transaction = Transaction::query()->find($this->transactionId); $this->transaction->type = 'energy'; $this->transaction->save(); } - private function initializeTransactionDataContainer(): TransactionDataContainer - { + private function initializeTransactionDataContainer(): TransactionDataContainer { try { return TransactionDataContainer::initialize($this->transaction); } catch (\Exception $e) { @@ -65,8 +60,7 @@ private function initializeTransactionDataContainer(): TransactionDataContainer } } - private function checkForMinimumPurchaseAmount(TransactionDataContainer $transactionData): void - { + private function checkForMinimumPurchaseAmount(TransactionDataContainer $transactionData): void { $minimumPurchaseAmount = $this->getTariffMinimumPurchaseAmount($transactionData); if ($minimumPurchaseAmount > 0) { @@ -81,8 +75,7 @@ private function checkForMinimumPurchaseAmount(TransactionDataContainer $transac } } - private function payApplianceInstallments(TransactionDataContainer $container): TransactionDataContainer - { + private function payApplianceInstallments(TransactionDataContainer $container): TransactionDataContainer { $applianceInstallmentPayer = resolve('ApplianceInstallmentPayer'); $applianceInstallmentPayer->initialize($container); $container->transaction->amount = $applianceInstallmentPayer->payInstallments(); @@ -92,8 +85,7 @@ private function payApplianceInstallments(TransactionDataContainer $container): return $container; } - private function payAccessRateIfExists(TransactionDataContainer $transactionData): TransactionDataContainer - { + private function payAccessRateIfExists(TransactionDataContainer $transactionData): TransactionDataContainer { if ($transactionData->transaction->amount > 0) { // pay if necessary access rate $accessRatePayer = resolve('AccessRatePayer'); @@ -104,13 +96,11 @@ private function payAccessRateIfExists(TransactionDataContainer $transactionData return $transactionData; } - private function completeTransactionWithNotification(TransactionDataContainer $transactionData): void - { + private function completeTransactionWithNotification(TransactionDataContainer $transactionData): void { event('transaction.successful', [$transactionData->transaction]); } - private function processToken(TransactionDataContainer $transactionData): void - { + private function processToken(TransactionDataContainer $transactionData): void { $kWhToBeCharged = 0.0; $transactionData->chargedEnergy = round($kWhToBeCharged, 1); @@ -119,8 +109,7 @@ private function processToken(TransactionDataContainer $transactionData): void ->onQueue(config('services.queues.token')); } - private function getTariffMinimumPurchaseAmount($transactionData) - { + private function getTariffMinimumPurchaseAmount($transactionData) { return $transactionData->tariff->minimum_purchase_amount; } } diff --git a/src/backend/app/Jobs/HearthBeat.php b/src/backend/app/Jobs/HearthBeat.php index fae5b6fd3..74d7f71a8 100644 --- a/src/backend/app/Jobs/HearthBeat.php +++ b/src/backend/app/Jobs/HearthBeat.php @@ -9,8 +9,7 @@ use Illuminate\Queue\SerializesModels; use Illuminate\Support\Facades\Log; -class HearthBeat implements ShouldQueue -{ +class HearthBeat implements ShouldQueue { use Dispatchable; use InteractsWithQueue; use Queueable; @@ -21,17 +20,14 @@ class HearthBeat implements ShouldQueue * * @return void */ - public function __construct() - { - } + public function __construct() {} /** * Execute the job. * * @return void */ - public function handle() - { + public function handle() { Log::critical('I\'m alive'); } } diff --git a/src/backend/app/Jobs/MeterReader.php b/src/backend/app/Jobs/MeterReader.php index 97e9adeac..1f6935b54 100644 --- a/src/backend/app/Jobs/MeterReader.php +++ b/src/backend/app/Jobs/MeterReader.php @@ -9,8 +9,7 @@ use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\SerializesModels; -class MeterReader extends AbstractJob -{ +class MeterReader extends AbstractJob { use Dispatchable; use InteractsWithQueue; use Queueable; @@ -29,8 +28,7 @@ class MeterReader extends AbstractJob /** * Create a new job instance. */ - public function __construct(CalinReadMeter $meterReader, Meter $meters) - { + public function __construct(CalinReadMeter $meterReader, Meter $meters) { $this->meterReader = $meterReader; $this->meters = $meters; parent::__construct(get_class($this)); @@ -39,8 +37,7 @@ public function __construct(CalinReadMeter $meterReader, Meter $meters) /** * Execute the job. */ - public function executeJob(): void - { + public function executeJob(): void { $this->meterReader->readBatch($this->meters->get(), $this->meterReader::READ_DAILY, ['date' => date('Y-m-d')]); } } diff --git a/src/backend/app/Jobs/ProcessPayment.php b/src/backend/app/Jobs/ProcessPayment.php index 2b2960a66..14b252407 100644 --- a/src/backend/app/Jobs/ProcessPayment.php +++ b/src/backend/app/Jobs/ProcessPayment.php @@ -9,8 +9,7 @@ use Illuminate\Queue\SerializesModels; use MPM\Transaction\TransactionPaymentProcessor; -class ProcessPayment extends AbstractJob -{ +class ProcessPayment extends AbstractJob { use Dispatchable; use InteractsWithQueue; use Queueable; @@ -26,8 +25,7 @@ class ProcessPayment extends AbstractJob * * @param int $transaction_id */ - public function __construct(int $transactionId) - { + public function __construct(int $transactionId) { $this->transactionId = $transactionId; parent::__construct(get_class($this)); @@ -36,8 +34,7 @@ public function __construct(int $transactionId) /** * Execute the job. */ - public function executeJob(): void - { + public function executeJob(): void { TransactionPaymentProcessor::process($this->transactionId); } } diff --git a/src/backend/app/Jobs/SmsLoadBalancer.php b/src/backend/app/Jobs/SmsLoadBalancer.php index 724b21531..8cb1cdb7a 100644 --- a/src/backend/app/Jobs/SmsLoadBalancer.php +++ b/src/backend/app/Jobs/SmsLoadBalancer.php @@ -10,8 +10,7 @@ use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Redis; -class SmsLoadBalancer extends AbstractJob -{ +class SmsLoadBalancer extends AbstractJob { use Dispatchable; use InteractsWithQueue; use Queueable; @@ -25,14 +24,12 @@ class SmsLoadBalancer extends AbstractJob public $smsBody; - public function __construct($smsBody) - { + public function __construct($smsBody) { $this->smsBody = $smsBody; parent::__construct(get_class($this)); } - public function executeJob(): void - { + public function executeJob(): void { Redis::throttle('smsgateway')->allow(10)->every(1)->block(1)->then( function () { $fireBaseResult = $this->sendSms($this->smsBody); @@ -44,8 +41,7 @@ function () { ); } - private function sendSms($data): string - { + private function sendSms($data): string { $smsCollection = collect($data); $smsCollection = $smsCollection->chunk(3); $httpClient = new Client(); diff --git a/src/backend/app/Jobs/SmsProcessor.php b/src/backend/app/Jobs/SmsProcessor.php index 17c1f848d..cc93c8c1f 100644 --- a/src/backend/app/Jobs/SmsProcessor.php +++ b/src/backend/app/Jobs/SmsProcessor.php @@ -12,8 +12,7 @@ use Illuminate\Queue\SerializesModels; use Illuminate\Support\Facades\Log; -class SmsProcessor extends AbstractJob -{ +class SmsProcessor extends AbstractJob { use Dispatchable; use InteractsWithQueue; use Queueable; @@ -26,8 +25,7 @@ class SmsProcessor extends AbstractJob * @param int $smsType * @param $smsConfigs */ - public function __construct(private SmsSender $smsSender) - { + public function __construct(private SmsSender $smsSender) { parent::__construct(get_class($this)); } @@ -36,8 +34,7 @@ public function __construct(private SmsSender $smsSender) * * @return void */ - public function executeJob() - { + public function executeJob() { try { $this->smsSender->sendSms(); } catch (SmsTypeNotFoundException|SmsAndroidSettingNotExistingException|SmsBodyParserNotExtendedException $exception) { diff --git a/src/backend/app/Jobs/SocialTariffPiggyBankManager.php b/src/backend/app/Jobs/SocialTariffPiggyBankManager.php index 6f45c7fd4..fe0215d91 100644 --- a/src/backend/app/Jobs/SocialTariffPiggyBankManager.php +++ b/src/backend/app/Jobs/SocialTariffPiggyBankManager.php @@ -9,8 +9,7 @@ use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\SerializesModels; -class SocialTariffPiggyBankManager extends AbstractJob -{ +class SocialTariffPiggyBankManager extends AbstractJob { use Dispatchable; use InteractsWithQueue; use Queueable; @@ -21,8 +20,7 @@ class SocialTariffPiggyBankManager extends AbstractJob * * @return void */ - public function __construct() - { + public function __construct() { parent::__construct(get_class($this)); } @@ -31,8 +29,7 @@ public function __construct() * * @return void */ - public function executeJob() - { + public function executeJob() { // get all social tariffs $socialTariffs = SocialTariff::all(); @@ -41,8 +38,7 @@ public function executeJob() } } - private function chargeClients(SocialTariff $socialTariff): void - { + private function chargeClients(SocialTariff $socialTariff): void { SocialTariffPiggyBank::query()-> where('social_tariff_id', $socialTariff->id) ->where('savings', '<=', $socialTariff->maximum_stacked_energy) diff --git a/src/backend/app/Jobs/TokenProcessor.php b/src/backend/app/Jobs/TokenProcessor.php index 96b363b38..7eb9c2958 100644 --- a/src/backend/app/Jobs/TokenProcessor.php +++ b/src/backend/app/Jobs/TokenProcessor.php @@ -11,8 +11,7 @@ use Illuminate\Queue\SerializesModels; use Illuminate\Support\Facades\Log; -class TokenProcessor extends AbstractJob -{ +class TokenProcessor extends AbstractJob { use Dispatchable; use InteractsWithQueue; use Queueable; @@ -37,8 +36,7 @@ public function __construct( parent::__construct(static::class); } - public function executeJob(): void - { + public function executeJob(): void { try { $api = resolve($this->transactionContainer->manufacturer->api_name); } catch (\Exception $e) { @@ -57,8 +55,7 @@ public function executeJob(): void } } - private function handleApiException(\Exception $e): void - { + private function handleApiException(\Exception $e): void { Log::critical( 'No Api is registered for '.$this->transactionContainer->manufacturer->name, ['message' => $e->getMessage()] @@ -66,8 +63,7 @@ private function handleApiException(\Exception $e): void event('transaction.failed', [$this->transactionContainer->transaction, $e->getMessage()]); } - private function handleExistingToken() - { + private function handleExistingToken() { $token = $this->transactionContainer->transaction->token()->first(); if ($token !== null && $this->reCreate === true) { @@ -78,8 +74,7 @@ private function handleExistingToken() return $token; } - private function generateToken($api): void - { + private function generateToken($api): void { try { $tokenData = $api->chargeDevice($this->transactionContainer); } catch (\Exception $e) { @@ -91,8 +86,7 @@ private function generateToken($api): void $this->saveToken($tokenData); } - private function handleTokenGenerationFailure(\Exception $e): void - { + private function handleTokenGenerationFailure(\Exception $e): void { if ($this->counter < self::MAX_TRIES) { $this->retryTokenGeneration(); @@ -112,8 +106,7 @@ private function handleTokenGenerationFailure(\Exception $e): void ]); } - private function retryTokenGeneration(): void - { + private function retryTokenGeneration(): void { ++$this->counter; self::dispatch( $this->transactionContainer, @@ -122,8 +115,7 @@ private function retryTokenGeneration(): void )->allOnConnection('redis')->onQueue(config('services.queues.token'))->delay(5); } - private function saveToken(array $tokenData): void - { + private function saveToken(array $tokenData): void { $token = Token::query()->make(['token' => $tokenData['token'], 'load' => $tokenData['load']]); $token->transaction()->associate($this->transactionContainer->transaction); $token->save(); @@ -131,8 +123,7 @@ private function saveToken(array $tokenData): void $this->handlePaymentEvents($token); } - private function handlePaymentEvents($token): void - { + private function handlePaymentEvents($token): void { $owner = $this->transactionContainer->device->person; event('payment.successful', [ @@ -148,8 +139,7 @@ private function handlePaymentEvents($token): void event('transaction.successful', [$this->transactionContainer->transaction]); } - private function handleRollbackInFailure() - { + private function handleRollbackInFailure() { $paidRates = $this->transactionContainer->paidRates; collect($paidRates)->map(function ($paidRate) { $assetRate = AssetRate::query()->find($paidRate['asset_rate_id']); diff --git a/src/backend/app/Jobs/UpdatePiggyBankEntry.php b/src/backend/app/Jobs/UpdatePiggyBankEntry.php index 2365c996a..2fa17662a 100644 --- a/src/backend/app/Jobs/UpdatePiggyBankEntry.php +++ b/src/backend/app/Jobs/UpdatePiggyBankEntry.php @@ -8,8 +8,7 @@ use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\SerializesModels; -class UpdatePiggyBankEntry extends AbstractJob -{ +class UpdatePiggyBankEntry extends AbstractJob { use Dispatchable; use InteractsWithQueue; use Queueable; @@ -25,8 +24,7 @@ class UpdatePiggyBankEntry extends AbstractJob * * @return void */ - public function __construct(MeterParameter $meterParameter) - { + public function __construct(MeterParameter $meterParameter) { $this->meterParameter = $meterParameter; parent::__construct(get_class($this)); } @@ -36,8 +34,7 @@ public function __construct(MeterParameter $meterParameter) * * @return void */ - public function executeJob() - { + public function executeJob() { $socialTariff = $this->meterParameter->tariff()->first()->socialTariff; if (!$socialTariff) { echo "meter has no social tariff should be deleted \n"; diff --git a/src/backend/app/Lib/IManufacturerAPI.php b/src/backend/app/Lib/IManufacturerAPI.php index 09394b7d5..4dd77c5e6 100644 --- a/src/backend/app/Lib/IManufacturerAPI.php +++ b/src/backend/app/Lib/IManufacturerAPI.php @@ -5,8 +5,7 @@ use App\Misc\TransactionDataContainer; use App\Models\Device; -interface IManufacturerAPI -{ +interface IManufacturerAPI { public function chargeDevice(TransactionDataContainer $transactionContainer): array; public function clearDevice(Device $device); diff --git a/src/backend/app/Lib/IMeterReader.php b/src/backend/app/Lib/IMeterReader.php index eb0b9c614..43f526af2 100644 --- a/src/backend/app/Lib/IMeterReader.php +++ b/src/backend/app/Lib/IMeterReader.php @@ -2,8 +2,7 @@ namespace App\Lib; -interface IMeterReader -{ +interface IMeterReader { /** * Reads the data for a single meter. * diff --git a/src/backend/app/Lib/ISmsProvider.php b/src/backend/app/Lib/ISmsProvider.php index bf8455769..909b69dca 100644 --- a/src/backend/app/Lib/ISmsProvider.php +++ b/src/backend/app/Lib/ISmsProvider.php @@ -4,8 +4,7 @@ use App\Models\SmsAndroidSetting; -interface ISmsProvider -{ +interface ISmsProvider { /** * Sends the sms to the sms provider. * diff --git a/src/backend/app/Lib/ITransaction.php b/src/backend/app/Lib/ITransaction.php index 7359ddca2..c985765a2 100644 --- a/src/backend/app/Lib/ITransaction.php +++ b/src/backend/app/Lib/ITransaction.php @@ -2,8 +2,7 @@ namespace App\Lib; -interface ITransaction -{ +interface ITransaction { public function getAmount(); public function getSender(); diff --git a/src/backend/app/Listeners/AccessRateListener.php b/src/backend/app/Listeners/AccessRateListener.php index e417d5534..4bd85edf8 100644 --- a/src/backend/app/Listeners/AccessRateListener.php +++ b/src/backend/app/Listeners/AccessRateListener.php @@ -9,10 +9,8 @@ use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Log; -class AccessRateListener -{ - public function initializeAccessRatePayment(Meter $meter): void - { +class AccessRateListener { + public function initializeAccessRatePayment(Meter $meter): void { try { $accessRate = $meter->tariff()->first()->accessRate; if (!$accessRate) { @@ -29,8 +27,7 @@ public function initializeAccessRatePayment(Meter $meter): void } } - public function subscribe(Dispatcher $events): void - { + public function subscribe(Dispatcher $events): void { $events->listen( 'accessRatePayment.initialize', '\App\Listeners\AccessRateListener@initializeAccessRatePayment' diff --git a/src/backend/app/Listeners/ClusterGeoListener.php b/src/backend/app/Listeners/ClusterGeoListener.php index 5b2a8f4e7..c659aeca5 100644 --- a/src/backend/app/Listeners/ClusterGeoListener.php +++ b/src/backend/app/Listeners/ClusterGeoListener.php @@ -9,13 +9,11 @@ use Illuminate\Support\Facades\Storage; use Mockery\Exception; -class ClusterGeoListener -{ +class ClusterGeoListener { /** * Handle the event. */ - public function handle(ClusterEvent $event): void - { + public function handle(ClusterEvent $event): void { $cluster = $event->cluster; $type = $event->type; if ($type === 'external') { @@ -45,8 +43,7 @@ public function handle(ClusterEvent $event): void /** * Creates a json file which has the same name as the cluster. */ - private function storeData(Cluster $cluster, $data): void - { + private function storeData(Cluster $cluster, $data): void { Storage::disk('local')->put($cluster->name.'.json', json_encode($data)); } @@ -59,8 +56,7 @@ private function storeData(Cluster $cluster, $data): void * * @psalm-return list */ - public function reformatExternalData($data): array - { + public function reformatExternalData($data): array { $formatted = []; if (is_array($data) && !array_key_exists('geojson', $data)) { $data = $data[0]; diff --git a/src/backend/app/Listeners/HistoryListener.php b/src/backend/app/Listeners/HistoryListener.php index 0c35e74c4..47e011f95 100644 --- a/src/backend/app/Listeners/HistoryListener.php +++ b/src/backend/app/Listeners/HistoryListener.php @@ -7,8 +7,7 @@ use Illuminate\Events\Dispatcher; use Illuminate\Support\Facades\Log; -class HistoryListener -{ +class HistoryListener { /** * @var History */ @@ -17,8 +16,7 @@ class HistoryListener /** * Create the event listener. */ - public function __construct(History $historyModel) - { + public function __construct(History $historyModel) { $this->historyModel = $historyModel; } @@ -28,8 +26,7 @@ public function __construct(History $historyModel) * @param mixed $data is an object which should be stored on the histories table * @param string $content the stringified message about the entry */ - public function save($data, string $content, string $type, ?string $field): void - { + public function save($data, string $content, string $type, ?string $field): void { $this->historyModel->target()->associate($data); $this->historyModel->content = $content; $this->historyModel->action = $type; @@ -39,8 +36,7 @@ public function save($data, string $content, string $type, ?string $field): void broadcast(new HistoryEvent($this->historyModel)); } - public function subscribe(Dispatcher $events): void - { + public function subscribe(Dispatcher $events): void { $events->listen('history.create', 'App\Listeners\HistoryListener@save'); $events->listen( 'history.hearth.beat', diff --git a/src/backend/app/Listeners/LogListener.php b/src/backend/app/Listeners/LogListener.php index 1bb19bdb1..8f740c986 100644 --- a/src/backend/app/Listeners/LogListener.php +++ b/src/backend/app/Listeners/LogListener.php @@ -5,20 +5,17 @@ use App\Models\Log; use Illuminate\Events\Dispatcher; -class LogListener -{ +class LogListener { /** * @var Log */ private $log; - public function __construct(Log $log) - { + public function __construct(Log $log) { $this->log = $log; } - public function storeLog($logData): void - { + public function storeLog($logData): void { $this->log->user_id = $logData['user_id']; $this->log->affected()->associate($logData['affected']); $this->log->action = $logData['action']; @@ -26,8 +23,7 @@ public function storeLog($logData): void $this->log->save(); } - public function subscribe(Dispatcher $event): void - { + public function subscribe(Dispatcher $event): void { $event->listen('new.log', '\App\Listeners\LogListener@storeLog'); } } diff --git a/src/backend/app/Listeners/MeterListener.php b/src/backend/app/Listeners/MeterListener.php index 94e9c6122..a1ed969d6 100644 --- a/src/backend/app/Listeners/MeterListener.php +++ b/src/backend/app/Listeners/MeterListener.php @@ -5,18 +5,15 @@ use Illuminate\Events\Dispatcher; use Illuminate\Support\Facades\Log; -class MeterListener -{ +class MeterListener { /** * Sets the in_use to true. */ - public function onParameterSaved(int $meter_id): void - { + public function onParameterSaved(int $meter_id): void { Log::debug('listener Core', []); } - public function subscribe(Dispatcher $events): void - { + public function subscribe(Dispatcher $events): void { $events->listen('meterparameter.saved', 'App\Listeners\MeterListener@onParameterSaved'); } } diff --git a/src/backend/app/Listeners/PaymentListener.php b/src/backend/app/Listeners/PaymentListener.php index 45c7b41b9..df9325e55 100644 --- a/src/backend/app/Listeners/PaymentListener.php +++ b/src/backend/app/Listeners/PaymentListener.php @@ -17,19 +17,16 @@ use Illuminate\Support\Facades\Log; use MPM\Transaction\Provider\ITransactionProvider; -class PaymentListener -{ +class PaymentListener { public function __construct( private PaymentHistoryService $paymentHistoryService, private PersonPaymentHistoryService $personPaymentHistoryService, private ApplianceRatePaymentHistoryService $applianceRatePaymentHistoryService, private AccessRatePaymentHistoryService $accessRatePaymentHistoryService, private TransactionPaymentHistoryService $transactionPaymentHistoryService, - ) { - } + ) {} - public function onEnergyPayment(ITransactionProvider $transactionProvider): void - { + public function onEnergyPayment(ITransactionProvider $transactionProvider): void { $transaction = $transactionProvider->getTransaction(); // get meter preferences try { @@ -40,12 +37,9 @@ public function onEnergyPayment(ITransactionProvider $transactionProvider): void } } - public function onLoanPayment(string $customer_id, int $amount): void - { - } + public function onLoanPayment(string $customer_id, int $amount): void {} - public function onPaymentFailed(): void - { + public function onPaymentFailed(): void { Log::debug('payment failed event'); } @@ -104,8 +98,7 @@ public function onPaymentSuccess( $this->paymentHistoryService->save($paymentHistory); } - public function subscribe(Dispatcher $events): void - { + public function subscribe(Dispatcher $events): void { $events->listen('payment.energy', 'App\Listeners\PaymentListener@onEnergyPayment'); $events->listen('payment.failed', 'App\Listeners\PaymentListener@onPaymentFailed'); $events->listen('payment.successful', 'App\Listeners\PaymentListener@onPaymentSuccess'); diff --git a/src/backend/app/Listeners/PaymentPeriodListener.php b/src/backend/app/Listeners/PaymentPeriodListener.php index ebd2d3e93..e2d69cd54 100644 --- a/src/backend/app/Listeners/PaymentPeriodListener.php +++ b/src/backend/app/Listeners/PaymentPeriodListener.php @@ -9,8 +9,7 @@ use Illuminate\Events\Dispatcher; use Illuminate\Support\Facades\Log; -class PaymentPeriodListener -{ +class PaymentPeriodListener { /** * @var PaymentProfile */ @@ -24,14 +23,12 @@ class PaymentPeriodListener /** * Create the event listener. */ - public function __construct(PaymentProfile $paymentProfile, PaymentHistory $history) - { + public function __construct(PaymentProfile $paymentProfile, PaymentHistory $history) { $this->paymentProfile = $paymentProfile; $this->history = $history; } - public function recalculate(Person $person): void - { + public function recalculate(Person $person): void { $transactions = $person->payments() ->with('transaction') ->latest()->take(10) @@ -50,8 +47,7 @@ public function recalculate(Person $person): void // $this->history-> } - public function subscribe(Dispatcher $events): void - { + public function subscribe(Dispatcher $events): void { $events->listen('payment.period.recalculate', '\App\Listeners\PaymentPeriodListener@recalculate'); } } diff --git a/src/backend/app/Listeners/SmsListener.php b/src/backend/app/Listeners/SmsListener.php index eceab931d..4ef9bda51 100644 --- a/src/backend/app/Listeners/SmsListener.php +++ b/src/backend/app/Listeners/SmsListener.php @@ -10,8 +10,7 @@ use Illuminate\Database\Eloquent\ModelNotFoundException; use Illuminate\Events\Dispatcher; -class SmsListener -{ +class SmsListener { private $smsResendInformationKeyService; private $transaction; @@ -28,8 +27,7 @@ public function __construct( $this->smsService = $smsService; } - public function onSmsStored($sender, $message) - { + public function onSmsStored($sender, $message) { $resendInformationKey = $this->smsResendInformationKeyService->getResendInformationKeys()->first(); if (!$resendInformationKey) { return; @@ -53,8 +51,7 @@ public function onSmsStored($sender, $message) } } - public function subscribe(Dispatcher $events) - { + public function subscribe(Dispatcher $events) { $events->listen('sms.stored', 'App\Listeners\SmsListener@onSmsStored'); } } diff --git a/src/backend/app/Listeners/SoldApplianceListener.php b/src/backend/app/Listeners/SoldApplianceListener.php index 3d2b619dd..5343b8195 100644 --- a/src/backend/app/Listeners/SoldApplianceListener.php +++ b/src/backend/app/Listeners/SoldApplianceListener.php @@ -7,16 +7,13 @@ use App\Services\PersonService; use Illuminate\Events\Dispatcher; -class SoldApplianceListener -{ +class SoldApplianceListener { public function __construct( private ApplianceRateService $applianceRateService, private PersonService $personService, - ) { - } + ) {} - public function initializeApplianceRates(SoldApplianceDataContainer $soldAppliance): void - { + public function initializeApplianceRates(SoldApplianceDataContainer $soldAppliance): void { $assetPerson = $soldAppliance->getAssetPerson(); $assetType = $soldAppliance->getAssetType(); $transaction = $soldAppliance->getTransaction(); @@ -42,8 +39,7 @@ public function initializeApplianceRates(SoldApplianceDataContainer $soldApplian } } - public function subscribe(Dispatcher $events): void - { + public function subscribe(Dispatcher $events): void { $events->listen('appliance.sold', 'App\Listeners\SoldApplianceListener@initializeApplianceRates'); } } diff --git a/src/backend/app/Listeners/TokenListener.php b/src/backend/app/Listeners/TokenListener.php index 199c70b20..0663852ef 100644 --- a/src/backend/app/Listeners/TokenListener.php +++ b/src/backend/app/Listeners/TokenListener.php @@ -10,8 +10,7 @@ use Illuminate\Events\Dispatcher; use Illuminate\Support\Facades\Log; -class TokenListener -{ +class TokenListener { private $token; protected $tokenData; @@ -21,13 +20,11 @@ class TokenListener * * @return void */ - public function __construct(MeterToken $token) - { + public function __construct(MeterToken $token) { $this->token = $token; } - public function generateToken(TransactionDataContainer $transactionContainer): void - { + public function generateToken(TransactionDataContainer $transactionContainer): void { $api = null; // get Manufacturer APi try { @@ -87,8 +84,7 @@ public function generateToken(TransactionDataContainer $transactionContainer): v ); } - public function subscribe(Dispatcher $events): void - { + public function subscribe(Dispatcher $events): void { $events->listen('token.generate', '\App\Listeners\TokenListener@generateToken'); } } diff --git a/src/backend/app/Listeners/TransactionListener.php b/src/backend/app/Listeners/TransactionListener.php index 398745fb4..05db61309 100644 --- a/src/backend/app/Listeners/TransactionListener.php +++ b/src/backend/app/Listeners/TransactionListener.php @@ -7,29 +7,24 @@ use MPM\Transaction\Provider\ITransactionProvider; use MPM\Transaction\Provider\TransactionAdapter; -class TransactionListener -{ - public function onTransactionSaved(ITransactionProvider $transactionProvider): void - { +class TransactionListener { + public function onTransactionSaved(ITransactionProvider $transactionProvider): void { // echos the confirmation output $transactionProvider->confirm(); } - public function onTransactionFailed(Transaction $transaction, $message = null): void - { + public function onTransactionFailed(Transaction $transaction, $message = null): void { $baseTransaction = TransactionAdapter::getTransaction($transaction->originalTransaction()->first()); $baseTransaction->addConflict($message); $baseTransaction->sendResult(false, $transaction); } - public function onTransactionSuccess(Transaction $transaction): void - { + public function onTransactionSuccess(Transaction $transaction): void { $baseTransaction = TransactionAdapter::getTransaction($transaction->originalTransaction()->first()); $baseTransaction->sendResult(true, $transaction); } - public function subscribe(Dispatcher $events): void - { + public function subscribe(Dispatcher $events): void { $events->listen('transaction.saved', 'App\Listeners\TransactionListener@onTransactionSaved'); $events->listen('transaction.successful', 'App\Listeners\TransactionListener@onTransactionSuccess'); $events->listen('transaction.failed', 'App\Listeners\TransactionListener@onTransactionFailed'); diff --git a/src/backend/app/ManufacturerApi/CalinReadMeter.php b/src/backend/app/ManufacturerApi/CalinReadMeter.php index 95c1af3a2..3213eeb23 100644 --- a/src/backend/app/ManufacturerApi/CalinReadMeter.php +++ b/src/backend/app/ManufacturerApi/CalinReadMeter.php @@ -8,8 +8,7 @@ use Carbon\Exceptions\InvalidDateException; use Illuminate\Support\Facades\Log; -class CalinReadMeter implements IMeterReader -{ +class CalinReadMeter implements IMeterReader { public const READ_DAILY = 1; /** @@ -27,8 +26,7 @@ class CalinReadMeter implements IMeterReader * * @throws \SoapFault */ - public function __construct(MeterConsumption $consumption) - { + public function __construct(MeterConsumption $consumption) { try { $this->api = new \SoapClient(\config('services.calin.meter.api'), ['keep_alive' => false]); } catch (\Exception $exception) { @@ -42,8 +40,7 @@ public function __construct(MeterConsumption $consumption) * * @return mixed */ - public function readDailyData($meterId, $date) - { + public function readDailyData($meterId, $date) { if ($this->api === null) { return; } @@ -61,9 +58,7 @@ public function readDailyData($meterId, $date) * * @return void */ - public function readMeter($meterId, $type) - { - } + public function readMeter($meterId, $type) {} /** * Reads the data for a given meter list. @@ -73,8 +68,7 @@ public function readMeter($meterId, $type) * * @return void */ - public function readBatch($meterList, $type, $options) - { + public function readBatch($meterList, $type, $options) { if ($type === self::READ_DAILY) { if (!isset($options['date'])) { throw new InvalidDateException('Date', 'date is not set. Send date within the options array'); @@ -116,8 +110,7 @@ public function readBatch($meterList, $type, $options) /** * Calculates the difference of usages with the prev. reading. */ - private function calculateDifference(MeterConsumption $consumption): MeterConsumption - { + private function calculateDifference(MeterConsumption $consumption): MeterConsumption { $prevReading = $this->consumption->where('meter_id', $consumption->meter_id)->latest()->first(); if ($prevReading !== null) { $consumption->consumption = $consumption->total_consumption - $prevReading->total_consumption; @@ -135,8 +128,7 @@ private function calculateDifference(MeterConsumption $consumption): MeterConsum * * @psalm-return non-empty-list */ - private function fetchResponseData($data): array - { + private function fetchResponseData($data): array { $out = []; /*fetch information out of the response. successful response : 00^total_power,rest_energy @@ -154,8 +146,7 @@ private function fetchResponseData($data): array * * @return array (\Illuminate\Config\Repository|float|mixed)[] */ - private function prepareDailyReq(string $meterId, string $year, string $month, string $day, $action = 'Read'): array - { + private function prepareDailyReq(string $meterId, string $year, string $month, string $day, $action = 'Read'): array { [$t1, $t2] = explode(' ', microtime()); $timestamp = (float) sprintf('%.0f', ((float) $t1 + (float) $t2) * 1000); @@ -173,8 +164,7 @@ private function prepareDailyReq(string $meterId, string $year, string $month, s return $params; } - private function generateCipher($meterId, float $timestamp, $dataWay): string - { + private function generateCipher($meterId, float $timestamp, $dataWay): string { return md5( sprintf( '%s%s%s%s%s', diff --git a/src/backend/app/Misc/LoanDataContainer.php b/src/backend/app/Misc/LoanDataContainer.php index 2ad41fab4..e4967d223 100644 --- a/src/backend/app/Misc/LoanDataContainer.php +++ b/src/backend/app/Misc/LoanDataContainer.php @@ -14,21 +14,18 @@ use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\ModelNotFoundException; -class LoanDataContainer -{ +class LoanDataContainer { private ?Person $meterOwner; private Transaction $transaction; public array $paid_rates = []; - public function initialize(Transaction $transaction): void - { + public function initialize(Transaction $transaction): void { $this->meterOwner = $this->getMeterOwner($transaction->message); } - public function loanCost() - { + public function loanCost() { if (!$this->meterOwner) { throw new MeterParameterNotFound('loan data container'); } @@ -92,8 +89,7 @@ public function loanCost() * * @psalm-return Collection|array */ - private function getCustomerDueRates($owner): Collection - { + private function getCustomerDueRates($owner): Collection { $loans = AssetPerson::query()->where('person_id', $owner->id)->pluck('id'); return AssetRate::with('assetPerson.assetType') @@ -109,8 +105,7 @@ private function getCustomerDueRates($owner): Collection * @throws MeterIsNotInUse * @throws MeterIsNotAssignedToCustomer */ - private function getMeterOwner(string $serialNumber): ?Person - { + private function getMeterOwner(string $serialNumber): ?Person { try { /** @var Meter $meter */ $meter = Meter::with('meterParameter.owner') diff --git a/src/backend/app/Misc/SoldApplianceDataContainer.php b/src/backend/app/Misc/SoldApplianceDataContainer.php index 64374b393..80eb0c781 100644 --- a/src/backend/app/Misc/SoldApplianceDataContainer.php +++ b/src/backend/app/Misc/SoldApplianceDataContainer.php @@ -7,33 +7,27 @@ use App\Models\AssetType; use App\Models\Transaction\Transaction; -class SoldApplianceDataContainer -{ +class SoldApplianceDataContainer { public function __construct( private Asset $asset, private AssetType $assetType, private AssetPerson $assetPerson, private ?Transaction $transaction = null, - ) { - } + ) {} - public function getAsset() - { + public function getAsset() { return $this->asset; } - public function getAssetType() - { + public function getAssetType() { return $this->assetType; } - public function getAssetPerson() - { + public function getAssetPerson() { return $this->assetPerson; } - public function getTransaction() - { + public function getTransaction() { return $this->transaction; } } diff --git a/src/backend/app/Misc/TransactionDataContainer.php b/src/backend/app/Misc/TransactionDataContainer.php index 6924506d0..0e9f52fb5 100644 --- a/src/backend/app/Misc/TransactionDataContainer.php +++ b/src/backend/app/Misc/TransactionDataContainer.php @@ -12,8 +12,7 @@ use Illuminate\Database\Eloquent\ModelNotFoundException; use MPM\Device\DeviceService; -class TransactionDataContainer -{ +class TransactionDataContainer { public int $accessRateDebt; public Transaction $transaction; @@ -42,8 +41,7 @@ class TransactionDataContainer public string $dayDifferenceBetweenTwoInstallments; - public static function initialize(Transaction $transaction): TransactionDataContainer - { + public static function initialize(Transaction $transaction): TransactionDataContainer { $container = app()->make(TransactionDataContainer::class); $deviceService = app()->make(DeviceService::class); $container->chargedEnergy = 0; diff --git a/src/backend/app/Models/AccessRate/AccessRate.php b/src/backend/app/Models/AccessRate/AccessRate.php index ffd95ec41..cc830fe4a 100644 --- a/src/backend/app/Models/AccessRate/AccessRate.php +++ b/src/backend/app/Models/AccessRate/AccessRate.php @@ -18,29 +18,24 @@ * @property int tariff_id * @property int period when the payment repeats itself */ -class AccessRate extends BaseModel -{ +class AccessRate extends BaseModel { use HasFactory; public const RELATION_NAME = 'access_rate'; - public function tariff(): BelongsTo - { + public function tariff(): BelongsTo { return $this->belongsTo(MeterTariff::class, 'tariff_id', 'id'); } - public function accessRatePayments(): HasMany - { + public function accessRatePayments(): HasMany { return $this->hasMany(AccessRatePayment::class); } - public function __toString() - { + public function __toString() { return sprintf('For tariff : %s', $this->tariff()->first()->name); } - public function paymentHistories(): MorphMany - { + public function paymentHistories(): MorphMany { return $this->morphMany(PaymentHistory::class, 'paid_for'); } } diff --git a/src/backend/app/Models/AccessRate/AccessRatePayment.php b/src/backend/app/Models/AccessRate/AccessRatePayment.php index 52552b9b1..705e3be91 100644 --- a/src/backend/app/Models/AccessRate/AccessRatePayment.php +++ b/src/backend/app/Models/AccessRate/AccessRatePayment.php @@ -14,15 +14,12 @@ * @property \DateTime due_date * @property int debt */ -class AccessRatePayment extends BaseModel -{ - public function meter(): BelongsTo - { +class AccessRatePayment extends BaseModel { + public function meter(): BelongsTo { return $this->belongsTo(Meter::class); } - public function accessRate(): BelongsTo - { + public function accessRate(): BelongsTo { return $this->belongsTo(AccessRate::class); } } diff --git a/src/backend/app/Models/Address/Address.php b/src/backend/app/Models/Address/Address.php index 47b657506..b66d94d0a 100644 --- a/src/backend/app/Models/Address/Address.php +++ b/src/backend/app/Models/Address/Address.php @@ -21,8 +21,7 @@ * @property int $owner_id * @property string $owner_type */ -class Address extends BaseModel -{ +class Address extends BaseModel { use HasFactory; public const RELATION_NAME = 'address'; @@ -33,50 +32,41 @@ class Address extends BaseModel 'city_id' => 'required|exists:cities,id', ]; - public function city(): BelongsTo - { + public function city(): BelongsTo { return $this->belongsTo(City::class); } // client & company - public function owner(): MorphTo - { + public function owner(): MorphTo { return $this->morphTo(); } - public function geo(): MorphOne - { + public function geo(): MorphOne { return $this->morphOne(GeographicalInformation::class, 'owner'); } - public function setOwner(int $ownerId, string $ownerType): void - { + public function setOwner(int $ownerId, string $ownerType): void { $this->owner_id = $ownerId; $this->owner_type = $ownerType; } - public function setCityId(int $cityId): void - { + public function setCityId(int $cityId): void { $this->city_id = $cityId; } - public function setPhone(?string $phone): void - { + public function setPhone(?string $phone): void { $this->phone = $phone; } - public function setEmail(?string $email): void - { + public function setEmail(?string $email): void { $this->email = $email; } - public function setIsPrimary(bool $isPrimary): void - { + public function setIsPrimary(bool $isPrimary): void { $this->is_primary = $isPrimary; } - public function setStreet(?string $street): void - { + public function setStreet(?string $street): void { $this->street = $street; } } diff --git a/src/backend/app/Models/Address/HasAddressesInterface.php b/src/backend/app/Models/Address/HasAddressesInterface.php index 6ae680e53..425b1785e 100644 --- a/src/backend/app/Models/Address/HasAddressesInterface.php +++ b/src/backend/app/Models/Address/HasAddressesInterface.php @@ -4,7 +4,6 @@ use Illuminate\Database\Eloquent\Relations\HasOneOrMany; -interface HasAddressesInterface -{ +interface HasAddressesInterface { public function addresses(): HasOneOrMany; } diff --git a/src/backend/app/Models/Admin.php b/src/backend/app/Models/Admin.php index 3a3bbba45..2cf81e2be 100644 --- a/src/backend/app/Models/Admin.php +++ b/src/backend/app/Models/Admin.php @@ -2,6 +2,4 @@ namespace App\Models; -class Admin extends BaseModel -{ -} +class Admin extends BaseModel {} diff --git a/src/backend/app/Models/Agent.php b/src/backend/app/Models/Agent.php index 49dcbf3ee..12a6a6161 100644 --- a/src/backend/app/Models/Agent.php +++ b/src/backend/app/Models/Agent.php @@ -32,20 +32,17 @@ * @property string $remember_token * @property int $company_id */ -class Agent extends Authenticatable implements JWTSubject -{ +class Agent extends Authenticatable implements JWTSubject { use HasFactory; public const RELATION_NAME = 'agent'; - public function __construct(array $attributes = []) - { + public function __construct(array $attributes = []) { $this->setConnection('shard'); parent::__construct($attributes); } - public function setPasswordAttribute($password): void - { + public function setPasswordAttribute($password): void { $this->attributes['password'] = Hash::make($password); } @@ -62,8 +59,7 @@ public function setPasswordAttribute($password): void 'device_id', ]; - public function miniGrid(): BelongsTo - { + public function miniGrid(): BelongsTo { return $this->belongsTo(MiniGrid::class); } @@ -72,8 +68,7 @@ public function miniGrid(): BelongsTo * * @return mixed */ - public function getJWTIdentifier() - { + public function getJWTIdentifier() { return $this->getKey(); } @@ -84,70 +79,57 @@ public function getJWTIdentifier() * * @psalm-return array */ - public function getJWTCustomClaims() - { + public function getJWTCustomClaims() { return [ 'companyId' => User::query()->select(User::COL_COMPANY_ID)->first()[User::COL_COMPANY_ID], ]; } - public function address(): MorphOne - { + public function address(): MorphOne { return $this->morphOne(Address::class, 'owner'); } - public function tickets(): MorphMany - { + public function tickets(): MorphMany { return $this->morphMany(Ticket::class, 'creator'); } - public function transaction(): HasMany - { + public function transaction(): HasMany { return $this->hasMany(Transaction::class); } - public function balanceHistory(): HasMany - { + public function balanceHistory(): HasMany { return $this->hasMany(AgentBalanceHistory::class); } - public function assignedAppliance(): HasMany - { + public function assignedAppliance(): HasMany { return $this->hasMany(AgentAssignedAppliances::class); } - public function addressDetails() - { + public function addressDetails() { return $this->addresses()->with('city'); } - public function person(): BelongsTo - { + public function person(): BelongsTo { return $this->belongsTo(Person::class); } - public function commission(): BelongsTo - { + public function commission(): BelongsTo { return $this->belongsTo(AgentCommission::class, 'agent_commission_id'); } - public function soldAppliances(): MorphMany - { + public function soldAppliances(): MorphMany { return $this->morphMany(AssetPerson::class, 'creator'); } - public function agentCharges(): HasMany - { + public function agentCharges(): HasMany { return $this->hasMany(AgentCharge::class); } - public function addresses(): MorphMany - { + public function addresses(): MorphMany { return $this->morphMany(Address::class, 'owner'); } - public function receipt(): HasMany - { + public function receipt(): HasMany { return $this->hasMany(AgentReceipt::class, 'agent_id', 'id'); } } diff --git a/src/backend/app/Models/AgentAssignedAppliances.php b/src/backend/app/Models/AgentAssignedAppliances.php index 5d5ac7337..b8f97d158 100644 --- a/src/backend/app/Models/AgentAssignedAppliances.php +++ b/src/backend/app/Models/AgentAssignedAppliances.php @@ -6,29 +6,24 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\HasMany; -class AgentAssignedAppliances extends BaseModel -{ +class AgentAssignedAppliances extends BaseModel { public const RELATION_NAME = 'agent_appliance'; protected $guarded = []; - public function agent(): BelongsTo - { + public function agent(): BelongsTo { return $this->belongsTo(Agent::class); } - public function user(): BelongsTo - { + public function user(): BelongsTo { return $this->belongsTo(User::class); } - public function appliance(): BelongsTo - { + public function appliance(): BelongsTo { return $this->belongsTo(Asset::class, 'appliance_id', 'id'); } - public function soldAppliance(): HasMany - { + public function soldAppliance(): HasMany { return $this->hasMany(AgentSoldAppliance::class); } } diff --git a/src/backend/app/Models/AgentBalanceHistory.php b/src/backend/app/Models/AgentBalanceHistory.php index ccd56168e..b788ade83 100644 --- a/src/backend/app/Models/AgentBalanceHistory.php +++ b/src/backend/app/Models/AgentBalanceHistory.php @@ -7,22 +7,18 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\MorphTo; -class AgentBalanceHistory extends BaseModel -{ +class AgentBalanceHistory extends BaseModel { protected $guarded = []; - public function agent(): void - { + public function agent(): void { $this->belongsTo(Agent::class); } - public function trigger(): MorphTo - { + public function trigger(): MorphTo { return $this->morphTo(); } - public function transaction(): BelongsTo - { + public function transaction(): BelongsTo { return $this->belongsTo(Transaction::class); } } diff --git a/src/backend/app/Models/AgentCharge.php b/src/backend/app/Models/AgentCharge.php index c8b51f70a..23930a668 100644 --- a/src/backend/app/Models/AgentCharge.php +++ b/src/backend/app/Models/AgentCharge.php @@ -7,24 +7,20 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\MorphOne; -class AgentCharge extends BaseModel -{ +class AgentCharge extends BaseModel { use HasFactory; public const RELATION_NAME = 'agent_charge'; - public function agent(): BelongsTo - { + public function agent(): BelongsTo { return $this->belongsTo(Agent::class); } - public function user(): BelongsTo - { + public function user(): BelongsTo { return $this->belongsTo(User::class); } - public function history(): MorphOne - { + public function history(): MorphOne { return $this->morphOne(AgentBalanceHistory::class, 'trigger'); } } diff --git a/src/backend/app/Models/AgentCommission.php b/src/backend/app/Models/AgentCommission.php index bf5c3e75d..b006d9f39 100644 --- a/src/backend/app/Models/AgentCommission.php +++ b/src/backend/app/Models/AgentCommission.php @@ -15,19 +15,16 @@ * @property float $appliance_commission * @property float $risk_balance */ -class AgentCommission extends BaseModel -{ +class AgentCommission extends BaseModel { use HasFactory; public const RELATION_NAME = 'agent_commission'; - public function agent(): HasMany - { + public function agent(): HasMany { return $this->hasMany(Agent::class); } - public function history(): MorphOne - { + public function history(): MorphOne { return $this->morphOne(AgentBalanceHistory::class, 'trigger'); } } diff --git a/src/backend/app/Models/AgentReceipt.php b/src/backend/app/Models/AgentReceipt.php index d9c682b90..3f41744de 100644 --- a/src/backend/app/Models/AgentReceipt.php +++ b/src/backend/app/Models/AgentReceipt.php @@ -6,27 +6,22 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\HasMany; -class AgentReceipt extends BaseModel -{ +class AgentReceipt extends BaseModel { public const RELATION_NAME = 'agent_receipt'; - public function history(): BelongsTo - { + public function history(): BelongsTo { return $this->belongsTo(AgentBalanceHistory::class, 'last_controlled_balance_history_id', 'id'); } - public function agent(): BelongsTo - { + public function agent(): BelongsTo { return $this->belongsTo(Agent::class); } - public function user(): BelongsTo - { + public function user(): BelongsTo { return $this->belongsTo(User::class); } - public function detail(): HasMany - { + public function detail(): HasMany { return $this->hasMany(AgentReceiptDetail::class); } } diff --git a/src/backend/app/Models/AgentReceiptDetail.php b/src/backend/app/Models/AgentReceiptDetail.php index 9e06d5d66..acfed7130 100644 --- a/src/backend/app/Models/AgentReceiptDetail.php +++ b/src/backend/app/Models/AgentReceiptDetail.php @@ -5,10 +5,8 @@ use App\Models\Base\BaseModel; use Illuminate\Database\Eloquent\Relations\BelongsTo; -class AgentReceiptDetail extends BaseModel -{ - public function receipt(): BelongsTo - { +class AgentReceiptDetail extends BaseModel { + public function receipt(): BelongsTo { return $this->belongsTo(AgentReceipt::class, 'agent_receipt_id'); } } diff --git a/src/backend/app/Models/AgentSoldAppliance.php b/src/backend/app/Models/AgentSoldAppliance.php index 428c08d44..33e58b7c4 100644 --- a/src/backend/app/Models/AgentSoldAppliance.php +++ b/src/backend/app/Models/AgentSoldAppliance.php @@ -6,17 +6,14 @@ use App\Models\Person\Person; use Illuminate\Database\Eloquent\Relations\BelongsTo; -class AgentSoldAppliance extends BaseModel -{ +class AgentSoldAppliance extends BaseModel { protected $guarded = []; - public function assignedAppliance(): BelongsTo - { + public function assignedAppliance(): BelongsTo { return $this->belongsTo(AgentAssignedAppliances::class, 'agent_assigned_appliance_id', 'id'); } - public function person(): BelongsTo - { + public function person(): BelongsTo { return $this->belongsTo(Person::class); } } diff --git a/src/backend/app/Models/Asset.php b/src/backend/app/Models/Asset.php index 7c95a1bbf..9ec760a15 100644 --- a/src/backend/app/Models/Asset.php +++ b/src/backend/app/Models/Asset.php @@ -8,31 +8,26 @@ use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\HasOne; -class Asset extends BaseModel -{ +class Asset extends BaseModel { use HasFactory; public const RELATION_NAME = 'appliance'; protected $table = 'assets'; - public function assetType(): BelongsTo - { + public function assetType(): BelongsTo { return $this->belongsTo(AssetType::class); } - public function agentAssignedAppliance(): HasMany - { + public function agentAssignedAppliance(): HasMany { return $this->hasMany(AgentAssignedAppliances::class, 'appliance_type_id', 'id'); } - public function rates(): HasMany - { + public function rates(): HasMany { return $this->hasMany(AssetPerson::class); } - public function smsReminderRate(): HasOne - { + public function smsReminderRate(): HasOne { return $this->hasOne(SmsApplianceRemindRate::class, 'appliance_id', 'id'); } } diff --git a/src/backend/app/Models/AssetPerson.php b/src/backend/app/Models/AssetPerson.php index 563b6a290..098b7595b 100644 --- a/src/backend/app/Models/AssetPerson.php +++ b/src/backend/app/Models/AssetPerson.php @@ -19,39 +19,32 @@ * @property int $down_payment * @property int $rate_count */ -class AssetPerson extends BaseModel -{ +class AssetPerson extends BaseModel { protected $dispatchesEvents = [ 'created' => AssetPersonCreated::class, ]; - public function person(): BelongsTo - { + public function person(): BelongsTo { return $this->belongsTo(Person::class); } - public function logs(): MorphMany - { + public function logs(): MorphMany { return $this->morphMany(Log::class, 'affected'); } - public function asset(): BelongsTo - { + public function asset(): BelongsTo { return $this->belongsTo(Asset::class, 'asset_id'); } - public function rates(): HasMany - { + public function rates(): HasMany { return $this->hasMany(AssetRate::class); } - public function creator(): MorphTo - { + public function creator(): MorphTo { return $this->morphTo(); } - public function device(): BelongsTo - { + public function device(): BelongsTo { return $this->belongsTo(Device::class); } } diff --git a/src/backend/app/Models/AssetRate.php b/src/backend/app/Models/AssetRate.php index fb7eb22ae..b1322f6a0 100644 --- a/src/backend/app/Models/AssetRate.php +++ b/src/backend/app/Models/AssetRate.php @@ -17,8 +17,7 @@ * @property string $due_date * @property AssetPerson assetPerson */ -class AssetRate extends BaseModel -{ +class AssetRate extends BaseModel { public const RELATION_NAME = 'asset_rate'; protected $fillable = [ @@ -29,23 +28,19 @@ class AssetRate extends BaseModel 'remind', ]; - public function assetPerson(): BelongsTo - { + public function assetPerson(): BelongsTo { return $this->belongsTo(AssetPerson::class); } - public function logs(): MorphMany - { + public function logs(): MorphMany { return $this->morphMany(Log::class, 'affected'); } - public function paymentHistory(): MorphOne - { + public function paymentHistory(): MorphOne { return $this->morphOne(PaymentHistory::class, 'paid_for'); } - public function asset(): HasOneThrough - { + public function asset(): HasOneThrough { return $this->HasOneThrough(AssetType::class, AssetPerson::class, 'asset_type_id', 'id'); } } diff --git a/src/backend/app/Models/AssetType.php b/src/backend/app/Models/AssetType.php index d6bc98b77..6ed715d7a 100644 --- a/src/backend/app/Models/AssetType.php +++ b/src/backend/app/Models/AssetType.php @@ -5,12 +5,10 @@ use App\Models\Base\BaseModel; use Illuminate\Database\Eloquent\Relations\HasMany; -class AssetType extends BaseModel -{ +class AssetType extends BaseModel { public const APPLIANCE_TYPE_SHS = 1; - public function asset(): HasMany - { + public function asset(): HasMany { return $this->hasMany(Asset::class); } } diff --git a/src/backend/app/Models/Base/BaseModel.php b/src/backend/app/Models/Base/BaseModel.php index 53bfa76e4..8fdc10894 100644 --- a/src/backend/app/Models/Base/BaseModel.php +++ b/src/backend/app/Models/Base/BaseModel.php @@ -11,14 +11,12 @@ * logic and define interaction between entities. * "Most" models will extend this base model. */ -abstract class BaseModel extends Model -{ +abstract class BaseModel extends Model { protected $guarded = ['id']; public static $rules = []; - public function __construct(array $attributes = []) - { + public function __construct(array $attributes = []) { parent::__construct($attributes); $this->setConnection('shard'); } diff --git a/src/backend/app/Models/Base/BaseModelCore.php b/src/backend/app/Models/Base/BaseModelCore.php index 60376555b..1553abaa6 100644 --- a/src/backend/app/Models/Base/BaseModelCore.php +++ b/src/backend/app/Models/Base/BaseModelCore.php @@ -10,14 +10,12 @@ * Only applies to very few common, high-level configuration entities in * the entire MPM-instance like database and plugin configuration. */ -abstract class BaseModelCore extends Model -{ +abstract class BaseModelCore extends Model { protected $guarded = ['id']; public static $rules = []; - public function __construct(array $attributes = []) - { + public function __construct(array $attributes = []) { $this->setConnection('micro_power_manager'); parent::__construct($attributes); } diff --git a/src/backend/app/Models/City.php b/src/backend/app/Models/City.php index 696945aa0..fd84932b1 100644 --- a/src/backend/app/Models/City.php +++ b/src/backend/app/Models/City.php @@ -18,69 +18,56 @@ * @property int $cluster_id * @property int $mini_grid_id */ -class City extends BaseModel -{ +class City extends BaseModel { use HasFactory; public const RELATION_NAME = 'city'; - public function targets(): HasMany - { + public function targets(): HasMany { return $this->hasMany(Target::class); } - public function addresses(): HasMany - { + public function addresses(): HasMany { return $this->hasMany(Address::class); } - public function country(): BelongsTo - { + public function country(): BelongsTo { return $this->belongsTo(Country::class); } - public function miniGrid(): BelongsTo - { + public function miniGrid(): BelongsTo { return $this->belongsTo(MiniGrid::class); } - public function cluster(): BelongsTo - { + public function cluster(): BelongsTo { return $this->belongsTo(Cluster::class); } - public function location(): MorphOne - { + public function location(): MorphOne { return $this->morphOne(GeographicalInformation::class, 'owner'); } - public function setName(string $name): void - { + public function setName(string $name): void { $this->name = $name; } - public function setCountryId(int $countryId): void - { + public function setCountryId(int $countryId): void { $this->country_id = $countryId; } - public function setClusterId(int $clusterId): void - { + public function setClusterId(int $clusterId): void { $this->cluster_id = $clusterId; } - public function setMiniGridId(int $miniGridId): void - { + public function setMiniGridId(int $miniGridId): void { $this->mini_grid_id = $miniGridId; } - public function getMiniGridId(): int - { + public function getMiniGridId(): int { return $this->mini_grid_id; } - public function geo(): MorphOne - { + public function geo(): MorphOne { return $this->morphOne(GeographicalInformation::class, 'owner'); } } diff --git a/src/backend/app/Models/Cluster.php b/src/backend/app/Models/Cluster.php index acf8bfaf2..f04a7d647 100644 --- a/src/backend/app/Models/Cluster.php +++ b/src/backend/app/Models/Cluster.php @@ -18,8 +18,7 @@ * @property string $updated_at * @property string $created_at */ -class Cluster extends BaseModel implements TargetAssignable -{ +class Cluster extends BaseModel implements TargetAssignable { use HasFactory; public const RELATION_NAME = 'cluster'; @@ -28,18 +27,15 @@ class Cluster extends BaseModel implements TargetAssignable 'geo_data' => 'array', ]; - public function manager(): BelongsTo - { + public function manager(): BelongsTo { return $this->belongsTo(User::class); } - public function cities(): HasMany - { + public function cities(): HasMany { return $this->hasMany(City::class); } - public function miniGrids(): HasMany - { + public function miniGrids(): HasMany { return $this->hasMany(MiniGrid::class); } } diff --git a/src/backend/app/Models/Company.php b/src/backend/app/Models/Company.php index 584247dca..0e08e49d7 100644 --- a/src/backend/app/Models/Company.php +++ b/src/backend/app/Models/Company.php @@ -11,8 +11,7 @@ * @property int $id * @property string $name; */ -class Company extends BaseModelCore -{ +class Company extends BaseModelCore { use HasFactory; public const COL_ID = 'id'; @@ -23,28 +22,23 @@ class Company extends BaseModelCore // return $this->hasMany(User::class); // } - public function database(): HasOne - { + public function database(): HasOne { return $this->hasOne(CompanyDatabase::class); } - public function databaseProxies(): HasMany - { + public function databaseProxies(): HasMany { return $this->hasMany(DatabaseProxy::class); } - public function getId(): int - { + public function getId(): int { return $this->id; } - public function getName(): string - { + public function getName(): string { return $this->name; } - public function jobs() - { + public function jobs() { return $this->hasMany(CompanyJob::class); } } diff --git a/src/backend/app/Models/CompanyDatabase.php b/src/backend/app/Models/CompanyDatabase.php index e4580350e..1a159f498 100644 --- a/src/backend/app/Models/CompanyDatabase.php +++ b/src/backend/app/Models/CompanyDatabase.php @@ -12,8 +12,7 @@ * @property int $database_name; * @property int $company_id; */ -class CompanyDatabase extends BaseModelCore -{ +class CompanyDatabase extends BaseModelCore { use HasFactory; public const TABLE_NAME = 'company_databases'; @@ -22,18 +21,15 @@ class CompanyDatabase extends BaseModelCore public const COL_COMPANY_ID = 'company_id'; - public function company(): BelongsTo - { + public function company(): BelongsTo { return $this->belongsTo(Company::class); } - public function databaseProxies(): HasMany - { + public function databaseProxies(): HasMany { return $this->hasMany(DatabaseProxy::class); } - public function findByCompanyId(int $companyId): CompanyDatabase - { + public function findByCompanyId(int $companyId): CompanyDatabase { /** @var CompanyDatabase $result */ $result = $this->newQuery() ->select(self::COL_DATABASE_NAME) @@ -43,18 +39,15 @@ public function findByCompanyId(int $companyId): CompanyDatabase return $result; } - public function getDatabaseName(): string - { + public function getDatabaseName(): string { return $this->database_name; } - public function getId(): int - { + public function getId(): int { return $this->id; } - public function getCompanyId(): int - { + public function getCompanyId(): int { return $this->company_id; } } diff --git a/src/backend/app/Models/CompanyJob.php b/src/backend/app/Models/CompanyJob.php index a833335b5..b7d8dabbc 100644 --- a/src/backend/app/Models/CompanyJob.php +++ b/src/backend/app/Models/CompanyJob.php @@ -4,8 +4,7 @@ use App\Models\Base\BaseModelCore; -class CompanyJob extends BaseModelCore -{ +class CompanyJob extends BaseModelCore { public const STATUS_PENDING = 0; public const STATUS_SUCCESS = 1; @@ -13,8 +12,7 @@ class CompanyJob extends BaseModelCore public const STATUS_FAILED = -1; // has one company - public function company() - { + public function company() { return $this->belongsTo(Company::class); } } diff --git a/src/backend/app/Models/ConnectionGroup.php b/src/backend/app/Models/ConnectionGroup.php index ebf0ed231..4a01a3744 100644 --- a/src/backend/app/Models/ConnectionGroup.php +++ b/src/backend/app/Models/ConnectionGroup.php @@ -9,15 +9,12 @@ /** * Class ConnectionGroup. */ -class ConnectionGroup extends BaseModel -{ - public function meterParameters(): HasMany - { +class ConnectionGroup extends BaseModel { + public function meterParameters(): HasMany { return $this->hasMany(MeterParameter::class); } - public function meterParametersCount($till) - { + public function meterParametersCount($till) { return $this->meterParameters() ->selectRaw('connection_group_id, count(*) as aggregate') ->where('created_at', '<=', $till) diff --git a/src/backend/app/Models/ConnectionType.php b/src/backend/app/Models/ConnectionType.php index 0ff6aea12..c051b2a02 100644 --- a/src/backend/app/Models/ConnectionType.php +++ b/src/backend/app/Models/ConnectionType.php @@ -13,36 +13,30 @@ * * @property string $name */ -class ConnectionType extends BaseModel -{ - public function subTargets(): HasMany - { +class ConnectionType extends BaseModel { + public function subTargets(): HasMany { return $this->hasMany(SubTarget::class); } - public function meterParameters(): HasMany - { + public function meterParameters(): HasMany { return $this->hasMany(MeterParameter::class); } - public function meterParametersCount($till) - { + public function meterParametersCount($till) { return $this->meterParameters() ->selectRaw('connection_type_id, count(*) as aggregate') ->where('created_at', '<=', $till) ->groupBy('connection_type_id'); } - public function numberOfConnections(): Collection - { + public function numberOfConnections(): Collection { return DB::connection('shard')->table('meter_parameters') ->select(DB::connection('shard')->raw('connection_type_id, count(id) as total')) ->groupBy('connection_type_id') ->get(); } - public function subConnections(): HasMany - { + public function subConnections(): HasMany { return $this->hasMany(SubConnectionType::class); } } diff --git a/src/backend/app/Models/Country.php b/src/backend/app/Models/Country.php index e66ad90ca..fd00e7f0d 100644 --- a/src/backend/app/Models/Country.php +++ b/src/backend/app/Models/Country.php @@ -5,15 +5,12 @@ use App\Models\Base\BaseModel; use Illuminate\Database\Eloquent\Relations\HasMany; -class Country extends BaseModel -{ - public function getRouteKeyName(): string - { +class Country extends BaseModel { + public function getRouteKeyName(): string { return 'country_code'; } - public function cities(): HasMany - { + public function cities(): HasMany { return $this->hasMany(City::class); } } diff --git a/src/backend/app/Models/CustomerGroup.php b/src/backend/app/Models/CustomerGroup.php index a0fa71081..878a36de1 100644 --- a/src/backend/app/Models/CustomerGroup.php +++ b/src/backend/app/Models/CustomerGroup.php @@ -8,15 +8,12 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\HasMany; -class CustomerGroup extends BaseModel -{ - public function tariff(): BelongsTo - { +class CustomerGroup extends BaseModel { + public function tariff(): BelongsTo { return $this->belongsTo(MeterTariff::class); } - public function customers(): HasMany - { + public function customers(): HasMany { return $this->hasMany(Person::class); } } diff --git a/src/backend/app/Models/DatabaseProxy.php b/src/backend/app/Models/DatabaseProxy.php index 88d2ac9e4..d47f08282 100644 --- a/src/backend/app/Models/DatabaseProxy.php +++ b/src/backend/app/Models/DatabaseProxy.php @@ -11,16 +11,14 @@ /** * @property int $fk_company_id */ -class DatabaseProxy extends BaseModelCore -{ +class DatabaseProxy extends BaseModelCore { public const COL_DATABASE_CONNECTION = 'database_connection'; public const COL_COMPANY_ID = 'fk_company_id'; public const COL_EMAIL = 'email'; - private function buildQuery(?int $companyId = null): Builder - { + private function buildQuery(?int $companyId = null): Builder { $query = $this->newQuery(); if ($companyId) { @@ -30,8 +28,7 @@ private function buildQuery(?int $companyId = null): Builder return $query; } - public function findByEmail(string $email): DatabaseProxy - { + public function findByEmail(string $email): DatabaseProxy { /** @var DatabaseProxy $result */ $result = $this->buildQuery() ->join(CompanyDatabase::TABLE_NAME, CompanyDatabase::COL_COMPANY_ID, '=', self::COL_COMPANY_ID) @@ -41,8 +38,7 @@ public function findByEmail(string $email): DatabaseProxy return $result; } - public function findByCompanyId(int $companyId): DatabaseProxy - { + public function findByCompanyId(int $companyId): DatabaseProxy { /** @var DatabaseProxy $result */ $result = $this->buildQuery($companyId) ->select(CompanyDatabase::COL_DATABASE_NAME) @@ -51,18 +47,15 @@ public function findByCompanyId(int $companyId): DatabaseProxy return $result; } - public function getCompanyId(): int - { + public function getCompanyId(): int { return $this->fk_company_id; } - public function company(): BelongsTo - { + public function company(): BelongsTo { return $this->belongsTo(Company::class, 'fk_company_id'); } - public function companyDatabase(): BelongsTo - { + public function companyDatabase(): BelongsTo { return $this->belongsTo(CompanyDatabase::class, 'fk_company_database_id'); } } diff --git a/src/backend/app/Models/Device.php b/src/backend/app/Models/Device.php index 0c356560d..4aedeae21 100644 --- a/src/backend/app/Models/Device.php +++ b/src/backend/app/Models/Device.php @@ -11,8 +11,7 @@ use Illuminate\Database\Eloquent\Relations\MorphOne; use Illuminate\Database\Eloquent\Relations\MorphTo; -class Device extends BaseModel -{ +class Device extends BaseModel { use HasFactory; public const RELATION_NAME = 'device'; @@ -22,23 +21,19 @@ class Device extends BaseModel // but they are completely different things. // `id` is this device's... well... id, which it can be references with in the `device` table // `device_id` is the `id` in the target table depending on type. For example `meter` or `solar_home_system`. - public function device(): MorphTo - { + public function device(): MorphTo { return $this->morphTo(); } - public function person(): BelongsTo - { + public function person(): BelongsTo { return $this->belongsTo(Person::class); } - public function address(): MorphOne - { + public function address(): MorphOne { return $this->morphOne(Address::class, 'owner'); } - public function appliance(): HasOne - { + public function appliance(): HasOne { return $this->hasOne(Asset::class, 'device_serial', 'device_serial'); } } diff --git a/src/backend/app/Models/EBike.php b/src/backend/app/Models/EBike.php index c12eb8335..b0c9769fc 100644 --- a/src/backend/app/Models/EBike.php +++ b/src/backend/app/Models/EBike.php @@ -6,24 +6,20 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\MorphOne; -class EBike extends BaseModel -{ +class EBike extends BaseModel { public const RELATION_NAME = 'e_bike'; protected $table = 'e_bikes'; - public function device(): MorphOne - { + public function device(): MorphOne { return $this->morphOne(Device::class, 'device'); } - public function manufacturer(): BelongsTo - { + public function manufacturer(): BelongsTo { return $this->belongsTo(Manufacturer::class); } - public function appliance(): BelongsTo - { + public function appliance(): BelongsTo { return $this->belongsTo(Asset::class, 'asset_id', 'id'); } } diff --git a/src/backend/app/Models/GeographicalInformation.php b/src/backend/app/Models/GeographicalInformation.php index 759693f75..15a2f64c4 100644 --- a/src/backend/app/Models/GeographicalInformation.php +++ b/src/backend/app/Models/GeographicalInformation.php @@ -11,14 +11,12 @@ * * @property string $points */ -class GeographicalInformation extends BaseModel -{ +class GeographicalInformation extends BaseModel { use HasFactory; protected $table = 'geographical_informations'; - public function owner(): MorphTo - { + public function owner(): MorphTo { return $this->morphTo(); } } diff --git a/src/backend/app/Models/History.php b/src/backend/app/Models/History.php index ddd6e1eab..feaafe331 100644 --- a/src/backend/app/Models/History.php +++ b/src/backend/app/Models/History.php @@ -13,16 +13,14 @@ * @property string $field the affected field. Only required for the update action * @property string $content; */ -class History extends BaseModel -{ +class History extends BaseModel { public const ACTION_CREATED = 'create'; public const ACTION_UPDATE = 'update'; public const ACTION_DELETE = 'delete'; - public function target(): MorphTo - { + public function target(): MorphTo { return $this->morphTo(); } } diff --git a/src/backend/app/Models/Loan/Loan.php b/src/backend/app/Models/Loan/Loan.php index e163857fd..12610572d 100644 --- a/src/backend/app/Models/Loan/Loan.php +++ b/src/backend/app/Models/Loan/Loan.php @@ -6,11 +6,9 @@ use App\Models\PaymentHistory; use Illuminate\Database\Eloquent\Relations\HasMany; -class Loan extends BaseModel -{ +class Loan extends BaseModel { // related payment histories which are made for that loan - public function paymentHistories(): HasMany - { + public function paymentHistories(): HasMany { return $this->hasMany(PaymentHistory::class); } } diff --git a/src/backend/app/Models/Loan/LoanableInterface.php b/src/backend/app/Models/Loan/LoanableInterface.php index 916425d39..2a5551322 100644 --- a/src/backend/app/Models/Loan/LoanableInterface.php +++ b/src/backend/app/Models/Loan/LoanableInterface.php @@ -2,7 +2,6 @@ namespace App\Models\Loan; -interface LoanableInterface -{ +interface LoanableInterface { public function loans(); } diff --git a/src/backend/app/Models/Log.php b/src/backend/app/Models/Log.php index 287ab2326..49718eb34 100644 --- a/src/backend/app/Models/Log.php +++ b/src/backend/app/Models/Log.php @@ -6,15 +6,12 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\MorphTo; -class Log extends BaseModel -{ - public function owner(): BelongsTo - { +class Log extends BaseModel { + public function owner(): BelongsTo { return $this->belongsTo(User::class, 'user_id'); } - public function affected(): MorphTo - { + public function affected(): MorphTo { return $this->morphTo(); } } diff --git a/src/backend/app/Models/MailSettings.php b/src/backend/app/Models/MailSettings.php index 7168b56bd..e3e6a16a7 100644 --- a/src/backend/app/Models/MailSettings.php +++ b/src/backend/app/Models/MailSettings.php @@ -7,6 +7,4 @@ /** * Class MailSettings. */ -class MailSettings extends BaseModel -{ -} +class MailSettings extends BaseModel {} diff --git a/src/backend/app/Models/MainSettings.php b/src/backend/app/Models/MainSettings.php index d64c2a842..6557fc307 100644 --- a/src/backend/app/Models/MainSettings.php +++ b/src/backend/app/Models/MainSettings.php @@ -16,6 +16,4 @@ * @property float $vat_energy * @property float $vat_appliance * */ -class MainSettings extends BaseModel -{ -} +class MainSettings extends BaseModel {} diff --git a/src/backend/app/Models/MaintenanceUsers.php b/src/backend/app/Models/MaintenanceUsers.php index 6177e9aa8..9385ad110 100644 --- a/src/backend/app/Models/MaintenanceUsers.php +++ b/src/backend/app/Models/MaintenanceUsers.php @@ -8,22 +8,18 @@ use Illuminate\Database\Eloquent\Relations\MorphMany; use Inensus\Ticket\Models\Ticket; -class MaintenanceUsers extends BaseModel -{ +class MaintenanceUsers extends BaseModel { public const RELATION_NAME = 'maintenance_user'; - public function person(): BelongsTo - { + public function person(): BelongsTo { return $this->belongsTo(Person::class); } - public function miniGrid(): BelongsTo - { + public function miniGrid(): BelongsTo { return $this->belongsTo(MiniGrid::class, 'mini_grid_id', 'id'); } - public function tickets(): MorphMany - { + public function tickets(): MorphMany { return $this->morphMany(Ticket::class, 'owner'); } } diff --git a/src/backend/app/Models/Manufacturer.php b/src/backend/app/Models/Manufacturer.php index 617d540b0..89150c828 100644 --- a/src/backend/app/Models/Manufacturer.php +++ b/src/backend/app/Models/Manufacturer.php @@ -7,8 +7,7 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\MorphMany; -class Manufacturer extends BaseModel -{ +class Manufacturer extends BaseModel { use HasFactory; public const RELATION_NAME = 'manufacturer'; @@ -17,8 +16,7 @@ class Manufacturer extends BaseModel protected $guarded = []; - public function address(): MorphMany - { + public function address(): MorphMany { return $this->morphMany(Address::class, 'owner'); } } diff --git a/src/backend/app/Models/MapSettings.php b/src/backend/app/Models/MapSettings.php index dbb4ea829..3bac61711 100644 --- a/src/backend/app/Models/MapSettings.php +++ b/src/backend/app/Models/MapSettings.php @@ -12,6 +12,4 @@ * @property float $latitude * @property float $longitude */ -class MapSettings extends BaseModel -{ -} +class MapSettings extends BaseModel {} diff --git a/src/backend/app/Models/Meter/Meter.php b/src/backend/app/Models/Meter/Meter.php index 0f1e10cd1..306573fa8 100644 --- a/src/backend/app/Models/Meter/Meter.php +++ b/src/backend/app/Models/Meter/Meter.php @@ -21,8 +21,7 @@ * @property MeterTariff $tariff * @property bool $in_use */ -class Meter extends BaseModel -{ +class Meter extends BaseModel { use HasFactory; public const RELATION_NAME = 'meter'; @@ -35,71 +34,58 @@ class Meter extends BaseModel 'manufacturer_id' => 'exists:shard.manufacturers,id', ]; - public function meterType(): BelongsTo - { + public function meterType(): BelongsTo { return $this->belongsTo(MeterType::class); } - public function device(): MorphOne - { + public function device(): MorphOne { return $this->morphOne(Device::class, 'device'); } - public function manufacturer(): BelongsTo - { + public function manufacturer(): BelongsTo { return $this->belongsTo(Manufacturer::class); } - public function tariff(): BelongsTo - { + public function tariff(): BelongsTo { return $this->belongsTo(MeterTariff::class); } - public function connectionType(): BelongsTo - { + public function connectionType(): BelongsTo { return $this->belongsTo(ConnectionType::class, 'connection_type_id', 'id'); } - public function connectionGroup(): BelongsTo - { + public function connectionGroup(): BelongsTo { return $this->belongsTo(ConnectionGroup::class); } - public function accessRatePayment(): HasOne - { + public function accessRatePayment(): HasOne { return $this->hasOne(AccessRatePayment::class); } - public function accessRate(): AccessRate - { + public function accessRate(): AccessRate { return $this->tariff->accessRate; } - public function tokens(): HasMany - { + public function tokens(): HasMany { return $this->hasMany(MeterToken::class); } - public function consumptions(): HasMany - { + public function consumptions(): HasMany { return $this->hasMany(MeterConsumption::class); } - public function transactions(): HasMany - { + public function transactions(): HasMany { return $this->hasMany(Transaction::class, 'message', 'serial_number'); } - public function findBySerialNumber(string $meterSerialNumber): ?self - { + public function findBySerialNumber(string $meterSerialNumber): ?self { /** @var Meter|null $result */ $result = $this->newQuery()->where('serial_number', '=', $meterSerialNumber)->first(); return $result; } - public function getId(): int - { + public function getId(): int { return $this->id; } } diff --git a/src/backend/app/Models/Meter/MeterConsumption.php b/src/backend/app/Models/Meter/MeterConsumption.php index d922b5bd8..ddf09869f 100644 --- a/src/backend/app/Models/Meter/MeterConsumption.php +++ b/src/backend/app/Models/Meter/MeterConsumption.php @@ -15,17 +15,14 @@ * @property float $credit_on_meter * @property string $reading_date */ -class MeterConsumption extends BaseModel -{ +class MeterConsumption extends BaseModel { protected $table = 'meter_consumptions'; - public function meter(): BelongsTo - { + public function meter(): BelongsTo { return $this->belongsTo(Meter::class); } - public function __toString() - { + public function __toString() { return 'Meter : '.$this->meter_id.' consumption : '.$this->total_consumption. ' credit :'.$this->credit_on_meter; } diff --git a/src/backend/app/Models/Meter/MeterParameter.php b/src/backend/app/Models/Meter/MeterParameter.php index d866fb96b..e698ec857 100644 --- a/src/backend/app/Models/Meter/MeterParameter.php +++ b/src/backend/app/Models/Meter/MeterParameter.php @@ -27,41 +27,34 @@ * @property int tariff_access_rate_id * @property MeterTariff $tariff */ -class MeterParameter extends BaseModel -{ +class MeterParameter extends BaseModel { public const RELATION_NAME = 'meter_parameter'; protected $hidden = ['owner_id', 'owner_type', 'meter_id', 'tariff_id']; protected $guarded = []; - public function connectionType(): BelongsTo - { + public function connectionType(): BelongsTo { return $this->belongsTo(ConnectionType::class, 'connection_type_id', 'id'); } - public function tariff(): BelongsTo - { + public function tariff(): BelongsTo { return $this->belongsTo(MeterTariff::class); } - public function tariffAccessRate(): ?AccessRate - { + public function tariffAccessRate(): ?AccessRate { return $this->tariff->accessRate; } - public function meter(): BelongsTo - { + public function meter(): BelongsTo { return $this->belongsTo(Meter::class); } - public function owner(): MorphTo - { + public function owner(): MorphTo { return $this->morphTo(); } - public function geo(): MorphOne - { + public function geo(): MorphOne { return $this->morphOne(GeographicalInformation::class, 'owner'); } @@ -70,24 +63,20 @@ public function geo(): MorphOne * * @psalm-return non-empty-list */ - public function latLon(): array - { + public function latLon(): array { return explode(',', $this->geo()->first()->points ?? '0.0,0.0'); } // the address where the meter is placed - public function address(): MorphOne - { + public function address(): MorphOne { return $this->morphOne(Address::class, 'owner'); } - public function connectionGroup(): BelongsTo - { + public function connectionGroup(): BelongsTo { return $this->belongsTo(ConnectionGroup::class); } - public function socialTariffPiggyBank(): HasOne - { + public function socialTariffPiggyBank(): HasOne { return $this->hasOne(SocialTariffPiggyBank::class); } } diff --git a/src/backend/app/Models/Meter/MeterTariff.php b/src/backend/app/Models/Meter/MeterTariff.php index dbf24de90..8db28565e 100644 --- a/src/backend/app/Models/Meter/MeterTariff.php +++ b/src/backend/app/Models/Meter/MeterTariff.php @@ -24,8 +24,7 @@ * @property int|null $factor * @property AccessRate $accessRate */ -class MeterTariff extends BaseModel -{ +class MeterTariff extends BaseModel { use HasFactory; use SoftDeletes; @@ -39,40 +38,33 @@ class MeterTariff extends BaseModel protected $guarded = []; - public function meterParameter(): HasMany - { + public function meterParameter(): HasMany { return $this->hasMany(MeterParameter::class, 'tariff_id'); } - public function meterParametersCount() - { + public function meterParametersCount() { return $this->meterParameter() ->selectRaw('tariff_id, count(*) as aggregate') ->groupBy('tariff_id'); } - public function customerGroups(): HasMany - { + public function customerGroups(): HasMany { return $this->hasMany(CustomerGroup::class, 'tariff_id'); } - public function accessRate(): HasOne - { + public function accessRate(): HasOne { return $this->hasOne(AccessRate::class, 'tariff_id'); } - public function pricingComponent(): MorphMany - { + public function pricingComponent(): MorphMany { return $this->morphMany(TariffPricingComponent::class, 'owner'); } - public function socialTariff(): HasOne - { + public function socialTariff(): HasOne { return $this->hasOne(SocialTariff::class, 'tariff_id'); } - public function tou(): HasMany - { + public function tou(): HasMany { return $this->hasMany(TimeOfUsage::class, 'tariff_id'); } } diff --git a/src/backend/app/Models/Meter/MeterToken.php b/src/backend/app/Models/Meter/MeterToken.php index f5313c187..bd9307b0e 100644 --- a/src/backend/app/Models/Meter/MeterToken.php +++ b/src/backend/app/Models/Meter/MeterToken.php @@ -16,32 +16,26 @@ * @property string $token * @property float $energy */ -class MeterToken extends BaseModel -{ +class MeterToken extends BaseModel { public const RELATION_NAME = 'meter_token'; - public function transaction(): BelongsTo - { + public function transaction(): BelongsTo { return $this->belongsTo(Transaction::class); } - public function meter(): BelongsTo - { + public function meter(): BelongsTo { return $this->belongsTo(Meter::class); } - public function __toString(): string - { + public function __toString(): string { return 'Token: '.$this->token.' for '.$this->energy.'kWh'; } - public function paymentHistories(): MorphOne - { + public function paymentHistories(): MorphOne { return $this->morphOne(PaymentHistory::class, 'paid_for'); } - public function soldEnergyPerPeriod($startDate, $endDate): Builder - { + public function soldEnergyPerPeriod($startDate, $endDate): Builder { return $this::query() ->select(DB::raw(' SUM( energy) as sold,YEARWEEK(created_at,3) as period')) ->whereBetween('created_at', [$startDate, $endDate]) diff --git a/src/backend/app/Models/Meter/MeterType.php b/src/backend/app/Models/Meter/MeterType.php index 4393e3b3d..495f2d865 100644 --- a/src/backend/app/Models/Meter/MeterType.php +++ b/src/backend/app/Models/Meter/MeterType.php @@ -12,8 +12,7 @@ * @property string $phase * @property int $max_current */ -class MeterType extends BaseModel -{ +class MeterType extends BaseModel { use HasFactory; public static $rules = [ @@ -22,13 +21,11 @@ class MeterType extends BaseModel 'max_current' => 'required', ]; - public function meters(): HasMany - { + public function meters(): HasMany { return $this->hasMany(Meter::class); } - public function __toString() - { + public function __toString() { return sprintf( '%s Phase, %s Amper, Online: %s', $this->phase, diff --git a/src/backend/app/Models/MiniGrid.php b/src/backend/app/Models/MiniGrid.php index 286fc95a0..e3d28d590 100644 --- a/src/backend/app/Models/MiniGrid.php +++ b/src/backend/app/Models/MiniGrid.php @@ -19,46 +19,38 @@ * @property int $cluster_id * @property Collection $cities */ -class MiniGrid extends BaseModel implements TargetAssignable -{ +class MiniGrid extends BaseModel implements TargetAssignable { use HasFactory; public const RELATION_NAME = 'mini-grid'; protected $guarded = []; - public function cities(): HasMany - { + public function cities(): HasMany { return $this->hasMany(City::class); } - public function cluster(): BelongsTo - { + public function cluster(): BelongsTo { return $this->belongsTo(Cluster::class); } - public function location(): MorphOne - { + public function location(): MorphOne { return $this->morphOne(GeographicalInformation::class, 'owner'); } - public function agent(): HasOne - { + public function agent(): HasOne { return $this->hasOne(Agent::class); } - public function setClusterId(int $clusterId): void - { + public function setClusterId(int $clusterId): void { $this->cluster_id = $clusterId; } - public function setName(string $name): void - { + public function setName(string $name): void { $this->name = $name; } - public function getClusterId(): int - { + public function getClusterId(): int { return $this->cluster_id; } } diff --git a/src/backend/app/Models/MpmPlugin.php b/src/backend/app/Models/MpmPlugin.php index b7ce38f48..4bd219597 100644 --- a/src/backend/app/Models/MpmPlugin.php +++ b/src/backend/app/Models/MpmPlugin.php @@ -9,8 +9,7 @@ * @property string|null $tail_tag * @property string|null $installation_command */ -class MpmPlugin extends BaseModelCore -{ +class MpmPlugin extends BaseModelCore { use HasFactory; public const SPARK_METER = 1; @@ -49,8 +48,7 @@ class MpmPlugin extends BaseModelCore protected $table = 'mpm_plugins'; - public function plugins() - { + public function plugins() { return $this->hasMany(Plugins::class); } } diff --git a/src/backend/app/Models/Payment/PaymentProfile.php b/src/backend/app/Models/Payment/PaymentProfile.php index a236f88d4..dc2b491fa 100644 --- a/src/backend/app/Models/Payment/PaymentProfile.php +++ b/src/backend/app/Models/Payment/PaymentProfile.php @@ -4,6 +4,4 @@ use App\Models\Base\BaseModel; -class PaymentProfile extends BaseModel -{ -} +class PaymentProfile extends BaseModel {} diff --git a/src/backend/app/Models/PaymentHistory.php b/src/backend/app/Models/PaymentHistory.php index 6601fa629..7db95fdfb 100644 --- a/src/backend/app/Models/PaymentHistory.php +++ b/src/backend/app/Models/PaymentHistory.php @@ -20,25 +20,20 @@ * @property string payment_type * @property int transaction_id */ -class PaymentHistory extends BaseModel -{ - public function paidFor(): MorphTo - { +class PaymentHistory extends BaseModel { + public function paidFor(): MorphTo { return $this->morphTo(); } - public function payer(): MorphTo - { + public function payer(): MorphTo { return $this->morphTo(); } - public function transaction(): BelongsTo - { + public function transaction(): BelongsTo { return $this->belongsTo(Transaction::class); } - public function getFlow(string $payer_type, int $payer_id, string $period, $limit = null, string $order = 'ASC') - { + public function getFlow(string $payer_type, int $payer_id, string $period, $limit = null, string $order = 'ASC') { $sql = 'SELECT sum(amount) as amount, payment_type, CONCAT_WS("/", '.$period.') as aperiod from'. ' payment_histories where payer_id=:payer_id and payer_type=:payer_type '. 'GROUP by concat( '.$period.'), payment_type ORDER BY created_at '.$order; @@ -50,8 +45,7 @@ public function getFlow(string $payer_type, int $payer_id, string $period, $limi return $this->executeSqlCommand($sql, $payer_id, null, $payer_type); } - public function getAgentCustomersFlow(string $payer_type, $agent_id, string $period, $limit = null, $order = 'ASC') - { + public function getAgentCustomersFlow(string $payer_type, $agent_id, string $period, $limit = null, $order = 'ASC') { $sql = 'SELECT sum(amount) as amount, payment_type, CONCAT_WS("/", '.$period.') as aperiod '. 'from payment_histories inner join addresses on payment_histories.payer_id = addresses.owner_id '. 'inner JOIN cities on addresses.city_id=cities.id inner JOIN mini_grids on '. @@ -67,8 +61,7 @@ public function getAgentCustomersFlow(string $payer_type, $agent_id, string $per return $this->executeSqlCommand($sql, null, $agent_id, $payer_type); } - public function getPaymentFlow(string $payer_type, int $payer_id, int $year) - { + public function getPaymentFlow(string $payer_type, int $payer_id, int $year) { $sql = 'SELECT sum(amount) as amount, MONTH(created_at) as month from payment_histories where'. ' payer_id=:payer_id and payer_type=:payer_type and '. 'YEAR(created_at)=:year group by MONTH(created_at) order by MONTH(created_at) '; @@ -87,8 +80,7 @@ public function getPaymentFlow(string $payer_type, int $payer_id, int $year) * @param Request|array|string $begin * @param Request|array|string $end */ - public function getOverview($begin, $end) - { + public function getOverview($begin, $end) { $sql = 'SELECT sum(amount) as total, DATE_FORMAT(created_at, "%Y-%m-%d")'. ' as dato from payment_histories where DATE(created_at) >= DATE(\''.$begin.'\') '. 'and DATE(created_at)<= DATE(\''.$end.'\') group by dato'; @@ -99,8 +91,7 @@ public function getOverview($begin, $end) return $results; } - private function executeSqlCommand(string $sql, $payer_id, $agent_id, $payer_type) - { + private function executeSqlCommand(string $sql, $payer_id, $agent_id, $payer_type) { $sth = DB::connection('shard')->getPdo()->prepare($sql); if ($payer_id) { $sth->bindValue(':payer_id', $payer_id, \PDO::PARAM_INT); diff --git a/src/backend/app/Models/Person/Person.php b/src/backend/app/Models/Person/Person.php index 6fc5ffac0..5b2b39e18 100644 --- a/src/backend/app/Models/Person/Person.php +++ b/src/backend/app/Models/Person/Person.php @@ -38,8 +38,7 @@ * @property int $nationality * @property int $is_customer */ -class Person extends BaseModel implements HasAddressesInterface, RoleInterface -{ +class Person extends BaseModel implements HasAddressesInterface, RoleInterface { use HasFactory; use SoftDeletes; @@ -55,69 +54,57 @@ class Person extends BaseModel implements HasAddressesInterface, RoleInterface 'deleting' => PersonDeleting::class, ]; - public function tickets(): MorphMany - { + public function tickets(): MorphMany { return $this->morphMany(Ticket::class, 'owner'); } - public function saveAddress(Address $address): void - { + public function saveAddress(Address $address): void { $this->addresses()->save($address); } /** * @return MorphMany */ - public function addresses(): HasOneOrMany - { + public function addresses(): HasOneOrMany { return $this->morphMany(Address::class, 'owner'); } - public function citizenship(): BelongsTo - { + public function citizenship(): BelongsTo { return $this->belongsTo(Country::class, 'nationality', 'id'); } - public function devices(): HasMany - { + public function devices(): HasMany { return $this->hasMany(Device::class); } /** * @return MorphMany */ - public function roleOwner(): HasOneOrMany - { + public function roleOwner(): HasOneOrMany { return $this->morphMany(Roles::class, 'role_owner'); } - public function payments(): MorphMany - { + public function payments(): MorphMany { return $this->morphMany(PaymentHistory::class, 'payer'); } - public function customerGroup(): BelongsTo - { + public function customerGroup(): BelongsTo { return $this->belongsTo(CustomerGroup::class); } - public function agent(): HasOne - { + public function agent(): HasOne { return $this->hasOne(Agent::class); } - public function agentSoldAppliance(): HasOne - { + public function agentSoldAppliance(): HasOne { return $this->hasOne(AgentSoldAppliance::class); } - public function __toString() - { + public function __toString() { return sprintf('%s %s', $this->name, $this->surname); } - public function livingInClusterQuery(int $clusterId) - { + public function livingInClusterQuery(int $clusterId) { return DB::table($this->getTable()) ->select('people.id') ->leftJoin('addresses', function (JoinClause $q) { @@ -135,8 +122,7 @@ public function livingInClusterQuery(int $clusterId) ->orderBy('cities.id'); } - public function getId(): int - { + public function getId(): int { return $this->id; } } diff --git a/src/backend/app/Models/PersonDocument.php b/src/backend/app/Models/PersonDocument.php index aa80760a9..3cc302ed0 100644 --- a/src/backend/app/Models/PersonDocument.php +++ b/src/backend/app/Models/PersonDocument.php @@ -5,10 +5,8 @@ use App\Models\Base\BaseModel; use App\Models\Person\Person; -class PersonDocument extends BaseModel -{ - public function person() - { +class PersonDocument extends BaseModel { + public function person() { return $this->belongsTo(Person::class); } } diff --git a/src/backend/app/Models/Plugins.php b/src/backend/app/Models/Plugins.php index a5e9e0c97..fbe32de69 100644 --- a/src/backend/app/Models/Plugins.php +++ b/src/backend/app/Models/Plugins.php @@ -4,8 +4,7 @@ use App\Models\Base\BaseModel; -class Plugins extends BaseModel -{ +class Plugins extends BaseModel { public const ACTIVE = 1; public const INACTIVE = 0; diff --git a/src/backend/app/Models/ProtectedPage.php b/src/backend/app/Models/ProtectedPage.php index 317acb440..7a23ce048 100644 --- a/src/backend/app/Models/ProtectedPage.php +++ b/src/backend/app/Models/ProtectedPage.php @@ -5,8 +5,7 @@ use App\Models\Base\BaseModelCore; use Illuminate\Database\Eloquent\Factories\HasFactory; -class ProtectedPage extends BaseModelCore -{ +class ProtectedPage extends BaseModelCore { use HasFactory; protected $table = 'protected_pages'; diff --git a/src/backend/app/Models/RegistrationTail.php b/src/backend/app/Models/RegistrationTail.php index 9bfab53ef..b0ce0438c 100644 --- a/src/backend/app/Models/RegistrationTail.php +++ b/src/backend/app/Models/RegistrationTail.php @@ -4,7 +4,6 @@ use App\Models\Base\BaseModel; -class RegistrationTail extends BaseModel -{ +class RegistrationTail extends BaseModel { protected $table = 'registration_tail'; } diff --git a/src/backend/app/Models/Report.php b/src/backend/app/Models/Report.php index 2b4d2e9a2..b8a0d225b 100644 --- a/src/backend/app/Models/Report.php +++ b/src/backend/app/Models/Report.php @@ -13,6 +13,4 @@ * @property string $path * @property string $type */ -class Report extends BaseModel -{ -} +class Report extends BaseModel {} diff --git a/src/backend/app/Models/Restriction.php b/src/backend/app/Models/Restriction.php index 98bd99ed2..bbe78d6b0 100644 --- a/src/backend/app/Models/Restriction.php +++ b/src/backend/app/Models/Restriction.php @@ -13,10 +13,8 @@ * @property int $default * @property int $limit */ -class Restriction extends BaseModel -{ - public function upgrades(): HasMany - { +class Restriction extends BaseModel { + public function upgrades(): HasMany { return $this->hasMany(Upgrade::class); } } diff --git a/src/backend/app/Models/Revenue.php b/src/backend/app/Models/Revenue.php index c4a57af0f..661250b29 100644 --- a/src/backend/app/Models/Revenue.php +++ b/src/backend/app/Models/Revenue.php @@ -4,7 +4,6 @@ use App\Models\Base\BaseModel; -class Revenue extends BaseModel -{ +class Revenue extends BaseModel { protected $table = 'revenues'; } diff --git a/src/backend/app/Models/Role/RoleDefinition.php b/src/backend/app/Models/Role/RoleDefinition.php index 71b867497..c05dcf8e9 100644 --- a/src/backend/app/Models/Role/RoleDefinition.php +++ b/src/backend/app/Models/Role/RoleDefinition.php @@ -4,14 +4,12 @@ use App\Models\Base\BaseModel; -class RoleDefinition extends BaseModel -{ +class RoleDefinition extends BaseModel { public $timestamps = false; protected $connection = 'micro_power_manager'; - public function roles(): void - { + public function roles(): void { $this->hasMany(Roles::class); } } diff --git a/src/backend/app/Models/Role/RoleInterface.php b/src/backend/app/Models/Role/RoleInterface.php index 010b7f713..6ac7537d1 100644 --- a/src/backend/app/Models/Role/RoleInterface.php +++ b/src/backend/app/Models/Role/RoleInterface.php @@ -4,7 +4,6 @@ use Illuminate\Database\Eloquent\Relations\HasOneOrMany; -interface RoleInterface -{ +interface RoleInterface { public function roleOwner(): HasOneOrMany; } diff --git a/src/backend/app/Models/Role/Roles.php b/src/backend/app/Models/Role/Roles.php index 65d27c71a..bb3514bc7 100644 --- a/src/backend/app/Models/Role/Roles.php +++ b/src/backend/app/Models/Role/Roles.php @@ -6,17 +6,14 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\MorphTo; -class Roles extends BaseModel -{ +class Roles extends BaseModel { protected $connection = 'micro_power_manager'; - public function definitions(): BelongsTo - { + public function definitions(): BelongsTo { return $this->belongsTo(RoleDefinition::class, 'role_definition_id'); } - public function roleOwner(): MorphTo - { + public function roleOwner(): MorphTo { return $this->morphTo(); } } diff --git a/src/backend/app/Models/Sms.php b/src/backend/app/Models/Sms.php index 36cbdbf81..f3947ad0a 100644 --- a/src/backend/app/Models/Sms.php +++ b/src/backend/app/Models/Sms.php @@ -20,15 +20,12 @@ * @property int $direction * @property int $sender_id */ -class Sms extends BaseModel -{ - public function trigger(): MorphTo - { +class Sms extends BaseModel { + public function trigger(): MorphTo { return $this->morphTo(); } - public function address(): BelongsTo - { + public function address(): BelongsTo { return $this->belongsTo(Address::class, 'receiver', 'phone'); } } diff --git a/src/backend/app/Models/SmsAndroidSetting.php b/src/backend/app/Models/SmsAndroidSetting.php index bae1bea8a..cb25957a0 100644 --- a/src/backend/app/Models/SmsAndroidSetting.php +++ b/src/backend/app/Models/SmsAndroidSetting.php @@ -9,12 +9,10 @@ /** * @property int $id */ -class SmsAndroidSetting extends BaseModel -{ +class SmsAndroidSetting extends BaseModel { protected $table = 'sms_android_settings'; - public static function getResponsible() - { + public static function getResponsible() { $smsAndroidSettings = SmsAndroidSetting::all(); if ($smsAndroidSettings->count()) { try { @@ -30,8 +28,7 @@ public static function getResponsible() } } - public function getId(): int - { + public function getId(): int { return $this->id; } } diff --git a/src/backend/app/Models/SmsApplianceRemindRate.php b/src/backend/app/Models/SmsApplianceRemindRate.php index eb2227c75..86de310fb 100644 --- a/src/backend/app/Models/SmsApplianceRemindRate.php +++ b/src/backend/app/Models/SmsApplianceRemindRate.php @@ -5,12 +5,10 @@ use App\Models\Base\BaseModel; use Illuminate\Database\Eloquent\Relations\BelongsTo; -class SmsApplianceRemindRate extends BaseModel -{ +class SmsApplianceRemindRate extends BaseModel { protected $table = 'sms_appliance_remind_rates'; - public function appliance(): BelongsTo - { + public function appliance(): BelongsTo { return $this->belongsTo(Asset::class, 'appliance_id', 'id'); } } diff --git a/src/backend/app/Models/SmsBody.php b/src/backend/app/Models/SmsBody.php index aa9192723..f3bb6840f 100644 --- a/src/backend/app/Models/SmsBody.php +++ b/src/backend/app/Models/SmsBody.php @@ -4,7 +4,6 @@ use App\Models\Base\BaseModel; -class SmsBody extends BaseModel -{ +class SmsBody extends BaseModel { protected $table = 'sms_bodies'; } diff --git a/src/backend/app/Models/SmsResendInformationKey.php b/src/backend/app/Models/SmsResendInformationKey.php index 2145b3672..a8cc4794c 100644 --- a/src/backend/app/Models/SmsResendInformationKey.php +++ b/src/backend/app/Models/SmsResendInformationKey.php @@ -4,7 +4,6 @@ use App\Models\Base\BaseModel; -class SmsResendInformationKey extends BaseModel -{ +class SmsResendInformationKey extends BaseModel { protected $table = 'sms_resend_information_keys'; } diff --git a/src/backend/app/Models/SmsVariableDefaultValue.php b/src/backend/app/Models/SmsVariableDefaultValue.php index 5fb11f64d..c406e7788 100644 --- a/src/backend/app/Models/SmsVariableDefaultValue.php +++ b/src/backend/app/Models/SmsVariableDefaultValue.php @@ -4,7 +4,6 @@ use App\Models\Base\BaseModel; -class SmsVariableDefaultValue extends BaseModel -{ +class SmsVariableDefaultValue extends BaseModel { protected $table = 'sms_variable_default_values'; } diff --git a/src/backend/app/Models/SocialTariff.php b/src/backend/app/Models/SocialTariff.php index 6fcb471fc..fcad1e190 100644 --- a/src/backend/app/Models/SocialTariff.php +++ b/src/backend/app/Models/SocialTariff.php @@ -14,7 +14,6 @@ * @property int $initial_energy_budget * @property int $maximum_stacked_energy */ -class SocialTariff extends BaseModel -{ +class SocialTariff extends BaseModel { protected $guarded = []; } diff --git a/src/backend/app/Models/SocialTariffPiggyBank.php b/src/backend/app/Models/SocialTariffPiggyBank.php index 3deb05a7a..db1454857 100644 --- a/src/backend/app/Models/SocialTariffPiggyBank.php +++ b/src/backend/app/Models/SocialTariffPiggyBank.php @@ -13,17 +13,14 @@ * @property string $owner_type * @property int $savings */ -class SocialTariffPiggyBank extends BaseModel -{ +class SocialTariffPiggyBank extends BaseModel { protected $guarded = []; - public function meter(): BelongsTo - { + public function meter(): BelongsTo { return $this->belongsTo(MeterParameter::class); } - public function socialTariff(): BelongsTo - { + public function socialTariff(): BelongsTo { return $this->belongsTo(SocialTariff::class); } } diff --git a/src/backend/app/Models/SolarHomeSystem.php b/src/backend/app/Models/SolarHomeSystem.php index 4f9d40753..a4828773b 100644 --- a/src/backend/app/Models/SolarHomeSystem.php +++ b/src/backend/app/Models/SolarHomeSystem.php @@ -7,26 +7,22 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\MorphOne; -class SolarHomeSystem extends BaseModel -{ +class SolarHomeSystem extends BaseModel { use HasFactory; public const RELATION_NAME = 'solar_home_system'; protected $table = 'solar_home_systems'; - public function device(): MorphOne - { + public function device(): MorphOne { return $this->morphOne(Device::class, 'device'); } - public function manufacturer(): BelongsTo - { + public function manufacturer(): BelongsTo { return $this->belongsTo(Manufacturer::class); } - public function appliance(): BelongsTo - { + public function appliance(): BelongsTo { return $this->belongsTo(Asset::class, 'asset_id', 'id'); } } diff --git a/src/backend/app/Models/SubConnectionType.php b/src/backend/app/Models/SubConnectionType.php index 79b07263a..607188e4f 100644 --- a/src/backend/app/Models/SubConnectionType.php +++ b/src/backend/app/Models/SubConnectionType.php @@ -8,20 +8,16 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\HasMany; -class SubConnectionType extends BaseModel -{ - public function connectionType(): BelongsTo - { +class SubConnectionType extends BaseModel { + public function connectionType(): BelongsTo { return $this->belongsTo(ConnectionType::class); } - public function meterParameters(): HasMany - { + public function meterParameters(): HasMany { return $this->hasMany(MeterParameter::class, 'connection_type_id'); } - public function tariff(): BelongsTo - { + public function tariff(): BelongsTo { return $this->belongsTo(MeterTariff::class, 'tariff_id', 'id'); } } diff --git a/src/backend/app/Models/SubTarget.php b/src/backend/app/Models/SubTarget.php index 85549f23b..92dfc70ce 100644 --- a/src/backend/app/Models/SubTarget.php +++ b/src/backend/app/Models/SubTarget.php @@ -14,15 +14,12 @@ * @property int $revenue * @property int new_connections */ -class SubTarget extends BaseModel -{ - public function target(): BelongsTo - { +class SubTarget extends BaseModel { + public function target(): BelongsTo { return $this->belongsTo(Target::class); } - public function connectionType(): BelongsTo - { + public function connectionType(): BelongsTo { return $this->belongsTo(ConnectionGroup::class, 'connection_id'); } } diff --git a/src/backend/app/Models/Subscription.php b/src/backend/app/Models/Subscription.php index bbc1d7bd2..b2e42f62c 100644 --- a/src/backend/app/Models/Subscription.php +++ b/src/backend/app/Models/Subscription.php @@ -13,10 +13,8 @@ * @property string $expires * @property string $transaction_id */ -class Subscription extends BaseModel -{ - public function upgrade(): BelongsTo - { +class Subscription extends BaseModel { + public function upgrade(): BelongsTo { return $this->belongsTo(Upgrade::class); } } diff --git a/src/backend/app/Models/Target.php b/src/backend/app/Models/Target.php index 51093002b..cedea66ee 100644 --- a/src/backend/app/Models/Target.php +++ b/src/backend/app/Models/Target.php @@ -17,20 +17,16 @@ * @property string $end_date * @property int $city_id */ -class Target extends BaseModel -{ - public function city(): BelongsTo - { +class Target extends BaseModel { + public function city(): BelongsTo { return $this->belongsTo(City::class); } - public function subTargets(): HasMany - { + public function subTargets(): HasMany { return $this->hasMany(SubTarget::class); } - public function targetForMiniGrid($cityId, string $endDate): Builder - { + public function targetForMiniGrid($cityId, string $endDate): Builder { return $this::with('subTargets.connectionType', 'city') ->where('owner_id', $cityId) ->where('owner_type', 'mini-grid') @@ -39,8 +35,7 @@ public function targetForMiniGrid($cityId, string $endDate): Builder ->limit(1); } - public function targetForCluster($miniGridIds, string $endDate): Builder - { + public function targetForCluster($miniGridIds, string $endDate): Builder { return $this::query() ->select(DB::raw('*, YEARWEEK(target_date,3) as period')) ->with('subTargets.connectionType', 'city') @@ -50,13 +45,11 @@ public function targetForCluster($miniGridIds, string $endDate): Builder ->orderBy('target_date', 'asc'); } - public function owner(): MorphTo - { + public function owner(): MorphTo { return $this->morphTo(); } - public function periodTargetAlternative($cityId, $startDate): Builder - { + public function periodTargetAlternative($cityId, $startDate): Builder { return $this::query() ->select(DB::raw('*, YEARWEEK(target_date,3) as period'))->with( 'subTargets.connectionType', diff --git a/src/backend/app/Models/TariffPricingComponent.php b/src/backend/app/Models/TariffPricingComponent.php index 73422b6e0..f0ffdee88 100644 --- a/src/backend/app/Models/TariffPricingComponent.php +++ b/src/backend/app/Models/TariffPricingComponent.php @@ -14,12 +14,10 @@ * @property int $owner_id * @property string $owner_type */ -class TariffPricingComponent extends BaseModel -{ +class TariffPricingComponent extends BaseModel { protected $guarded = []; - public function owner(): MorphTo - { + public function owner(): MorphTo { return $this->morphTo(); } } diff --git a/src/backend/app/Models/TicketSettings.php b/src/backend/app/Models/TicketSettings.php index 081c3f385..bbfe4fc1d 100644 --- a/src/backend/app/Models/TicketSettings.php +++ b/src/backend/app/Models/TicketSettings.php @@ -13,6 +13,4 @@ * @property string $api_url * @property string $api_key * */ -class TicketSettings extends BaseModel -{ -} +class TicketSettings extends BaseModel {} diff --git a/src/backend/app/Models/TimeOfUsage.php b/src/backend/app/Models/TimeOfUsage.php index 2227c2c5c..c5d98f62e 100644 --- a/src/backend/app/Models/TimeOfUsage.php +++ b/src/backend/app/Models/TimeOfUsage.php @@ -6,10 +6,8 @@ use App\Models\Meter\MeterTariff; use Illuminate\Database\Eloquent\Relations\BelongsTo; -class TimeOfUsage extends BaseModel -{ - public function tariff(): BelongsTo - { +class TimeOfUsage extends BaseModel { + public function tariff(): BelongsTo { return $this->belongsTo(MeterTariff::class); } } diff --git a/src/backend/app/Models/Token.php b/src/backend/app/Models/Token.php index 52f839fce..4382fcc7d 100644 --- a/src/backend/app/Models/Token.php +++ b/src/backend/app/Models/Token.php @@ -7,17 +7,14 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\MorphOne; -class Token extends BaseModel -{ +class Token extends BaseModel { public const RELATION_NAME = 'token'; - public function transaction(): BelongsTo - { + public function transaction(): BelongsTo { return $this->belongsTo(Transaction::class); } - public function paymentHistories(): MorphOne - { + public function paymentHistories(): MorphOne { return $this->morphOne(PaymentHistory::class, 'paid_for'); } } diff --git a/src/backend/app/Models/Transaction/AgentTransaction.php b/src/backend/app/Models/Transaction/AgentTransaction.php index 5af770914..8f7255ee6 100644 --- a/src/backend/app/Models/Transaction/AgentTransaction.php +++ b/src/backend/app/Models/Transaction/AgentTransaction.php @@ -16,32 +16,26 @@ * @property int status * @property string sender */ -class AgentTransaction extends BaseModel implements FullySupportedTransactionInterface, IRawTransaction -{ +class AgentTransaction extends BaseModel implements FullySupportedTransactionInterface, IRawTransaction { public const RELATION_NAME = 'agent_transaction'; - public function transaction(): MorphOne - { + public function transaction(): MorphOne { return $this->morphOne(Transaction::class, 'original_transaction'); } - public function manufacturerTransaction(): MorphTo - { + public function manufacturerTransaction(): MorphTo { return $this->morphTo(); } - public function agent(): BelongsTo - { + public function agent(): BelongsTo { return $this->belongsTo(Agent::class); } - public function conflicts(): MorphMany - { + public function conflicts(): MorphMany { return $this->morphMany(TransactionConflicts::class, 'transaction'); } - public static function getTransactionName(): string - { + public static function getTransactionName(): string { return self::RELATION_NAME; } } diff --git a/src/backend/app/Models/Transaction/AirtelTransaction.php b/src/backend/app/Models/Transaction/AirtelTransaction.php index c638dcc65..f541ac289 100644 --- a/src/backend/app/Models/Transaction/AirtelTransaction.php +++ b/src/backend/app/Models/Transaction/AirtelTransaction.php @@ -18,27 +18,22 @@ * @property int $status * @property string $tr_id */ -class AirtelTransaction extends BaseModel implements FullySupportedTransactionInterface, IRawTransaction -{ +class AirtelTransaction extends BaseModel implements FullySupportedTransactionInterface, IRawTransaction { public const RELATION_NAME = 'airtel_transaction'; - public function transaction(): MorphOne - { + public function transaction(): MorphOne { return $this->morphOne(Transaction::class, 'original_transaction'); } - public function manufacturerTransaction(): MorphTo - { + public function manufacturerTransaction(): MorphTo { return $this->morphTo(); } - public function conflicts(): MorphMany - { + public function conflicts(): MorphMany { return $this->morphMany(TransactionConflicts::class, 'transaction'); } - public static function getTransactionName(): string - { + public static function getTransactionName(): string { return self::RELATION_NAME; } } diff --git a/src/backend/app/Models/Transaction/CashTransaction.php b/src/backend/app/Models/Transaction/CashTransaction.php index a0e511809..d095aaa01 100644 --- a/src/backend/app/Models/Transaction/CashTransaction.php +++ b/src/backend/app/Models/Transaction/CashTransaction.php @@ -15,27 +15,22 @@ * @property int manufacturer_transaction_id * @property string manufacturer_transaction_type */ -class CashTransaction extends BaseModel implements IRawTransaction -{ +class CashTransaction extends BaseModel implements IRawTransaction { public const RELATION_NAME = 'cash_transaction'; - public function user(): BelongsTo - { + public function user(): BelongsTo { return $this->belongsTo(User::class); } - public function transaction(): MorphOne - { + public function transaction(): MorphOne { return $this->morphOne(Transaction::class, 'original_transaction'); } - public function manufacturerTransaction(): MorphTo - { + public function manufacturerTransaction(): MorphTo { return $this->morphTo(); } - public function conflicts(): MorphMany - { + public function conflicts(): MorphMany { return $this->morphMany(TransactionConflicts::class, 'transaction'); } } diff --git a/src/backend/app/Models/Transaction/IRawTransaction.php b/src/backend/app/Models/Transaction/IRawTransaction.php index efd619135..4a675fee4 100644 --- a/src/backend/app/Models/Transaction/IRawTransaction.php +++ b/src/backend/app/Models/Transaction/IRawTransaction.php @@ -2,8 +2,7 @@ namespace App\Models\Transaction; -interface IRawTransaction -{ +interface IRawTransaction { // returns the filtered transaction // which is been used by the system // to process the payment diff --git a/src/backend/app/Models/Transaction/ISubTransaction.php b/src/backend/app/Models/Transaction/ISubTransaction.php index 42e3957ae..34e5cf778 100644 --- a/src/backend/app/Models/Transaction/ISubTransaction.php +++ b/src/backend/app/Models/Transaction/ISubTransaction.php @@ -2,8 +2,7 @@ namespace App\Models\Transaction; -interface ISubTransaction -{ +interface ISubTransaction { public function vodacomTransaction(); public function airtelTransaction(); diff --git a/src/backend/app/Models/Transaction/ThirdPartyTransaction.php b/src/backend/app/Models/Transaction/ThirdPartyTransaction.php index 28b7bddd3..284acb34d 100644 --- a/src/backend/app/Models/Transaction/ThirdPartyTransaction.php +++ b/src/backend/app/Models/Transaction/ThirdPartyTransaction.php @@ -7,22 +7,18 @@ use Illuminate\Database\Eloquent\Relations\MorphOne; use Illuminate\Database\Eloquent\Relations\MorphTo; -class ThirdPartyTransaction extends BaseModel implements IRawTransaction -{ +class ThirdPartyTransaction extends BaseModel implements IRawTransaction { public const RELATION_NAME = 'third_party_transaction'; - public function transaction(): MorphOne - { + public function transaction(): MorphOne { return $this->morphOne(Transaction::class, 'original_transaction'); } - public function manufacturerTransaction(): MorphTo - { + public function manufacturerTransaction(): MorphTo { return $this->morphTo(); } - public function conflicts(): MorphMany - { + public function conflicts(): MorphMany { return $this->morphMany(TransactionConflicts::class, 'transaction'); } } diff --git a/src/backend/app/Models/Transaction/Transaction.php b/src/backend/app/Models/Transaction/Transaction.php index b35a2a89e..c4f456f76 100644 --- a/src/backend/app/Models/Transaction/Transaction.php +++ b/src/backend/app/Models/Transaction/Transaction.php @@ -27,46 +27,38 @@ * @property string $message * @property string $original_transaction_type */ -class Transaction extends BaseModel -{ +class Transaction extends BaseModel { use RelationsManager; public const RELATION_NAME = 'transaction'; public const TYPE_IMPORTED = 'imported'; - public function originalTransaction(): MorphTo - { + public function originalTransaction(): MorphTo { return $this->morphTo(); } - public function token(): HasOne - { + public function token(): HasOne { return $this->hasOne(Token::class); } - public function sms(): MorphOne - { + public function sms(): MorphOne { return $this->morphOne(Sms::class, 'trigger'); } - public function paymentHistories(): HasMany - { + public function paymentHistories(): HasMany { return $this->hasMany(PaymentHistory::class); } - public function device(): HasOne - { + public function device(): HasOne { return $this->hasOne(Device::class, 'device_serial', 'message'); } - public function appliance(): HasOne - { + public function appliance(): HasOne { return $this->hasOne(AssetPerson::class, 'device_serial', 'message'); } - public function periodTargetAlternative($cityId, $startDate, $endDate) - { + public function periodTargetAlternative($cityId, $startDate, $endDate) { $sql = 'SELECT sum(transactions.amount) as revenue,'. ' count(transactions.id) as total,'. ' AVG(transactions.amount) as average,'. @@ -100,68 +92,55 @@ public function periodTargetAlternative($cityId, $startDate, $endDate) return $sth->fetchAll(\PDO::FETCH_ASSOC); } - public function getAmount(): int - { + public function getAmount(): int { return $this->amount; } - public function getOriginalTransactionType(): string - { + public function getOriginalTransactionType(): string { return $this->original_transaction_type; } - public function getSender(): string - { + public function getSender(): string { return $this->sender; } - public function setAmount(int $amount): void - { + public function setAmount(int $amount): void { $this->amount = $amount; } - public function setSender(string $sender): void - { + public function setSender(string $sender): void { $this->sender = $sender; } - public function setMessage(string $message): void - { + public function setMessage(string $message): void { $this->message = $message; } - public function setOriginalTransactionType(string $originalTransaction): void - { + public function setOriginalTransactionType(string $originalTransaction): void { $this->original_transaction_type = $originalTransaction; } - public function getId(): int - { + public function getId(): int { return $this->id; } - public function setType(string $type) - { + public function setType(string $type) { $this->type = $type; } - public function getMessage(): string - { + public function getMessage(): string { return $this->message; } - public function originalAgent(): BelongsToMorph - { + public function originalAgent(): BelongsToMorph { return BelongsToMorph::build($this, AgentTransaction::class, 'originalTransaction'); } - public function originalCash(): BelongsToMorph - { + public function originalCash(): BelongsToMorph { return BelongsToMorph::build($this, CashTransaction::class, 'originalTransaction'); } - public function originalWaveMoney(): BelongsToMorph - { + public function originalWaveMoney(): BelongsToMorph { return BelongsToMorph::build($this, WaveMoneyTransaction::class, 'originalTransaction'); } } diff --git a/src/backend/app/Models/Transaction/TransactionConflicts.php b/src/backend/app/Models/Transaction/TransactionConflicts.php index 997c03d18..2213f1f1c 100644 --- a/src/backend/app/Models/Transaction/TransactionConflicts.php +++ b/src/backend/app/Models/Transaction/TransactionConflicts.php @@ -11,10 +11,8 @@ * @property int id * @property string state */ -class TransactionConflicts extends BaseModel -{ - public function transaction(): MorphTo - { +class TransactionConflicts extends BaseModel { + public function transaction(): MorphTo { return $this->morphTo(); } } diff --git a/src/backend/app/Models/Transaction/VodacomTransaction.php b/src/backend/app/Models/Transaction/VodacomTransaction.php index 7cd110e3f..b890e0872 100644 --- a/src/backend/app/Models/Transaction/VodacomTransaction.php +++ b/src/backend/app/Models/Transaction/VodacomTransaction.php @@ -17,30 +17,25 @@ * @property string transaction_date * @property int status */ -class VodacomTransaction extends BaseModel implements FullySupportedTransactionInterface, IRawTransaction -{ +class VodacomTransaction extends BaseModel implements FullySupportedTransactionInterface, IRawTransaction { public const RELATION_NAME = 'vodacom_transaction'; /** * @return MorphOne */ - public function transaction() - { + public function transaction() { return $this->morphOne(Transaction::class, 'original_transaction'); } - public function manufacturerTransaction(): MorphTo - { + public function manufacturerTransaction(): MorphTo { return $this->morphTo(); } - public function conflicts(): MorphMany - { + public function conflicts(): MorphMany { return $this->morphMany(TransactionConflicts::class, 'transaction'); } - public static function getTransactionName(): string - { + public static function getTransactionName(): string { return self::RELATION_NAME; } } diff --git a/src/backend/app/Models/Upgrade.php b/src/backend/app/Models/Upgrade.php index dcdf08189..dd0b0a78e 100644 --- a/src/backend/app/Models/Upgrade.php +++ b/src/backend/app/Models/Upgrade.php @@ -13,10 +13,8 @@ * @property int $cost * @property int $period_in_months */ -class Upgrade extends BaseModel -{ - public function restriction(): BelongsTo - { +class Upgrade extends BaseModel { + public function restriction(): BelongsTo { return $this->belongsTo(Restriction::class); } } diff --git a/src/backend/app/Models/UsageType.php b/src/backend/app/Models/UsageType.php index 9b6f99281..48f9dce6f 100644 --- a/src/backend/app/Models/UsageType.php +++ b/src/backend/app/Models/UsageType.php @@ -5,8 +5,7 @@ use App\Models\Base\BaseModelCore; use Illuminate\Database\Eloquent\Factories\HasFactory; -class UsageType extends BaseModelCore -{ +class UsageType extends BaseModelCore { use HasFactory; protected $table = 'usage_types'; diff --git a/src/backend/app/Models/User.php b/src/backend/app/Models/User.php index 1b787188a..5a6ca8022 100644 --- a/src/backend/app/Models/User.php +++ b/src/backend/app/Models/User.php @@ -22,8 +22,7 @@ * @property string $name * @property string|null $email */ -class User extends Authenticatable implements JWTSubject -{ +class User extends Authenticatable implements JWTSubject { use HasFactory; use Notifiable; @@ -33,15 +32,13 @@ class User extends Authenticatable implements JWTSubject public const COL_COMPANY_ID = 'company_id'; - public function __construct(array $attributes = []) - { + public function __construct(array $attributes = []) { $this->setConnection('shard'); parent::__construct($attributes); } - public function setPasswordAttribute($password): void - { + public function setPasswordAttribute($password): void { $this->attributes['password'] = Hash::make($password); } @@ -72,67 +69,55 @@ public function setPasswordAttribute($password): void * * @return mixed */ - public function getJWTIdentifier() - { + public function getJWTIdentifier() { return $this->getKey(); } // we need to provide the company id in the token to encode and find the right database when an authenticated requests hits the api - public function getJWTCustomClaims(): array - { + public function getJWTCustomClaims(): array { return [ 'companyId' => $this->getCompanyId(), ]; } - public function address(): MorphOne - { + public function address(): MorphOne { return $this->morphOne(Address::class, 'owner'); } - public function addressDetails(): MorphOne - { + public function addressDetails(): MorphOne { return $this->address()->with('city'); } - public function balanceHistory(): HasMany - { + public function balanceHistory(): HasMany { return $this->hasMany(AgentBalanceHistory::class); } - public function assignedAppliance(): HasMany - { + public function assignedAppliance(): HasMany { return $this->hasMany(AgentAssignedAppliances::class); } // belongsTo company - public function company(): BelongsTo - { + public function company(): BelongsTo { return $this->BelongsTo(Company::class, 'company_id'); } - public function getCompanyId(): int - { + public function getCompanyId(): int { return $this->company_id; } - public function getId(): int - { + public function getId(): int { return $this->id; } - public function getName(): string - { + public function getName(): string { return $this->name; } - public function getEmail(): string - { + public function getEmail(): string { return $this->email; } - public function relationTicketUser(): HasOne - { + public function relationTicketUser(): HasOne { return $this->hasOne(TicketUser::class, TicketUser::COL_USER_ID, User::COL_ID); } } diff --git a/src/backend/app/Observers/AddressesObserver.php b/src/backend/app/Observers/AddressesObserver.php index 274dfbae3..d09caecb5 100644 --- a/src/backend/app/Observers/AddressesObserver.php +++ b/src/backend/app/Observers/AddressesObserver.php @@ -4,13 +4,11 @@ use App\Models\Address\Address; -class AddressesObserver -{ +class AddressesObserver { /** * Handles 'deleted' event of Address. */ - public function deleted(Address $address): void - { + public function deleted(Address $address): void { // delete the geographic information for that address // $address->geo()->delete(); } diff --git a/src/backend/app/Observers/AgentBalanceHistoryObserver.php b/src/backend/app/Observers/AgentBalanceHistoryObserver.php index 3db4e311e..b51627eb4 100644 --- a/src/backend/app/Observers/AgentBalanceHistoryObserver.php +++ b/src/backend/app/Observers/AgentBalanceHistoryObserver.php @@ -10,20 +10,17 @@ use App\Models\Transaction\AgentTransaction; use App\Services\AgentService; -class AgentBalanceHistoryObserver -{ +class AgentBalanceHistoryObserver { public function __construct( private AgentService $agentService, - ) { - } + ) {} /** * Handle the asset person "updated" event. * * @return void */ - public function created(AgentBalanceHistory $agentBalanceHistory) - { + public function created(AgentBalanceHistory $agentBalanceHistory) { $trigger = $agentBalanceHistory->trigger()->first(); $agent = $this->agentService->getById($agentBalanceHistory->agent_id); diff --git a/src/backend/app/Observers/AgentChargeObserver.php b/src/backend/app/Observers/AgentChargeObserver.php index fa9d39e67..509397724 100644 --- a/src/backend/app/Observers/AgentChargeObserver.php +++ b/src/backend/app/Observers/AgentChargeObserver.php @@ -7,17 +7,14 @@ use App\Services\AgentChargeHistoryBalanceService; use App\Services\AgentService; -class AgentChargeObserver -{ +class AgentChargeObserver { public function __construct( private AgentChargeHistoryBalanceService $agentChargeHistoryBalanceService, private AgentBalanceHistoryService $agentBalanceHistoryService, private AgentService $agentService, - ) { - } + ) {} - public function created(AgentCharge $agentCharge): void - { + public function created(AgentCharge $agentCharge): void { $agent = $this->agentService->getById($agentCharge->agent_id); $agentBalanceHistoryData = [ 'agent_id' => $agent->id, diff --git a/src/backend/app/Observers/AgentObserver.php b/src/backend/app/Observers/AgentObserver.php index d7f4d5b4f..67e955e24 100644 --- a/src/backend/app/Observers/AgentObserver.php +++ b/src/backend/app/Observers/AgentObserver.php @@ -6,19 +6,14 @@ use App\Models\Person\Person; use Illuminate\Support\Facades\Log; -class AgentObserver -{ - public function created(Agent $agent): void - { - } +class AgentObserver { + public function created(Agent $agent): void {} - public function updated(Agent $agent): void - { + public function updated(Agent $agent): void { Log::debug($agent->id.'updated'); } - public function deleted(Agent $agent): void - { + public function deleted(Agent $agent): void { $person = Person::find($agent->person_id); $person->delete(); foreach ($agent->addresses()->get() as $address) { diff --git a/src/backend/app/Observers/AgentReceiptObserver.php b/src/backend/app/Observers/AgentReceiptObserver.php index 59c46f608..fc0394de4 100644 --- a/src/backend/app/Observers/AgentReceiptObserver.php +++ b/src/backend/app/Observers/AgentReceiptObserver.php @@ -10,19 +10,16 @@ use App\Services\AgentService; use Illuminate\Database\Eloquent\ModelNotFoundException; -class AgentReceiptObserver -{ +class AgentReceiptObserver { public function __construct( private AgentBalanceHistoryService $agentBalanceHistoryService, private AgentService $agentService, private AgentReceiptService $agentReceiptService, private AgentReceiptDetailService $agentReceiptDetailService, private AgentReceiptHistoryBalanceService $agentReceiptHistoryBalanceService, - ) { - } + ) {} - public function created(AgentReceipt $receipt): void - { + public function created(AgentReceipt $receipt): void { $agentId = $receipt->agent_id; $agent = $this->agentService->getById($agentId); $due = $agent->due_to_energy_supplier; diff --git a/src/backend/app/Observers/AgentSoldApplianceObserver.php b/src/backend/app/Observers/AgentSoldApplianceObserver.php index 6da696d97..66cd33ae0 100644 --- a/src/backend/app/Observers/AgentSoldApplianceObserver.php +++ b/src/backend/app/Observers/AgentSoldApplianceObserver.php @@ -15,8 +15,7 @@ use App\Services\AppliancePersonService; use MPM\Transaction\TransactionService; -class AgentSoldApplianceObserver -{ +class AgentSoldApplianceObserver { public function __construct( private AgentBalanceHistoryService $agentBalanceHistoryService, private AgentAssignedApplianceService $agentAssignedApplianceService, @@ -29,18 +28,15 @@ public function __construct( private AgentAssignedApplianceHistoryBalanceService $agentAssignedApplianceHistoryBalanceService, private AgentCommissionService $agentCommissionService, private AgentCommissionHistoryBalanceService $agentCommissionHistoryBalanceService, - ) { - } + ) {} - public function created(AgentSoldAppliance $agentSoldAppliance): void - { + public function created(AgentSoldAppliance $agentSoldAppliance): void { if (request()->all()) { $this->processSaleIfIsNotCreatedByFactory($agentSoldAppliance); } } - private function processSaleIfIsNotCreatedByFactory($agentSoldAppliance) - { + private function processSaleIfIsNotCreatedByFactory($agentSoldAppliance) { $assignedApplianceId = $agentSoldAppliance->agent_assigned_appliance_id; $assignedAppliance = $this->agentAssignedApplianceService->getById($assignedApplianceId); $appliance = $assignedAppliance->applianceType()->first(); diff --git a/src/backend/app/Observers/MeterParameterObserver.php b/src/backend/app/Observers/MeterParameterObserver.php index 5b4cf9f71..2a652ff3d 100644 --- a/src/backend/app/Observers/MeterParameterObserver.php +++ b/src/backend/app/Observers/MeterParameterObserver.php @@ -8,25 +8,20 @@ use App\Models\Meter\MeterParameter; use App\Services\MeterParameterService; -class MeterParameterObserver -{ - public function __construct(private MeterParameterService $meterParameterService) - { - } +class MeterParameterObserver { + public function __construct(private MeterParameterService $meterParameterService) {} /** * Handle "deleted" event. */ - public function deleted(MeterParameter $meterParameter): void - { + public function deleted(MeterParameter $meterParameter): void { // set the meter free $meter = $meterParameter->meter()->first(); $meter->in_use = 0; $meter->save(); } - public function created(MeterParameter $meterParameter): void - { + public function created(MeterParameter $meterParameter): void { /* CreatePiggyBankEntry::dispatchSync( $meterParameter,$this->meterParameterService);*/ @@ -35,8 +30,7 @@ public function created(MeterParameter $meterParameter): void $meter->save(); } - public function updated(MeterParameter $meterParameter): void - { + public function updated(MeterParameter $meterParameter): void { // UpdatePiggyBankEntry::dispatchSync($meterParameter); } } diff --git a/src/backend/app/Observers/PersonObserver.php b/src/backend/app/Observers/PersonObserver.php index 0e23a6ac5..fbcc9ed4b 100644 --- a/src/backend/app/Observers/PersonObserver.php +++ b/src/backend/app/Observers/PersonObserver.php @@ -5,21 +5,18 @@ use App\Models\Person\Person; use Illuminate\Support\Facades\Log; -class PersonObserver -{ +class PersonObserver { /** * Handle the Person "updated" event. */ - public function updated(Person $person): void - { + public function updated(Person $person): void { Log::debug($person->id.'updated'); } /** * Handle the User "deleted" event. */ - public function deleted(Person $person): void - { + public function deleted(Person $person): void { // delete all associated roles $person->roleOwner()->get(); diff --git a/src/backend/app/PaymentHandler/AccessRate.php b/src/backend/app/PaymentHandler/AccessRate.php index 7b9e9f815..946b76127 100644 --- a/src/backend/app/PaymentHandler/AccessRate.php +++ b/src/backend/app/PaymentHandler/AccessRate.php @@ -9,8 +9,7 @@ use App\Models\Meter\MeterParameter; use Carbon\Carbon; -class AccessRate -{ +class AccessRate { /** * @var AccessRate */ @@ -26,15 +25,12 @@ class AccessRate * * @param AccessRate $accessRate */ - public function __construct() - { - } + public function __construct() {} /** * @throws NoAccessRateFound */ - public static function withMeterParameters(MeterParameter $meterParameter): AccessRate - { + public static function withMeterParameters(MeterParameter $meterParameter): AccessRate { if ($meterParameter->tariffAccessRate() === null) { throw new NoAccessRateFound('Tariff '.$meterParameter->tariff()->first()->name.' has no access rate'); } @@ -45,16 +41,14 @@ public static function withMeterParameters(MeterParameter $meterParameter): Acce return $accessRate; } - private function setMeterParameter(MeterParameter $meterParameter): void - { + private function setMeterParameter(MeterParameter $meterParameter): void { $this->meterParameter = $meterParameter; } /** * @throws NoAccessRateFound */ - public function initializeAccessRatePayment(): AccessRatePayment - { + public function initializeAccessRatePayment(): AccessRatePayment { if ($this->accessRate === null || $this->meterParameter === null) { throw new NoAccessRateFound(sprintf('%s %s', $this->accessRate === null ? 'Access Rate is not set' : '', $this->meterParameter === null ? 'Meter Parameter is not set' : '')); } @@ -73,8 +67,7 @@ public function initializeAccessRatePayment(): AccessRatePayment /** * @throws NoAccessRateFound */ - private function getDebt(Meter $meter): int - { + private function getDebt(Meter $meter): int { $accessRate = $meter->accessRatePayment()->first(); if ($accessRate === null) { throw new NoAccessRateFound('no access rate is defined'); @@ -88,8 +81,7 @@ private function getDebt(Meter $meter): int * * @deprecated */ - public static function payAccessRate(TransactionDataContainer $transactionData): TransactionDataContainer - { + public static function payAccessRate(TransactionDataContainer $transactionData): TransactionDataContainer { $nonStaticGateway = new self(); // get accessRatePayment $accessRatePayment = $nonStaticGateway->getAccessRatePayment($transactionData->meter); @@ -128,14 +120,12 @@ public static function payAccessRate(TransactionDataContainer $transactionData): return $transactionData; } - public function updatePayment($accessRatePayment, int $paidAmount, bool $satisfied = false): void - { + public function updatePayment($accessRatePayment, int $paidAmount, bool $satisfied = false): void { $accessRatePayment->debt = $satisfied === true ? 0 : $accessRatePayment->debt - $paidAmount; $accessRatePayment->save(); } - private function getAccessRatePayment(Meter $meter): ?object - { + private function getAccessRatePayment(Meter $meter): ?object { return $meter->accessRatePayment()->first(); } } diff --git a/src/backend/app/PaymentHandler/EnergyPayment.php b/src/backend/app/PaymentHandler/EnergyPayment.php index bc17ecacd..de76192f4 100644 --- a/src/backend/app/PaymentHandler/EnergyPayment.php +++ b/src/backend/app/PaymentHandler/EnergyPayment.php @@ -2,6 +2,4 @@ namespace App\PaymentHandler; -class EnergyPayment -{ -} +class EnergyPayment {} diff --git a/src/backend/app/Providers/AppServiceProvider.php b/src/backend/app/Providers/AppServiceProvider.php index 9ac2d29f2..24a61d74c 100644 --- a/src/backend/app/Providers/AppServiceProvider.php +++ b/src/backend/app/Providers/AppServiceProvider.php @@ -48,15 +48,13 @@ use MPM\Transaction\Provider\AirtelVoltTerraProvider; use MPM\Transaction\Provider\VodacomTransactionProvider; -class AppServiceProvider extends ServiceProvider -{ +class AppServiceProvider extends ServiceProvider { /** * Bootstrap any application services. * * @return void */ - public function boot() - { + public function boot() { // Maria DB work-around Schema::defaultStringLength(191); @@ -100,8 +98,7 @@ public function boot() /** * Register any application services. */ - public function register(): void - { + public function register(): void { if ($this->app->environment('development') || $this->app->environment('local')) { $this->app->singleton(MailHelperInterface::class, MailHelperMock::class); } else { diff --git a/src/backend/app/Providers/AuthServiceProvider.php b/src/backend/app/Providers/AuthServiceProvider.php index 84c04286a..de96aa8b4 100644 --- a/src/backend/app/Providers/AuthServiceProvider.php +++ b/src/backend/app/Providers/AuthServiceProvider.php @@ -4,8 +4,7 @@ use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; -class AuthServiceProvider extends ServiceProvider -{ +class AuthServiceProvider extends ServiceProvider { /** * The policy mappings for the application. * @@ -20,8 +19,7 @@ class AuthServiceProvider extends ServiceProvider * * @return void */ - public function boot() - { + public function boot() { $this->registerPolicies(); } } diff --git a/src/backend/app/Providers/BroadcastServiceProvider.php b/src/backend/app/Providers/BroadcastServiceProvider.php index 9529056e6..b254637d9 100644 --- a/src/backend/app/Providers/BroadcastServiceProvider.php +++ b/src/backend/app/Providers/BroadcastServiceProvider.php @@ -5,15 +5,13 @@ use Illuminate\Support\Facades\Broadcast; use Illuminate\Support\ServiceProvider; -class BroadcastServiceProvider extends ServiceProvider -{ +class BroadcastServiceProvider extends ServiceProvider { /** * Bootstrap any application services. * * @return void */ - public function boot() - { + public function boot() { Broadcast::routes(); include base_path('routes/channels.php'); diff --git a/src/backend/app/Providers/EventServiceProvider.php b/src/backend/app/Providers/EventServiceProvider.php index 96f555224..3c2f4f080 100644 --- a/src/backend/app/Providers/EventServiceProvider.php +++ b/src/backend/app/Providers/EventServiceProvider.php @@ -15,8 +15,7 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; use MPM\User\UserEventSubscriber; -class EventServiceProvider extends ServiceProvider -{ +class EventServiceProvider extends ServiceProvider { /** * The event listener mappings for the application. * @@ -45,8 +44,7 @@ class EventServiceProvider extends ServiceProvider * * @return void */ - public function boot() - { + public function boot() { parent::boot(); } } diff --git a/src/backend/app/Providers/HorizonServiceProvider.php b/src/backend/app/Providers/HorizonServiceProvider.php index c72d99ca6..829903db9 100644 --- a/src/backend/app/Providers/HorizonServiceProvider.php +++ b/src/backend/app/Providers/HorizonServiceProvider.php @@ -6,15 +6,13 @@ use Laravel\Horizon\Horizon; use Laravel\Horizon\HorizonApplicationServiceProvider; -class HorizonServiceProvider extends HorizonApplicationServiceProvider -{ +class HorizonServiceProvider extends HorizonApplicationServiceProvider { /** * Bootstrap any application services. * * @return void */ - public function boot() - { + public function boot() { parent::boot(); // Horizon::routeSmsNotificationsTo('15556667777'); @@ -31,8 +29,7 @@ public function boot() * * @return void */ - protected function gate() - { + protected function gate() { Gate::define( 'viewHorizon', function ($user) { diff --git a/src/backend/app/Providers/RouteServiceProvider.php b/src/backend/app/Providers/RouteServiceProvider.php index 4c0493cf0..aee4ccf4e 100644 --- a/src/backend/app/Providers/RouteServiceProvider.php +++ b/src/backend/app/Providers/RouteServiceProvider.php @@ -5,8 +5,7 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Support\Facades\Route; -class RouteServiceProvider extends ServiceProvider -{ +class RouteServiceProvider extends ServiceProvider { /** * This namespace is applied to your controller routes. * @@ -21,8 +20,7 @@ class RouteServiceProvider extends ServiceProvider * * @return void */ - public function boot() - { + public function boot() { parent::boot(); } @@ -31,8 +29,7 @@ public function boot() * * @return void */ - public function map() - { + public function map() { $this->mapApiRoutes(); $this->mapWebRoutes(); @@ -45,8 +42,7 @@ public function map() * * @return void */ - protected function mapWebRoutes() - { + protected function mapWebRoutes() { Route::middleware('web') ->namespace($this->namespace) ->group(base_path('routes/web.php')); @@ -59,8 +55,7 @@ protected function mapWebRoutes() * * @return void */ - protected function mapApiRoutes() - { + protected function mapApiRoutes() { Route::prefix('api') ->middleware('api') ->namespace($this->namespace) diff --git a/src/backend/app/Providers/ServicesProvider.php b/src/backend/app/Providers/ServicesProvider.php index de50c837d..4137f8c78 100644 --- a/src/backend/app/Providers/ServicesProvider.php +++ b/src/backend/app/Providers/ServicesProvider.php @@ -26,13 +26,11 @@ use Illuminate\Support\ServiceProvider; use Laravel\Horizon\Horizon; -class ServicesProvider extends ServiceProvider -{ +class ServicesProvider extends ServiceProvider { /** * Bootstrap services. */ - public function boot(): void - { + public function boot(): void { Person::observe(PersonObserver::class); Address::observe(AddressesObserver::class); MeterParameter::observe(MeterParameterObserver::class); @@ -51,8 +49,7 @@ static function ($request) { /** * Register services. */ - public function register(): void - { + public function register(): void { $this->app->bind( RolesService::class, function ($app) { diff --git a/src/backend/app/Providers/VodacomServiceProvider.php b/src/backend/app/Providers/VodacomServiceProvider.php index 32bee4568..a00aca511 100644 --- a/src/backend/app/Providers/VodacomServiceProvider.php +++ b/src/backend/app/Providers/VodacomServiceProvider.php @@ -4,8 +4,7 @@ use Illuminate\Support\ServiceProvider; -class VodacomServiceProvider extends ServiceProvider -{ +class VodacomServiceProvider extends ServiceProvider { protected $defer = true; /** @@ -13,16 +12,12 @@ class VodacomServiceProvider extends ServiceProvider * * @return void */ - public function boot() - { - } + public function boot() {} /** * Register services. * * @return void */ - public function register() - { - } + public function register() {} } diff --git a/src/backend/app/Relations/BelongsToMorph.php b/src/backend/app/Relations/BelongsToMorph.php index 07aeda666..ab8724441 100644 --- a/src/backend/app/Relations/BelongsToMorph.php +++ b/src/backend/app/Relations/BelongsToMorph.php @@ -9,8 +9,7 @@ use Illuminate\Support\Arr; use Illuminate\Support\Str; -class BelongsToMorph extends BelongsTo -{ +class BelongsToMorph extends BelongsTo { /** * The name of the polymorphic relation. * @@ -25,8 +24,7 @@ class BelongsToMorph extends BelongsTo */ protected $morphType; - public function __construct(Builder $query, Model $parent, $name, $type, $id, $otherKey, $relation) - { + public function __construct(Builder $query, Model $parent, $name, $type, $id, $otherKey, $relation) { $this->morphName = $name; $this->morphType = $type; parent::__construct($query, $parent, $id, $otherKey, $relation); @@ -53,8 +51,7 @@ public function __construct(Builder $query, Model $parent, $name, $type, $id, $o * * @return mixed */ - public function getResults() - { + public function getResults() { if ($this->getParent()->{$this->morphType} === $this->morphName) { return $this->query->first(); } @@ -69,8 +66,7 @@ public function getResults() * @param string $type * @param string $id */ - protected static function getMorphs($name, $type, $id): array - { + protected static function getMorphs($name, $type, $id): array { $type = $type ?: $name.'_type'; $id = $id ?: $name.'_id'; diff --git a/src/backend/app/Services/AbstractDashboardCacheDataService.php b/src/backend/app/Services/AbstractDashboardCacheDataService.php index 162bdb04e..d3e370291 100644 --- a/src/backend/app/Services/AbstractDashboardCacheDataService.php +++ b/src/backend/app/Services/AbstractDashboardCacheDataService.php @@ -6,8 +6,7 @@ use App\Models\User; use Illuminate\Support\Facades\Cache; -abstract class AbstractDashboardCacheDataService -{ +abstract class AbstractDashboardCacheDataService { protected string $cacheDataKey; public function __construct( @@ -18,13 +17,11 @@ public function __construct( abstract public function setData($dateRange = []); - public function getData() - { + public function getData() { return Cache::get(self::cacheKeyGenerator()) ? Cache::get(self::cacheKeyGenerator())->toArray() : []; } - public function getDataById($id) - { + public function getDataById($id) { $cachedData = Cache::get(self::cacheKeyGenerator()); return $cachedData ? collect($cachedData)->filter(function ($data) use ($id) { @@ -32,8 +29,7 @@ public function getDataById($id) })->first() : []; } - protected function cacheKeyGenerator(): string - { + protected function cacheKeyGenerator(): string { $user = User::query()->first(); $databaseProxy = app()->make(DatabaseProxy::class); $companyId = $databaseProxy->findByEmail($user->email)->getCompanyId(); @@ -41,8 +37,7 @@ protected function cacheKeyGenerator(): string return $this->cacheDataKey.'-'.$companyId; } - protected function reformatPeriod($period): string - { + protected function reformatPeriod($period): string { return substr_replace($period, '-', 4, 0); } } diff --git a/src/backend/app/Services/AbstractExportService.php b/src/backend/app/Services/AbstractExportService.php index e495608d4..efec54ff1 100644 --- a/src/backend/app/Services/AbstractExportService.php +++ b/src/backend/app/Services/AbstractExportService.php @@ -14,8 +14,7 @@ use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet; use Webpatser\Uuid\Uuid; -abstract class AbstractExportService -{ +abstract class AbstractExportService { protected IReader $reader; protected Worksheet $worksheet; @@ -36,8 +35,7 @@ abstract public function getTemplatePath(); abstract public function getPrefix(); - public function createSpreadSheetFromTemplate(string $path): Spreadsheet - { + public function createSpreadSheetFromTemplate(string $path): Spreadsheet { try { $this->reader = IOFactory::createReader('Xlsx'); $this->spreadsheet = @@ -53,18 +51,15 @@ public function createSpreadSheetFromTemplate(string $path): Spreadsheet } } - public function setCurrency($currency) - { + public function setCurrency($currency) { $this->currency = $currency; } - public function setTimeZone($timeZone) - { + public function setTimeZone($timeZone) { $this->timeZone = $timeZone; } - public function readable($amount, $separator = ',') - { + public function readable($amount, $separator = ',') { // Check for null or undefined amount and return '0' if ($amount === null || $amount === 'undefined') { return '0'; @@ -89,8 +84,7 @@ public function readable($amount, $separator = ',') return $decimal ? "$whole.$decimal" : $whole; } - public function convertUtcDateToTimezone($utcDate): string - { + public function convertUtcDateToTimezone($utcDate): string { // Create a DateTime object with the UTC-based date $dateTimeUtc = Carbon::parse($utcDate)->setTimezone('UTC'); @@ -101,13 +95,11 @@ public function convertUtcDateToTimezone($utcDate): string return $dateTimeUtc->format('Y-m-d H:i:s'); } - public function setRecentlyCreatedSpreadSheetId(string $id): void - { + public function setRecentlyCreatedSpreadSheetId(string $id): void { $this->recentlyCreatedSpreadSheetId = $id; } - public function setActivatedSheet($sheetName): void - { + public function setActivatedSheet($sheetName): void { try { $this->worksheet = $this->spreadsheet->setActiveSheetIndexByName($sheetName); } catch (\Exception $e) { @@ -118,8 +110,7 @@ public function setActivatedSheet($sheetName): void } } - public function saveSpreadSheet(): string - { + public function saveSpreadSheet(): string { try { $uuid = (string) Uuid::generate(4); $fileName = storage_path('appliance').'/'.$this->getPrefix().'-'.$uuid.'.xlsx'; diff --git a/src/backend/app/Services/AbstractPaymentAggregatorTransactionService.php b/src/backend/app/Services/AbstractPaymentAggregatorTransactionService.php index fad456b89..c5073dfcf 100644 --- a/src/backend/app/Services/AbstractPaymentAggregatorTransactionService.php +++ b/src/backend/app/Services/AbstractPaymentAggregatorTransactionService.php @@ -13,8 +13,7 @@ use App\Models\Transaction\Transaction; use Inensus\SteamaMeter\Exceptions\ModelNotFoundException; -abstract class AbstractPaymentAggregatorTransactionService -{ +abstract class AbstractPaymentAggregatorTransactionService { private const MINIMUM_TRANSACTION_AMOUNT = 0; protected string $payerPhoneNumber; @@ -33,11 +32,9 @@ public function __construct( private Transaction $transaction, private MeterParameter $meterParameter, private IRawTransaction $paymentAggregatorTransaction, - ) { - } + ) {} - public function validatePaymentOwner(string $meterSerialNumber, float $amount): void - { + public function validatePaymentOwner(string $meterSerialNumber, float $amount): void { if (!$meter = $this->meter->findBySerialNumber($meterSerialNumber)) { throw new ModelNotFoundException('Meter not found with serial number you entered'); } @@ -68,8 +65,7 @@ public function validatePaymentOwner(string $meterSerialNumber, float $amount): * @throws TransactionIsInvalidForProcessingIncomingRequestException * @throws TransactionAmountNotEnoughException */ - public function imitateTransactionForValidation(array $transactionData) - { + public function imitateTransactionForValidation(array $transactionData) { $this->paymentAggregatorTransaction = $this->paymentAggregatorTransaction->newQuery()->make($transactionData); $this->transaction = $this->transaction->newQuery()->make([ 'amount' => $transactionData['amount'], @@ -82,14 +78,12 @@ public function imitateTransactionForValidation(array $transactionData) $this->isImitationTransactionValid($this->transaction); } - public function saveTransaction() - { + public function saveTransaction() { $this->paymentAggregatorTransaction->save(); $this->transaction->originalTransaction()->associate($this->paymentAggregatorTransaction)->save(); } - private function isImitationTransactionValid($transaction) - { + private function isImitationTransactionValid($transaction) { try { $transactionData = TransactionDataContainer::initialize($transaction); } catch (\Exception $e) { @@ -109,8 +103,7 @@ private function isImitationTransactionValid($transaction) } } - private function getTransactionSender($meterSerialNumber) - { + private function getTransactionSender($meterSerialNumber) { $meterParameter = $this->meterParameter->newQuery() ->whereHas( 'meter', @@ -136,28 +129,23 @@ function ($q) use ($personId) { } } - public function getCustomerId(): int - { + public function getCustomerId(): int { return $this->customerId; } - public function getMeterSerialNumber() - { + public function getMeterSerialNumber() { return $this->meterSerialNumber; } - public function getAmount() - { + public function getAmount() { return $this->amount; } - public function getMinimumPurchaseAmount() - { + public function getMinimumPurchaseAmount() { return $this->minimumPurchaseAmount; } - public function getPaymentAggregatorTransaction(): IRawTransaction - { + public function getPaymentAggregatorTransaction(): IRawTransaction { return $this->paymentAggregatorTransaction; } } diff --git a/src/backend/app/Services/AccessRatePaymentHistoryService.php b/src/backend/app/Services/AccessRatePaymentHistoryService.php index 5b658a979..d06263608 100644 --- a/src/backend/app/Services/AccessRatePaymentHistoryService.php +++ b/src/backend/app/Services/AccessRatePaymentHistoryService.php @@ -9,24 +9,20 @@ /** * @implements IAssignationService */ -class AccessRatePaymentHistoryService implements IAssignationService -{ +class AccessRatePaymentHistoryService implements IAssignationService { private PaymentHistory $paymentHistory; private AccessRate $accessRate; - public function setAssigned($paymentHistory): void - { + public function setAssigned($paymentHistory): void { $this->paymentHistory = $paymentHistory; } - public function setAssignee($accessRate): void - { + public function setAssignee($accessRate): void { $this->accessRate = $accessRate; } - public function assign(): PaymentHistory - { + public function assign(): PaymentHistory { $this->paymentHistory->paidFor()->associate($this->accessRate); return $this->paymentHistory; diff --git a/src/backend/app/Services/AccessRatePaymentService.php b/src/backend/app/Services/AccessRatePaymentService.php index 395257da0..9722f69ab 100644 --- a/src/backend/app/Services/AccessRatePaymentService.php +++ b/src/backend/app/Services/AccessRatePaymentService.php @@ -10,38 +10,31 @@ /** * @implements IBaseService */ -class AccessRatePaymentService implements IBaseService -{ +class AccessRatePaymentService implements IBaseService { public function __construct( private AccessRatePayment $accessRatePayment, - ) { - } + ) {} - public function getById(int $id): AccessRatePayment - { + public function getById(int $id): AccessRatePayment { return $this->accessRatePayment->newQuery()->find($id); } - public function create(array $accessRatePaymentData): AccessRatePayment - { + public function create(array $accessRatePaymentData): AccessRatePayment { return $this->accessRatePayment->newQuery()->create($accessRatePaymentData); } - public function update($accessRatePayment, array $accessRatePaymentData): AccessRatePayment - { + public function update($accessRatePayment, array $accessRatePaymentData): AccessRatePayment { $accessRatePayment->update($accessRatePaymentData); $accessRatePayment->fresh(); return $accessRatePayment; } - public function delete($accessRatePayment): ?bool - { + public function delete($accessRatePayment): ?bool { return $accessRatePayment->delete(); } - public function getAll(?int $limit = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null): Collection|LengthAwarePaginator { $query = $this->accessRatePayment->newQuery(); if ($limit) { @@ -51,8 +44,7 @@ public function getAll(?int $limit = null): Collection|LengthAwarePaginator return $this->accessRatePayment->newQuery()->get(); } - public function getAccessRatePaymentByMeter($meter) - { + public function getAccessRatePaymentByMeter($meter) { return $meter->accessRatePayment()->first(); } } diff --git a/src/backend/app/Services/AccessRateService.php b/src/backend/app/Services/AccessRateService.php index a28e5bc55..21d6cdb03 100644 --- a/src/backend/app/Services/AccessRateService.php +++ b/src/backend/app/Services/AccessRateService.php @@ -9,43 +9,35 @@ /** * @implements IBaseService */ -class AccessRateService implements IBaseService -{ +class AccessRateService implements IBaseService { public function __construct( private AccessRate $accessRate, - ) { - } + ) {} - public function getById(int $accessRateId): AccessRate - { + public function getById(int $accessRateId): AccessRate { return $this->accessRate->newQuery()->find($accessRateId); } - public function create(array $accessRateData): AccessRate - { + public function create(array $accessRateData): AccessRate { return $this->accessRate->newQuery()->create($accessRateData); } - public function update($accessRate, $acessRateData): AccessRate - { + public function update($accessRate, $acessRateData): AccessRate { $accessRate->update($acessRateData); $accessRate->fresh(); return $accessRate; } - public function deleteByTariffId($meterTariffId) - { + public function deleteByTariffId($meterTariffId) { $this->accessRate->newQuery()->where('tariff_id', $meterTariffId)->delete(); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } - public function getAll(?int $limit = null): Collection - { + public function getAll(?int $limit = null): Collection { throw new \Exception('Method getAll() not yet implemented.'); } } diff --git a/src/backend/app/Services/AddressGeographicalInformationService.php b/src/backend/app/Services/AddressGeographicalInformationService.php index e911bfca3..74e925d20 100644 --- a/src/backend/app/Services/AddressGeographicalInformationService.php +++ b/src/backend/app/Services/AddressGeographicalInformationService.php @@ -9,24 +9,20 @@ /** * @implements IAssignationService */ -class AddressGeographicalInformationService implements IAssignationService -{ +class AddressGeographicalInformationService implements IAssignationService { private GeographicalInformation $geographicInformation; private Address $address; - public function setAssigned($assigned): void - { + public function setAssigned($assigned): void { $this->geographicInformation = $assigned; } - public function setAssignee($assignee): void - { + public function setAssignee($assignee): void { $this->address = $assignee; } - public function assign(): GeographicalInformation - { + public function assign(): GeographicalInformation { $this->geographicInformation->owner()->associate($this->address); return $this->geographicInformation; diff --git a/src/backend/app/Services/AddressesService.php b/src/backend/app/Services/AddressesService.php index b05a73de8..00d262457 100644 --- a/src/backend/app/Services/AddressesService.php +++ b/src/backend/app/Services/AddressesService.php @@ -14,16 +14,13 @@ * @implements IBaseService
* @implements IAssociative
*/ -class AddressesService implements IAssociative, IBaseService -{ +class AddressesService implements IAssociative, IBaseService { public function __construct( private Address $address, - ) { - } + ) {} // fills the object and returns it without saving. - public function instantiate(array $params): Address - { + public function instantiate(array $params): Address { return $this->address->fill([ 'city_id' => $params['city_id'] ?? null, 'email' => $params['email'] ?? null, @@ -33,18 +30,15 @@ public function instantiate(array $params): Address ]); } - public function assignAddressToOwner(HasAddressesInterface $owner, Address $address) - { + public function assignAddressToOwner(HasAddressesInterface $owner, Address $address) { return $owner->addresses()->save($address); } - public function getStoredAddressWithCityRelation(int $id): Address - { + public function getStoredAddressWithCityRelation(int $id): Address { return $this->address::with('city')->findOrFail($id); } - public function createAddressDataFromRequest(Request $request): array - { + public function createAddressDataFromRequest(Request $request): array { return [ 'email' => $request->get('email') ?? '', 'phone' => $request->get('phone') ?? '', @@ -54,13 +48,11 @@ public function createAddressDataFromRequest(Request $request): array ]; } - public function getById(int $id): Address - { + public function getById(int $id): Address { return $this->address->newQuery()->findOrFail($id); } - public function getAll(?int $limit = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null): Collection|LengthAwarePaginator { if ($limit) { return $this->address->newQuery()->paginate($limit); } @@ -68,25 +60,21 @@ public function getAll(?int $limit = null): Collection|LengthAwarePaginator return $this->address->newQuery()->get(); } - public function create(array $data): Address - { + public function create(array $data): Address { throw new \Exception('Method create() not yet implemented.'); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } - public function update($address, array $addressData): Address - { + public function update($address, array $addressData): Address { $address->update($addressData); return $address; } - public function make($addressData): Address - { + public function make($addressData): Address { return $this->address->newQuery()->make([ 'email' => $addressData['email'] ?? null, 'phone' => $addressData['phone'] ?? null, @@ -97,8 +85,7 @@ public function make($addressData): Address ]); } - public function save($address): bool - { + public function save($address): bool { return $address->save(); } } diff --git a/src/backend/app/Services/AgentAppliancePersonService.php b/src/backend/app/Services/AgentAppliancePersonService.php index b5b8e30e3..f6a154947 100644 --- a/src/backend/app/Services/AgentAppliancePersonService.php +++ b/src/backend/app/Services/AgentAppliancePersonService.php @@ -9,24 +9,20 @@ /** * @implements IAssignationService */ -class AgentAppliancePersonService implements IAssignationService -{ +class AgentAppliancePersonService implements IAssignationService { private AssetPerson $appliancePerson; private Agent $agent; - public function setAssigned($appliancePerson): void - { + public function setAssigned($appliancePerson): void { $this->appliancePerson = $appliancePerson; } - public function setAssignee($agent): void - { + public function setAssignee($agent): void { $this->agent = $agent; } - public function assign(): AssetPerson - { + public function assign(): AssetPerson { $this->appliancePerson->creator()->associate($this->agent); return $this->appliancePerson; diff --git a/src/backend/app/Services/AgentAssignedApplianceHistoryBalanceService.php b/src/backend/app/Services/AgentAssignedApplianceHistoryBalanceService.php index 76cde4207..cbb77b9f1 100644 --- a/src/backend/app/Services/AgentAssignedApplianceHistoryBalanceService.php +++ b/src/backend/app/Services/AgentAssignedApplianceHistoryBalanceService.php @@ -9,24 +9,20 @@ /** * @implements IAssignationService */ -class AgentAssignedApplianceHistoryBalanceService implements IAssignationService -{ +class AgentAssignedApplianceHistoryBalanceService implements IAssignationService { private AgentBalanceHistory $agentBalanceHistory; private AgentAssignedAppliances $agentAssignedAppliance; - public function setAssigned($agentBalanceHistory): void - { + public function setAssigned($agentBalanceHistory): void { $this->agentBalanceHistory = $agentBalanceHistory; } - public function setAssignee($agentAssignedAppliance): void - { + public function setAssignee($agentAssignedAppliance): void { $this->agentAssignedAppliance = $agentAssignedAppliance; } - public function assign(): AgentBalanceHistory - { + public function assign(): AgentBalanceHistory { $this->agentBalanceHistory->trigger()->associate($this->agentAssignedAppliance); return $this->agentBalanceHistory; diff --git a/src/backend/app/Services/AgentAssignedApplianceService.php b/src/backend/app/Services/AgentAssignedApplianceService.php index b5b4756ec..837502e67 100644 --- a/src/backend/app/Services/AgentAssignedApplianceService.php +++ b/src/backend/app/Services/AgentAssignedApplianceService.php @@ -10,15 +10,12 @@ /** * @implements IBaseService */ -class AgentAssignedApplianceService implements IBaseService -{ +class AgentAssignedApplianceService implements IBaseService { public function __construct( private AgentAssignedAppliances $agentAssignedAppliance, - ) { - } + ) {} - public function create(array $applianceData): AgentAssignedAppliances - { + public function create(array $applianceData): AgentAssignedAppliances { return $this->agentAssignedAppliance->newQuery()->create([ 'agent_id' => $applianceData['agent_id'], 'user_id' => $applianceData['user_id'], @@ -27,23 +24,19 @@ public function create(array $applianceData): AgentAssignedAppliances ]); } - public function getById(int $id): AgentAssignedAppliances - { + public function getById(int $id): AgentAssignedAppliances { return $this->agentAssignedAppliance->newQuery()->with('applianceType')->find($id); } - public function update($model, array $data): AgentAssignedAppliances - { + public function update($model, array $data): AgentAssignedAppliances { throw new \Exception('Method update() not yet implemented.'); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } - public function getAll(?int $limit = null, ?int $agentId = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null, ?int $agentId = null): Collection|LengthAwarePaginator { $query = $this->agentAssignedAppliance->newQuery(); if ($agentId) { diff --git a/src/backend/app/Services/AgentBalanceHistoryService.php b/src/backend/app/Services/AgentBalanceHistoryService.php index 19a5c0bed..1b75fc343 100644 --- a/src/backend/app/Services/AgentBalanceHistoryService.php +++ b/src/backend/app/Services/AgentBalanceHistoryService.php @@ -13,16 +13,13 @@ * @implements IBaseService * @implements IAssociative */ -class AgentBalanceHistoryService implements IAssociative, IBaseService -{ +class AgentBalanceHistoryService implements IAssociative, IBaseService { public function __construct( private AgentBalanceHistory $agentBalanceHistory, private PeriodService $periodService, - ) { - } + ) {} - public function getAll(?int $limit = null, ?int $agentId = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null, ?int $agentId = null): Collection|LengthAwarePaginator { $query = $this->agentBalanceHistory->newQuery() ->whereHasMorph( 'trigger', @@ -38,36 +35,30 @@ public function getAll(?int $limit = null, ?int $agentId = null): Collection|Len return $query->latest()->get(); } - public function create(array $agentBalanceHistoryData): AgentBalanceHistory - { + public function create(array $agentBalanceHistoryData): AgentBalanceHistory { return $this->agentBalanceHistory->newQuery()->create($agentBalanceHistoryData); } - public function make(array $agentBalanceHistoryData): AgentBalanceHistory - { + public function make(array $agentBalanceHistoryData): AgentBalanceHistory { return $this->agentBalanceHistory->newQuery()->make($agentBalanceHistoryData); } - public function save($agentBalanceHistory): bool - { + public function save($agentBalanceHistory): bool { return $agentBalanceHistory->save(); } - public function getLastAgentBalanceHistory($agentId) - { + public function getLastAgentBalanceHistory($agentId) { return $this->agentBalanceHistory->newQuery()->where('agent_id', $agentId)->get()->last(); } - public function getTotalAmountSinceLastVisit($agentBalanceHistoryId, $agentId) - { + public function getTotalAmountSinceLastVisit($agentBalanceHistoryId, $agentId) { return $this->agentBalanceHistory->newQuery()->where('agent_id', $agentId) ->where('id', '>', $agentBalanceHistoryId) ->whereIn('trigger_type', ['agent_appliance', 'agent_transaction']) ->sum('amount'); } - public function getTransactionAverage($agent, $lastReceipt) - { + public function getTransactionAverage($agent, $lastReceipt) { if ($lastReceipt) { $averageTransactionAmounts = $this->agentBalanceHistory->newQuery() ->where('agent_id', $agent->id) @@ -86,8 +77,7 @@ public function getTransactionAverage($agent, $lastReceipt) return -1 * $averageTransactionAmounts; } - public function getGraphValues($agent, $lastReceiptDate) - { + public function getGraphValues($agent, $lastReceiptDate) { $periodDate = $lastReceiptDate; $period = $this->getPeriod($agent, $periodDate); $history = $this->agentBalanceHistory->newQuery() @@ -142,8 +132,7 @@ public function getGraphValues($agent, $lastReceiptDate) return $period; } - public function getPeriod($agent, $date): array - { + public function getPeriod($agent, $date): array { $days = $this->agentBalanceHistory->newQuery()->selectRaw('DATE_FORMAT(created_at,\'%Y-%m-%d\') as day') ->where('agent_id', $agent->id) ->where( @@ -164,8 +153,7 @@ public function getPeriod($agent, $date): array return $period; } - public function getAgentRevenuesWeekly($agent): array - { + public function getAgentRevenuesWeekly($agent): array { $startDate = date('Y-m-d', strtotime('-3 months')); $endDate = date('Y-m-d'); $Revenues = $this->agentBalanceHistory->newQuery() @@ -184,18 +172,15 @@ public function getAgentRevenuesWeekly($agent): array return $p; } - public function getById($id): AgentBalanceHistory - { + public function getById($id): AgentBalanceHistory { throw new \Exception('Method getById() not yet implemented.'); } - public function update($model, $data): AgentBalanceHistory - { + public function update($model, $data): AgentBalanceHistory { throw new \Exception('Method update() not yet implemented.'); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } } diff --git a/src/backend/app/Services/AgentChargeHistoryBalanceService.php b/src/backend/app/Services/AgentChargeHistoryBalanceService.php index d7f9e1dce..a759053c3 100644 --- a/src/backend/app/Services/AgentChargeHistoryBalanceService.php +++ b/src/backend/app/Services/AgentChargeHistoryBalanceService.php @@ -9,24 +9,20 @@ /** * @implements IAssignationService */ -class AgentChargeHistoryBalanceService implements IAssignationService -{ +class AgentChargeHistoryBalanceService implements IAssignationService { private AgentBalanceHistory $agentBalanceHistory; private AgentCharge $agentCharge; - public function setAssigned($agentBalanceHistory): void - { + public function setAssigned($agentBalanceHistory): void { $this->agentBalanceHistory = $agentBalanceHistory; } - public function setAssignee($agentCharge): void - { + public function setAssignee($agentCharge): void { $this->agentCharge = $agentCharge; } - public function assign(): AgentBalanceHistory - { + public function assign(): AgentBalanceHistory { $this->agentBalanceHistory->trigger()->associate($this->agentCharge); return $this->agentBalanceHistory; diff --git a/src/backend/app/Services/AgentChargeService.php b/src/backend/app/Services/AgentChargeService.php index e05307ee8..992bb8ac5 100644 --- a/src/backend/app/Services/AgentChargeService.php +++ b/src/backend/app/Services/AgentChargeService.php @@ -9,35 +9,28 @@ /** * @implements IBaseService */ -class AgentChargeService implements IBaseService -{ +class AgentChargeService implements IBaseService { public function __construct( private AgentCharge $agentCharge, - ) { - } + ) {} - public function create(array $agentChargeData): AgentCharge - { + public function create(array $agentChargeData): AgentCharge { return $this->agentCharge->newQuery()->create($agentChargeData); } - public function getById(int $id): AgentCharge - { + public function getById(int $id): AgentCharge { throw new \Exception('Method getById() not yet implemented.'); } - public function update($model, array $data): AgentCharge - { + public function update($model, array $data): AgentCharge { throw new \Exception('Method update() not yet implemented.'); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } - public function getAll(?int $limit = null): Collection - { + public function getAll(?int $limit = null): Collection { throw new \Exception('Method getAll() not yet implemented.'); } } diff --git a/src/backend/app/Services/AgentCommissionHistoryBalanceService.php b/src/backend/app/Services/AgentCommissionHistoryBalanceService.php index dc3d563f7..3002d7891 100644 --- a/src/backend/app/Services/AgentCommissionHistoryBalanceService.php +++ b/src/backend/app/Services/AgentCommissionHistoryBalanceService.php @@ -9,24 +9,20 @@ /** * @implements IAssignationService */ -class AgentCommissionHistoryBalanceService implements IAssignationService -{ +class AgentCommissionHistoryBalanceService implements IAssignationService { private AgentBalanceHistory $agentBalanceHistory; private AgentCommission $agentCommission; - public function setAssigned($agentBalanceHistory): void - { + public function setAssigned($agentBalanceHistory): void { $this->agentBalanceHistory = $agentBalanceHistory; } - public function setAssignee($agentCommission): void - { + public function setAssignee($agentCommission): void { $this->agentCommission = $agentCommission; } - public function assign(): AgentBalanceHistory - { + public function assign(): AgentBalanceHistory { $this->agentBalanceHistory->trigger()->associate($this->agentCommission); return $this->agentBalanceHistory; diff --git a/src/backend/app/Services/AgentCommissionService.php b/src/backend/app/Services/AgentCommissionService.php index 9c1e5d1af..1085e12d5 100644 --- a/src/backend/app/Services/AgentCommissionService.php +++ b/src/backend/app/Services/AgentCommissionService.php @@ -10,38 +10,31 @@ /** * @implements IBaseService */ -class AgentCommissionService implements IBaseService -{ +class AgentCommissionService implements IBaseService { public function __construct( private AgentCommission $agentCommission, - ) { - } + ) {} - public function create(array $agentCommissiondata): AgentCommission - { + public function create(array $agentCommissiondata): AgentCommission { return $this->agentCommission->newQuery()->create($agentCommissiondata); } - public function update($agentCommission, array $agentCommissiondata): AgentCommission - { + public function update($agentCommission, array $agentCommissiondata): AgentCommission { $agentCommission->update($agentCommissiondata); $agentCommission->fresh(); return $agentCommission; } - public function delete($agentCommission): ?bool - { + public function delete($agentCommission): ?bool { return $agentCommission->delete(); } - public function getById(int $id): AgentCommission - { + public function getById(int $id): AgentCommission { return $this->agentCommission->newQuery()->find($id); } - public function getAll(?int $limit = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null): Collection|LengthAwarePaginator { if ($limit) { return $this->agentCommission->newQuery()->paginate($limit); } diff --git a/src/backend/app/Services/AgentCustomerService.php b/src/backend/app/Services/AgentCustomerService.php index 07c79211b..d66ef83a1 100644 --- a/src/backend/app/Services/AgentCustomerService.php +++ b/src/backend/app/Services/AgentCustomerService.php @@ -6,14 +6,10 @@ use App\Models\Person\Person; use Illuminate\Contracts\Pagination\LengthAwarePaginator; -class AgentCustomerService -{ - public function __construct(private Agent $agent, private Person $person) - { - } +class AgentCustomerService { + public function __construct(private Agent $agent, private Person $person) {} - public function list(Agent $agent): LengthAwarePaginator - { + public function list(Agent $agent): LengthAwarePaginator { $miniGridId = $agent->mini_grid_id; return $this->person->newQuery()->with([ @@ -28,8 +24,7 @@ public function list(Agent $agent): LengthAwarePaginator ->paginate(config('settings.paginate')); } - public function search($searchTerm, $limit, $agent) - { + public function search($searchTerm, $limit, $agent) { return $this->person->newQuery()->with(['addresses.city', 'devices'])->whereHas( 'addresses', fn ($q) => $q->where('phone', 'LIKE', '%'.$searchTerm.'%') diff --git a/src/backend/app/Services/AgentCustomersPaymentHistoryService.php b/src/backend/app/Services/AgentCustomersPaymentHistoryService.php index 6982f3169..78ca0cc99 100644 --- a/src/backend/app/Services/AgentCustomersPaymentHistoryService.php +++ b/src/backend/app/Services/AgentCustomersPaymentHistoryService.php @@ -5,15 +5,12 @@ use App\Models\PaymentHistory; use Illuminate\Support\Facades\DB; -class AgentCustomersPaymentHistoryService -{ +class AgentCustomersPaymentHistoryService { public function __construct( private PaymentHistory $paymentHistory, - ) { - } + ) {} - public function getPaymentFlowByCustomerId($period, $customerId, $limit, $order = 'ASC') - { + public function getPaymentFlowByCustomerId($period, $customerId, $limit, $order = 'ASC') { $periodParam = strtoupper($period); $period = strtoupper($period); @@ -52,8 +49,7 @@ public function getPaymentFlowByCustomerId($period, $customerId, $limit, $order return $this->preparePaymentFlow($payments); } - public function getPaymentFlows($period, $agentId, $limit, $order = 'ASC') - { + public function getPaymentFlows($period, $agentId, $limit, $order = 'ASC') { $periodParam = strtoupper($period); $period = strtoupper($period); @@ -96,8 +92,7 @@ public function getPaymentFlows($period, $agentId, $limit, $order = 'ASC') return $this->preparePaymentFlow($payments); } - private function preparePaymentFlow($payments): array - { + private function preparePaymentFlow($payments): array { $flowList = []; foreach ($payments as $payment) { $flowList[$payment['period']][$payment['payment_type']] = $payment['amount']; @@ -106,8 +101,7 @@ private function preparePaymentFlow($payments): array return $flowList; } - private function executeSqlCommand(string $sql, $payerId, $agentId, $payerType) - { + private function executeSqlCommand(string $sql, $payerId, $agentId, $payerType) { $sth = DB::connection($this->paymentHistory->getConnectionName())->getPdo()->prepare($sql); if ($payerId) { diff --git a/src/backend/app/Services/AgentReceiptDetailService.php b/src/backend/app/Services/AgentReceiptDetailService.php index 8612d91b4..d164f5c42 100644 --- a/src/backend/app/Services/AgentReceiptDetailService.php +++ b/src/backend/app/Services/AgentReceiptDetailService.php @@ -9,15 +9,12 @@ /** * @implements IBaseService */ -class AgentReceiptDetailService implements IBaseService -{ +class AgentReceiptDetailService implements IBaseService { public function __construct( private AgentReceiptDetail $agentReceiptDetail, - ) { - } + ) {} - public function getSummary($agentId) - { + public function getSummary($agentId) { return $this->agentReceiptDetail->newQuery()->select('summary') ->whereHas( 'receipt', @@ -27,28 +24,23 @@ static function ($q) use ($agentId) { )->latest()->firstOrFail()->summary; } - public function getById(int $id): AgentReceiptDetail - { + public function getById(int $id): AgentReceiptDetail { throw new \Exception('Method getById() not yet implemented.'); } - public function create(array $agentReceiptDetailData): AgentReceiptDetail - { + public function create(array $agentReceiptDetailData): AgentReceiptDetail { return $this->agentReceiptDetail->create($agentReceiptDetailData); } - public function update($model, array $data): AgentReceiptDetail - { + public function update($model, array $data): AgentReceiptDetail { throw new \Exception('Method update() not yet implemented.'); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } - public function getAll(?int $limit = null): Collection - { + public function getAll(?int $limit = null): Collection { throw new \Exception('Method getAll() not yet implemented.'); } } diff --git a/src/backend/app/Services/AgentReceiptHistoryBalanceService.php b/src/backend/app/Services/AgentReceiptHistoryBalanceService.php index 9c282796e..4e42d76dd 100644 --- a/src/backend/app/Services/AgentReceiptHistoryBalanceService.php +++ b/src/backend/app/Services/AgentReceiptHistoryBalanceService.php @@ -9,24 +9,20 @@ /** * @implements IAssignationService */ -class AgentReceiptHistoryBalanceService implements IAssignationService -{ +class AgentReceiptHistoryBalanceService implements IAssignationService { private AgentBalanceHistory $agentBalanceHistory; private AgentReceipt $agentReceipt; - public function setAssigned($agentBalanceHistory): void - { + public function setAssigned($agentBalanceHistory): void { $this->agentBalanceHistory = $agentBalanceHistory; } - public function setAssignee($agentReceipt): void - { + public function setAssignee($agentReceipt): void { $this->agentReceipt = $agentReceipt; } - public function assign(): AgentBalanceHistory - { + public function assign(): AgentBalanceHistory { $this->agentBalanceHistory->trigger()->associate($this->agentReceipt); return $this->agentBalanceHistory; diff --git a/src/backend/app/Services/AgentReceiptService.php b/src/backend/app/Services/AgentReceiptService.php index 1d86579c3..fdacf7647 100644 --- a/src/backend/app/Services/AgentReceiptService.php +++ b/src/backend/app/Services/AgentReceiptService.php @@ -10,15 +10,12 @@ /** * @implements IBaseService */ -class AgentReceiptService implements IBaseService -{ +class AgentReceiptService implements IBaseService { public function __construct( private AgentReceipt $agentReceipt, - ) { - } + ) {} - public function getAll(?int $limit = null, ?int $agentId = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null, ?int $agentId = null): Collection|LengthAwarePaginator { $query = $this->agentReceipt->newQuery() ->with(['user', 'agent', 'history']); @@ -37,34 +34,28 @@ function ($q) use ($agentId) { } } - public function create(array $receiptData): AgentReceipt - { + public function create(array $receiptData): AgentReceipt { return $this->agentReceipt->newQuery()->create($receiptData); } - public function getById(int $id): AgentReceipt - { + public function getById(int $id): AgentReceipt { throw new \Exception('Method getById() not yet implemented.'); } - public function update($model, array $data): AgentReceipt - { + public function update($model, array $data): AgentReceipt { throw new \Exception('Method update() not yet implemented.'); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } - public function getLastReceipt($agentId) - { + public function getLastReceipt($agentId) { return $this->agentReceipt->newQuery()->where('agent_id', $agentId) ->latest('id')->first(); } - public function getLastReceiptDate($agent) - { + public function getLastReceiptDate($agent) { $lastReceiptDate = $this->agentReceipt->newQuery()->where('agent_id', $agent->id)->get()->last(); if ($lastReceiptDate) { diff --git a/src/backend/app/Services/AgentService.php b/src/backend/app/Services/AgentService.php index 67426c1c8..53fbaafc4 100644 --- a/src/backend/app/Services/AgentService.php +++ b/src/backend/app/Services/AgentService.php @@ -15,19 +15,16 @@ /** * @implements IBaseService */ -class AgentService implements IBaseService -{ +class AgentService implements IBaseService { public function __construct( private Agent $agent, private AgentReceipt $agentReceipt, private AgentBalanceHistory $agentBalanceHistory, private PeriodService $periodService, private PersonService $personService, - ) { - } + ) {} - public function resetPassword(string $email) - { + public function resetPassword(string $email) { try { $newPassword = PasswordGenerator::generatePassword(); } catch (Exception $exception) { @@ -48,28 +45,24 @@ public function resetPassword(string $email) return $newPassword; } - public function updateDevice($agent, $deviceId): void - { + public function updateDevice($agent, $deviceId): void { $agent->device_id = $deviceId; $agent->update(); $agent->fresh(); } - public function setFirebaseToken($agent, $firebaseToken) - { + public function setFirebaseToken($agent, $firebaseToken) { $agent->fire_base_token = $firebaseToken; $agent->update(); return $agent->fresh(); } - public function getAgentBalance($agent) - { + public function getAgentBalance($agent) { return $agent->balance; } - public function searchAgent($searchTerm, $paginate) - { + public function searchAgent($searchTerm, $paginate) { if ($paginate === 1) { return $this->agent->newQuery()->with('miniGrid')->WhereHas( 'miniGrid', @@ -89,25 +82,21 @@ function ($q) use ($searchTerm) { ->orWhere('email', 'LIKE', '%'.$searchTerm.'%')->get(); } - public function getByAuthenticatedUser() - { + public function getByAuthenticatedUser() { return $this->agent->newQuery()->find(auth('agent_api')->user()->id); } - public function getById(int $id): Agent - { + public function getById(int $id): Agent { return $this->agent->newQuery() ->with(['person', 'person.addresses', 'miniGrid', 'commission']) ->where('id', $id)->firstOrFail(); } - public function delete($agent): ?bool - { + public function delete($agent): ?bool { return $agent->delete(); } - public function getAll(?int $limit = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null): Collection|LengthAwarePaginator { if ($limit) { return $this->agent->newQuery() ->with(['person', 'person.addresses', 'miniGrid', 'commission']) @@ -146,8 +135,7 @@ public function create( return $this->agent->newQuery()->create($agentData); } - public function update($agent, array $agentData): Agent - { + public function update($agent, array $agentData): Agent { $person = $this->personService->getById($agentData['personId']); $personData = [ 'name' => $agentData['name'], diff --git a/src/backend/app/Services/AgentSoldApplianceService.php b/src/backend/app/Services/AgentSoldApplianceService.php index 12f5f0f5e..1662010bf 100644 --- a/src/backend/app/Services/AgentSoldApplianceService.php +++ b/src/backend/app/Services/AgentSoldApplianceService.php @@ -12,21 +12,17 @@ /** * @implements IBaseService */ -class AgentSoldApplianceService implements IBaseService -{ +class AgentSoldApplianceService implements IBaseService { public function __construct( private AgentSoldAppliance $agentSoldAppliance, private AssetPerson $assetPerson, - ) { - } + ) {} - public function create($applianceData): AgentSoldAppliance - { + public function create($applianceData): AgentSoldAppliance { return $this->agentSoldAppliance->newQuery()->create($applianceData); } - public function getById(int $agentId, ?int $customerId = null): AgentSoldAppliance - { + public function getById(int $agentId, ?int $customerId = null): AgentSoldAppliance { return $this->assetPerson->newQuery()->with(['person', 'assetType', 'rates']) ->whereHasMorph( 'creator', @@ -43,13 +39,11 @@ function ($q) use ($agentId) { ->first(); } - public function update($model, array $data): AgentSoldAppliance - { + public function update($model, array $data): AgentSoldAppliance { throw new \Exception('Method update() not yet implemented.'); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } @@ -92,8 +86,7 @@ function ($q) use ($agentId) { } } - public function list($agentId) - { + public function list($agentId) { return $this->assetPerson->newQuery()->with(['person', 'assetType', 'rates']) ->whereHasMorph( 'creator', diff --git a/src/backend/app/Services/AgentTicketService.php b/src/backend/app/Services/AgentTicketService.php index bd976ff72..d994eca25 100644 --- a/src/backend/app/Services/AgentTicketService.php +++ b/src/backend/app/Services/AgentTicketService.php @@ -9,24 +9,20 @@ /** * @implements IAssignationService */ -class AgentTicketService implements IAssignationService -{ +class AgentTicketService implements IAssignationService { private Ticket $ticket; private Agent $agent; - public function setAssigned($ticket): void - { + public function setAssigned($ticket): void { $this->ticket = $ticket; } - public function setAssignee($agent): void - { + public function setAssignee($agent): void { $this->agent = $agent; } - public function assign(): Ticket - { + public function assign(): Ticket { $this->ticket->creator()->associate($this->agent); return $this->ticket; diff --git a/src/backend/app/Services/AgentTransactionHistoryBalanceService.php b/src/backend/app/Services/AgentTransactionHistoryBalanceService.php index 2ef31cb57..bb371b58d 100644 --- a/src/backend/app/Services/AgentTransactionHistoryBalanceService.php +++ b/src/backend/app/Services/AgentTransactionHistoryBalanceService.php @@ -9,24 +9,20 @@ /** * @implements IAssignationService */ -class AgentTransactionHistoryBalanceService implements IAssignationService -{ +class AgentTransactionHistoryBalanceService implements IAssignationService { private AgentBalanceHistory $agentBalanceHistory; private AgentTransaction $agentTransaction; - public function setAssigned($agentBalanceHistory): void - { + public function setAssigned($agentBalanceHistory): void { $this->agentBalanceHistory = $agentBalanceHistory; } - public function setAssignee($agentTransaction): void - { + public function setAssignee($agentTransaction): void { $this->agentTransaction = $agentTransaction; } - public function assign(): AgentBalanceHistory - { + public function assign(): AgentBalanceHistory { $this->agentBalanceHistory->trigger()->associate($this->agentTransaction); return $this->agentBalanceHistory; diff --git a/src/backend/app/Services/AgentTransactionService.php b/src/backend/app/Services/AgentTransactionService.php index 7d75e37cf..9eaf29781 100644 --- a/src/backend/app/Services/AgentTransactionService.php +++ b/src/backend/app/Services/AgentTransactionService.php @@ -12,14 +12,12 @@ /** * @implements IBaseService */ -class AgentTransactionService implements IBaseService -{ +class AgentTransactionService implements IBaseService { public function __construct( private AgentTransaction $agentTransaction, private Transaction $transaction, private Device $device, - ) { - } + ) {} public function getAll( ?int $limit = null, @@ -49,8 +47,7 @@ static function ($q) use ($agentId) { return $query->get(); } - public function getById(int $agentId, ?int $customerId = null): AgentTransaction - { + public function getById(int $agentId, ?int $customerId = null): AgentTransaction { $customerDeviceSerials = $this->device->newQuery()->where('person_id', $customerId) ->get()->pluck('device_serial'); @@ -73,18 +70,15 @@ public function getById(int $agentId, ?int $customerId = null): AgentTransaction ->first(); } - public function create(array $transactionData): AgentTransaction - { + public function create(array $transactionData): AgentTransaction { return $this->agentTransaction->newQuery()->create($transactionData); } - public function update($model, array $data): AgentTransaction - { + public function update($model, array $data): AgentTransaction { throw new \Exception('Method update() not yet implemented.'); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } } diff --git a/src/backend/app/Services/AgentTransactionTransactionService.php b/src/backend/app/Services/AgentTransactionTransactionService.php index 73af9fc6d..1693971ef 100644 --- a/src/backend/app/Services/AgentTransactionTransactionService.php +++ b/src/backend/app/Services/AgentTransactionTransactionService.php @@ -9,24 +9,20 @@ /** * @implements IAssignationService */ -class AgentTransactionTransactionService implements IAssignationService -{ +class AgentTransactionTransactionService implements IAssignationService { private Transaction $transaction; private AgentTransaction $agentTransaction; - public function setAssigned($transaction): void - { + public function setAssigned($transaction): void { $this->transaction = $transaction; } - public function setAssignee($agentTransaction): void - { + public function setAssignee($agentTransaction): void { $this->agentTransaction = $agentTransaction; } - public function assign(): Transaction - { + public function assign(): Transaction { $this->transaction->originalTransaction()->associate($this->agentTransaction); return $this->transaction; diff --git a/src/backend/app/Services/AppliancePaymentService.php b/src/backend/app/Services/AppliancePaymentService.php index 73d5ef8f4..a82b32ab1 100644 --- a/src/backend/app/Services/AppliancePaymentService.php +++ b/src/backend/app/Services/AppliancePaymentService.php @@ -12,8 +12,7 @@ use Illuminate\Support\Carbon; use MPM\Device\DeviceService; -class AppliancePaymentService -{ +class AppliancePaymentService { private float $paymentAmount; public function __construct( @@ -21,11 +20,9 @@ public function __construct( private MainSettings $mainSettings, private AppliancePersonService $appliancePersonService, private DeviceService $deviceService, - ) { - } + ) {} - public function getPaymentForAppliance($request, $appliancePerson) - { + public function getPaymentForAppliance($request, $appliancePerson) { $creatorId = auth('api')->user()->id; $this->paymentAmount = $amount = (float) $request->input('amount'); $applianceDetail = $this->appliancePersonService->getApplianceDetails($appliancePerson->id); @@ -50,8 +47,7 @@ public function getPaymentForAppliance($request, $appliancePerson) return $appliancePerson; } - public function updateRateRemaining($id, $amount): AssetRate - { + public function updateRateRemaining($id, $amount): AssetRate { /** @var AssetRate $applianceRate */ $applianceRate = AssetRate::query()->findOrFail($id); $applianceRate->remaining -= $amount; @@ -61,8 +57,7 @@ public function updateRateRemaining($id, $amount): AssetRate return $applianceRate; } - public function createPaymentLog($appliancePerson, $amount, $creatorId): void - { + public function createPaymentLog($appliancePerson, $amount, $creatorId): void { /** @var MainSettings $mainSettings */ $mainSettings = $this->mainSettings->newQuery()->first(); $currency = $mainSettings ? $mainSettings->currency : '€'; @@ -78,8 +73,7 @@ public function createPaymentLog($appliancePerson, $amount, $creatorId): void ); } - public function createPaymentHistory($amount, $buyer, $applianceRate, $transaction) - { + public function createPaymentHistory($amount, $buyer, $applianceRate, $transaction) { event( 'payment.successful', [ @@ -94,8 +88,7 @@ public function createPaymentHistory($amount, $buyer, $applianceRate, $transacti ); } - private function validateAmount($applianceDetail, $amount) - { + private function validateAmount($applianceDetail, $amount) { $totalRemainingAmount = $applianceDetail->rates->sum('remaining'); $installmentCost = $applianceDetail->rates[1]['rate_cost']; @@ -112,8 +105,7 @@ private function validateAmount($applianceDetail, $amount) } } - public function payInstallment($installment, $applianceOwner, $transaction) - { + public function payInstallment($installment, $applianceOwner, $transaction) { if ($installment['remaining'] > 0 && $this->paymentAmount > 0) { if ($installment['remaining'] <= $this->paymentAmount) { $this->paymentAmount -= $installment['remaining']; @@ -127,8 +119,7 @@ public function payInstallment($installment, $applianceOwner, $transaction) } } - private function processPaymentForDevice($deviceSerial, $transaction, $applianceDetail) - { + private function processPaymentForDevice($deviceSerial, $transaction, $applianceDetail) { $device = $this->deviceService->getBySerialNumber($deviceSerial); if (!$device) { @@ -156,8 +147,7 @@ private function processPaymentForDevice($deviceSerial, $transaction, $appliance $token->save(); } - public function getDayDifferenceBetweenTwoInstallments($installments) - { + public function getDayDifferenceBetweenTwoInstallments($installments) { try { $secondInstallment = $installments[1]; $thirdInstallment = $installments[2]; @@ -170,8 +160,7 @@ public function getDayDifferenceBetweenTwoInstallments($installments) } } - public function setPaymentAmount($amount): void - { + public function setPaymentAmount($amount): void { $this->paymentAmount = $amount; } } diff --git a/src/backend/app/Services/AppliancePersonService.php b/src/backend/app/Services/AppliancePersonService.php index bb271d902..8d4b67ec9 100644 --- a/src/backend/app/Services/AppliancePersonService.php +++ b/src/backend/app/Services/AppliancePersonService.php @@ -16,34 +16,28 @@ * @implements IBaseService * @implements IAssociative */ -class AppliancePersonService implements IAssociative, IBaseService -{ +class AppliancePersonService implements IAssociative, IBaseService { public function __construct( private MainSettings $mainSettings, private AssetPerson $assetPerson, private CashTransactionService $cashTransactionService, - ) { - } + ) {} - public function make(array $data): AssetPerson - { + public function make(array $data): AssetPerson { return $this->assetPerson->newQuery()->make($data); } - public function save($appliancePerson): bool - { + public function save($appliancePerson): bool { return $appliancePerson->save(); } - private function checkDownPaymentIsBigger($downPayment, $cost) - { + private function checkDownPaymentIsBigger($downPayment, $cost) { if ($downPayment > $cost) { throw new DownPaymentBiggerThanAppliancePriceException('Down payment is not bigger than appliance sold cost '); } } - public function createFromRequest($request, $person, $asset) - { + public function createFromRequest($request, $person, $asset) { $this->checkDownPaymentIsBigger($request->input('down_payment'), $request->input('cost')); $assetPerson = $this->assetPerson::query()->make( [ @@ -102,8 +96,7 @@ static function ($q) { return $assetPerson; } - public function initSoldApplianceDataContainer($asset, $assetPerson, $transaction) - { + public function initSoldApplianceDataContainer($asset, $assetPerson, $transaction) { $soldApplianceDataContainer = app()->makeWith( SoldApplianceDataContainer::class, [ @@ -116,8 +109,7 @@ public function initSoldApplianceDataContainer($asset, $assetPerson, $transactio event('appliance.sold', $soldApplianceDataContainer); } - public function createLogForSoldAppliance($assetPerson, $cost, $preferredPrice) - { + public function createLogForSoldAppliance($assetPerson, $cost, $preferredPrice) { $currency = $this->getCurrencyFromMainSettings(); event( @@ -133,15 +125,13 @@ public function createLogForSoldAppliance($assetPerson, $cost, $preferredPrice) ); } - public function getCurrencyFromMainSettings() - { + public function getCurrencyFromMainSettings() { $mainSettings = $this->mainSettings->newQuery()->first(); return $mainSettings === null ? '€' : $mainSettings->currency; } - public function getApplianceDetails($applianceId) - { + public function getApplianceDetails($applianceId) { $appliance = $this->assetPerson::with('asset', 'rates.logs', 'logs.owner') ->where('id', '=', $applianceId) ->first(); @@ -149,8 +139,7 @@ public function getApplianceDetails($applianceId) return $this->sumTotalPaymentsAndTotalRemainingAmount($appliance); } - private function sumTotalPaymentsAndTotalRemainingAmount($appliance) - { + private function sumTotalPaymentsAndTotalRemainingAmount($appliance) { $rates = Collect($appliance->rates); $appliance['totalRemainingAmount'] = 0; $appliance['totalPayments'] = 0; @@ -165,33 +154,27 @@ private function sumTotalPaymentsAndTotalRemainingAmount($appliance) return $appliance; } - public function getLoansForCustomerId($customerId) - { + public function getLoansForCustomerId($customerId) { return $this->assetPerson->newQuery()->where('person_id', $customerId); } - public function getById(int $id): AssetPerson - { + public function getById(int $id): AssetPerson { throw new \Exception('Method getById() not yet implemented.'); } - public function create(array $data): AssetPerson - { + public function create(array $data): AssetPerson { throw new \Exception('Method create() not yet implemented.'); } - public function update($model, array $data): AssetPerson - { + public function update($model, array $data): AssetPerson { throw new \Exception('Method update() not yet implemented.'); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } - public function getAll(?int $limit = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null): Collection|LengthAwarePaginator { if ($limit) { return $this->assetPerson->newQuery()->with(['person.devices'])->paginate($limit); } @@ -199,16 +182,14 @@ public function getAll(?int $limit = null): Collection|LengthAwarePaginator return $this->assetPerson->newQuery()->with(['person.devices'])->get(); } - public function getLoanIdsForCustomerId($customerId) - { + public function getLoanIdsForCustomerId($customerId) { return $this->assetPerson->newQuery() ->where('person_id', $customerId) ->where('device_serial', null) ->orWhere('device_serial', '')->pluck('id'); } - public function getBySerialNumber($serialNumber) - { + public function getBySerialNumber($serialNumber) { return $this->assetPerson->newQuery()->where('device_serial', $serialNumber)->first(); } } diff --git a/src/backend/app/Services/ApplianceRatePaymentHistoryService.php b/src/backend/app/Services/ApplianceRatePaymentHistoryService.php index b5c109618..79f7f7c26 100644 --- a/src/backend/app/Services/ApplianceRatePaymentHistoryService.php +++ b/src/backend/app/Services/ApplianceRatePaymentHistoryService.php @@ -9,24 +9,20 @@ /** * @implements IAssignationService */ -class ApplianceRatePaymentHistoryService implements IAssignationService -{ +class ApplianceRatePaymentHistoryService implements IAssignationService { private PaymentHistory $paymentHistory; private AssetRate $assetRate; - public function setAssigned($paymentHistory): void - { + public function setAssigned($paymentHistory): void { $this->paymentHistory = $paymentHistory; } - public function setAssignee($assetRate): void - { + public function setAssignee($assetRate): void { $this->assetRate = $assetRate; } - public function assign(): PaymentHistory - { + public function assign(): PaymentHistory { $this->paymentHistory->paidFor()->associate($this->assetRate); return $this->paymentHistory; diff --git a/src/backend/app/Services/ApplianceRateService.php b/src/backend/app/Services/ApplianceRateService.php index 7f5fa6820..195bbece9 100644 --- a/src/backend/app/Services/ApplianceRateService.php +++ b/src/backend/app/Services/ApplianceRateService.php @@ -11,24 +11,20 @@ // FIXME: // class ApplianceRateService implements IBaseService -class ApplianceRateService -{ +class ApplianceRateService { public function __construct( private AssetRate $applianceRate, private MainSettings $mainSettings, - ) { - } + ) {} - public function getCurrencyFromMainSettings(): string - { + public function getCurrencyFromMainSettings(): string { /** @var MainSettings $mainSettings */ $mainSettings = $this->mainSettings->newQuery()->first(); return $mainSettings === null ? '€' : $mainSettings->currency; } - public function updateApplianceRateCost(AssetRate $applianceRate, $creatorId, $cost, $newCost): AssetRate - { + public function updateApplianceRateCost(AssetRate $applianceRate, $creatorId, $cost, $newCost): AssetRate { $currency = $this->getCurrencyFromMainSettings(); event( 'new.log', @@ -52,8 +48,7 @@ public function updateApplianceRateCost(AssetRate $applianceRate, $creatorId, $c return $applianceRate->refresh(); } - public function deleteUpdatedApplianceRateIfCostZero(AssetRate $applianceRate, $creatorId, $cost, $newCost): void - { + public function deleteUpdatedApplianceRateIfCostZero(AssetRate $applianceRate, $creatorId, $cost, $newCost): void { $currency = $this->getCurrencyFromMainSettings(); $appliancePerson = $applianceRate->assetPerson; $applianceRate->delete(); @@ -73,8 +68,7 @@ public function deleteUpdatedApplianceRateIfCostZero(AssetRate $applianceRate, $ ); } - public function getByLoanIdsForDueDate($loanIds): Collection - { + public function getByLoanIdsForDueDate($loanIds): Collection { return $this->applianceRate->newQuery()->with('assetPerson.asset') ->whereIn('asset_person_id', $loanIds) ->where('remaining', '>', 0) @@ -82,20 +76,17 @@ public function getByLoanIdsForDueDate($loanIds): Collection ->get(); } - public function getAllByLoanId($loanId): Collection - { + public function getAllByLoanId($loanId): Collection { return $this->applianceRate->newQuery()->with('assetPerson.asset') ->where('asset_person_id', $loanId) ->get(); } - public function getById(int $id): AssetRate - { + public function getById(int $id): AssetRate { throw new \Exception('Method getById() not yet implemented.'); } - public function create($assetPerson, $installmentType = 'monthly'): void - { + public function create($assetPerson, $installmentType = 'monthly'): void { $baseTime = $assetPerson->first_payment_date ?? date('Y-m-d'); $installment = $installmentType === 'monthly' ? 'month' : 'week'; if ($assetPerson->down_payment > 0) { @@ -134,23 +125,19 @@ public function create($assetPerson, $installmentType = 'monthly'): void } } - public function update($model, array $data): AssetRate - { + public function update($model, array $data): AssetRate { throw new \Exception('Method update() not yet implemented.'); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } - public function getAll(?int $limit = null): Collection - { + public function getAll(?int $limit = null): Collection { throw new \Exception('Method getAll() not yet implemented.'); } - public function getDownPaymentAsAssetRate($assetPerson): ?AssetRate - { + public function getDownPaymentAsAssetRate($assetPerson): ?AssetRate { /** @var ?AssetRate $result */ $result = $this->applianceRate->newQuery() ->where('asset_person_id', $assetPerson->id) @@ -161,8 +148,7 @@ public function getDownPaymentAsAssetRate($assetPerson): ?AssetRate return $result; } - public function queryOutstandingDebtsByApplianceRates(CarbonImmutable $toDate): Builder - { + public function queryOutstandingDebtsByApplianceRates(CarbonImmutable $toDate): Builder { return $this->applianceRate->newQuery() ->with(['assetPerson.asset', 'assetPerson.person']) ->where('due_date', '<', $toDate->format('Y-m-d')) diff --git a/src/backend/app/Services/ApplianceTypeService.php b/src/backend/app/Services/ApplianceTypeService.php index 1feb0bb8a..d83b6c39d 100644 --- a/src/backend/app/Services/ApplianceTypeService.php +++ b/src/backend/app/Services/ApplianceTypeService.php @@ -4,17 +4,14 @@ use App\Models\AssetType; -class ApplianceTypeService -{ +class ApplianceTypeService { private $assetType; - public function __construct(AssetType $assetType) - { + public function __construct(AssetType $assetType) { $this->assetType = $assetType; } - public function getApplianceTypes($request) - { + public function getApplianceTypes($request) { $perPage = $request->get('per_page'); if ($perPage) { return $this->assetType->newQuery()->paginate($perPage); @@ -23,24 +20,21 @@ public function getApplianceTypes($request) return $this->assetType->newQuery()->get(); } - public function createApplianceType($request) - { + public function createApplianceType($request) { return $this->assetType::query() ->create( $request->only(['name', 'price']) ); } - public function updateApplianceType($request, $appliance) - { + public function updateApplianceType($request, $appliance) { $appliance->update($request->only(['name', 'price'])); $appliance->fresh(); return $appliance; } - public function deleteApplianceType($applianceType) - { + public function deleteApplianceType($applianceType) { $applianceType->delete(); } } diff --git a/src/backend/app/Services/AssetService.php b/src/backend/app/Services/AssetService.php index d4a4c71e1..2b0000d55 100644 --- a/src/backend/app/Services/AssetService.php +++ b/src/backend/app/Services/AssetService.php @@ -4,14 +4,10 @@ use App\Models\Asset; -class AssetService -{ - public function __construct(private Asset $asset) - { - } +class AssetService { + public function __construct(private Asset $asset) {} - public function getAssets($request) - { + public function getAssets($request) { $perPage = $request->get('per_page'); if ($perPage) { return $this->asset->newQuery()->with(['assetType'])->paginate($perPage); @@ -20,29 +16,25 @@ public function getAssets($request) return $this->asset->newQuery()->with(['assetType'])->get(); } - public function createAsset($request) - { + public function createAsset($request) { return $this->asset::query() ->create( $request->only(['asset_type_id', 'name', 'price']) ); } - public function updateAsset($request, $asset) - { + public function updateAsset($request, $asset) { $asset->update($request->only(['name', 'asset_type_id', 'price'])); $asset->fresh(); return $asset; } - public function deleteAsset($asset) - { + public function deleteAsset($asset) { $asset->delete(); } - public function getById($id) - { + public function getById($id) { return $this->asset->newQuery()->with(['assetType'])->find($id); } } diff --git a/src/backend/app/Services/BingMapApiService.php b/src/backend/app/Services/BingMapApiService.php index c79367e1b..b850b9505 100644 --- a/src/backend/app/Services/BingMapApiService.php +++ b/src/backend/app/Services/BingMapApiService.php @@ -6,20 +6,17 @@ use GuzzleHttp\Client; use GuzzleHttp\Exception\GuzzleException; -class BingMapApiService -{ +class BingMapApiService { private $httpClient; - public function __construct(Client $httpClient) - { + public function __construct(Client $httpClient) { $this->httpClient = $httpClient; } /** * @throws InvalidBingApiKeyException */ - public function checkAuthenticationKey($key): bool - { + public function checkAuthenticationKey($key): bool { try { $response = $this->httpClient->get(config('services.bingMapApi.url').$key)->getBody()->getContents(); } catch (GuzzleException $e) { @@ -29,8 +26,7 @@ public function checkAuthenticationKey($key): bool return $this->isRequestAuthenticated($response); } - private function isRequestAuthenticated($body): bool - { + private function isRequestAuthenticated($body): bool { try { $jsonBody = json_decode($body, true, 512, JSON_THROW_ON_ERROR); $authenticated = $jsonBody['statusDescription'] === 'OK'; diff --git a/src/backend/app/Services/CashTransactionService.php b/src/backend/app/Services/CashTransactionService.php index edf152f45..9b4a3e1da 100644 --- a/src/backend/app/Services/CashTransactionService.php +++ b/src/backend/app/Services/CashTransactionService.php @@ -5,20 +5,17 @@ use App\Models\Transaction\CashTransaction; use App\Models\Transaction\Transaction; -class CashTransactionService -{ +class CashTransactionService { private $cashTransaction; private $transaction; - public function __construct(CashTransaction $cashTransaction, Transaction $transaction) - { + public function __construct(CashTransaction $cashTransaction, Transaction $transaction) { $this->transaction = $transaction; $this->cashTransaction = $cashTransaction; } - public function createCashTransaction($creatorId, $amount, $sender, $deviceSerial = null) - { + public function createCashTransaction($creatorId, $amount, $sender, $deviceSerial = null) { $cashTransaction = $this->cashTransaction->newQuery()->create( [ 'user_id' => $creatorId, diff --git a/src/backend/app/Services/CityGeographicalInformationService.php b/src/backend/app/Services/CityGeographicalInformationService.php index 4ff96020f..351b15daa 100644 --- a/src/backend/app/Services/CityGeographicalInformationService.php +++ b/src/backend/app/Services/CityGeographicalInformationService.php @@ -9,24 +9,20 @@ /** * @implements IAssignationService */ -class CityGeographicalInformationService implements IAssignationService -{ +class CityGeographicalInformationService implements IAssignationService { private GeographicalInformation $geographicInformation; private City $city; - public function setAssigned($assigned): void - { + public function setAssigned($assigned): void { $this->geographicInformation = $assigned; } - public function setAssignee($assignee): void - { + public function setAssignee($assignee): void { $this->city = $assignee; } - public function assign(): GeographicalInformation - { + public function assign(): GeographicalInformation { $this->geographicInformation->owner()->associate($this->city); return $this->geographicInformation; diff --git a/src/backend/app/Services/CityService.php b/src/backend/app/Services/CityService.php index 4690699ce..b5250239f 100644 --- a/src/backend/app/Services/CityService.php +++ b/src/backend/app/Services/CityService.php @@ -10,30 +10,24 @@ /** * @implements IBaseService */ -class CityService implements IBaseService -{ +class CityService implements IBaseService { public function __construct( private City $city, - ) { - } + ) {} - public function getCityIdsByMiniGridId($miniGridId): array - { + public function getCityIdsByMiniGridId($miniGridId): array { return $this->city->newQuery()->select('id')->where('mini_grid_id', $miniGridId)->get()->pluck('id')->toArray(); } - public function getByIdWithRelation($cityId, $relation) - { + public function getByIdWithRelation($cityId, $relation) { return $this->city->newQuery()->with($relation)->find($cityId); } - public function getById($cityId): City - { + public function getById($cityId): City { return $this->city->newQuery()->find($cityId); } - public function update($city, array $cityData): City - { + public function update($city, array $cityData): City { $city->update([ 'name' => $cityData['name'] ?? $city->name, 'mini_grid_id' => $cityData['mini_grid_id'] ?? $city->mini_grid_id, @@ -45,13 +39,11 @@ public function update($city, array $cityData): City return $city; } - public function create(array $data): City - { + public function create(array $data): City { return $this->city->newQuery()->create($data); } - public function getAll(?int $limit = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null): Collection|LengthAwarePaginator { if ($limit) { return $this->city->newQuery()->with('location')->paginate($limit); } @@ -59,8 +51,7 @@ public function getAll(?int $limit = null): Collection|LengthAwarePaginator return $this->city->newQuery()->with('location')->get(); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('not implemented'); } } diff --git a/src/backend/app/Services/ClusterManagerService.php b/src/backend/app/Services/ClusterManagerService.php index d6433b6a3..4d511c9d7 100644 --- a/src/backend/app/Services/ClusterManagerService.php +++ b/src/backend/app/Services/ClusterManagerService.php @@ -4,17 +4,14 @@ use App\Models\User; -class ClusterManagerService -{ +class ClusterManagerService { private User $user; - public function __construct(User $user) - { + public function __construct(User $user) { $this->user = $user; } - public function findManagerById(int $managerId): User - { + public function findManagerById(int $managerId): User { return $this->user->find($managerId); } } diff --git a/src/backend/app/Services/ClusterMeterService.php b/src/backend/app/Services/ClusterMeterService.php index 6929a8091..41a9f69d9 100644 --- a/src/backend/app/Services/ClusterMeterService.php +++ b/src/backend/app/Services/ClusterMeterService.php @@ -5,14 +5,10 @@ use App\Models\Cluster; use App\Models\Meter\Meter; -class ClusterMeterService -{ - public function __construct(private Cluster $cluster, private Meter $meter) - { - } +class ClusterMeterService { + public function __construct(private Cluster $cluster, private Meter $meter) {} - public function getCountById($clusterId): int - { + public function getCountById($clusterId): int { return $this->meter->newQuery()->whereHas( 'meterParameter', function ($q) use ($clusterId) { diff --git a/src/backend/app/Services/ClusterMiniGridService.php b/src/backend/app/Services/ClusterMiniGridService.php index 896357a6d..ff7788327 100644 --- a/src/backend/app/Services/ClusterMiniGridService.php +++ b/src/backend/app/Services/ClusterMiniGridService.php @@ -5,14 +5,10 @@ use App\Models\Cluster; use App\Models\MiniGrid; -class ClusterMiniGridService -{ - public function __construct(private Cluster $cluster, private MiniGrid $miniGrid) - { - } +class ClusterMiniGridService { + public function __construct(private Cluster $cluster, private MiniGrid $miniGrid) {} - public function getClustersWithMiniGrids() - { + public function getClustersWithMiniGrids() { return $this->cluster->newQuery()->with('miniGrids')->get(); } } diff --git a/src/backend/app/Services/ClusterPopulationService.php b/src/backend/app/Services/ClusterPopulationService.php index b686b3a7a..f90fcae16 100644 --- a/src/backend/app/Services/ClusterPopulationService.php +++ b/src/backend/app/Services/ClusterPopulationService.php @@ -5,14 +5,10 @@ use App\Models\Cluster; use App\Models\Person\Person; -class ClusterPopulationService -{ - public function __construct(private Person $person, private Cluster $cluster) - { - } +class ClusterPopulationService { + public function __construct(private Person $person, private Cluster $cluster) {} - public function getById($clusterId, $onlyCustomers = true): int - { + public function getById($clusterId, $onlyCustomers = true): int { if ($onlyCustomers) { $population = $this->person->newQuery() ->where('is_customer', 1) diff --git a/src/backend/app/Services/ClusterRevenueService.php b/src/backend/app/Services/ClusterRevenueService.php index 1c8169f03..feb2b6b3e 100644 --- a/src/backend/app/Services/ClusterRevenueService.php +++ b/src/backend/app/Services/ClusterRevenueService.php @@ -8,14 +8,12 @@ use Illuminate\Database\Eloquent\Collection; use Illuminate\Support\Facades\DB; -class ClusterRevenueService -{ +class ClusterRevenueService { public function __construct( private PeriodService $periodService, private Cluster $cluster, private Transaction $transaction, - ) { - } + ) {} public function getTransactionsForMonthlyPeriodById( $clusterId, @@ -63,8 +61,7 @@ static function ($q) { ->groupBy(DB::raw('DATE_FORMAT(created_at,\'%Y-%m\')'))->get(); } - public function getTransactionsForWeeklyPeriod($clusterId, $period, $connectionType = null) - { + public function getTransactionsForWeeklyPeriod($clusterId, $period, $connectionType = null) { return $this->transaction->newQuery() ->selectRaw('DATE_FORMAT(created_at,\'%Y-%m\') as period , SUM(amount) as revenue') ->whereHas( @@ -240,8 +237,7 @@ public function getMonthlyRevenueAnalysisForConnectionTypesById( /** * @throws \Exception */ - public function getMonthlyMiniGridBasedRevenueById($clusterId) - { + public function getMonthlyMiniGridBasedRevenueById($clusterId) { $startDate = date('Y-01-01'); $endDate = date('Y-m-t'); $period = 'monthly'; @@ -309,8 +305,7 @@ public function getMiniGridBasedRevenueById( return $miniGrids; } - public function setDatesForRequest($startDate, $endDate): array - { + public function setDatesForRequest($startDate, $endDate): array { if (!$startDate) { $start = new \DateTime(); $start->setDate($start->format('Y'), $start->format('n'), 1); // Normalize the day to 1 @@ -323,8 +318,7 @@ public function setDatesForRequest($startDate, $endDate): array return ['startDate' => $startDate, 'endDate' => $endDate]; } - public function setDateRangeForRequest($startDate, $endDate): array - { + public function setDateRangeForRequest($startDate, $endDate): array { $dateRange = []; if ($startDate !== null && $endDate !== null) { $dateRange[0] = $startDate; diff --git a/src/backend/app/Services/ClusterService.php b/src/backend/app/Services/ClusterService.php index 7288bbb2b..4c0306d4a 100644 --- a/src/backend/app/Services/ClusterService.php +++ b/src/backend/app/Services/ClusterService.php @@ -10,25 +10,20 @@ /** * @implements IBaseService */ -class ClusterService implements IBaseService -{ +class ClusterService implements IBaseService { public function __construct( private Cluster $cluster, - ) { - } + ) {} - protected function setClusterMeterCount(Cluster $cluster, int $meterCount) - { + protected function setClusterMeterCount(Cluster $cluster, int $meterCount) { $cluster->meterCount = $meterCount; } - protected function setRevenue(Cluster $cluster, int $totalTransactionsAmount) - { + protected function setRevenue(Cluster $cluster, int $totalTransactionsAmount) { $cluster->revenue = $totalTransactionsAmount; } - protected function setPopulation(Cluster $cluster, int $populationCount) - { + protected function setPopulation(Cluster $cluster, int $populationCount) { $cluster->population = $populationCount; } @@ -45,23 +40,19 @@ public function getCluster( return $cluster; } - public function getClusterCities($clusterId) - { + public function getClusterCities($clusterId) { return Cluster::query()->with('cities')->find($clusterId); } - public function getClusterMiniGrids($clusterId) - { + public function getClusterMiniGrids($clusterId) { return Cluster::query()->with('miniGrids')->find($clusterId); } - public function getGeoLocationById($clusterId) - { + public function getGeoLocationById($clusterId) { return $this->cluster->newQuery()->select('geo_data')->find($clusterId)->geo_data; } - public function getDateRangeFromRequest($startDate, $endDate): array - { + public function getDateRangeFromRequest($startDate, $endDate): array { $dateRange = []; if ($startDate !== null && $endDate !== null) { @@ -75,18 +66,15 @@ public function getDateRangeFromRequest($startDate, $endDate): array return $dateRange; } - public function getById($clusterId): Cluster - { + public function getById($clusterId): Cluster { return $this->cluster->newQuery()->with(['miniGrids.location', 'cities'])->find($clusterId); } - public function create(array $clusterData): Cluster - { + public function create(array $clusterData): Cluster { return $this->cluster->newQuery()->create($clusterData); } - public function getAll(?int $limit = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null): Collection|LengthAwarePaginator { if ($limit !== null) { return $this->cluster->newQuery()->with('miniGrids')->limit($limit)->get(); } @@ -94,15 +82,13 @@ public function getAll(?int $limit = null): Collection|LengthAwarePaginator return $this->cluster->newQuery()->with('miniGrids')->get(); } - public function update($model, array $data): Cluster - { + public function update($model, array $data): Cluster { throw new \Exception('Method update() not yet implemented.'); return new Cluster(); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } } diff --git a/src/backend/app/Services/ClusterTransactionService.php b/src/backend/app/Services/ClusterTransactionService.php index b64c1cfc0..bea5180f5 100644 --- a/src/backend/app/Services/ClusterTransactionService.php +++ b/src/backend/app/Services/ClusterTransactionService.php @@ -5,14 +5,10 @@ use App\Models\Cluster; use App\Models\Transaction\Transaction; -class ClusterTransactionService -{ - public function __construct(private Cluster $cluster, private Transaction $transaction) - { - } +class ClusterTransactionService { + public function __construct(private Cluster $cluster, private Transaction $transaction) {} - public function getById($clusterId, array $range) - { + public function getById($clusterId, array $range) { return $this->transaction->newQuery()->whereHas( 'device', function ($q) use ($clusterId) { diff --git a/src/backend/app/Services/ClustersDashboardCacheDataService.php b/src/backend/app/Services/ClustersDashboardCacheDataService.php index dac6372ad..f0f90e22d 100644 --- a/src/backend/app/Services/ClustersDashboardCacheDataService.php +++ b/src/backend/app/Services/ClustersDashboardCacheDataService.php @@ -6,8 +6,7 @@ use MPM\Device\ClusterDeviceService; use Nette\Utils\DateTime; -class ClustersDashboardCacheDataService extends AbstractDashboardCacheDataService -{ +class ClustersDashboardCacheDataService extends AbstractDashboardCacheDataService { private const CACHE_KEY_CLUSTERS_DATA = 'ClustersData'; public function __construct( @@ -23,8 +22,7 @@ public function __construct( parent::__construct(self::CACHE_KEY_CLUSTERS_DATA); } - public function setData($dateRange = []) - { + public function setData($dateRange = []) { if (empty($dateRange)) { $startDate = date('Y-01-01'); // first day of the year $endDate = date('Y-m-d H:i:s', strtotime('today')); diff --git a/src/backend/app/Services/CompanyDatabaseService.php b/src/backend/app/Services/CompanyDatabaseService.php index fae0c3f1e..d055ac71d 100644 --- a/src/backend/app/Services/CompanyDatabaseService.php +++ b/src/backend/app/Services/CompanyDatabaseService.php @@ -12,23 +12,19 @@ /** * @implements IBaseService */ -class CompanyDatabaseService implements IBaseService -{ +class CompanyDatabaseService implements IBaseService { public function __construct( private CompanyDatabase $companyDatabase, private DatabaseProxyManagerService $databaseProxyManagerService, - ) { - } + ) {} - public function getById(int $id): CompanyDatabase - { + public function getById(int $id): CompanyDatabase { $result = $this->companyDatabase->newQuery()->find($id); return $result; } - public function create(array $data): CompanyDatabase - { + public function create(array $data): CompanyDatabase { /** @var CompanyDatabase $result */ $company_database = $this->companyDatabase->newQuery()->create($data); $database_name = $company_database->database_name; @@ -55,23 +51,19 @@ function () { return $company_database; } - public function update($model, array $data): CompanyDatabase - { + public function update($model, array $data): CompanyDatabase { throw new \Exception('Method update() not yet implemented.'); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method update() not yet implemented.'); } - public function getAll(?int $limit = null): Collection - { + public function getAll(?int $limit = null): Collection { throw new \Exception('Method getAll() not yet implemented.'); } - public function findByCompanyId(int $companyId): CompanyDatabase - { + public function findByCompanyId(int $companyId): CompanyDatabase { /** @var CompanyDatabase $result */ $result = $this->companyDatabase->newQuery() ->where(CompanyDatabase::COL_COMPANY_ID, '=', $companyId) diff --git a/src/backend/app/Services/CompanyService.php b/src/backend/app/Services/CompanyService.php index 5f978ca7e..4f67dac71 100644 --- a/src/backend/app/Services/CompanyService.php +++ b/src/backend/app/Services/CompanyService.php @@ -9,49 +9,40 @@ /** * @implements IBaseService */ -class CompanyService implements IBaseService -{ +class CompanyService implements IBaseService { public function __construct( private Company $company, - ) { - } + ) {} - public function getByName($name): Company - { + public function getByName($name): Company { return $this->company->where('name', $name)->firstOrFail(); } - public function getByDatabaseProxy($databaseProxy): Company - { + public function getByDatabaseProxy($databaseProxy): Company { return $this->getById($databaseProxy->getCompanyId()); } - public function getById($id): Company - { + public function getById($id): Company { $result = $this->company->newQuery()->findOrFail($id); return $result; } - public function create($data): Company - { + public function create($data): Company { $company = $this->company->newQuery()->create($data); return $company; } - public function update($model, array $data): Company - { + public function update($model, array $data): Company { throw new \Exception('Method update() not yet implemented.'); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } - public function getAll(?int $limit = null): Collection - { + public function getAll(?int $limit = null): Collection { return $this->company->newQuery()->get(); } } diff --git a/src/backend/app/Services/ConnectionGroupService.php b/src/backend/app/Services/ConnectionGroupService.php index c29f1060e..60f9cd016 100644 --- a/src/backend/app/Services/ConnectionGroupService.php +++ b/src/backend/app/Services/ConnectionGroupService.php @@ -9,33 +9,27 @@ /** * @implements IBaseService - */ class ConnectionGroupService implements IBaseService -{ + */ class ConnectionGroupService implements IBaseService { public function __construct( private ConnectionGroup $connectionGroup, - ) { - } + ) {} - public function create(array $connectionGroupData): ConnectionGroup - { + public function create(array $connectionGroupData): ConnectionGroup { return $this->connectionGroup->newQuery()->create($connectionGroupData); } - public function getById(int $connectionGroupId): ConnectionGroup - { + public function getById(int $connectionGroupId): ConnectionGroup { return $this->connectionGroup->newQuery()->findOrFail($connectionGroupId); } - public function update($connectionGroup, array $connectionGroupData): ConnectionGroup - { + public function update($connectionGroup, array $connectionGroupData): ConnectionGroup { $connectionGroup->update($connectionGroupData); $connectionGroup->fresh(); return $connectionGroup; } - public function getAll(?int $limit = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null): Collection|LengthAwarePaginator { if ($limit) { return $this->connectionGroup->newQuery()->paginate($limit); } @@ -43,8 +37,7 @@ public function getAll(?int $limit = null): Collection|LengthAwarePaginator return $this->connectionGroup->newQuery()->get(); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } } diff --git a/src/backend/app/Services/ConnectionTypeService.php b/src/backend/app/Services/ConnectionTypeService.php index f8c8bcd5f..c61f31d21 100644 --- a/src/backend/app/Services/ConnectionTypeService.php +++ b/src/backend/app/Services/ConnectionTypeService.php @@ -12,39 +12,32 @@ /** * @implements IBaseService */ -class ConnectionTypeService implements IBaseService -{ +class ConnectionTypeService implements IBaseService { public function __construct( private ConnectionType $connectionType, - ) { - } + ) {} - public function getByIdWithMeterCountRelation($connectionTypeId): Model|Builder - { + public function getByIdWithMeterCountRelation($connectionTypeId): Model|Builder { return $this->connectionType->newQuery()->withCount('meterParameters')->where('id', $connectionTypeId) ->firstOrFail(); } - public function getById(int $connectionTypeId): ConnectionType - { + public function getById(int $connectionTypeId): ConnectionType { return $this->connectionType->newQuery()->findOrFail($connectionTypeId); } - public function create(array $connectionServiceData): ConnectionType - { + public function create(array $connectionServiceData): ConnectionType { return $this->connectionType->newQuery()->create($connectionServiceData); } - public function update($connectionType, array $connectionTypeData): ConnectionType - { + public function update($connectionType, array $connectionTypeData): ConnectionType { $connectionType->update($connectionTypeData); $connectionType->fresh(); return $connectionType; } - public function getAll(?int $limit = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null): Collection|LengthAwarePaginator { if ($limit) { return $this->connectionType->newQuery()->paginate($limit); } @@ -52,8 +45,7 @@ public function getAll(?int $limit = null): Collection|LengthAwarePaginator return $this->connectionType->newQuery()->get(); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } } diff --git a/src/backend/app/Services/CountryService.php b/src/backend/app/Services/CountryService.php index 7be1f06d1..e40dd85ed 100644 --- a/src/backend/app/Services/CountryService.php +++ b/src/backend/app/Services/CountryService.php @@ -9,40 +9,32 @@ /** * @implements IBaseService */ -class CountryService implements IBaseService -{ +class CountryService implements IBaseService { public function __construct( private Country $country, - ) { - } + ) {} - public function getByCode(?string $countryCode) - { + public function getByCode(?string $countryCode) { return $countryCode !== null ? $this->country->where('country_code', $countryCode)->first() : $countryCode; } - public function getById(int $id): Country - { + public function getById(int $id): Country { throw new \Exception('Method getById() not yet implemented.'); } - public function create(array $data): Country - { + public function create(array $data): Country { throw new \Exception('Method create() not yet implemented.'); } - public function update($model, array $data): Country - { + public function update($model, array $data): Country { throw new \Exception('Method update() not yet implemented.'); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } - public function getAll(?int $limit = null): Collection - { + public function getAll(?int $limit = null): Collection { throw new \Exception('Method getAll() not yet implemented.'); } } diff --git a/src/backend/app/Services/DatabaseProxyService.php b/src/backend/app/Services/DatabaseProxyService.php index d0d6b558c..9968e85be 100644 --- a/src/backend/app/Services/DatabaseProxyService.php +++ b/src/backend/app/Services/DatabaseProxyService.php @@ -9,36 +9,28 @@ /** * @implements IBaseService */ -class DatabaseProxyService implements IBaseService -{ - public function __construct(private DatabaseProxy $databaseProxy) - { - } +class DatabaseProxyService implements IBaseService { + public function __construct(private DatabaseProxy $databaseProxy) {} - public function getById($id): DatabaseProxy - { + public function getById($id): DatabaseProxy { throw new \Exception('Method getById() not yet implemented.'); return new DatabaseProxy(); } - public function create(array $databaseProxyData): DatabaseProxy - { + public function create(array $databaseProxyData): DatabaseProxy { return $this->databaseProxy->newQuery()->create($databaseProxyData); } - public function update($model, array $data): DatabaseProxy - { + public function update($model, array $data): DatabaseProxy { throw new \Exception('Method update() not yet implemented.'); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } - public function getAll(?int $limit = null): Collection - { + public function getAll(?int $limit = null): Collection { throw new \Exception('Method getAll() not yet implemented.'); } } diff --git a/src/backend/app/Services/FirebaseService.php b/src/backend/app/Services/FirebaseService.php index 22ba42fec..63080a4c5 100644 --- a/src/backend/app/Services/FirebaseService.php +++ b/src/backend/app/Services/FirebaseService.php @@ -6,10 +6,8 @@ use GuzzleHttp\Client; use Illuminate\Support\Facades\Log; -class FirebaseService -{ - public function sendNotify($firebaseToken, $body): string - { +class FirebaseService { + public function sendNotify($firebaseToken, $body): string { try { $httpClient = new Client(); $request = $httpClient->post( diff --git a/src/backend/app/Services/GeographicalInformationService.php b/src/backend/app/Services/GeographicalInformationService.php index e9de7eab9..6598f385c 100644 --- a/src/backend/app/Services/GeographicalInformationService.php +++ b/src/backend/app/Services/GeographicalInformationService.php @@ -12,16 +12,13 @@ * @implements IBaseService * @implements IAssociative */ -class GeographicalInformationService implements IAssociative, IBaseService -{ +class GeographicalInformationService implements IAssociative, IBaseService { public function __construct( private GeographicalInformation $geographicalInformation, - ) { - } + ) {} // This function will be removed until devices feature migration is done - public function changeOwnerWithAddress($meterParameter, $addressId) - { + public function changeOwnerWithAddress($meterParameter, $addressId) { $geoInfo = $this->geographicalInformation->newQuery()->where('owner_type', 'meter_parameter')->where('owner_id', $meterParameter->id)->first(); if ($geoInfo) { $geoInfo->owner_type = 'address'; @@ -30,43 +27,36 @@ public function changeOwnerWithAddress($meterParameter, $addressId) } } - public function getById(int $id): GeographicalInformation - { + public function getById(int $id): GeographicalInformation { return $this->geographicalInformation->newQuery()->find($id); } - public function delete($model): ?bool - { + public function delete($model): ?bool { return $model->delete(); } - public function getAll(?int $limit = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null): Collection|LengthAwarePaginator { return $this->geographicalInformation->newQuery()->get(); } - public function create(array $data): GeographicalInformation - { + public function create(array $data): GeographicalInformation { throw new \Exception('Method create() not yet implemented.'); } - public function update($model, array $data): GeographicalInformation - { + public function update($model, array $data): GeographicalInformation { $model->update($data); $model->fresh(); return $model; } - public function make($geographicalInformationData): GeographicalInformation - { + public function make($geographicalInformationData): GeographicalInformation { return $this->geographicalInformation->newQuery()->make([ 'points' => $geographicalInformationData['points'], ]); } - public function save($geographicalInformation): bool - { + public function save($geographicalInformation): bool { return $geographicalInformation->save(); } } diff --git a/src/backend/app/Services/Interfaces/IAssignationService.php b/src/backend/app/Services/Interfaces/IAssignationService.php index aa16f18da..d240a495f 100644 --- a/src/backend/app/Services/Interfaces/IAssignationService.php +++ b/src/backend/app/Services/Interfaces/IAssignationService.php @@ -10,8 +10,7 @@ * @template TAssigned of Model * @template TAssignee of Model */ -interface IAssignationService -{ +interface IAssignationService { /** @param TAssigned $assigned */ public function setAssigned($assigned): void; diff --git a/src/backend/app/Services/Interfaces/IAssociative.php b/src/backend/app/Services/Interfaces/IAssociative.php index 12859bb1f..c77a4e4d9 100644 --- a/src/backend/app/Services/Interfaces/IAssociative.php +++ b/src/backend/app/Services/Interfaces/IAssociative.php @@ -9,8 +9,7 @@ * * @template T of Model */ -interface IAssociative -{ +interface IAssociative { public function make(array $data): Model; /** diff --git a/src/backend/app/Services/Interfaces/IBaseService.php b/src/backend/app/Services/Interfaces/IBaseService.php index 90651b23e..322698360 100644 --- a/src/backend/app/Services/Interfaces/IBaseService.php +++ b/src/backend/app/Services/Interfaces/IBaseService.php @@ -11,8 +11,7 @@ * * @template T of Model */ -interface IBaseService -{ +interface IBaseService { /** @return T|null */ public function getById(int $id): ?Model; diff --git a/src/backend/app/Services/Interfaces/ISettingsService.php b/src/backend/app/Services/Interfaces/ISettingsService.php index 37a6f47a3..dabc62855 100644 --- a/src/backend/app/Services/Interfaces/ISettingsService.php +++ b/src/backend/app/Services/Interfaces/ISettingsService.php @@ -9,8 +9,7 @@ * * @template T of Model */ -interface ISettingsService -{ +interface ISettingsService { /** @return T|null */ public function get(): ?Model; diff --git a/src/backend/app/Services/MailService.php b/src/backend/app/Services/MailService.php index 9c506cdaf..3650d0947 100644 --- a/src/backend/app/Services/MailService.php +++ b/src/backend/app/Services/MailService.php @@ -5,17 +5,14 @@ use Illuminate\Mail\MailManager; use Illuminate\Mail\Message; -class MailService -{ +class MailService { private MailManager $mailManager; - public function __construct(MailManager $mailManager) - { + public function __construct(MailManager $mailManager) { $this->mailManager = $mailManager; } - public function sendWithAttachment(string $view, array $viewData, array $mailMeta, array $attachments) - { + public function sendWithAttachment(string $view, array $viewData, array $mailMeta, array $attachments) { $this->mailManager->send($view, $viewData, function (Message $message) use ($attachments, $mailMeta) { $message->to($mailMeta['to']) ->from($mailMeta['from']) diff --git a/src/backend/app/Services/MailSettingsService.php b/src/backend/app/Services/MailSettingsService.php index 33735bd01..3472edfbf 100644 --- a/src/backend/app/Services/MailSettingsService.php +++ b/src/backend/app/Services/MailSettingsService.php @@ -4,22 +4,18 @@ use App\Models\MailSettings; -class MailSettingsService -{ +class MailSettingsService { private $mailSettings; - public function __construct(MailSettings $mailSettings) - { + public function __construct(MailSettings $mailSettings) { $this->mailSettings = $mailSettings; } - public function list() - { + public function list() { return $this->mailSettings->newQuery()->get()->first(); } - public function create($request) - { + public function create($request) { $mailSettings = $this->mailSettings->newQuery()->create( ['mail_host' => $request->get('mail_host'), 'mail_port' => $request->get('mail_port'), @@ -32,8 +28,7 @@ public function create($request) return $mailSettings; } - public function update($request, $mailSettings) - { + public function update($request, $mailSettings) { $mailSettings->update( ['mail_host' => $request->get('mail_host'), 'mail_port' => $request->get('mail_port'), diff --git a/src/backend/app/Services/MainSettingsService.php b/src/backend/app/Services/MainSettingsService.php index ed83749b0..f8e700b5b 100644 --- a/src/backend/app/Services/MainSettingsService.php +++ b/src/backend/app/Services/MainSettingsService.php @@ -11,42 +11,35 @@ * @implements IBaseService */ // FIXME: Should this not be a ISettingsService? -class MainSettingsService implements IBaseService -{ +class MainSettingsService implements IBaseService { public function __construct( private MainSettings $mainSettings, - ) { - } + ) {} - public function getById(int $id): MainSettings - { + public function getById(int $id): MainSettings { throw new \Exception('Method getById() not yet implemented.'); return new MainSettings(); } - public function create(array $data): MainSettings - { + public function create(array $data): MainSettings { throw new \Exception('Method create() not yet implemented.'); return new MainSettings(); } - public function update($mainSettings, $mainSettingsData): MainSettings - { + public function update($mainSettings, $mainSettingsData): MainSettings { $mainSettings->update($mainSettingsData); $mainSettings->fresh(); return $mainSettings; } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method getById() not yet implemented.'); } - public function getAll(?int $limit = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null): Collection|LengthAwarePaginator { return $this->mainSettings->newQuery()->get(); } } diff --git a/src/backend/app/Services/MaintenanceUserService.php b/src/backend/app/Services/MaintenanceUserService.php index b2d4700a1..bb4095862 100644 --- a/src/backend/app/Services/MaintenanceUserService.php +++ b/src/backend/app/Services/MaintenanceUserService.php @@ -9,40 +9,32 @@ /** * @implements IBaseService */ -class MaintenanceUserService implements IBaseService -{ +class MaintenanceUserService implements IBaseService { public function __construct( private MaintenanceUsers $maintenanceUser, - ) { - } + ) {} - public function getMaintenanceUsersCount() - { + public function getMaintenanceUsersCount() { return $this->maintenanceUser->newQuery()->count(); } - public function create(array $maintenanceUserData): MaintenanceUsers - { + public function create(array $maintenanceUserData): MaintenanceUsers { return $this->maintenanceUser->newQuery()->create($maintenanceUserData); } - public function getById(int $id): MaintenanceUsers - { + public function getById(int $id): MaintenanceUsers { return $this->maintenanceUser->newQuery()->find($id); } - public function update($model, array $data): MaintenanceUsers - { + public function update($model, array $data): MaintenanceUsers { throw new \Exception('Method update() not yet implemented.'); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } - public function getAll(?int $limit = null): Collection - { + public function getAll(?int $limit = null): Collection { throw new \Exception('Method getAll() not yet implemented.'); } } diff --git a/src/backend/app/Services/MaintenanceUserTicketService.php b/src/backend/app/Services/MaintenanceUserTicketService.php index b995ce601..bda3e8408 100644 --- a/src/backend/app/Services/MaintenanceUserTicketService.php +++ b/src/backend/app/Services/MaintenanceUserTicketService.php @@ -9,24 +9,20 @@ /** * @implements IAssignationService */ -class MaintenanceUserTicketService implements IAssignationService -{ +class MaintenanceUserTicketService implements IAssignationService { private Ticket $ticket; private MaintenanceUsers $maintenanceUser; - public function setAssigned($ticket): void - { + public function setAssigned($ticket): void { $this->ticket = $ticket; } - public function setAssignee($maintenanceUser): void - { + public function setAssignee($maintenanceUser): void { $this->maintenanceUser = $maintenanceUser; } - public function assign(): Ticket - { + public function assign(): Ticket { $this->ticket->owner()->associate($this->maintenanceUser); return $this->ticket; diff --git a/src/backend/app/Services/ManufacturerAddressService.php b/src/backend/app/Services/ManufacturerAddressService.php index 3835c8bc6..df50e2d44 100644 --- a/src/backend/app/Services/ManufacturerAddressService.php +++ b/src/backend/app/Services/ManufacturerAddressService.php @@ -9,24 +9,20 @@ /** * @implements IAssignationService */ -class ManufacturerAddressService implements IAssignationService -{ +class ManufacturerAddressService implements IAssignationService { private Address $address; private Manufacturer $manufacturer; - public function setAssigned($address): void - { + public function setAssigned($address): void { $this->address = $address; } - public function setAssignee($manufacturer): void - { + public function setAssignee($manufacturer): void { $this->manufacturer = $manufacturer; } - public function assign(): Address - { + public function assign(): Address { $this->address->owner()->associate($this->manufacturer); return $this->address; diff --git a/src/backend/app/Services/ManufacturerService.php b/src/backend/app/Services/ManufacturerService.php index 3f936b697..8a90ccb90 100644 --- a/src/backend/app/Services/ManufacturerService.php +++ b/src/backend/app/Services/ManufacturerService.php @@ -11,15 +11,12 @@ /** * @implements IBaseService */ -class ManufacturerService implements IBaseService -{ +class ManufacturerService implements IBaseService { public function __construct( private Manufacturer $manufacturer, - ) { - } + ) {} - public function createManufacturerDataFromRequest(Request $request): array - { + public function createManufacturerDataFromRequest(Request $request): array { return [ 'name' => $request->get('name'), 'contact_person' => $request->get('contact_person'), @@ -28,18 +25,15 @@ public function createManufacturerDataFromRequest(Request $request): array ]; } - public function getById(int $manufacturerId): Manufacturer - { + public function getById(int $manufacturerId): Manufacturer { return $this->manufacturer->newQuery()->with(['address.city.country'])->findOrFail($manufacturerId); } - public function create(array $manufacturerData): Manufacturer - { + public function create(array $manufacturerData): Manufacturer { return $this->manufacturer->newQuery()->create($manufacturerData); } - public function getAll(?int $limit = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null): Collection|LengthAwarePaginator { if ($limit) { return $this->manufacturer->newQuery()->paginate($limit); } @@ -47,18 +41,15 @@ public function getAll(?int $limit = null): Collection|LengthAwarePaginator return $this->manufacturer->newQuery()->get(); } - public function getByName($manufacturerName) - { + public function getByName($manufacturerName) { return $this->manufacturer->newQuery()->where('name', $manufacturerName)->first(); } - public function update($model, array $data): Manufacturer - { + public function update($model, array $data): Manufacturer { throw new \Exception('Method update() not yet implemented.'); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } } diff --git a/src/backend/app/Services/MeterConsumptionService.php b/src/backend/app/Services/MeterConsumptionService.php index 3605922d0..af28ab39e 100644 --- a/src/backend/app/Services/MeterConsumptionService.php +++ b/src/backend/app/Services/MeterConsumptionService.php @@ -10,15 +10,12 @@ /** * @implements IBaseService */ -class MeterConsumptionService implements IBaseService -{ +class MeterConsumptionService implements IBaseService { public function __construct( private MeterConsumption $meterConsumption, - ) { - } + ) {} - public function getByMeter(Meter $meter, $start, $end): Collection|array - { + public function getByMeter(Meter $meter, $start, $end): Collection|array { return $this->meterConsumption->newQuery() ->where('meter_id', $meter->id)->whereBetween( 'reading_date', @@ -26,28 +23,23 @@ public function getByMeter(Meter $meter, $start, $end): Collection|array )->orderBy('reading_date')->get(); } - public function getById(int $id): MeterConsumption - { + public function getById(int $id): MeterConsumption { throw new \Exception('Method getById() not yet implemented.'); } - public function create(array $data): MeterConsumption - { + public function create(array $data): MeterConsumption { throw new \Exception('Method create() not yet implemented.'); } - public function update($model, array $data): MeterConsumption - { + public function update($model, array $data): MeterConsumption { throw new \Exception('Method update() not yet implemented.'); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } - public function getAll(?int $limit = null): Collection - { + public function getAll(?int $limit = null): Collection { throw new \Exception('Method getAll() not yet implemented.'); } } diff --git a/src/backend/app/Services/MeterGeographicalInformationService.php b/src/backend/app/Services/MeterGeographicalInformationService.php index aa1c741db..648b0a81f 100644 --- a/src/backend/app/Services/MeterGeographicalInformationService.php +++ b/src/backend/app/Services/MeterGeographicalInformationService.php @@ -5,16 +5,13 @@ use App\Models\GeographicalInformation; use App\Models\Meter\Meter; -class MeterGeographicalInformationService -{ +class MeterGeographicalInformationService { public function __construct( private GeographicalInformation $geographicalInformation, private Meter $meter, - ) { - } + ) {} - public function updateGeographicalInformation(array $meters): array - { + public function updateGeographicalInformation(array $meters): array { collect($meters)->each(function ($meter) { $points = [ $meter['lat'], diff --git a/src/backend/app/Services/MeterParameterAddressService.php b/src/backend/app/Services/MeterParameterAddressService.php index 461173dfa..548c0be25 100644 --- a/src/backend/app/Services/MeterParameterAddressService.php +++ b/src/backend/app/Services/MeterParameterAddressService.php @@ -9,24 +9,20 @@ /** * @implements IAssignationService */ -class MeterParameterAddressService implements IAssignationService -{ +class MeterParameterAddressService implements IAssignationService { private MeterParameter $meterParameter; private Address $address; - public function setAssignee($meterParameter): void - { + public function setAssignee($meterParameter): void { $this->meterParameter = $meterParameter; } - public function setAssigned($address): void - { + public function setAssigned($address): void { $this->address = $address; } - public function assign(): Address - { + public function assign(): Address { $this->address->owner()->associate($this->meterParameter); return $this->address; diff --git a/src/backend/app/Services/MeterParameterService.php b/src/backend/app/Services/MeterParameterService.php index a724be0c2..cf5ff6de7 100644 --- a/src/backend/app/Services/MeterParameterService.php +++ b/src/backend/app/Services/MeterParameterService.php @@ -6,12 +6,10 @@ use App\Models\Meter\MeterParameter; use App\Models\Person\Person; -class MeterParameterService -{ +class MeterParameterService { public function __construct( private MeterParameter $meterParameter, - ) { - } + ) {} public function createMeterParameter( array $meterParameterData, @@ -36,13 +34,11 @@ public function createMeterParameter( return $meterParameter; } - public function getAll() - { + public function getAll() { return $this->meterParameter->newQuery()->get(); } - public function delete($meterParameter) - { + public function delete($meterParameter) { return $meterParameter->delete(); } } diff --git a/src/backend/app/Services/MeterRevenueService.php b/src/backend/app/Services/MeterRevenueService.php index bb1f3aad5..698227ac9 100644 --- a/src/backend/app/Services/MeterRevenueService.php +++ b/src/backend/app/Services/MeterRevenueService.php @@ -9,16 +9,13 @@ use Illuminate\Support\Collection; use Illuminate\Support\Facades\DB; -class MeterRevenueService -{ +class MeterRevenueService { public function __construct( private MeterToken $meterToken, private Transaction $transaction, - ) { - } + ) {} - public function getBySerialNumber(string $serialNumber) - { + public function getBySerialNumber(string $serialNumber) { $tokens = $this->meterToken->newQuery()->whereHas( 'meter', function ($q) use ($serialNumber) { diff --git a/src/backend/app/Services/MeterService.php b/src/backend/app/Services/MeterService.php index 6511d4631..cac55efb3 100644 --- a/src/backend/app/Services/MeterService.php +++ b/src/backend/app/Services/MeterService.php @@ -10,15 +10,12 @@ /** * @implements IBaseService */ -class MeterService implements IBaseService -{ +class MeterService implements IBaseService { public function __construct( private Meter $meter, - ) { - } + ) {} - public function getBySerialNumber($serialNumber) - { + public function getBySerialNumber($serialNumber) { return $this->meter->newQuery()->with([ 'tariff', 'device.person', @@ -30,8 +27,7 @@ public function getBySerialNumber($serialNumber) ])->where('serial_number', $serialNumber)->first(); } - public function search($term, $paginate): LengthAwarePaginator - { + public function search($term, $paginate): LengthAwarePaginator { return $this->meter->newQuery()->with(['meterType', 'tariff']) ->whereHas('tariff', fn ($q) => $q->where('name', 'LIKE', '%'.$term.'%')) ->orWhere( @@ -41,8 +37,7 @@ public function search($term, $paginate): LengthAwarePaginator )->paginate($paginate); } - public function getMeterWithAllRelations(int $meterId) - { + public function getMeterWithAllRelations(int $meterId) { return $this->meter->newQuery()->with([ 'tariff', 'device.geo', @@ -50,13 +45,11 @@ public function getMeterWithAllRelations(int $meterId) ])->find($meterId); } - public function getUsedMetersGeoWithAccessRatePayments(): Collection|array - { + public function getUsedMetersGeoWithAccessRatePayments(): Collection|array { return $this->meter->newQuery()->with(['device.geo', 'accessRatePayment'])->where('in_use', 1)->get(); } - public function getUsedMetersGeoWithAccessRatePaymentsInCities($cities): Collection|array - { + public function getUsedMetersGeoWithAccessRatePaymentsInCities($cities): Collection|array { return $this->meter->newQuery()->with(['device.geo', 'accessRatePayment']) ->whereHas( 'device', @@ -70,8 +63,7 @@ function ($q) use ($cities) { ->where('in_use', 1)->get(); } - public function create(array $meterData): Meter - { + public function create(array $meterData): Meter { return $this->meter->newQuery()->create([ 'serial_number' => $meterData['serial_number'], 'meter_type_id' => $meterData['meter_type_id'], @@ -83,8 +75,7 @@ public function create(array $meterData): Meter ]); } - public function getById(int $meterId): Meter - { + public function getById(int $meterId): Meter { return $this->meter->newQuery()->with([ 'tariff', 'device', @@ -95,13 +86,11 @@ public function getById(int $meterId): Meter ])->find($meterId); } - public function delete($meter): ?bool - { + public function delete($meter): ?bool { return $meter->delete(); } - public function getAll(?int $limit = null, $inUse = true): LengthAwarePaginator - { + public function getAll(?int $limit = null, $inUse = true): LengthAwarePaginator { if (isset($inUse)) { return $this->meter->newQuery()->with(['meterType', 'tariff'])->where( 'in_use', @@ -112,8 +101,7 @@ public function getAll(?int $limit = null, $inUse = true): LengthAwarePaginator return $this->meter->newQuery()->with(['meterType', 'tariff'])->paginate($limit); } - public function update($meter, array $meterData): Meter - { + public function update($meter, array $meterData): Meter { $meter->update($meterData); $meter->fresh(); diff --git a/src/backend/app/Services/MeterTariffMeterParameterService.php b/src/backend/app/Services/MeterTariffMeterParameterService.php index 290645901..ccfd4dafa 100644 --- a/src/backend/app/Services/MeterTariffMeterParameterService.php +++ b/src/backend/app/Services/MeterTariffMeterParameterService.php @@ -6,17 +6,14 @@ use App\Models\Meter\MeterParameter; use App\Models\Meter\MeterTariff; -class MeterTariffMeterParameterService -{ +class MeterTariffMeterParameterService { public function __construct( private MeterTariff $meterTariff, private MeterParameter $meterParameter, private Meter $meter, - ) { - } + ) {} - public function getCountById($meterTariffId): array - { + public function getCountById($meterTariffId): array { $count = $this->meterParameter->newQuery()->whereHas( 'meter', function ($q) { @@ -27,8 +24,7 @@ function ($q) { return ['count' => $count]; } - public function changeMetersTariff($meterTariffIdFrom, $meterTariffIdTo) - { + public function changeMetersTariff($meterTariffIdFrom, $meterTariffIdTo) { return $this->meterParameter->newQuery()->where('tariff_id', $meterTariffIdFrom) ->get() ->each(function ($meterParameter) use ($meterTariffIdTo) { @@ -38,8 +34,7 @@ public function changeMetersTariff($meterTariffIdFrom, $meterTariffIdTo) }); } - public function changeMeterTariff($meterSerial, $tariffId): MeterParameter - { + public function changeMeterTariff($meterSerial, $tariffId): MeterParameter { $meter = $this->meter->newQuery()->where('serial_number', $meterSerial)->firstOrFail(); $meterParameter = $this->meterParameter->newQuery()->where('meter_id', $meter->id)->firstOrFail(); $meterParameter->tariff_id = $tariffId; diff --git a/src/backend/app/Services/MeterTariffService.php b/src/backend/app/Services/MeterTariffService.php index 895cc2e20..bdab93a75 100644 --- a/src/backend/app/Services/MeterTariffService.php +++ b/src/backend/app/Services/MeterTariffService.php @@ -10,27 +10,22 @@ /** * @implements IBaseService */ -class MeterTariffService implements IBaseService -{ +class MeterTariffService implements IBaseService { public function __construct( private MeterTariff $meterTariff, - ) { - } + ) {} - public function getById(int $meterTariffId): MeterTariff - { + public function getById(int $meterTariffId): MeterTariff { return $this->meterTariff->newQuery() ->with(['accessRate', 'pricingComponent', 'socialTariff', 'tou']) ->findOrFail($meterTariffId); } - public function create(array $meterTariffData): MeterTariff - { + public function create(array $meterTariffData): MeterTariff { return $this->meterTariff->newQuery()->create($meterTariffData); } - public function update($meterTariff, array $meterTariffData): MeterTariff - { + public function update($meterTariff, array $meterTariffData): MeterTariff { $meterTariff->update( $meterTariffData ); @@ -39,13 +34,11 @@ public function update($meterTariff, array $meterTariffData): MeterTariff return $meterTariff; } - public function delete($meterTariff): ?bool - { + public function delete($meterTariff): ?bool { return $meterTariff->delete(); } - public function getAll(?int $limit = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null): Collection|LengthAwarePaginator { if ($limit) { return $this->meterTariff->newQuery() ->with(['accessRate', 'pricingComponent', 'socialTariff', 'tou'])->where('factor', 1) diff --git a/src/backend/app/Services/MeterTokenPaymentHistoryService.php b/src/backend/app/Services/MeterTokenPaymentHistoryService.php index 9ed3409b6..ea8255a5d 100644 --- a/src/backend/app/Services/MeterTokenPaymentHistoryService.php +++ b/src/backend/app/Services/MeterTokenPaymentHistoryService.php @@ -9,24 +9,20 @@ /** * @implements IAssignationService */ -class MeterTokenPaymentHistoryService implements IAssignationService -{ +class MeterTokenPaymentHistoryService implements IAssignationService { private PaymentHistory $paymentHistory; private MeterToken $meterToken; - public function setAssigned($paymentHistory): void - { + public function setAssigned($paymentHistory): void { $this->paymentHistory = $paymentHistory; } - public function setAssignee($meterToken): void - { + public function setAssignee($meterToken): void { $this->meterToken = $meterToken; } - public function assign(): PaymentHistory - { + public function assign(): PaymentHistory { $this->paymentHistory->paidFor()->associate($this->meterToken); return $this->paymentHistory; diff --git a/src/backend/app/Services/MeterTypeMeterService.php b/src/backend/app/Services/MeterTypeMeterService.php index bcc35a1ed..c478f5df1 100644 --- a/src/backend/app/Services/MeterTypeMeterService.php +++ b/src/backend/app/Services/MeterTypeMeterService.php @@ -4,14 +4,10 @@ use App\Models\Meter\MeterType; -class MeterTypeMeterService -{ - public function __construct(private MeterType $meterType) - { - } +class MeterTypeMeterService { + public function __construct(private MeterType $meterType) {} - public function getByIdWithMeters($meterTypeId) - { + public function getByIdWithMeters($meterTypeId) { return $this->meterType->newQuery()->with(['meters'])->findOrFail($meterTypeId); } } diff --git a/src/backend/app/Services/MeterTypeService.php b/src/backend/app/Services/MeterTypeService.php index 8fc62632b..d57197842 100644 --- a/src/backend/app/Services/MeterTypeService.php +++ b/src/backend/app/Services/MeterTypeService.php @@ -10,32 +10,25 @@ /** * @implements IBaseService */ -class MeterTypeService implements IBaseService -{ - public function __construct(private MeterType $meterType) - { - } +class MeterTypeService implements IBaseService { + public function __construct(private MeterType $meterType) {} - public function create(array $meterTypeData): MeterType - { + public function create(array $meterTypeData): MeterType { return $this->meterType->newQuery()->create($meterTypeData); } - public function getById(int $meterTypeId): MeterType - { + public function getById(int $meterTypeId): MeterType { return $this->meterType->newQuery()->findOrFail($meterTypeId); } - public function update($meterType, array $meterTypeData): MeterType - { + public function update($meterType, array $meterTypeData): MeterType { $meterType->update($meterTypeData); $meterType->fresh(); return $meterType; } - public function getAll(?int $limit = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null): Collection|LengthAwarePaginator { if ($limit) { return $this->meterType->newQuery()->paginate($limit); } @@ -43,8 +36,7 @@ public function getAll(?int $limit = null): Collection|LengthAwarePaginator return $this->meterType->newQuery()->get(); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } } diff --git a/src/backend/app/Services/MiniGridDashboardCacheDataService.php b/src/backend/app/Services/MiniGridDashboardCacheDataService.php index 2bd6d854c..0a9f046e0 100644 --- a/src/backend/app/Services/MiniGridDashboardCacheDataService.php +++ b/src/backend/app/Services/MiniGridDashboardCacheDataService.php @@ -11,8 +11,7 @@ use MPM\Device\MiniGridDeviceService; use Nette\Utils\DateTime; -class MiniGridDashboardCacheDataService extends AbstractDashboardCacheDataService -{ +class MiniGridDashboardCacheDataService extends AbstractDashboardCacheDataService { private const CACHE_KEY_MINI_GRIDS_DATA = 'MiniGridsData'; public function __construct( @@ -32,8 +31,7 @@ public function __construct( parent::__construct(self::CACHE_KEY_MINI_GRIDS_DATA); } - public function setData($dateRange = []) - { + public function setData($dateRange = []) { if (empty($dateRange)) { $startDate = date('Y-01-01'); // first day of the year $endDate = date('Y-m-d H:i:s', strtotime('today')); diff --git a/src/backend/app/Services/MiniGridEnergyService.php b/src/backend/app/Services/MiniGridEnergyService.php index c8f756a32..31fea954b 100644 --- a/src/backend/app/Services/MiniGridEnergyService.php +++ b/src/backend/app/Services/MiniGridEnergyService.php @@ -7,14 +7,10 @@ use Carbon\Carbon; use Illuminate\Database\Eloquent\Collection; -class MiniGridEnergyService -{ - public function __construct(private MiniGrid $miniGrid, private Energy $energy) - { - } +class MiniGridEnergyService { + public function __construct(private MiniGrid $miniGrid, private Energy $energy) {} - public function getById($miniGridId, $startDate, $endDate): Collection|array - { + public function getById($miniGridId, $startDate, $endDate): Collection|array { $energyReadings = $this->energy->newQuery() ->where('mini_grid_id', $miniGridId); diff --git a/src/backend/app/Services/MiniGridGeographicalInformationService.php b/src/backend/app/Services/MiniGridGeographicalInformationService.php index daf7ac8d6..bacaf8238 100644 --- a/src/backend/app/Services/MiniGridGeographicalInformationService.php +++ b/src/backend/app/Services/MiniGridGeographicalInformationService.php @@ -9,24 +9,20 @@ /** * @implements IAssignationService */ -class MiniGridGeographicalInformationService implements IAssignationService -{ +class MiniGridGeographicalInformationService implements IAssignationService { private GeographicalInformation $geographicInformation; private MiniGrid $miniGrid; - public function setAssigned($assigned): void - { + public function setAssigned($assigned): void { $this->geographicInformation = $assigned; } - public function setAssignee($assignee): void - { + public function setAssignee($assignee): void { $this->miniGrid = $assignee; } - public function assign(): GeographicalInformation - { + public function assign(): GeographicalInformation { $this->geographicInformation->owner()->associate($this->miniGrid); return $this->geographicInformation; diff --git a/src/backend/app/Services/MiniGridRevenueService.php b/src/backend/app/Services/MiniGridRevenueService.php index 12153cec8..0bcb6bba1 100644 --- a/src/backend/app/Services/MiniGridRevenueService.php +++ b/src/backend/app/Services/MiniGridRevenueService.php @@ -6,16 +6,13 @@ use App\Models\Transaction\Transaction; use Illuminate\Support\Carbon; -class MiniGridRevenueService -{ +class MiniGridRevenueService { public function __construct( private Transaction $transaction, private MeterToken $meterToken, - ) { - } + ) {} - public function getById($miniGridId, $startDate, $endDate, $miniGridDeviceService) - { + public function getById($miniGridId, $startDate, $endDate, $miniGridDeviceService) { $startDate = $startDate ?? date('Y-01-01'); $endDate = $endDate ?? date('Y-m-t'); $miniGridMeters = $miniGridDeviceService->getMetersByMiniGridId($miniGridId); @@ -33,8 +30,7 @@ static function ($q) { ->whereBetween('created_at', [$startDate, Carbon::parse($endDate)->endOfDay()])->get(); } - public function getSoldEnergyById($miniGridId, $startDate, $endDate, $miniGridDeviceService) - { + public function getSoldEnergyById($miniGridId, $startDate, $endDate, $miniGridDeviceService) { $startDate = $startDate ?? date('Y-01-01'); $endDate = $endDate ?? date('Y-m-t'); $miniGridMeters = $miniGridDeviceService->getMetersByMiniGridId($miniGridId); diff --git a/src/backend/app/Services/MiniGridService.php b/src/backend/app/Services/MiniGridService.php index c9f9f1aa8..b3e5626d6 100644 --- a/src/backend/app/Services/MiniGridService.php +++ b/src/backend/app/Services/MiniGridService.php @@ -11,37 +11,31 @@ /** * @implements IBaseService */ -class MiniGridService implements IBaseService -{ +class MiniGridService implements IBaseService { public function __construct( private MiniGrid $miniGrid, private Cluster $cluster, - ) { - } + ) {} - public function getByIdWithLocation($miniGridId) - { + public function getByIdWithLocation($miniGridId) { return $this->miniGrid->newQuery()->with(['location'])->find($miniGridId); } - public function getById($miniGridId): MiniGrid - { + public function getById($miniGridId): MiniGrid { /** @var MiniGrid $model */ $model = $this->miniGrid->newQuery()->find($miniGridId); return $model; } - public function create($miniGridData): MiniGrid - { + public function create($miniGridData): MiniGrid { /** @var MiniGrid $result */ $result = $this->miniGrid->newQuery()->create($miniGridData); return $result; } - public function update($miniGrid, $miniGridData): MiniGrid - { + public function update($miniGrid, $miniGridData): MiniGrid { $miniGrid->update([ 'name' => $miniGridData['name'] ?? $miniGrid->name, ]); @@ -50,8 +44,7 @@ public function update($miniGrid, $miniGridData): MiniGrid return $miniGrid; } - public function getAll(?int $limit = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null): Collection|LengthAwarePaginator { $miniGrids = $this->miniGrid->newQuery()->with(['location']); if ($limit) { @@ -61,8 +54,7 @@ public function getAll(?int $limit = null): Collection|LengthAwarePaginator return $miniGrids->newQuery()->get(); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } } diff --git a/src/backend/app/Services/MpmPluginService.php b/src/backend/app/Services/MpmPluginService.php index 78b9c5e53..3eac5fe6e 100644 --- a/src/backend/app/Services/MpmPluginService.php +++ b/src/backend/app/Services/MpmPluginService.php @@ -10,38 +10,31 @@ /** * @implements IBaseService */ -class MpmPluginService implements IBaseService -{ +class MpmPluginService implements IBaseService { public function __construct( private MpmPlugin $mpmPlugin, - ) { - } + ) {} - public function getById($id): MpmPlugin - { + public function getById($id): MpmPlugin { /** @var MpmPlugin $result */ $result = $this->mpmPlugin->newQuery()->findOrFail($id); return $result; } - public function create(array $data): MpmPlugin - { + public function create(array $data): MpmPlugin { throw new \Exception('Method create() not yet implemented.'); } - public function update($model, array $data): MpmPlugin - { + public function update($model, array $data): MpmPlugin { throw new \Exception('Method update() not yet implemented.'); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } - public function getAll(?int $limit = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null): Collection|LengthAwarePaginator { if ($limit) { return $this->mpmPlugin->newQuery() ->paginate($limit); diff --git a/src/backend/app/Services/PaymentHistoryService.php b/src/backend/app/Services/PaymentHistoryService.php index 63896d00e..db9bc4a23 100644 --- a/src/backend/app/Services/PaymentHistoryService.php +++ b/src/backend/app/Services/PaymentHistoryService.php @@ -12,12 +12,10 @@ /** * @implements IAssociative */ -class PaymentHistoryService implements IAssociative -{ +class PaymentHistoryService implements IAssociative { public function __construct( private PaymentHistory $paymentHistory, - ) { - } + ) {} public function findPayingCustomersInRange( array $customerIds, @@ -27,16 +25,14 @@ public function findPayingCustomersInRange( return $this->paymentHistory->findCustomersPaidInRange($customerIds, $startDate, $endDate); } - public function findCustomerLastPayment(int $customerId): PaymentHistory - { + public function findCustomerLastPayment(int $customerId): PaymentHistory { return $this->paymentHistory ->whereHasMorph('owner', [Person::class], fn (Builder $q) => $q->where('id', $customerId)) ->latest('created_at') ->first(); } - public function getBySerialNumber(string $serialNumber, int $paginate): LengthAwarePaginator - { + public function getBySerialNumber(string $serialNumber, int $paginate): LengthAwarePaginator { return $this->paymentHistory->newQuery()->with(['transaction', 'paidFor']) ->whereHas( 'transaction', @@ -46,13 +42,11 @@ function ($q) use ($serialNumber) { )->latest()->paginate($paginate); } - public function make(array $paymentHistoryData): PaymentHistory - { + public function make(array $paymentHistoryData): PaymentHistory { return $this->paymentHistory->newQuery()->make($paymentHistoryData); } - public function save($paymentHistory): bool - { + public function save($paymentHistory): bool { return $paymentHistory->save(); } } diff --git a/src/backend/app/Services/PdfService.php b/src/backend/app/Services/PdfService.php index 96f2f6381..2a58f4021 100644 --- a/src/backend/app/Services/PdfService.php +++ b/src/backend/app/Services/PdfService.php @@ -5,17 +5,14 @@ use Barryvdh\DomPDF\PDF; use Illuminate\Support\Facades\Storage; -class PdfService -{ +class PdfService { private PDF $pdf; - public function __construct(PDF $pdf) - { + public function __construct(PDF $pdf) { $this->pdf = $pdf; } - public function generatePdfFromView(string $view, $dataToInject): string - { + public function generatePdfFromView(string $view, $dataToInject): string { $this->pdf->loadView($view, ['data' => $dataToInject]); $filePath = Storage::path('non-paying').time().'.pdf'; diff --git a/src/backend/app/Services/PeriodService.php b/src/backend/app/Services/PeriodService.php index c5b8a91ef..32bdcea83 100644 --- a/src/backend/app/Services/PeriodService.php +++ b/src/backend/app/Services/PeriodService.php @@ -2,15 +2,13 @@ namespace App\Services; -class PeriodService -{ +class PeriodService { /** * @param (int|int[])[]|int $initialData * * @throws \Exception */ - public function generatePeriodicList(string $startDate, string $endDate, string $interval, $initialData): array - { + public function generatePeriodicList(string $startDate, string $endDate, string $interval, $initialData): array { $result = []; $begin = date_create($startDate); $end = date_create($endDate); diff --git a/src/backend/app/Services/PersonAddressService.php b/src/backend/app/Services/PersonAddressService.php index db2b9c2eb..51c51b5de 100644 --- a/src/backend/app/Services/PersonAddressService.php +++ b/src/backend/app/Services/PersonAddressService.php @@ -9,36 +9,30 @@ /** * @implements IAssignationService */ -class PersonAddressService implements IAssignationService -{ +class PersonAddressService implements IAssignationService { private Address $address; private Person $person; - public function setOldPrimaryAddressToNotPrimary(): Person - { + public function setOldPrimaryAddressToNotPrimary(): Person { $this->person->addresses()->where('is_primary', 1)->update(['is_primary' => 0]); return $this->person; } - public function getPersonAddresses($person) - { + public function getPersonAddresses($person) { return $person->addresses()->with('city', 'geo')->orderBy('is_primary', 'DESC')->paginate(5); } - public function setAssigned($address): void - { + public function setAssigned($address): void { $this->address = $address; } - public function setAssignee($person): void - { + public function setAssignee($person): void { $this->person = $person; } - public function assign(): Address - { + public function assign(): Address { $this->address->owner()->associate($this->person); return $this->address; diff --git a/src/backend/app/Services/PersonMeterService.php b/src/backend/app/Services/PersonMeterService.php index f9d3ddffb..e42334b74 100644 --- a/src/backend/app/Services/PersonMeterService.php +++ b/src/backend/app/Services/PersonMeterService.php @@ -5,21 +5,17 @@ use App\Models\Meter\Meter; use App\Models\Person\Person; -class PersonMeterService -{ +class PersonMeterService { public function __construct( private Person $person, private Meter $meter, - ) { - } + ) {} - public function getPersonMeters(int $personId) - { + public function getPersonMeters(int $personId) { return $this->person->newQuery()->with(['meters.tariff', 'meters.meter'])->find($personId); } - public function getPersonMetersGeographicalInformation(int $personId) - { + public function getPersonMetersGeographicalInformation(int $personId) { return $this->person->newQuery()->with(['meters.meter', 'meters.geo'])->find($personId); } } diff --git a/src/backend/app/Services/PersonPaymentHistoryService.php b/src/backend/app/Services/PersonPaymentHistoryService.php index 029d600ba..05dbd7a49 100644 --- a/src/backend/app/Services/PersonPaymentHistoryService.php +++ b/src/backend/app/Services/PersonPaymentHistoryService.php @@ -9,24 +9,20 @@ /** * @implements IAssignationService */ -class PersonPaymentHistoryService implements IAssignationService -{ +class PersonPaymentHistoryService implements IAssignationService { private PaymentHistory $paymentHistory; private Person $person; - public function setAssigned($paymentHistory): void - { + public function setAssigned($paymentHistory): void { $this->paymentHistory = $paymentHistory; } - public function setAssignee($person): void - { + public function setAssignee($person): void { $this->person = $person; } - public function assign(): PaymentHistory - { + public function assign(): PaymentHistory { $this->paymentHistory->payer()->associate($this->person); return $this->paymentHistory; diff --git a/src/backend/app/Services/PersonService.php b/src/backend/app/Services/PersonService.php index 4011bf9f2..4e394e0d9 100644 --- a/src/backend/app/Services/PersonService.php +++ b/src/backend/app/Services/PersonService.php @@ -15,26 +15,21 @@ /** * @implements IBaseService */ -class PersonService implements IBaseService -{ +class PersonService implements IBaseService { public function __construct( private Person $person, - ) { - } + ) {} - public function getAllRegisteredPeople(): Collection|array - { + public function getAllRegisteredPeople(): Collection|array { return $this->person->newQuery()->get(); } // associates the person with a country - public function addCitizenship(Person $person, Country $country): Model - { + public function addCitizenship(Person $person, Country $country): Model { return $person->citizenship()->associate($country); } - public function getDetails(int $personID, bool $allRelations = false) - { + public function getDetails(int $personID, bool $allRelations = false) { if (!$allRelations) { return $this->getById($personID); } @@ -61,8 +56,7 @@ public function getDetails(int $personID, bool $allRelations = false) * * @psalm-return Collection|LengthAwarePaginator|array */ - public function searchPerson($searchTerm, $paginate) - { + public function searchPerson($searchTerm, $paginate) { $query = $this->person->newQuery()->with(['addresses.city', 'devices'])->whereHas( 'addresses', fn ($q) => $q->where('phone', 'LIKE', '%'.$searchTerm.'%') @@ -79,13 +73,11 @@ public function searchPerson($searchTerm, $paginate) return $query->get(); } - public function getPersonTransactions($person) - { + public function getPersonTransactions($person) { return $person->payments()->with('transaction.token')->latest()->paginate(7); } - public function createMaintenancePerson(array $personData): Person - { + public function createMaintenancePerson(array $personData): Person { $personData['is_customer'] = 0; /** @var Person $person */ $person = $this->person->newQuery()->create($personData); @@ -93,13 +85,11 @@ public function createMaintenancePerson(array $personData): Person return $person; } - public function livingInCluster(int $clusterId) - { + public function livingInCluster(int $clusterId) { return $this->person->livingInClusterQuery($clusterId); } - public function getBulkDetails(array $peopleId): Builder - { + public function getBulkDetails(array $peopleId): Builder { return $this->person->newQuery()->with( [ 'addresses' => fn ($q) => $q->where('is_primary', '=', 1), @@ -112,19 +102,16 @@ public function getBulkDetails(array $peopleId): Builder )->whereIn('id', $peopleId); } - public function updatePersonUpdatedDate(Person $person) - { + public function updatePersonUpdatedDate(Person $person) { $person->updated_at = Carbon::now(); $person->save(); } - public function isMaintenancePerson($customerType): bool - { + public function isMaintenancePerson($customerType): bool { return $customerType !== null && $customerType !== 'customer' && $customerType === 'maintenance'; } - public function createPersonDataFromRequest(Request $request): array - { + public function createPersonDataFromRequest(Request $request): array { return [ 'title' => $request->get('title'), 'education' => $request->get('education'), @@ -136,21 +123,18 @@ public function createPersonDataFromRequest(Request $request): array ]; } - public function getById(int $personId): Person - { + public function getById(int $personId): Person { /** @var Person $model */ $model = $this->person->newQuery()->find($personId); return $model; } - public function create(array $personData): Person - { + public function create(array $personData): Person { return $this->person->newQuery()->create($personData); } - public function update($person, array $personData): Person - { + public function update($person, array $personData): Person { foreach ($personData as $key => $value) { $person->$key = $value; } @@ -161,13 +145,11 @@ public function update($person, array $personData): Person return $person; } - public function delete($person): ?bool - { + public function delete($person): ?bool { return $person->delete(); } - public function getAll(?int $limit = null, $customerType = 1): LengthAwarePaginator - { + public function getAll(?int $limit = null, $customerType = 1): LengthAwarePaginator { return $this->person->newQuery()->with([ 'addresses' => function ($q) { return $q->where('is_primary', 1); @@ -177,8 +159,7 @@ public function getAll(?int $limit = null, $customerType = 1): LengthAwarePagina ])->where('is_customer', $customerType)->paginate($limit); } - public function createFromRequest(Request $request): Model - { + public function createFromRequest(Request $request): Model { $person = $this->person->newQuery()->create($request->only([ 'title', 'education', @@ -204,8 +185,7 @@ public function createFromRequest(Request $request): Model return $person; } - public function getByPhoneNumber($phoneNumber): ?Person - { + public function getByPhoneNumber($phoneNumber): ?Person { return $this->person->newQuery()->whereHas('addresses', fn ($q) => $q->where('phone', $phoneNumber)) ->first(); } diff --git a/src/backend/app/Services/PersonTicketService.php b/src/backend/app/Services/PersonTicketService.php index a4ba8e05c..47cafe994 100644 --- a/src/backend/app/Services/PersonTicketService.php +++ b/src/backend/app/Services/PersonTicketService.php @@ -9,24 +9,20 @@ /** * @implements IAssignationService */ -class PersonTicketService implements IAssignationService -{ +class PersonTicketService implements IAssignationService { private Ticket $ticket; private Person $person; - public function setAssigned($ticket): void - { + public function setAssigned($ticket): void { $this->ticket = $ticket; } - public function setAssignee($person): void - { + public function setAssignee($person): void { $this->person = $person; } - public function assign(): Ticket - { + public function assign(): Ticket { $this->ticket->owner()->associate($this->person); return $this->ticket; diff --git a/src/backend/app/Services/PluginsService.php b/src/backend/app/Services/PluginsService.php index 6ecde7a27..90c8be505 100644 --- a/src/backend/app/Services/PluginsService.php +++ b/src/backend/app/Services/PluginsService.php @@ -6,31 +6,26 @@ use Illuminate\Database\Eloquent\Collection; use Illuminate\Pagination\LengthAwarePaginator; -class PluginsService -{ +class PluginsService { public function __construct( private Plugins $plugin, - ) { - } + ) {} - public function create(array $pluginData): Plugins - { + public function create(array $pluginData): Plugins { /** @var Plugins $plugin */ $plugin = $this->plugin->newQuery()->create($pluginData); return $plugin; } - public function update($model, array $data): Plugins - { + public function update($model, array $data): Plugins { $model->update($data); $model->fresh(); return $model; } - public function getAll(?int $limit = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null): Collection|LengthAwarePaginator { if ($limit) { return $this->plugin->newQuery()->paginate($limit); } @@ -38,13 +33,11 @@ public function getAll(?int $limit = null): Collection|LengthAwarePaginator return $this->plugin->newQuery()->get(); } - public function getByMpmPluginId($mpmPluginId) - { + public function getByMpmPluginId($mpmPluginId) { return $this->plugin->newQuery()->where('mpm_plugin_id', $mpmPluginId)->first(); } - public function isPluginActive(int $pluginId): bool - { + public function isPluginActive(int $pluginId): bool { return $this->plugin->newQuery() ->where('mpm_plugin_id', '=', $pluginId) ->exists(); diff --git a/src/backend/app/Services/RegistrationTailService.php b/src/backend/app/Services/RegistrationTailService.php index 82af06afb..f0c0cb337 100644 --- a/src/backend/app/Services/RegistrationTailService.php +++ b/src/backend/app/Services/RegistrationTailService.php @@ -11,25 +11,20 @@ /** * @implements IBaseService */ -class RegistrationTailService implements IBaseService -{ +class RegistrationTailService implements IBaseService { public function __construct( private RegistrationTail $registrationTail, - ) { - } + ) {} - public function getById(int $id): RegistrationTail - { + public function getById(int $id): RegistrationTail { return $this->registrationTail->newQuery()->find($id); } - public function create(array $registrationTailData): RegistrationTail - { + public function create(array $registrationTailData): RegistrationTail { return $this->registrationTail->newQuery()->create($registrationTailData); } - public function update($registrationTail, array $registrationTailData): RegistrationTail - { + public function update($registrationTail, array $registrationTailData): RegistrationTail { if (array_key_exists('tail', $registrationTailData)) { $registrationTail->update($registrationTailData); } else { @@ -41,23 +36,19 @@ public function update($registrationTail, array $registrationTailData): Registra return $registrationTail; } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } - public function getAll(?int $limit = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null): Collection|LengthAwarePaginator { return $this->registrationTail->newQuery()->get(); } - public function getFirst($limit = null) - { + public function getFirst($limit = null) { return $this->registrationTail->newQuery()->firstOrCreate(); } - public function addMpmPluginToRegistrationTail(RegistrationTail $registrationTail, MpmPlugin $mpmPlugin): RegistrationTail - { + public function addMpmPluginToRegistrationTail(RegistrationTail $registrationTail, MpmPlugin $mpmPlugin): RegistrationTail { $tail = !empty($registrationTail->tail) ? json_decode($registrationTail->tail, true) : []; array_push($tail, [ @@ -76,8 +67,7 @@ public function addMpmPluginToRegistrationTail(RegistrationTail $registrationTai ); } - public function removeMpmPluginFromRegistrationTail(RegistrationTail $registrationTail, MpmPlugin $mpmPlugin): RegistrationTail - { + public function removeMpmPluginFromRegistrationTail(RegistrationTail $registrationTail, MpmPlugin $mpmPlugin): RegistrationTail { $tail = !empty($registrationTail->tail) ? json_decode($registrationTail->tail, true) : []; $updatedTail = array_filter($tail, function ($item) use ($mpmPlugin) { diff --git a/src/backend/app/Services/RestrictionService.php b/src/backend/app/Services/RestrictionService.php index f9a3220d7..ebd002234 100644 --- a/src/backend/app/Services/RestrictionService.php +++ b/src/backend/app/Services/RestrictionService.php @@ -9,40 +9,32 @@ /** * @implements IBaseService */ -class RestrictionService implements IBaseService -{ +class RestrictionService implements IBaseService { public function __construct( private Restriction $restriction, - ) { - } + ) {} - public function getRestrictionForTarget($target) - { + public function getRestrictionForTarget($target) { return $this->restriction->newQuery()->where('target', $target)->firstOrFail(); } - public function getById(int $id): Restriction - { + public function getById(int $id): Restriction { throw new \Exception('Method getById() not yet implemented.'); } - public function create(array $data): Restriction - { + public function create(array $data): Restriction { throw new \Exception('Method create() not yet implemented.'); } - public function update($model, array $data): Restriction - { + public function update($model, array $data): Restriction { throw new \Exception('Method update() not yet implemented.'); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } - public function getAll(?int $limit = null): Collection - { + public function getAll(?int $limit = null): Collection { throw new \Exception('Method getAll() not yet implemented.'); } } diff --git a/src/backend/app/Services/RevenueService.php b/src/backend/app/Services/RevenueService.php index 47318dc93..9564c5651 100644 --- a/src/backend/app/Services/RevenueService.php +++ b/src/backend/app/Services/RevenueService.php @@ -2,10 +2,8 @@ namespace App\Services; -class RevenueService -{ - public function fetchTargets($targetData): array - { +class RevenueService { + public function fetchTargets($targetData): array { $formattedTarget = []; if (is_object($targetData) && count($targetData) >= 1) { foreach ($targetData as $targets) { diff --git a/src/backend/app/Services/RolesService.php b/src/backend/app/Services/RolesService.php index 1730148d7..a65c54a26 100644 --- a/src/backend/app/Services/RolesService.php +++ b/src/backend/app/Services/RolesService.php @@ -9,8 +9,7 @@ use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Model; -class RolesService -{ +class RolesService { /** * @var Roles */ @@ -21,14 +20,12 @@ class RolesService */ private $definiton; - public function __construct(Roles $role, RoleDefinition $definition) - { + public function __construct(Roles $role, RoleDefinition $definition) { $this->role = $role; $this->definiton = $definition; } - public function findOrCreateRoleDefinition(string $roleName) - { + public function findOrCreateRoleDefinition(string $roleName) { return $this->definiton->firstOrCreate(['role_name' => $roleName]); } @@ -37,21 +34,18 @@ public function findOrCreateRoleDefinition(string $roleName) * * @psalm-return Collection|array */ - public function findRoleByDefinition(RoleDefinition $definition) - { + public function findRoleByDefinition(RoleDefinition $definition) { return $this->role->with()->get(); } /** * @return Model|false */ - public function attachToOwner(RoleInterface $roleOwner, Roles $role) // person or a company - { + public function attachToOwner(RoleInterface $roleOwner, Roles $role) { // person or a company return $roleOwner->roleowner()->save($role); } - public function create(RoleDefinition $definition): Roles - { + public function create(RoleDefinition $definition): Roles { $this->role->definitions()->associate($definition); return $this->role; diff --git a/src/backend/app/Services/SessionService.php b/src/backend/app/Services/SessionService.php index a85928ba0..86605826c 100644 --- a/src/backend/app/Services/SessionService.php +++ b/src/backend/app/Services/SessionService.php @@ -5,12 +5,10 @@ use App\Models\Base\BaseModel; use Illuminate\Database\Eloquent\Model; -class SessionService -{ +class SessionService { private BaseModel|Model $model; - public function setModel(BaseModel|Model $model): void - { + public function setModel(BaseModel|Model $model): void { $this->model = $model; $databaseName = $model->getConnectionName(); if (!$this->checkDatabaseName($databaseName)) { @@ -18,13 +16,11 @@ public function setModel(BaseModel|Model $model): void } } - private function checkDatabaseName($databaseName): bool - { + private function checkDatabaseName($databaseName): bool { return $this->getAuthenticatedUserDatabaseName() == $databaseName; } - public function getAuthenticatedUserDatabaseName(): string - { + public function getAuthenticatedUserDatabaseName(): string { return config()->get('database.connections.shard.database'); } } diff --git a/src/backend/app/Services/SmsAndroidSettingService.php b/src/backend/app/Services/SmsAndroidSettingService.php index 8454e53e0..4d15bf6f4 100644 --- a/src/backend/app/Services/SmsAndroidSettingService.php +++ b/src/backend/app/Services/SmsAndroidSettingService.php @@ -4,25 +4,21 @@ use App\Models\SmsAndroidSetting; -class SmsAndroidSettingService -{ +class SmsAndroidSettingService { private string $fireBaseKey; private string $callbackUrl; - public function __construct(private SmsAndroidSetting $smsAndroidSetting, private UserService $userService) - { + public function __construct(private SmsAndroidSetting $smsAndroidSetting, private UserService $userService) { $this->fireBaseKey = config('services.sms.android.key'); $this->callbackUrl = config('services.sms.callback').$this->userService->getCompanyId(); } - public function getSmsAndroidSetting() - { + public function getSmsAndroidSetting() { return $this->smsAndroidSetting->newQuery()->get(); } - public function createSmsAndroidSetting($androidPhoneToken) - { + public function createSmsAndroidSetting($androidPhoneToken) { $smsAndroidSettingData = [ 'callback' => $this->callbackUrl, 'token' => $androidPhoneToken, @@ -33,8 +29,7 @@ public function createSmsAndroidSetting($androidPhoneToken) return $this->smsAndroidSetting->newQuery()->get(); } - public function updateSmsAndroidSetting(SmsAndroidSetting $smsAndroidSetting, $androidPhoneToken) - { + public function updateSmsAndroidSetting(SmsAndroidSetting $smsAndroidSetting, $androidPhoneToken) { $fireBaseKey = config('services.sms.android.key'); $callbackUrl = config('services.sms.android.callback_url').$this->userService->getCompanyId(); @@ -47,8 +42,7 @@ public function updateSmsAndroidSetting(SmsAndroidSetting $smsAndroidSetting, $a return $this->smsAndroidSetting->newQuery()->get(); } - public function deleteSmsAndroidSetting(SmsAndroidSetting $smsAndroidSetting) - { + public function deleteSmsAndroidSetting(SmsAndroidSetting $smsAndroidSetting) { $smsAndroidSetting->delete(); return $this->smsAndroidSetting->newQuery()->get(); diff --git a/src/backend/app/Services/SmsApplianceRemindRateService.php b/src/backend/app/Services/SmsApplianceRemindRateService.php index 9abc32fe9..257bb38be 100644 --- a/src/backend/app/Services/SmsApplianceRemindRateService.php +++ b/src/backend/app/Services/SmsApplianceRemindRateService.php @@ -6,26 +6,21 @@ use App\Models\SmsApplianceRemindRate; use Illuminate\Support\Collection; -class SmsApplianceRemindRateService -{ +class SmsApplianceRemindRateService { public function __construct( private SmsApplianceRemindRate $smsApplianceRemindRate, private Asset $appliance, - ) { - } + ) {} - public function getApplianceRemindRatesWithAppliances(): Collection - { + public function getApplianceRemindRatesWithAppliances(): Collection { return $this->appliance->newQuery()->with(['smsReminderRate'])->get(); } - public function getApplianceRemindRates(): Collection - { + public function getApplianceRemindRates(): Collection { return $this->smsApplianceRemindRate->newQuery()->get(); } - public function updateApplianceRemindRate(SmsApplianceRemindRate $smsApplianceRemindRate, $data): Asset - { + public function updateApplianceRemindRate(SmsApplianceRemindRate $smsApplianceRemindRate, $data): Asset { $smsApplianceRemindRate->update([ 'appliance_id' => $data['appliance_id'], 'overdue_remind_rate' => $data['overdue_remind_rate'], @@ -38,8 +33,7 @@ public function updateApplianceRemindRate(SmsApplianceRemindRate $smsApplianceRe return $result; } - public function createApplianceRemindRate($data): Collection - { + public function createApplianceRemindRate($data): Collection { $this->smsApplianceRemindRate->newQuery()->create([ 'appliance_id' => $data['appliance_type_id'], 'overdue_remind_rate' => $data['overdue_remind_rate'], diff --git a/src/backend/app/Services/SmsBodyService.php b/src/backend/app/Services/SmsBodyService.php index 719db5f29..97837f118 100644 --- a/src/backend/app/Services/SmsBodyService.php +++ b/src/backend/app/Services/SmsBodyService.php @@ -4,27 +4,22 @@ use App\Models\SmsBody; -class SmsBodyService -{ +class SmsBodyService { private $smsBody; - public function __construct(SmsBody $smsBody) - { + public function __construct(SmsBody $smsBody) { $this->smsBody = $smsBody; } - public function getSmsBodyByReference($reference) - { + public function getSmsBodyByReference($reference) { return $this->smsBody->newQuery()->where('reference', $reference)->firstOrFail(); } - public function getSmsBodies() - { + public function getSmsBodies() { return $this->smsBody->newQuery()->get(); } - public function updateSmsBodies($smsBodiesData) - { + public function updateSmsBodies($smsBodiesData) { $smsBodies = $this->smsBody->newQuery()->get(); collect($smsBodiesData[0])->each(function ($smsBody) use ($smsBodies) { $smsBodies->filter(function ($body) use ($smsBody) { @@ -37,8 +32,7 @@ public function updateSmsBodies($smsBodiesData) return $smsBodies; } - public function getNullBodies() - { + public function getNullBodies() { return $this->smsBody->newQuery()->whereNull('body')->get(); } } diff --git a/src/backend/app/Services/SmsResendInformationKeyService.php b/src/backend/app/Services/SmsResendInformationKeyService.php index 6019d2148..34b10fa2d 100644 --- a/src/backend/app/Services/SmsResendInformationKeyService.php +++ b/src/backend/app/Services/SmsResendInformationKeyService.php @@ -4,22 +4,18 @@ use App\Models\SmsResendInformationKey; -class SmsResendInformationKeyService -{ +class SmsResendInformationKeyService { private $smsResendInformationKey; - public function __construct(SmsResendInformationKey $smsResendInformationKey) - { + public function __construct(SmsResendInformationKey $smsResendInformationKey) { $this->smsResendInformationKey = $smsResendInformationKey; } - public function getResendInformationKeys() - { + public function getResendInformationKeys() { return $this->smsResendInformationKey->newQuery()->get(); } - public function updateResendInformationKey(SmsResendInformationKey $smsResendInformationKey, $data) - { + public function updateResendInformationKey(SmsResendInformationKey $smsResendInformationKey, $data) { $smsResendInformationKey->update([ 'key' => $data['key'], ]); diff --git a/src/backend/app/Services/SmsService.php b/src/backend/app/Services/SmsService.php index 01c4aea15..2dc9a1851 100644 --- a/src/backend/app/Services/SmsService.php +++ b/src/backend/app/Services/SmsService.php @@ -14,8 +14,7 @@ use App\Sms\SmsTypes; use Illuminate\Support\Facades\Log; -class SmsService -{ +class SmsService { public const TICKET = 1; public const FEEDBACK = 2; @@ -24,11 +23,9 @@ class SmsService public function __construct( private Sms $sms, - ) { - } + ) {} - public function checkMessageType($message) - { + public function checkMessageType($message) { $wordsInMessage = explode(' ', $message); $firstWord = $wordsInMessage[0]; switch (strtolower($firstWord)) { @@ -39,8 +36,7 @@ public function checkMessageType($message) } } - public function createAndSendSms($smsData): Sms - { + public function createAndSendSms($smsData): Sms { $sms = $this->createSms($smsData); $data = [ @@ -52,16 +48,14 @@ public function createAndSendSms($smsData): Sms return $sms; } - public function createSms($smsData): Sms - { + public function createSms($smsData): Sms { /** @var Sms $sms */ $sms = $this->sms->newQuery()->create($smsData); return $sms; } - private function getSmsAndroidSettings() - { + private function getSmsAndroidSettings() { try { return SmsAndroidSetting::getResponsible(); } catch (SmsAndroidSettingNotExistingException $exception) { @@ -69,8 +63,7 @@ private function getSmsAndroidSettings() } } - public function sendSms($data, $smsType, $smsConfigs) - { + public function sendSms($data, $smsType, $smsConfigs) { try { $smsAndroidSettings = $this->getSmsAndroidSettings(); $smsType = $this->resolveSmsType($data, $smsType, $smsConfigs, $smsAndroidSettings); @@ -93,8 +86,7 @@ public function sendSms($data, $smsType, $smsConfigs) $this->associateSmsWithForSmsType($smsType, $data, $uuid, $receiver, $smsAndroidSettings); } - private function resolveSmsType($data, $smsType, $smsConfigs, $smsAndroidSettings) - { + private function resolveSmsType($data, $smsType, $smsConfigs, $smsAndroidSettings) { $configs = resolve($smsConfigs); if (!array_key_exists($smsType, $configs->smsTypes)) { throw new SmsTypeNotFoundException('SmsType could not resolve.'); @@ -114,8 +106,7 @@ private function resolveSmsType($data, $smsType, $smsConfigs, $smsAndroidSetting ]); } - private function associateSmsWithForSmsType($smsType, $data, $uuid, $receiver, $smsAndroidSettings) - { + private function associateSmsWithForSmsType($smsType, $data, $uuid, $receiver, $smsAndroidSettings) { if (!($smsType instanceof ManualSms)) { $sms = Sms::query()->make([ 'uuid' => $uuid, diff --git a/src/backend/app/Services/SmsVariableDefaultValueService.php b/src/backend/app/Services/SmsVariableDefaultValueService.php index f06ff49cd..109e0b5d7 100644 --- a/src/backend/app/Services/SmsVariableDefaultValueService.php +++ b/src/backend/app/Services/SmsVariableDefaultValueService.php @@ -4,17 +4,14 @@ use App\Models\SmsVariableDefaultValue; -class SmsVariableDefaultValueService -{ +class SmsVariableDefaultValueService { private $smsVariableDefaultValue; - public function __construct(SmsVariableDefaultValue $smsVariableDefaultValue) - { + public function __construct(SmsVariableDefaultValue $smsVariableDefaultValue) { $this->smsVariableDefaultValue = $smsVariableDefaultValue; } - public function getSmsVariableDefaultValues() - { + public function getSmsVariableDefaultValues() { return $this->smsVariableDefaultValue->newQuery()->get(); } } diff --git a/src/backend/app/Services/SocialTariffService.php b/src/backend/app/Services/SocialTariffService.php index 08b08122d..4377be0d7 100644 --- a/src/backend/app/Services/SocialTariffService.php +++ b/src/backend/app/Services/SocialTariffService.php @@ -9,43 +9,35 @@ /** * @implements IBaseService */ -class SocialTariffService implements IBaseService -{ +class SocialTariffService implements IBaseService { public function __construct( private SocialTariff $socialTariff, - ) { - } + ) {} - public function create(array $socialTariffData): SocialTariff - { + public function create(array $socialTariffData): SocialTariff { return $this->socialTariff->newQuery()->create($socialTariffData); } - public function getById(int $socialTariffId): SocialTariff - { + public function getById(int $socialTariffId): SocialTariff { return $this->socialTariff->newQuery()->find($socialTariffId); } - public function update($socialTariff, array $socialTariffData): SocialTariff - { + public function update($socialTariff, array $socialTariffData): SocialTariff { $socialTariff->update($socialTariffData); $socialTariff->fresh(); return $socialTariff; } - public function deleteByTariffId($meterTariffId) - { + public function deleteByTariffId($meterTariffId) { $this->socialTariff->newQuery()->where('tariff_id', $meterTariffId)->delete(); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } - public function getAll(?int $limit = null): Collection - { + public function getAll(?int $limit = null): Collection { throw new \Exception('Method getAll() not yet implemented.'); } } diff --git a/src/backend/app/Services/SubConnectionTypeService.php b/src/backend/app/Services/SubConnectionTypeService.php index 04cdd9e98..cc7af9535 100644 --- a/src/backend/app/Services/SubConnectionTypeService.php +++ b/src/backend/app/Services/SubConnectionTypeService.php @@ -10,41 +10,34 @@ /** * @implements IBaseService */ -class SubConnectionTypeService implements IBaseService -{ +class SubConnectionTypeService implements IBaseService { public function __construct( private SubConnectionType $subConnectionType, - ) { - } + ) {} - public function getSubConnectionTypesByConnectionTypeId($connectionTypeId, $limit = null): LengthAwarePaginator|Collection - { + public function getSubConnectionTypesByConnectionTypeId($connectionTypeId, $limit = null): LengthAwarePaginator|Collection { return $limit ? $this->subConnectionType->newQuery()->where('connection_type_id', $connectionTypeId) ->paginate($limit) : $this->subConnectionType->newQuery()->where('connection_type_id', $connectionTypeId) ->get(); } - public function getById(int $subConnectionTypeId): SubConnectionType - { + public function getById(int $subConnectionTypeId): SubConnectionType { return $this->subConnectionType->newQuery()->findOrFail($subConnectionTypeId); } - public function create(array $subConnectionServiceData): SubConnectionType - { + public function create(array $subConnectionServiceData): SubConnectionType { return $this->subConnectionType->newQuery()->create($subConnectionServiceData); } - public function update($subConnectionType, array $subConnectionTypeData): SubConnectionType - { + public function update($subConnectionType, array $subConnectionTypeData): SubConnectionType { $subConnectionType->update($subConnectionTypeData); $subConnectionType->fresh(); return $subConnectionType; } - public function getAll(?int $limit = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null): Collection|LengthAwarePaginator { if ($limit) { return $this->subConnectionType->newQuery()->paginate($limit); } @@ -52,8 +45,7 @@ public function getAll(?int $limit = null): Collection|LengthAwarePaginator return $this->subConnectionType->newQuery()->get(); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } } diff --git a/src/backend/app/Services/SubTargetService.php b/src/backend/app/Services/SubTargetService.php index 8177906a2..eac3f3646 100644 --- a/src/backend/app/Services/SubTargetService.php +++ b/src/backend/app/Services/SubTargetService.php @@ -9,22 +9,18 @@ /** * @implements IBaseService */ -class SubTargetService implements IBaseService -{ +class SubTargetService implements IBaseService { public function __construct( private SubTarget $subTarget, - ) { - } + ) {} - public function getById(int $id): SubTarget - { + public function getById(int $id): SubTarget { throw new \Exception('Method getById() not yet implemented.'); return new SubTarget(); } - public function create(array $subTargetData): SubTarget - { + public function create(array $subTargetData): SubTarget { $targetId = $subTargetData['targetId']; foreach ($subTargetData['data'] as $data) { @@ -42,20 +38,17 @@ public function create(array $subTargetData): SubTarget return $this->subTarget; } - public function update($model, array $data): SubTarget - { + public function update($model, array $data): SubTarget { throw new \Exception('Method update() not yet implemented.'); return new SubTarget(); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } - public function getAll(?int $limit = null): Collection - { + public function getAll(?int $limit = null): Collection { throw new \Exception('Method getAll() not yet implemented.'); } } diff --git a/src/backend/app/Services/TargetService.php b/src/backend/app/Services/TargetService.php index 5a8d4193d..0baedefd5 100644 --- a/src/backend/app/Services/TargetService.php +++ b/src/backend/app/Services/TargetService.php @@ -10,22 +10,17 @@ use Illuminate\Support\Collection; use MPM\Target\TargetAssignable; -class TargetService -{ - public function __construct(private Target $target) - { - } +class TargetService { + public function __construct(private Target $target) {} - public function getById($targetId): Target - { + public function getById($targetId): Target { /** @var Target $model */ $model = $this->target->newQuery()->with(['subTargets', 'city'])->find($targetId); return $model; } - public function create(CarbonImmutable $period, string $targetForType, TargetAssignable $targetOwner): Target - { + public function create(CarbonImmutable $period, string $targetForType, TargetAssignable $targetOwner): Target { /** @var Target $target */ $target = $this->target->newQuery()->make([ 'target_date' => $period->format('Y-m-d'), @@ -40,8 +35,7 @@ public function create(CarbonImmutable $period, string $targetForType, TargetAss return $target; } - public function getAll(?int $limit = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null): Collection|LengthAwarePaginator { if ($limit) { return $this->target->newQuery()->with(['owner', 'subTargets.connectionType'])->orderBy( 'target_date', @@ -55,8 +49,7 @@ public function getAll(?int $limit = null): Collection|LengthAwarePaginator )->get(); } - public function getTakenSlots($targetDate): Collection - { + public function getTakenSlots($targetDate): Collection { return $this->target->newQuery()->whereBetween('target_date', $targetDate)->get(); } } diff --git a/src/backend/app/Services/TariffPricingComponentService.php b/src/backend/app/Services/TariffPricingComponentService.php index 0f42ea050..bbdf7a955 100644 --- a/src/backend/app/Services/TariffPricingComponentService.php +++ b/src/backend/app/Services/TariffPricingComponentService.php @@ -9,20 +9,16 @@ /** * @implements IBaseService */ -class TariffPricingComponentService implements IBaseService -{ +class TariffPricingComponentService implements IBaseService { public function __construct( private TariffPricingComponent $tariffPricingComponent, - ) { - } + ) {} - public function make($tariffPricingComponentData) - { + public function make($tariffPricingComponentData) { return $this->tariffPricingComponent->newQuery()->make($tariffPricingComponentData); } - public function deleteByTariffId($meterTariffId) - { + public function deleteByTariffId($meterTariffId) { $this->tariffPricingComponent->newQuery()->where('owner_type', 'meter_tariff')->where( 'owner_id', $meterTariffId @@ -31,28 +27,23 @@ public function deleteByTariffId($meterTariffId) }); } - public function getById(int $id): TariffPricingComponent - { + public function getById(int $id): TariffPricingComponent { throw new \Exception('Method getById() not yet implemented.'); } - public function create(array $data): TariffPricingComponent - { + public function create(array $data): TariffPricingComponent { throw new \Exception('Method create() not yet implemented.'); } - public function update($model, array $data): TariffPricingComponent - { + public function update($model, array $data): TariffPricingComponent { throw new \Exception('Method update() not yet implemented.'); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } - public function getAll(?int $limit = null): Collection - { + public function getAll(?int $limit = null): Collection { throw new \Exception('Method getAll() not yet implemented.'); } } diff --git a/src/backend/app/Services/TicketSettingsService.php b/src/backend/app/Services/TicketSettingsService.php index 5bea79434..0dc653869 100644 --- a/src/backend/app/Services/TicketSettingsService.php +++ b/src/backend/app/Services/TicketSettingsService.php @@ -8,23 +8,19 @@ /** * @implements ISettingsService */ -class TicketSettingsService implements ISettingsService -{ +class TicketSettingsService implements ISettingsService { public function __construct( private TicketSettings $ticketSettings, - ) { - } + ) {} - public function update($ticketSettings, array $ticketSettingsData): TicketSettings - { + public function update($ticketSettings, array $ticketSettingsData): TicketSettings { $ticketSettings->update($ticketSettingsData); $ticketSettings->fresh(); return $ticketSettings; } - public function get(): TicketSettings - { + public function get(): TicketSettings { return $this->ticketSettings->newQuery()->first(); } } diff --git a/src/backend/app/Services/TimeOfUsageService.php b/src/backend/app/Services/TimeOfUsageService.php index 348b267c2..35470e495 100644 --- a/src/backend/app/Services/TimeOfUsageService.php +++ b/src/backend/app/Services/TimeOfUsageService.php @@ -9,38 +9,31 @@ /** * @implements IBaseService */ -class TimeOfUsageService implements IBaseService -{ +class TimeOfUsageService implements IBaseService { public function __construct( private TimeOfUsage $timeOfUsage, - ) { - } + ) {} - public function create(array $timeOfUsageData): TimeOfUsage - { + public function create(array $timeOfUsageData): TimeOfUsage { return $this->timeOfUsage->newQuery()->create($timeOfUsageData); } - public function getById(int $timeOfUsageId): TimeOfUsage - { + public function getById(int $timeOfUsageId): TimeOfUsage { return $this->timeOfUsage->newQuery()->find($timeOfUsageId); } - public function update($timeOfUsage, array $timeOfUsageData): TimeOfUsage - { + public function update($timeOfUsage, array $timeOfUsageData): TimeOfUsage { $timeOfUsage->update($timeOfUsageData); $timeOfUsage->fresh(); return $timeOfUsage; } - public function delete($timeOfUsage): ?bool - { + public function delete($timeOfUsage): ?bool { return $timeOfUsage->delete(); } - public function getAll(?int $limit = null): Collection - { + public function getAll(?int $limit = null): Collection { throw new \Exception('Method getAll() not yet implemented.'); } } diff --git a/src/backend/app/Services/TokenService.php b/src/backend/app/Services/TokenService.php index c71b6485e..f5e484d85 100644 --- a/src/backend/app/Services/TokenService.php +++ b/src/backend/app/Services/TokenService.php @@ -10,37 +10,30 @@ /** * @implements IBaseService */ -class TokenService implements IBaseService -{ +class TokenService implements IBaseService { public function __construct( private Token $token, - ) { - } + ) {} - public function getById(int $id): Token - { + public function getById(int $id): Token { return $this->token->newQuery()->find($id); } - public function create(array $data): Token - { + public function create(array $data): Token { return $this->token->newQuery()->create($data); } - public function update($model, array $data): Token - { + public function update($model, array $data): Token { throw new \Exception('Method update() not yet implemented.'); return new Token(); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } - public function getAll(?int $limit = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null): Collection|LengthAwarePaginator { if ($limit) { return $this->token->newQuery()->paginate($limit); } diff --git a/src/backend/app/Services/TransactionPaymentHistoryService.php b/src/backend/app/Services/TransactionPaymentHistoryService.php index e962a18b3..bc44c95ee 100644 --- a/src/backend/app/Services/TransactionPaymentHistoryService.php +++ b/src/backend/app/Services/TransactionPaymentHistoryService.php @@ -9,24 +9,20 @@ /** * @implements IAssignationService */ -class TransactionPaymentHistoryService implements IAssignationService -{ +class TransactionPaymentHistoryService implements IAssignationService { private PaymentHistory $paymentHistory; private Transaction $transaction; - public function setAssigned($paymentHistory): void - { + public function setAssigned($paymentHistory): void { $this->paymentHistory = $paymentHistory; } - public function setAssignee($transaction): void - { + public function setAssignee($transaction): void { $this->transaction = $transaction; } - public function assign(): PaymentHistory - { + public function assign(): PaymentHistory { $this->paymentHistory->transaction()->associate($this->transaction); return $this->paymentHistory; diff --git a/src/backend/app/Services/TransactionProviderService.php b/src/backend/app/Services/TransactionProviderService.php index b2bb3ab62..9c002263a 100644 --- a/src/backend/app/Services/TransactionProviderService.php +++ b/src/backend/app/Services/TransactionProviderService.php @@ -4,20 +4,17 @@ use App\Models\Transaction\Transaction; -class TransactionProviderService -{ +class TransactionProviderService { private $transaction; /** * TransactionProviderService constructor. */ - public function __construct(Transaction $transaction) - { + public function __construct(Transaction $transaction) { $this->transaction = $transaction; } - public function getTransactionProviders() - { + public function getTransactionProviders() { return $this->transaction->withAll('BelongsToMorph'); } } diff --git a/src/backend/app/Services/UsageTypeService.php b/src/backend/app/Services/UsageTypeService.php index ff76287af..b5614a6a7 100644 --- a/src/backend/app/Services/UsageTypeService.php +++ b/src/backend/app/Services/UsageTypeService.php @@ -10,41 +10,34 @@ /** * @implements IBaseService */ -class UsageTypeService implements IBaseService -{ +class UsageTypeService implements IBaseService { public function __construct( private UsageType $usageType, - ) { - } + ) {} - public function getAll(?int $limit = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null): Collection|LengthAwarePaginator { return $this->usageType->newQuery()->get(); } - public function getById(int $id): UsageType - { + public function getById(int $id): UsageType { throw new \Exception('Method getById() not yet implemented.'); return new UsageType(); } - public function create(array $data): UsageType - { + public function create(array $data): UsageType { throw new \Exception('Method create() not yet implemented.'); return new UsageType(); } - public function update($model, array $data): UsageType - { + public function update($model, array $data): UsageType { throw new \Exception('Method update() not yet implemented.'); return new UsageType(); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } } diff --git a/src/backend/app/Services/UserAddressService.php b/src/backend/app/Services/UserAddressService.php index 7bb1ffdc7..28d6fd5c6 100644 --- a/src/backend/app/Services/UserAddressService.php +++ b/src/backend/app/Services/UserAddressService.php @@ -5,20 +5,17 @@ use App\Models\Address\Address; use App\Models\User; -class UserAddressService -{ +class UserAddressService { private $address; private $user; - public function __construct(Address $address, User $user) - { + public function __construct(Address $address, User $user) { $this->address = $address; $this->user = $user; } - public function create(User $user, $data) - { + public function create(User $user, $data) { $address = $this->address->newQuery()->create([ 'email' => $data['email'] ?? '', 'phone' => $data['phone'] ?? '', @@ -33,8 +30,7 @@ public function create(User $user, $data) return $address->with(['city']); } - public function update(User $user, $data) - { + public function update(User $user, $data) { $user->name = $data['name']; $user->update(); $address = $user->address()->first(); diff --git a/src/backend/app/Services/UserAppliancePersonService.php b/src/backend/app/Services/UserAppliancePersonService.php index 9ffddb78b..4818fc653 100644 --- a/src/backend/app/Services/UserAppliancePersonService.php +++ b/src/backend/app/Services/UserAppliancePersonService.php @@ -9,24 +9,20 @@ /** * @implements IAssignationService */ -class UserAppliancePersonService implements IAssignationService -{ +class UserAppliancePersonService implements IAssignationService { private AssetPerson $appliancePerson; private User $user; - public function setAssigned($appliancePerson): void - { + public function setAssigned($appliancePerson): void { $this->appliancePerson = $appliancePerson; } - public function setAssignee($user): void - { + public function setAssignee($user): void { $this->user = $user; } - public function assign(): AssetPerson - { + public function assign(): AssetPerson { $this->appliancePerson->creator()->associate($this->user); return $this->appliancePerson; diff --git a/src/backend/app/Services/UserService.php b/src/backend/app/Services/UserService.php index 8d0f6ef96..bbe13150f 100644 --- a/src/backend/app/Services/UserService.php +++ b/src/backend/app/Services/UserService.php @@ -11,14 +11,10 @@ use Illuminate\Support\Collection; use MPM\User\Events\UserCreatedEvent; -class UserService -{ - public function __construct(private User $user, private MailHelperInterface $mailHelper) - { - } +class UserService { + public function __construct(private User $user, private MailHelperInterface $mailHelper) {} - public function create(array $userData, ?int $companyId = null): User - { + public function create(array $userData, ?int $companyId = null): User { $shouldSyncUserWithMasterDatabase = $companyId !== null; $companyId = $companyId ?? auth('api')->payload()->get('companyId'); @@ -35,15 +31,13 @@ public function create(array $userData, ?int $companyId = null): User return $user; } - public function update($user, $data) - { + public function update($user, $data) { $user->update(['password' => $data['password']]); return $user->fresh(); } - public function resetPassword(string $email): ?User - { + public function resetPassword(string $email): ?User { try { $newPassword = PasswordGenerator::generatePassword(); } catch (\Exception $exception) { @@ -77,16 +71,14 @@ public function resetPassword(string $email): ?User return $user; } - public function list(): LengthAwarePaginator - { + public function list(): LengthAwarePaginator { return $this->buildQuery() ->select('id', 'name', 'email') ->with(['addressDetails']) ->paginate(); } - public function get($id): User - { + public function get($id): User { /** @var User $user */ $user = User::with(['addressDetails']) ->where('id', '=', $id) @@ -95,8 +87,7 @@ public function get($id): User return $user; } - public function resetAdminPassword(): array - { + public function resetAdminPassword(): array { /** @var User $user */ $user = $this->buildQuery()->first(); $randomPassword = str_random(8); @@ -109,13 +100,11 @@ public function resetAdminPassword(): array return $admin; } - private function buildQuery(): Builder - { + private function buildQuery(): Builder { return $this->user->newQuery(); } - public function getCompanyId(): int - { + public function getCompanyId(): int { /** @var User $user */ $user = $this->buildQuery() ->select(User::COL_COMPANY_ID) @@ -124,23 +113,19 @@ public function getCompanyId(): int return $user->getCompanyId(); } - public function getById($id) - { + public function getById($id) { return $this->user->newQuery()->find($id); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } - public function getAll(?int $limit = null): Collection - { + public function getAll(?int $limit = null): Collection { throw new \Exception('Method getAll() not yet implemented.'); } - public function getUsers(): Collection - { + public function getUsers(): Collection { return $this->user->newQuery()->get(); } } diff --git a/src/backend/app/Services/UserTicketService.php b/src/backend/app/Services/UserTicketService.php index 6f8eab875..477cc8ed9 100644 --- a/src/backend/app/Services/UserTicketService.php +++ b/src/backend/app/Services/UserTicketService.php @@ -9,24 +9,20 @@ /** * @implements IAssignationService */ -class UserTicketService implements IAssignationService -{ +class UserTicketService implements IAssignationService { private Ticket $ticket; private User $user; - public function setAssigned($ticket): void - { + public function setAssigned($ticket): void { $this->ticket = $ticket; } - public function setAssignee($user): void - { + public function setAssignee($user): void { $this->user = $user; } - public function assign(): Ticket - { + public function assign(): Ticket { $this->ticket->creator()->associate($this->user); return $this->ticket; diff --git a/src/backend/app/Sms/AndroidGateway.php b/src/backend/app/Sms/AndroidGateway.php index b4c342bc5..7ecaac59d 100644 --- a/src/backend/app/Sms/AndroidGateway.php +++ b/src/backend/app/Sms/AndroidGateway.php @@ -7,15 +7,13 @@ use App\Models\SmsAndroidSetting; use Illuminate\Support\Facades\Log; -class AndroidGateway implements ISmsProvider -{ +class AndroidGateway implements ISmsProvider { /** * Sends the sms to the sms provider. * * @param SmsAndroidSetting $smsAndroidSettings */ - public function sendSms(string $number, string $body, string $callback, SmsAndroidSetting $smsAndroidSetting) - { + public function sendSms(string $number, string $body, string $callback, SmsAndroidSetting $smsAndroidSetting) { if (!config('app.env') == 'production') { Log::debug('Send sms on allowed in production', ['number' => $number, 'message' => $body]); diff --git a/src/backend/app/Sms/BodyParsers/AccessRateConfirmation.php b/src/backend/app/Sms/BodyParsers/AccessRateConfirmation.php index 8dd9a3b9a..372a9f732 100644 --- a/src/backend/app/Sms/BodyParsers/AccessRateConfirmation.php +++ b/src/backend/app/Sms/BodyParsers/AccessRateConfirmation.php @@ -4,19 +4,16 @@ use App\Models\PaymentHistory; -class AccessRateConfirmation extends SmsBodyParser -{ +class AccessRateConfirmation extends SmsBodyParser { protected $variables = ['amount']; protected $paymentHistory; - public function __construct(PaymentHistory $paymentHistory) - { + public function __construct(PaymentHistory $paymentHistory) { $this->paymentHistory = $paymentHistory; } - protected function getVariableValue($variable) - { + protected function getVariableValue($variable) { switch ($variable) { case 'amount': $variable = $this->paymentHistory->amount; diff --git a/src/backend/app/Sms/BodyParsers/AssetRatePayment.php b/src/backend/app/Sms/BodyParsers/AssetRatePayment.php index 297b358e2..03e7cd0ee 100644 --- a/src/backend/app/Sms/BodyParsers/AssetRatePayment.php +++ b/src/backend/app/Sms/BodyParsers/AssetRatePayment.php @@ -4,19 +4,16 @@ use App\Models\PaymentHistory; -class AssetRatePayment extends SmsBodyParser -{ +class AssetRatePayment extends SmsBodyParser { protected $variables = ['appliance_type_name', 'amount']; protected $paymentHistory; - public function __construct(PaymentHistory $paymentHistory) - { + public function __construct(PaymentHistory $paymentHistory) { $this->paymentHistory = $paymentHistory; } - protected function getVariableValue($variable) - { + protected function getVariableValue($variable) { switch ($variable) { case 'appliance_type_name': $variable = $this->paymentHistory->paidFor->assetPerson->assetType; diff --git a/src/backend/app/Sms/BodyParsers/AssetRateReminder.php b/src/backend/app/Sms/BodyParsers/AssetRateReminder.php index ca914eb14..671ee2615 100644 --- a/src/backend/app/Sms/BodyParsers/AssetRateReminder.php +++ b/src/backend/app/Sms/BodyParsers/AssetRateReminder.php @@ -4,19 +4,16 @@ use App\Models\AssetRate; -class AssetRateReminder extends SmsBodyParser -{ +class AssetRateReminder extends SmsBodyParser { protected $variables = ['appliance_type_name', 'remaining', 'due_date']; protected $reminderData; - public function __construct(AssetRate $reminderData) - { + public function __construct(AssetRate $reminderData) { $this->reminderData = $reminderData; } - protected function getVariableValue($variable) - { + protected function getVariableValue($variable) { switch ($variable) { case 'appliance_type_name': $variable = $this->reminderData->assetPerson->assetType->name; diff --git a/src/backend/app/Sms/BodyParsers/EnergyConfirmation.php b/src/backend/app/Sms/BodyParsers/EnergyConfirmation.php index 8ba16b169..08cd3593a 100644 --- a/src/backend/app/Sms/BodyParsers/EnergyConfirmation.php +++ b/src/backend/app/Sms/BodyParsers/EnergyConfirmation.php @@ -4,19 +4,16 @@ use App\Models\PaymentHistory; -class EnergyConfirmation extends SmsBodyParser -{ +class EnergyConfirmation extends SmsBodyParser { protected $variables = ['meter', 'token', 'energy', 'amount']; protected $paymentHistory; - public function __construct(PaymentHistory $paymentHistory) - { + public function __construct(PaymentHistory $paymentHistory) { $this->paymentHistory = $paymentHistory; } - protected function getVariableValue($variable) - { + protected function getVariableValue($variable) { $token = $this->paymentHistory->paidFor()->first(); $transaction = $this->paymentHistory->transaction()->first(); switch ($variable) { diff --git a/src/backend/app/Sms/BodyParsers/OverDueAssetRateReminder.php b/src/backend/app/Sms/BodyParsers/OverDueAssetRateReminder.php index f1f01d5a3..638af1963 100644 --- a/src/backend/app/Sms/BodyParsers/OverDueAssetRateReminder.php +++ b/src/backend/app/Sms/BodyParsers/OverDueAssetRateReminder.php @@ -4,19 +4,16 @@ use App\Models\AssetRate; -class OverDueAssetRateReminder extends SmsBodyParser -{ +class OverDueAssetRateReminder extends SmsBodyParser { public $variables = ['appliance_type_name', 'remaining', 'due_date']; protected $reminderData; - public function __construct(AssetRate $reminderData) - { + public function __construct(AssetRate $reminderData) { $this->reminderData = $reminderData; } - protected function getVariableValue($variable) - { + protected function getVariableValue($variable) { switch ($variable) { case 'appliance_type_name': $variable = $this->reminderData->assetPerson->assetType->name; diff --git a/src/backend/app/Sms/BodyParsers/PricingDetails.php b/src/backend/app/Sms/BodyParsers/PricingDetails.php index 0d568fa8e..238f12d32 100644 --- a/src/backend/app/Sms/BodyParsers/PricingDetails.php +++ b/src/backend/app/Sms/BodyParsers/PricingDetails.php @@ -5,8 +5,7 @@ use App\Models\MainSettings; use App\Models\Transaction\Transaction; -class PricingDetails extends SmsBodyParser -{ +class PricingDetails extends SmsBodyParser { public $variables = ['amount', 'vat_energy', 'vat_others']; protected $transaction; @@ -15,14 +14,12 @@ class PricingDetails extends SmsBodyParser private $vatOtherStaffs = 0; - public function __construct(Transaction $transaction) - { + public function __construct(Transaction $transaction) { $this->transaction = $transaction; $this->calculateTaxes(); } - protected function getVariableValue($variable) - { + protected function getVariableValue($variable) { switch ($variable) { case 'amount': $variable = $this->transaction->amount; @@ -38,8 +35,7 @@ protected function getVariableValue($variable) return $variable; } - private function calculateTaxes() - { + private function calculateTaxes() { $mainSettings = MainSettings::query()->first(); $energy = $this->transaction->paymentHistories->where('payment_type', 'energy')->sum('amount'); $other = $this->transaction->paymentHistories->where('payment_type', '!=', 'energy')->sum('amount'); diff --git a/src/backend/app/Sms/BodyParsers/ResendInformation.php b/src/backend/app/Sms/BodyParsers/ResendInformation.php index 997b3955b..5d3e6827f 100644 --- a/src/backend/app/Sms/BodyParsers/ResendInformation.php +++ b/src/backend/app/Sms/BodyParsers/ResendInformation.php @@ -4,19 +4,16 @@ use App\Models\PaymentHistory; -class ResendInformation extends SmsBodyParser -{ +class ResendInformation extends SmsBodyParser { protected $variables = ['meter', 'token', 'energy', 'amount']; protected $paymentHistory; - public function __construct(PaymentHistory $paymentHistory) - { + public function __construct(PaymentHistory $paymentHistory) { $this->paymentHistory = $paymentHistory; } - protected function getVariableValue($variable) - { + protected function getVariableValue($variable) { $token = $this->paymentHistory->paidFor()->first(); $transaction = $this->paymentHistory->transaction()->first(); switch ($variable) { diff --git a/src/backend/app/Sms/BodyParsers/ResendInformationLastTransactionNotFound.php b/src/backend/app/Sms/BodyParsers/ResendInformationLastTransactionNotFound.php index ad3adfde2..228ead7f0 100644 --- a/src/backend/app/Sms/BodyParsers/ResendInformationLastTransactionNotFound.php +++ b/src/backend/app/Sms/BodyParsers/ResendInformationLastTransactionNotFound.php @@ -2,19 +2,16 @@ namespace App\Sms\BodyParsers; -class ResendInformationLastTransactionNotFound extends SmsBodyParser -{ +class ResendInformationLastTransactionNotFound extends SmsBodyParser { protected $variables = ['meter']; protected $data; - public function __construct($data) - { + public function __construct($data) { $this->data = $data; } - protected function getVariableValue($variable) - { + protected function getVariableValue($variable) { return $this->data['meter']; } } diff --git a/src/backend/app/Sms/BodyParsers/SmsBodyParser.php b/src/backend/app/Sms/BodyParsers/SmsBodyParser.php index 53ebbafee..efa325188 100644 --- a/src/backend/app/Sms/BodyParsers/SmsBodyParser.php +++ b/src/backend/app/Sms/BodyParsers/SmsBodyParser.php @@ -2,12 +2,10 @@ namespace App\Sms\BodyParsers; -abstract class SmsBodyParser -{ +abstract class SmsBodyParser { protected $variables; - public function parseSms($body) - { + public function parseSms($body) { foreach ($this->variables as $variable) { $body = str_replace('['.$variable.']', $this->getVariableValue($variable), $body); } @@ -15,8 +13,7 @@ public function parseSms($body) return $body; } - protected function getVariableValue($varialbe) - { + protected function getVariableValue($varialbe) { return new \Exception('implement it on each class'); } } diff --git a/src/backend/app/Sms/BodyParsers/SmsReminderHeader.php b/src/backend/app/Sms/BodyParsers/SmsReminderHeader.php index 44cffc803..5a77a4848 100644 --- a/src/backend/app/Sms/BodyParsers/SmsReminderHeader.php +++ b/src/backend/app/Sms/BodyParsers/SmsReminderHeader.php @@ -4,19 +4,16 @@ use App\Models\AssetRate; -class SmsReminderHeader extends SmsBodyParser -{ +class SmsReminderHeader extends SmsBodyParser { protected $variables = ['name', 'surname']; protected $reminderData; - public function __construct(AssetRate $reminderData) - { + public function __construct(AssetRate $reminderData) { $this->reminderData = $reminderData; } - protected function getVariableValue($variable) - { + protected function getVariableValue($variable) { $person = $this->reminderData->assetPerson->person; switch ($variable) { case 'name': diff --git a/src/backend/app/Sms/BodyParsers/SmsResendInformationHeader.php b/src/backend/app/Sms/BodyParsers/SmsResendInformationHeader.php index b1174b456..4c587dc25 100644 --- a/src/backend/app/Sms/BodyParsers/SmsResendInformationHeader.php +++ b/src/backend/app/Sms/BodyParsers/SmsResendInformationHeader.php @@ -4,19 +4,16 @@ use App\Models\Person\Person; -class SmsResendInformationHeader extends SmsBodyParser -{ +class SmsResendInformationHeader extends SmsBodyParser { protected $variables = ['name', 'surname']; protected $data; - public function __construct($data) - { + public function __construct($data) { $this->data = $data; } - protected function getVariableValue($variable) - { + protected function getVariableValue($variable) { if (!is_array($this->data)) { $person = $this->data->meter->meterParameter->owner()->first(); } else { diff --git a/src/backend/app/Sms/BodyParsers/SmsTransactionHeader.php b/src/backend/app/Sms/BodyParsers/SmsTransactionHeader.php index 5ddec7c4c..a69480de1 100644 --- a/src/backend/app/Sms/BodyParsers/SmsTransactionHeader.php +++ b/src/backend/app/Sms/BodyParsers/SmsTransactionHeader.php @@ -4,19 +4,16 @@ use App\Models\Transaction\Transaction; -class SmsTransactionHeader extends SmsBodyParser -{ +class SmsTransactionHeader extends SmsBodyParser { protected $variables = ['name', 'surname', 'transaction_amount']; protected $transaction; - public function __construct(Transaction $transaction) - { + public function __construct(Transaction $transaction) { $this->transaction = $transaction; } - protected function getVariableValue($variable) - { + protected function getVariableValue($variable) { $person = $this->transaction->device->person->first(); switch ($variable) { case 'name': diff --git a/src/backend/app/Sms/Senders/AssetRateNotification.php b/src/backend/app/Sms/Senders/AssetRateNotification.php index 7270527a3..ee49e0b4d 100644 --- a/src/backend/app/Sms/Senders/AssetRateNotification.php +++ b/src/backend/app/Sms/Senders/AssetRateNotification.php @@ -2,8 +2,7 @@ namespace App\Sms\Senders; -class AssetRateNotification extends SmsSender -{ +class AssetRateNotification extends SmsSender { protected $references = [ 'header' => 'SmsReminderHeader', 'body' => 'AssetRateReminder', diff --git a/src/backend/app/Sms/Senders/ManualSms.php b/src/backend/app/Sms/Senders/ManualSms.php index ce277dfb7..83980680c 100644 --- a/src/backend/app/Sms/Senders/ManualSms.php +++ b/src/backend/app/Sms/Senders/ManualSms.php @@ -2,8 +2,7 @@ namespace App\Sms\Senders; -class ManualSms extends SmsSender -{ +class ManualSms extends SmsSender { protected $data; public $body = ''; @@ -12,8 +11,7 @@ class ManualSms extends SmsSender 'body' => '', ]; - public function prepareBody() - { + public function prepareBody() { $this->body .= $this->data['message']; } } diff --git a/src/backend/app/Sms/Senders/OverDueAssetRateNotification.php b/src/backend/app/Sms/Senders/OverDueAssetRateNotification.php index 13d5f2bc3..37dbe350b 100644 --- a/src/backend/app/Sms/Senders/OverDueAssetRateNotification.php +++ b/src/backend/app/Sms/Senders/OverDueAssetRateNotification.php @@ -2,8 +2,7 @@ namespace App\Sms\Senders; -class OverDueAssetRateNotification extends SmsSender -{ +class OverDueAssetRateNotification extends SmsSender { protected $references = [ 'header' => 'SmsReminderHeader', 'body' => 'OverDueAssetRateReminder', diff --git a/src/backend/app/Sms/Senders/ResendInformationNotification.php b/src/backend/app/Sms/Senders/ResendInformationNotification.php index eb8e9f776..4ff53ec9f 100644 --- a/src/backend/app/Sms/Senders/ResendInformationNotification.php +++ b/src/backend/app/Sms/Senders/ResendInformationNotification.php @@ -8,8 +8,7 @@ use Illuminate\Database\Eloquent\ModelNotFoundException; use Illuminate\Support\Facades\Log; -class ResendInformationNotification extends SmsSender -{ +class ResendInformationNotification extends SmsSender { protected $data; public $body = ''; @@ -20,8 +19,7 @@ class ResendInformationNotification extends SmsSender 'body' => 'ResendInformation', ]; - public function prepareBody() - { + public function prepareBody() { if (!is_array($this->data)) { try { $smsBody = $this->smsBodyService->getSmsBodyByReference('ResendInformation'); diff --git a/src/backend/app/Sms/Senders/SmsConfigs.php b/src/backend/app/Sms/Senders/SmsConfigs.php index 5d4993ac3..f6065199a 100644 --- a/src/backend/app/Sms/Senders/SmsConfigs.php +++ b/src/backend/app/Sms/Senders/SmsConfigs.php @@ -2,6 +2,4 @@ namespace App\Sms\Senders; -class SmsConfigs extends SmsConfigsCore -{ -} +class SmsConfigs extends SmsConfigsCore {} diff --git a/src/backend/app/Sms/Senders/SmsConfigsCore.php b/src/backend/app/Sms/Senders/SmsConfigsCore.php index ff663af3c..310e5d9a2 100644 --- a/src/backend/app/Sms/Senders/SmsConfigsCore.php +++ b/src/backend/app/Sms/Senders/SmsConfigsCore.php @@ -4,8 +4,7 @@ use App\Sms\SmsTypes; -abstract class SmsConfigsCore -{ +abstract class SmsConfigsCore { public $smsTypes = [ SmsTypes::TRANSACTION_CONFIRMATION => 'App\Sms\Senders\TransactionConfirmation', SmsTypes::APPLIANCE_RATE => 'App\Sms\Senders\AssetRateNotification', diff --git a/src/backend/app/Sms/Senders/SmsSender.php b/src/backend/app/Sms/Senders/SmsSender.php index 715e4681b..8e874f12b 100644 --- a/src/backend/app/Sms/Senders/SmsSender.php +++ b/src/backend/app/Sms/Senders/SmsSender.php @@ -14,8 +14,7 @@ use Inensus\ViberMessaging\Services\ViberContactService; use Webpatser\Uuid\Uuid; -abstract class SmsSender -{ +abstract class SmsSender { protected $smsBodyService; protected $data; @@ -32,16 +31,14 @@ abstract class SmsSender private $smsAndroidSettings; - public function __construct($data, $smsBodyService, $parserSubPath, $smsAndroidSettings) - { + public function __construct($data, $smsBodyService, $parserSubPath, $smsAndroidSettings) { $this->smsBodyService = $smsBodyService; $this->data = $data; $this->parserSubPath = $parserSubPath; $this->smsAndroidSettings = $smsAndroidSettings; } - public function sendSms() - { + public function sendSms() { $viberId = $this->checkForViberIdOfReceiverIfPluginIsActive(); if ($viberId) { resolve('ViberGateway') @@ -68,8 +65,7 @@ public function sendSms() } } - public function prepareHeader() - { + public function prepareHeader() { try { $smsBody = $this->getSmsBody('header'); } catch (MissingSmsReferencesException $exception) { @@ -88,8 +84,7 @@ public function prepareHeader() } } - public function prepareBody() - { + public function prepareBody() { try { $smsBody = $this->getSmsBody('body'); } catch (MissingSmsReferencesException $exception) { @@ -106,8 +101,7 @@ public function prepareBody() } } - public function prepareFooter() - { + public function prepareFooter() { try { $smsBody = $this->getSmsBody('footer'); $this->body .= ' '.$smsBody->body; @@ -117,8 +111,7 @@ public function prepareFooter() } } - private function getSmsBody($reference) - { + private function getSmsBody($reference) { try { $smsBody = $this->smsBodyService->getSmsBodyByReference($this->references[$reference]); } catch (ModelNotFoundException $e) { @@ -128,8 +121,7 @@ private function getSmsBody($reference) return $smsBody; } - public function validateReferences() - { + public function validateReferences() { if (($this->data instanceof Transaction) || ($this->data instanceof AssetRate)) { $nullSmsBodies = $this->smsBodyService->getNullBodies(); if (count($nullSmsBodies)) { @@ -152,8 +144,7 @@ public function validateReferences() } } - public function getReceiver() - { + public function getReceiver() { if ($this->data instanceof Transaction) { $this->receiver = strpos($this->data->sender, '+') === 0 ? $this->data->sender : '+'.$this->data->sender; } elseif ($this->data instanceof AssetRate) { @@ -177,16 +168,14 @@ public function getReceiver() return $this->receiver; } - public function generateCallbackAndGetUuid($callback) - { + public function generateCallbackAndGetUuid($callback) { $uuid = (string) Uuid::generate(4); $this->callback = sprintf($callback, $uuid); return $uuid; } - private function checkForViberIdOfReceiverIfPluginIsActive() - { + private function checkForViberIdOfReceiverIfPluginIsActive() { $pluginsService = app()->make(PluginsService::class); $viberContactService = app()->make(ViberContactService::class); $viberMessagingPlugin = $pluginsService->getByMpmPluginId(MpmPlugin::VIBER_MESSAGING); diff --git a/src/backend/app/Sms/Senders/TransactionConfirmation.php b/src/backend/app/Sms/Senders/TransactionConfirmation.php index 1e7e96c9c..b33172356 100644 --- a/src/backend/app/Sms/Senders/TransactionConfirmation.php +++ b/src/backend/app/Sms/Senders/TransactionConfirmation.php @@ -6,8 +6,7 @@ use Illuminate\Database\Eloquent\ModelNotFoundException; use Illuminate\Support\Facades\Log; -class TransactionConfirmation extends SmsSender -{ +class TransactionConfirmation extends SmsSender { protected $data; public $body = ''; @@ -24,8 +23,7 @@ class TransactionConfirmation extends SmsSender public const ASSET_RATE_PAYMENT = 'loan rate'; - public function prepareBody() - { + public function prepareBody() { $this->data->paymentHistories()->each(function ($payment) { switch ($payment->payment_type) { case self::ENERGY_CONFIRMATION: @@ -42,13 +40,11 @@ public function prepareBody() $this->preparePricingDetails(); } - public function preparePricingDetails() - { + public function preparePricingDetails() { $this->prepareBodyByClassReference('PricingDetails', $this->data); } - private function prepareBodyByClassReference($reference, $payload) - { + private function prepareBodyByClassReference($reference, $payload) { try { $smsBody = $this->smsBodyService->getSmsBodyByReference($reference); } catch (ModelNotFoundException $exception) { diff --git a/src/backend/app/Sms/SmsTypes.php b/src/backend/app/Sms/SmsTypes.php index 5e713bf48..76e0d7e73 100644 --- a/src/backend/app/Sms/SmsTypes.php +++ b/src/backend/app/Sms/SmsTypes.php @@ -2,8 +2,7 @@ namespace App\Sms; -class SmsTypes -{ +class SmsTypes { public const TRANSACTION_CONFIRMATION = 1; public const APPLIANCE_RATE = 2; diff --git a/src/backend/app/Traits/RestExceptionHandler.php b/src/backend/app/Traits/RestExceptionHandler.php index 9a6770ac9..b2b76f06c 100644 --- a/src/backend/app/Traits/RestExceptionHandler.php +++ b/src/backend/app/Traits/RestExceptionHandler.php @@ -11,8 +11,7 @@ use Tymon\JWTAuth\Exceptions\TokenExpiredException; use Tymon\JWTAuth\Exceptions\TokenInvalidException; -trait RestExceptionHandler -{ +trait RestExceptionHandler { /** * Creates a new response based on exception type. * @@ -20,8 +19,7 @@ trait RestExceptionHandler * * @return JsonResponse */ - protected function getJsonResponseForException(Request $request, \Exception|\Throwable $e) - { + protected function getJsonResponseForException(Request $request, \Exception|\Throwable $e) { switch (true) { case $e instanceof TokenExpiredException: return response()->json(['error' => 'Token is expired'], 401); @@ -50,8 +48,7 @@ protected function getJsonResponseForException(Request $request, \Exception|\Thr * * @return JsonResponse */ - protected function badRequest($message = 'Bad request', $status_code = 400) - { + protected function badRequest($message = 'Bad request', $status_code = 400) { return $this->jsonResponse( [ 'message' => $message, @@ -69,8 +66,7 @@ protected function badRequest($message = 'Bad request', $status_code = 400) * * @return JsonResponse */ - protected function modelNotFound($message = 'Record not found', $status_code = 404) - { + protected function modelNotFound($message = 'Record not found', $status_code = 404) { return $this->jsonResponse( [ 'message' => $message, @@ -88,8 +84,7 @@ protected function modelNotFound($message = 'Record not found', $status_code = 4 * * @return JsonResponse */ - protected function validationError($message = 'Validation failed', $status_code = 422) - { + protected function validationError($message = 'Validation failed', $status_code = 422) { return $this->jsonResponse( [ 'message' => $message, @@ -104,8 +99,7 @@ protected function validationError($message = 'Validation failed', $status_code * * @param \Exception $e */ - protected function isModelNotFoundException($e): bool - { + protected function isModelNotFoundException($e): bool { return $e instanceof ModelNotFoundException; } @@ -114,8 +108,7 @@ protected function isModelNotFoundException($e): bool * * @param \Exception $e */ - protected function isValidationException($e): bool - { + protected function isValidationException($e): bool { return $e instanceof ValidationException; } @@ -124,8 +117,7 @@ protected function isValidationException($e): bool * * @return JsonResponse */ - protected function jsonResponse(?array $payload, $status_code) - { + protected function jsonResponse(?array $payload, $status_code) { $payload = $payload ?: []; return response()->json( diff --git a/src/backend/app/Traits/ScheduledPluginCommand.php b/src/backend/app/Traits/ScheduledPluginCommand.php index 5fc51df7b..27fe6d63e 100644 --- a/src/backend/app/Traits/ScheduledPluginCommand.php +++ b/src/backend/app/Traits/ScheduledPluginCommand.php @@ -4,12 +4,10 @@ use App\Models\Plugins; -trait ScheduledPluginCommand -{ +trait ScheduledPluginCommand { private static int $ACTIVE = 1; - protected function checkForPluginStatusIsActive($mpmPluginId) - { + protected function checkForPluginStatusIsActive($mpmPluginId) { $plugin = Plugins::query()->where('mpm_plugin_id', $mpmPluginId)->first(); return $plugin && $plugin->status === self::$ACTIVE; diff --git a/src/backend/app/Utils/AccessRatePayer.php b/src/backend/app/Utils/AccessRatePayer.php index 14d244848..6c3f1e171 100644 --- a/src/backend/app/Utils/AccessRatePayer.php +++ b/src/backend/app/Utils/AccessRatePayer.php @@ -7,8 +7,7 @@ use App\Models\Transaction\Transaction; use App\Services\AccessRatePaymentService; -class AccessRatePayer -{ +class AccessRatePayer { public const MINIMUM_AMOUNT = 0; private AccessRatePayment $accessRatePayment; @@ -19,13 +18,11 @@ class AccessRatePayer private float $debtAmount; - public function __construct(private AccessRatePaymentService $accessRatePaymentService) - { + public function __construct(private AccessRatePaymentService $accessRatePaymentService) { $this->debtAmount = self::MINIMUM_AMOUNT; } - public function initialize(TransactionDataContainer $container) - { + public function initialize(TransactionDataContainer $container) { $meter = $container->device->device; $accessRatePayment = $this->accessRatePaymentService->getAccessRatePaymentByMeter($meter); @@ -38,8 +35,7 @@ public function initialize(TransactionDataContainer $container) $this->transaction = $container->transaction; } - public function pay() - { + public function pay() { $meter = $this->transactionData->device->device; $owner = $this->transactionData->device->person; if ($this->debtAmount > self::MINIMUM_AMOUNT) { // there is unpaid amount @@ -68,8 +64,7 @@ public function pay() return $this->transactionData; } - public function consumeAmount() - { + public function consumeAmount() { $this->transaction->amount -= $this->debtAmount; return $this->transaction->amount; diff --git a/src/backend/app/Utils/ApplianceInstallmentPayer.php b/src/backend/app/Utils/ApplianceInstallmentPayer.php index b5c3951b8..ef41f0b4d 100644 --- a/src/backend/app/Utils/ApplianceInstallmentPayer.php +++ b/src/backend/app/Utils/ApplianceInstallmentPayer.php @@ -13,8 +13,7 @@ use Illuminate\Support\Collection; use MPM\Device\DeviceService; -class ApplianceInstallmentPayer -{ +class ApplianceInstallmentPayer { private Person $customer; private Transaction $transaction; @@ -30,19 +29,16 @@ public function __construct( private ApplianceRateService $applianceRateService, private AppliancePaymentService $appliancePaymentService, private DeviceService $deviceService, - ) { - } + ) {} - public function initialize(TransactionDataContainer $transactionData): void - { + public function initialize(TransactionDataContainer $transactionData): void { $this->transaction = $transactionData->transaction; $this->consumableAmount = $this->transaction->amount; $this->customer = $this->getCustomerByDeviceSerial($this->transaction->message); } // This function pays the installments for the device number that provided in transaction - public function payInstallmentsForDevice(TransactionDataContainer $container) - { + public function payInstallmentsForDevice(TransactionDataContainer $container) { $customer = $container->appliancePerson->person; $this->appliancePaymentService->setPaymentAmount($container->transaction->amount); $installments = $container->appliancePerson->rates; @@ -51,8 +47,7 @@ public function payInstallmentsForDevice(TransactionDataContainer $container) // This function processes the payment of all installments (excluding device-recorded ones) that are due, right before generating the meter token. // If meter number is provided in transaction - public function payInstallments() - { + public function payInstallments() { $customer = $this->customer; $appliancePersonIds = $this->appliancePersonService->getLoanIdsForCustomerId($customer->id); $installments = $this->applianceRateService->getByLoanIdsForDueDate($appliancePersonIds); @@ -61,8 +56,7 @@ public function payInstallments() return $this->transaction->amount; } - public function consumeAmount() - { + public function consumeAmount() { $installments = $this->getInstallments($this->customer); $installments->each(function ($installment) { if ($installment->remaining > $this->consumableAmount) {// money is not enough to cover the @@ -80,8 +74,7 @@ public function consumeAmount() return $this->consumableAmount; } - private function getCustomerByDeviceSerial(string $serialNumber): Person - { + private function getCustomerByDeviceSerial(string $serialNumber): Person { $device = $this->deviceService->getBySerialNumber($serialNumber); if (!$device) { @@ -91,15 +84,13 @@ private function getCustomerByDeviceSerial(string $serialNumber): Person return $device->person; } - private function getInstallments($customer) - { + private function getInstallments($customer) { $loans = $this->appliancePersonService->getLoanIdsForCustomerId($customer->id); return $this->applianceRateService->getByLoanIdsForDueDate($loans); } - private function pay(Collection $installments, mixed $customer): void - { + private function pay(Collection $installments, mixed $customer): void { $installments->map(function ($installment) use ($customer) { if ($installment->remaining > $this->transaction->amount) {// money is not enough to cover the whole rate // add payment history for the installment diff --git a/src/backend/app/Utils/DummyCompany.php b/src/backend/app/Utils/DummyCompany.php index 7a1a6a15e..52d70e54f 100644 --- a/src/backend/app/Utils/DummyCompany.php +++ b/src/backend/app/Utils/DummyCompany.php @@ -2,8 +2,7 @@ namespace App\Utils; -class DummyCompany -{ +class DummyCompany { public const DUMMY_COMPANY_ID = 1; public const DUMMY_COMPANY_DATABASE_NAME = 'DummyCompany_1'; diff --git a/src/backend/app/Utils/MinimumPurchaseAmountValidator.php b/src/backend/app/Utils/MinimumPurchaseAmountValidator.php index ee25e4ed4..b05a10708 100644 --- a/src/backend/app/Utils/MinimumPurchaseAmountValidator.php +++ b/src/backend/app/Utils/MinimumPurchaseAmountValidator.php @@ -4,14 +4,12 @@ use App\Misc\TransactionDataContainer; -class MinimumPurchaseAmountValidator -{ +class MinimumPurchaseAmountValidator { private float $restAmount; private TransactionDataContainer $transactionData; - public function validate(TransactionDataContainer $transactionData, $minimumPurchaseAmount): bool - { + public function validate(TransactionDataContainer $transactionData, $minimumPurchaseAmount): bool { $this->transactionData = $transactionData; $this->restAmount = $this->transactionData->transaction->amount; diff --git a/src/backend/app/Utils/TariffPriceCalculator.php b/src/backend/app/Utils/TariffPriceCalculator.php index b524281ef..43a5adbd4 100644 --- a/src/backend/app/Utils/TariffPriceCalculator.php +++ b/src/backend/app/Utils/TariffPriceCalculator.php @@ -9,15 +9,13 @@ use App\Services\TariffPricingComponentService; use App\Services\TimeOfUsageService; -class TariffPriceCalculator -{ +class TariffPriceCalculator { public function __construct( private AccessRateService $accessRateService, private SocialTariffService $socialTariffService, private TimeOfUsageService $timeOfUsageService, private TariffPricingComponentService $tariffPricingComponentService, - ) { - } + ) {} public function calculateTotalPrice( MeterTariff $meterTariff, @@ -37,8 +35,7 @@ public function calculateTotalPrice( $this->setAdditionalComponents($additionalComponents, $meterTariff); } - private function setAccessRate($accessRate, $meterTariff) - { + private function setAccessRate($accessRate, $meterTariff) { if ($accessRate) { if (isset($accessRate['id'])) { $updatedAccessRate = $this->accessRateService->getById($accessRate['id']); @@ -62,8 +59,7 @@ private function setAccessRate($accessRate, $meterTariff) } } - private function setSocialTariff($socialTariff, $meterTariff) - { + private function setSocialTariff($socialTariff, $meterTariff) { if ($socialTariff) { if (isset($socialTariff['id'])) { $updatedSocialTariff = $this->socialTariffService->getById($socialTariff['id']); @@ -91,8 +87,7 @@ private function setSocialTariff($socialTariff, $meterTariff) } } - private function setTimeOfUsages($timeOfUsage, $meterTariff) - { + private function setTimeOfUsages($timeOfUsage, $meterTariff) { if ($timeOfUsage) { foreach ($timeOfUsage as $key => $value) { $tou = isset($timeOfUsage[$key]['id']) ? $this->timeOfUsageService->getById($timeOfUsage[$key]['id']) : @@ -118,8 +113,7 @@ private function setTimeOfUsages($timeOfUsage, $meterTariff) } } - private function setAdditionalComponents($additionalComponents, $meterTariff) - { + private function setAdditionalComponents($additionalComponents, $meterTariff) { $this->tariffPricingComponentService->deleteByTariffId($meterTariff->id); if ($additionalComponents) { diff --git a/src/backend/app/modules/Apps/CustomerRegistration/CustomerRegistrationAppService.php b/src/backend/app/modules/Apps/CustomerRegistration/CustomerRegistrationAppService.php index 267370fdb..55b31347e 100644 --- a/src/backend/app/modules/Apps/CustomerRegistration/CustomerRegistrationAppService.php +++ b/src/backend/app/modules/Apps/CustomerRegistration/CustomerRegistrationAppService.php @@ -13,8 +13,7 @@ use MPM\Device\DeviceService; use MPM\Meter\MeterDeviceService; -class CustomerRegistrationAppService -{ +class CustomerRegistrationAppService { public function __construct( private PersonService $personService, private MeterService $meterService, @@ -24,11 +23,9 @@ public function __construct( private DeviceAddressService $deviceAddressService, private GeographicalInformationService $geographicalInformationService, private AddressGeographicalInformationService $addressGeographicalInformationService, - ) { - } + ) {} - public function createCustomer(AndroidAppRequest $request): Person - { + public function createCustomer(AndroidAppRequest $request): Person { $serialNumber = $request->input('serial_number'); $meter = $this->meterService->getBySerialNumber($serialNumber); $phone = $request->input('phone'); diff --git a/src/backend/app/modules/CustomBulkRegistration/Abstract/CreatorService.php b/src/backend/app/modules/CustomBulkRegistration/Abstract/CreatorService.php index 8af3ed60f..5c43fec04 100644 --- a/src/backend/app/modules/CustomBulkRegistration/Abstract/CreatorService.php +++ b/src/backend/app/modules/CustomBulkRegistration/Abstract/CreatorService.php @@ -2,17 +2,14 @@ namespace MPM\CustomBulkRegistration\Abstract; -abstract class CreatorService -{ +abstract class CreatorService { protected $model; - public function __construct($model) - { + public function __construct($model) { $this->model = $model; } - public function createRelatedDataIfDoesNotExists($resolvedCsvData) - { + public function createRelatedDataIfDoesNotExists($resolvedCsvData) { return $this->model->newQuery()->firstOrCreate($resolvedCsvData, $resolvedCsvData); } diff --git a/src/backend/app/modules/CustomBulkRegistration/Ecosys/CustomerDatabaseParser.php b/src/backend/app/modules/CustomBulkRegistration/Ecosys/CustomerDatabaseParser.php index 6643b22c7..3ee588d25 100644 --- a/src/backend/app/modules/CustomBulkRegistration/Ecosys/CustomerDatabaseParser.php +++ b/src/backend/app/modules/CustomBulkRegistration/Ecosys/CustomerDatabaseParser.php @@ -22,14 +22,12 @@ use MPM\CustomBulkRegistration\Ecosys\Services\PersonService; use ParseCsv\Csv; -class CustomerDatabaseParser -{ +class CustomerDatabaseParser { private $path; private $recentlyCreatedRecords; - public function __construct(private Csv $csv) - { + public function __construct(private Csv $csv) { $this->path = __DIR__.'/CustomerDb/customer_db.csv'; $this->recentlyCreatedRecords = [ 'customer' => 0, @@ -40,15 +38,13 @@ public function __construct(private Csv $csv) ]; } - private function parseCsvFromFilePath() - { + private function parseCsvFromFilePath() { $this->csv->auto($this->path); return $this->csv->data; } - public function insertFromCsv() - { + public function insertFromCsv() { $parsedCsvData = $this->parseCsvFromFilePath(); $cluster = Cluster::query()->first(); $miniGrid = MiniGrid::query()->first(); @@ -132,15 +128,13 @@ public function insertFromCsv() return $this->recentlyCreatedRecords; } - private function createRecordFromCsv($row, $service) - { + private function createRecordFromCsv($row, $service) { $service = app()->make($service); return $service->resolveCsvDataFromComingRow($row); } - private function checkRecordWasRecentlyCreated($record, $type) - { + private function checkRecordWasRecentlyCreated($record, $type) { if ($record->wasRecentlyCreated) { ++$this->recentlyCreatedRecords[$type]; } diff --git a/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/AddressService.php b/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/AddressService.php index 5ac8d5d47..f5ede905f 100644 --- a/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/AddressService.php +++ b/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/AddressService.php @@ -5,15 +5,12 @@ use App\Models\Address\Address; use MPM\CustomBulkRegistration\Abstract\CreatorService; -class AddressService extends CreatorService -{ - public function __construct(Address $address) - { +class AddressService extends CreatorService { + public function __construct(Address $address) { parent::__construct($address); } - public function resolveCsvDataFromComingRow($csvData): void - { + public function resolveCsvDataFromComingRow($csvData): void { $addressConfig = [ 'person_id' => 'person_id', 'city_id' => 'city_id', @@ -44,8 +41,7 @@ public function resolveCsvDataFromComingRow($csvData): void $this->createRelatedDataIfDoesNotExists($returnAddresses); } - public function createRelatedDataIfDoesNotExists($addresses): void - { + public function createRelatedDataIfDoesNotExists($addresses): void { foreach ($addresses as $address) { Address::query()->firstOrCreate($address, $address); } diff --git a/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/AppliancePersonService.php b/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/AppliancePersonService.php index ceb75346e..21bee70f6 100644 --- a/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/AppliancePersonService.php +++ b/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/AppliancePersonService.php @@ -13,8 +13,7 @@ use App\Models\User; use MPM\CustomBulkRegistration\Abstract\CreatorService; -class AppliancePersonService extends CreatorService -{ +class AppliancePersonService extends CreatorService { private $newTarifName; private ?float $price = null; @@ -37,13 +36,11 @@ class AppliancePersonService extends CreatorService private $lastPaymentDate; - public function __construct(AssetPerson $appliancePerson) - { + public function __construct(AssetPerson $appliancePerson) { parent::__construct($appliancePerson); } - public function resolveCsvDataFromComingRow($csvData) - { + public function resolveCsvDataFromComingRow($csvData) { $creatorId = User::query()->first()->id; $appliancePersonConfig = [ 'asset_id' => 'asset_id', @@ -85,8 +82,7 @@ public function resolveCsvDataFromComingRow($csvData) return $this->createRelatedDataIfDoesNotExists($appliancePersonData); } - private function calculateRateCount($price, $downPayment, $minimumPaymentAmount): int - { + private function calculateRateCount($price, $downPayment, $minimumPaymentAmount): int { $rawCost = $price - $downPayment; $rateCount = 0; @@ -98,8 +94,7 @@ private function calculateRateCount($price, $downPayment, $minimumPaymentAmount) return $rateCount; } - public function createRelatedDataIfDoesNotExists($appliancePersonData) - { + public function createRelatedDataIfDoesNotExists($appliancePersonData) { $creatorId = User::query()->first()->id; $currency = MainSettings::query()->first() ? MainSettings::query()->first()->currency : 'MTn'; $newTariffData = [ @@ -227,8 +222,7 @@ static function ($q) { return $appliancePerson; } - private function updateRateRemaining($id, $amount): ?AssetRate - { + private function updateRateRemaining($id, $amount): ?AssetRate { /** @var AssetRate|null $applianceRate */ $applianceRate = AssetRate::query()->find($id); $applianceRate->remaining -= $amount; @@ -238,8 +232,7 @@ private function updateRateRemaining($id, $amount): ?AssetRate return $applianceRate; } - private function createPaymentHistory($amount, $buyer, $applianceRate, $transaction): void - { + private function createPaymentHistory($amount, $buyer, $applianceRate, $transaction): void { event( 'payment.successful', [ diff --git a/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/ApplianceService.php b/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/ApplianceService.php index 0126ac0b0..f13d300bf 100644 --- a/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/ApplianceService.php +++ b/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/ApplianceService.php @@ -5,19 +5,16 @@ use App\Models\Asset; use MPM\CustomBulkRegistration\Abstract\CreatorService; -class ApplianceService extends CreatorService -{ +class ApplianceService extends CreatorService { private $appliance1 = 'SunKing Home 40Plus - Sofala - Humanitário 2'; private $appliance2 = 'SunKing Home 40Plus - Nacional - COVID PLUS 2'; - public function __construct(Asset $asset) - { + public function __construct(Asset $asset) { parent::__construct($asset); } - public function resolveCsvDataFromComingRow($csvData) - { + public function resolveCsvDataFromComingRow($csvData) { $applianceConfig = [ 'price' => 'price', ]; diff --git a/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/CityService.php b/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/CityService.php index af3cd1e92..50f2a7a5d 100644 --- a/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/CityService.php +++ b/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/CityService.php @@ -5,15 +5,12 @@ use App\Models\City; use MPM\CustomBulkRegistration\Abstract\CreatorService; -class CityService extends CreatorService -{ - public function __construct(City $city) - { +class CityService extends CreatorService { + public function __construct(City $city) { parent::__construct($city); } - public function resolveCsvDataFromComingRow($csvData) - { + public function resolveCsvDataFromComingRow($csvData) { $cityConfig = [ 'cluster_id' => 'cluster_id', 'mini_grid_id' => 'mini_grid_id', diff --git a/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/ConnectionGroupService.php b/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/ConnectionGroupService.php index d7aad1803..17d8b1422 100644 --- a/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/ConnectionGroupService.php +++ b/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/ConnectionGroupService.php @@ -5,19 +5,16 @@ use App\Models\ConnectionGroup; use MPM\CustomBulkRegistration\Abstract\CreatorService; -class ConnectionGroupService extends CreatorService -{ +class ConnectionGroupService extends CreatorService { private $group1 = 'SunKing Home 40Plus - Sofala - Humanitário 2'; private $group2 = 'SunKing Home 40Plus - Nacional - COVID PLUS 2'; - public function __construct(ConnectionGroup $connectionGroup) - { + public function __construct(ConnectionGroup $connectionGroup) { parent::__construct($connectionGroup); } - public function resolveCsvDataFromComingRow($csvData) - { + public function resolveCsvDataFromComingRow($csvData) { $connectionConfig = [ 'price' => 'price', ]; diff --git a/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/GeographicalInformationService.php b/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/GeographicalInformationService.php index f8d53e6f8..1586941a2 100644 --- a/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/GeographicalInformationService.php +++ b/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/GeographicalInformationService.php @@ -5,15 +5,12 @@ use App\Models\GeographicalInformation; use MPM\CustomBulkRegistration\Abstract\CreatorService; -class GeographicalInformationService extends CreatorService -{ - public function __construct(GeographicalInformation $geo) - { +class GeographicalInformationService extends CreatorService { + public function __construct(GeographicalInformation $geo) { parent::__construct($geo); } - public function resolveCsvDataFromComingRow($csvData) - { + public function resolveCsvDataFromComingRow($csvData) { $geoConfig = [ 'owner_type' => 'meter_parameter', 'owner_id' => 'meter_parameter_id', diff --git a/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/MeterParameterService.php b/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/MeterParameterService.php index b109ba89a..5f70cdec0 100644 --- a/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/MeterParameterService.php +++ b/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/MeterParameterService.php @@ -5,15 +5,12 @@ use App\Models\Meter\MeterParameter; use MPM\CustomBulkRegistration\Abstract\CreatorService; -class MeterParameterService extends CreatorService -{ - public function __construct(MeterParameter $meterParameter) - { +class MeterParameterService extends CreatorService { + public function __construct(MeterParameter $meterParameter) { parent::__construct($meterParameter); } - public function resolveCsvDataFromComingRow($csvData) - { + public function resolveCsvDataFromComingRow($csvData) { $meterParameterConfig = [ 'owner_type' => 'person', 'owner_id' => 'person_id', diff --git a/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/MeterService.php b/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/MeterService.php index 5277845f1..0f5339bbf 100644 --- a/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/MeterService.php +++ b/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/MeterService.php @@ -5,15 +5,12 @@ use App\Models\Meter\Meter; use MPM\CustomBulkRegistration\Abstract\CreatorService; -class MeterService extends CreatorService -{ - public function __construct(Meter $meter) - { +class MeterService extends CreatorService { + public function __construct(Meter $meter) { parent::__construct($meter); } - public function resolveCsvDataFromComingRow($csvData) - { + public function resolveCsvDataFromComingRow($csvData) { $meterConfig = [ 'serial_number' => 'device', 'manufacturer_id' => 'manufacturer_id', diff --git a/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/PersonService.php b/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/PersonService.php index b49ea96c6..ae2348021 100644 --- a/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/PersonService.php +++ b/src/backend/app/modules/CustomBulkRegistration/Ecosys/Services/PersonService.php @@ -5,17 +5,14 @@ use App\Models\Person\Person; use MPM\CustomBulkRegistration\Abstract\CreatorService; -class PersonService extends CreatorService -{ +class PersonService extends CreatorService { private $phone; - public function __construct(Person $person) - { + public function __construct(Person $person) { parent::__construct($person); } - public function resolveCsvDataFromComingRow($csvData) - { + public function resolveCsvDataFromComingRow($csvData) { $personConfig = [ 'name' => 'name', 'gender' => 'gender', @@ -34,13 +31,11 @@ public function resolveCsvDataFromComingRow($csvData) return $this->createRelatedDataIfDoesNotExists($personData); } - private function getBirthDateByGivenAge($age) - { + private function getBirthDateByGivenAge($age) { return date('Y-m-d', strtotime('-'.$age.' years')); } - public function createRelatedDataIfDoesNotExists($personData) - { + public function createRelatedDataIfDoesNotExists($personData) { $phone = $this->phone; $existingPerson = Person::query() diff --git a/src/backend/app/modules/DatabaseProxy/DatabaseProxyManagerService.php b/src/backend/app/modules/DatabaseProxy/DatabaseProxyManagerService.php index 742bfd7f5..bb7400c33 100644 --- a/src/backend/app/modules/DatabaseProxy/DatabaseProxyManagerService.php +++ b/src/backend/app/modules/DatabaseProxy/DatabaseProxyManagerService.php @@ -10,40 +10,33 @@ use Illuminate\Database\DatabaseManager; use Illuminate\Database\Eloquent\Builder; -class DatabaseProxyManagerService -{ +class DatabaseProxyManagerService { public function __construct( private DatabaseProxy $databaseProxy, private DatabaseManager $databaseManager, private CompanyDatabase $companyDatabase, - ) { - } + ) {} - public function findByEmail(string $email): DatabaseProxy - { + public function findByEmail(string $email): DatabaseProxy { return $this->databaseProxy->findByEmail($email); } - public function runForCompany(int $companyId, callable $callable) - { + public function runForCompany(int $companyId, callable $callable) { $database = $this->companyDatabase->findByCompanyId($companyId); $this->buildDatabaseConnection($database->getDatabaseName()); return $callable(); } - public function queryAllConnections(): Builder - { + public function queryAllConnections(): Builder { return $this->companyDatabase->newQuery(); } - public function buildDatabaseConnectionDummyCompany(): void - { + public function buildDatabaseConnectionDummyCompany(): void { $this->buildDatabaseConnection(DummyCompany::DUMMY_COMPANY_DATABASE_NAME); } - private function buildDatabaseConnection(string $databaseName): void - { + private function buildDatabaseConnection(string $databaseName): void { $databaseConnections = config()->get('database.connections'); $databaseConnections['shard'] = [ 'driver' => 'mysql', diff --git a/src/backend/app/modules/Device/ClusterDeviceService.php b/src/backend/app/modules/Device/ClusterDeviceService.php index 70ccbdc6d..53869b6a0 100644 --- a/src/backend/app/modules/Device/ClusterDeviceService.php +++ b/src/backend/app/modules/Device/ClusterDeviceService.php @@ -6,29 +6,23 @@ use App\Models\Device; use App\Models\Meter\Meter; -class ClusterDeviceService -{ - public function __construct(private Cluster $cluster, private Device $device) - { - } +class ClusterDeviceService { + public function __construct(private Cluster $cluster, private Device $device) {} - public function getCountByClusterId($clusterId): int - { + public function getCountByClusterId($clusterId): int { return $this->device->newQuery() ->whereHas('address', fn ($q) => $q->whereHas('city', fn ($q) => $q->where('cluster_id', $clusterId))) ->count(); } - public function getByClusterId($clusterId) - { + public function getByClusterId($clusterId) { return $this->device->newQuery() ->with('device') ->whereHas('address', fn ($q) => $q->whereHas('city', fn ($q) => $q->where('cluster_id', $clusterId))) ->get(); } - public function getMetersByClusterId($clusterId) - { + public function getMetersByClusterId($clusterId) { return $this->device->newQuery() ->whereHasMorph( 'device', diff --git a/src/backend/app/modules/Device/DeviceAddressService.php b/src/backend/app/modules/Device/DeviceAddressService.php index 3cb87f915..b87ff9fba 100644 --- a/src/backend/app/modules/Device/DeviceAddressService.php +++ b/src/backend/app/modules/Device/DeviceAddressService.php @@ -9,31 +9,26 @@ /** * @implements IAssignationService */ -class DeviceAddressService implements IAssignationService -{ +class DeviceAddressService implements IAssignationService { private Address $address; private Device $device; - public function setAssigned($assigned): void - { + public function setAssigned($assigned): void { $this->address = $assigned; } - public function setAssignee($assignee): void - { + public function setAssignee($assignee): void { $this->device = $assignee; } - public function assign(): Address - { + public function assign(): Address { $this->address->owner()->associate($this->device); return $this->address; } - public function getAddressByDevice(Device $device): ?Address - { + public function getAddressByDevice(Device $device): ?Address { $result = Address::query()->with('geo') ->where('owner_id', $device->id) ->where('owner_type', 'device') @@ -42,8 +37,7 @@ public function getAddressByDevice(Device $device): ?Address return $result; } - public function updateDeviceAddress($deviceAddress, $addressData): Address - { + public function updateDeviceAddress($deviceAddress, $addressData): Address { $points = $addressData['lat'].','.$addressData['lon']; $deviceAddress->geo()->update([ 'points' => $points, diff --git a/src/backend/app/modules/Device/DeviceService.php b/src/backend/app/modules/Device/DeviceService.php index a5f7debd8..83495a984 100644 --- a/src/backend/app/modules/Device/DeviceService.php +++ b/src/backend/app/modules/Device/DeviceService.php @@ -12,15 +12,12 @@ * @implements IBaseService * @implements IAssociative */ -class DeviceService implements IAssociative, IBaseService -{ +class DeviceService implements IAssociative, IBaseService { public function __construct( private Device $device, - ) { - } + ) {} - public function make($deviceData): Device - { + public function make($deviceData): Device { $result = $this->device->newQuery()->create([ 'person_id' => $deviceData['person_id'], 'device_serial' => $deviceData['device_serial'], @@ -29,8 +26,7 @@ public function make($deviceData): Device return $result; } - public function getBySerialNumber($serialNumber): ?Device - { + public function getBySerialNumber($serialNumber): ?Device { $result = $this->device->newQuery() ->with(['address.geo', 'device.manufacturer', 'person']) ->where('device_serial', $serialNumber) @@ -39,40 +35,34 @@ public function getBySerialNumber($serialNumber): ?Device return $result; } - public function save($device): bool - { + public function save($device): bool { return $device->save(); } - public function getById(int $id): Device - { + public function getById(int $id): Device { throw new \Exception('Method getById() not yet implemented.'); return new Device(); } - public function create(array $data): Device - { + public function create(array $data): Device { throw new \Exception('Method create() not yet implemented.'); return new Device(); } - public function update($device, array $deviceData): Device - { + public function update($device, array $deviceData): Device { $device->update($deviceData); $device->fresh(); return $device; } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } - public function getAll(?int $limit = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null): Collection|LengthAwarePaginator { if ($limit) { return $this->device->newQuery()->with(['person', 'device'])->paginate($limit); } diff --git a/src/backend/app/modules/Device/MiniGridDeviceService.php b/src/backend/app/modules/Device/MiniGridDeviceService.php index 7bb80f7ad..cdf77a8cf 100644 --- a/src/backend/app/modules/Device/MiniGridDeviceService.php +++ b/src/backend/app/modules/Device/MiniGridDeviceService.php @@ -7,14 +7,10 @@ use App\Models\MiniGrid; use Illuminate\Support\Collection; -class MiniGridDeviceService -{ - public function __construct(private Device $device, private MiniGrid $miniGrid) - { - } +class MiniGridDeviceService { + public function __construct(private Device $device, private MiniGrid $miniGrid) {} - public function getMetersByMiniGridId($miniGridId) - { + public function getMetersByMiniGridId($miniGridId) { return $this->device->newQuery() ->with('device') ->whereHasMorph( @@ -25,8 +21,7 @@ public function getMetersByMiniGridId($miniGridId) ->get()->pluck('device'); } - public function getDevicesByMiniGridId($miniGridId): Collection - { + public function getDevicesByMiniGridId($miniGridId): Collection { return $this->device->newQuery() ->with(['device', 'address.geo']) ->whereHasMorph( diff --git a/src/backend/app/modules/EBike/EBikeDeviceService.php b/src/backend/app/modules/EBike/EBikeDeviceService.php index 068f7187b..a620c755d 100644 --- a/src/backend/app/modules/EBike/EBikeDeviceService.php +++ b/src/backend/app/modules/EBike/EBikeDeviceService.php @@ -9,24 +9,20 @@ /** * @implements IAssignationService */ -class EBikeDeviceService implements IAssignationService -{ +class EBikeDeviceService implements IAssignationService { private Device $device; protected EBike $eBike; - public function setAssigned($assigned): void - { + public function setAssigned($assigned): void { $this->device = $assigned; } - public function setAssignee($assignee): void - { + public function setAssignee($assignee): void { $this->eBike = $assignee; } - public function assign(): Device - { + public function assign(): Device { $this->device->device()->associate($this->eBike); return $this->device; diff --git a/src/backend/app/modules/EBike/EBikeService.php b/src/backend/app/modules/EBike/EBikeService.php index 386017449..846772040 100644 --- a/src/backend/app/modules/EBike/EBikeService.php +++ b/src/backend/app/modules/EBike/EBikeService.php @@ -10,15 +10,12 @@ /** * @implements IBaseService */ -class EBikeService implements IBaseService -{ +class EBikeService implements IBaseService { public function __construct( private EBike $eBike, - ) { - } + ) {} - public function getAll(?int $limit = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null): Collection|LengthAwarePaginator { if ($limit) { return $this->eBike->newQuery()->with(['manufacturer', 'appliance', 'device.person'])->paginate($limit); } @@ -26,18 +23,15 @@ public function getAll(?int $limit = null): Collection|LengthAwarePaginator return $this->eBike->newQuery()->with(['manufacturer', 'appliance', 'device.person'])->get(); } - public function getById(int $id): EBike - { + public function getById(int $id): EBike { return $this->eBike->newQuery()->with(['manufacturer', 'appliance', 'device.person'])->find($id); } - public function create(array $data): EBike - { + public function create(array $data): EBike { return $this->eBike->newQuery()->create($data); } - public function search($term, $paginate): LengthAwarePaginator - { + public function search($term, $paginate): LengthAwarePaginator { return $this->eBike->newQuery() ->with(['manufacturer', 'appliance', 'device.person']) ->whereHas( @@ -55,16 +49,14 @@ public function search($term, $paginate): LengthAwarePaginator )->paginate($paginate); } - public function update($model, array $data): EBike - { + public function update($model, array $data): EBike { $model->newQuery()->update($data); $model->fresh(); return $model; } - public function getBySerialNumber($serialNumber) - { + public function getBySerialNumber($serialNumber) { return $this->eBike->newQuery() ->with(['manufacturer', 'appliance', 'device.person'])->where( 'serial_number', @@ -72,8 +64,7 @@ public function getBySerialNumber($serialNumber) )->first(); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } } diff --git a/src/backend/app/modules/Meter/MeterDeviceService.php b/src/backend/app/modules/Meter/MeterDeviceService.php index 1a10e3bad..cad8158af 100644 --- a/src/backend/app/modules/Meter/MeterDeviceService.php +++ b/src/backend/app/modules/Meter/MeterDeviceService.php @@ -9,24 +9,20 @@ /** * @implements IAssignationService */ -class MeterDeviceService implements IAssignationService -{ +class MeterDeviceService implements IAssignationService { private Device $device; private Meter $meter; - public function setAssigned($assigned): void - { + public function setAssigned($assigned): void { $this->device = $assigned; } - public function setAssignee($assignee): void - { + public function setAssignee($assignee): void { $this->meter = $assignee; } - public function assign(): Device - { + public function assign(): Device { $this->device->device()->associate($this->meter); return $this->device; diff --git a/src/backend/app/modules/OutstandingDebts/OutstandingDebtsExportService.php b/src/backend/app/modules/OutstandingDebts/OutstandingDebtsExportService.php index 61ffe009c..508ca7383 100644 --- a/src/backend/app/modules/OutstandingDebts/OutstandingDebtsExportService.php +++ b/src/backend/app/modules/OutstandingDebts/OutstandingDebtsExportService.php @@ -10,20 +10,17 @@ use Carbon\CarbonImmutable; use Illuminate\Support\Collection; -class OutstandingDebtsExportService extends AbstractExportService -{ +class OutstandingDebtsExportService extends AbstractExportService { public function __construct( private readonly UserService $userService, private ApplianceRateService $applianceService, private ApplianceRateService $applianceRateService, private MailHelper $mailHelper, - ) { - } + ) {} private Collection $outstandingDebtsData; - public function writeOutstandingDebtsData(): void - { + public function writeOutstandingDebtsData(): void { $this->setActivatedSheet('Sheet1'); foreach ($this->exportingData as $key => $value) { @@ -39,8 +36,7 @@ public function writeOutstandingDebtsData(): void } } - public function setExportingData(): void - { + public function setExportingData(): void { $this->exportingData = $this->outstandingDebtsData->map(function ($applianceRate) { return [ $applianceRate->assetPerson->person->name.' '.$applianceRate->assetPerson->person->surname, @@ -52,18 +48,15 @@ public function setExportingData(): void }); } - public function setOutstandingDebtsData($outstandingDebtsData): void - { + public function setOutstandingDebtsData($outstandingDebtsData): void { $this->outstandingDebtsData = $outstandingDebtsData; } - public function getTemplatePath(): string - { + public function getTemplatePath(): string { return storage_path('appliance/export_outstanding_debts_template.xlsx'); } - public function createReport(CarbonImmutable $toDate): string - { + public function createReport(CarbonImmutable $toDate): string { $currency = $this->applianceRateService->getCurrencyFromMainSettings(); $data = $this->applianceService->queryOutstandingDebtsByApplianceRates($toDate)->get(); @@ -76,8 +69,7 @@ public function createReport(CarbonImmutable $toDate): string return $this->saveSpreadSheet(); } - public function sendApplianceDebtsAsEmail(): void - { + public function sendApplianceDebtsAsEmail(): void { $reportDate = CarbonImmutable::now()->endOfWeek()->endOfDay(); $path = $this->createReport($reportDate); @@ -92,8 +84,7 @@ public function sendApplianceDebtsAsEmail(): void }); } - public function getPrefix(): string - { + public function getPrefix(): string { return 'OutstandingDebtsExport'; } } diff --git a/src/backend/app/modules/Sharding/ApiCompanyResolverService.php b/src/backend/app/modules/Sharding/ApiCompanyResolverService.php index 78b7dd31c..c6a03537b 100644 --- a/src/backend/app/modules/Sharding/ApiCompanyResolverService.php +++ b/src/backend/app/modules/Sharding/ApiCompanyResolverService.php @@ -10,14 +10,10 @@ use MPM\Sharding\ApiResolvers\ApiResolverInterface; use MPM\Sharding\ApiResolvers\Data\ApiResolverMap; -class ApiCompanyResolverService -{ - public function __construct(private ApiResolverMap $apiResolverMap) - { - } +class ApiCompanyResolverService { + public function __construct(private ApiResolverMap $apiResolverMap) {} - public function resolve(Request $request): int - { + public function resolve(Request $request): int { $api = collect($this->apiResolverMap::RESOLVABLE_APIS)->filter(fn ($apiPath) => Str::startsWith(Str::lower($request->path()), Str::lower($apiPath))); if (!$api) { throw new ValidationException('No api resolver registered for '.$request->path()); @@ -28,8 +24,7 @@ public function resolve(Request $request): int return $resolver->resolveCompanyId($request); } - private function startResolver(string $api): ApiResolverInterface - { + private function startResolver(string $api): ApiResolverInterface { $apiResolver = $this->apiResolverMap->getApiResolver($api); if (!$apiResolver) { throw new ValidationException('Api is registered to resolve but no resolver class is assigned'.$api); diff --git a/src/backend/app/modules/Sharding/ApiResolvers/AndroidGatewayCallbackApiResolver.php b/src/backend/app/modules/Sharding/ApiResolvers/AndroidGatewayCallbackApiResolver.php index 9becf1fe3..4a86416fe 100644 --- a/src/backend/app/modules/Sharding/ApiResolvers/AndroidGatewayCallbackApiResolver.php +++ b/src/backend/app/modules/Sharding/ApiResolvers/AndroidGatewayCallbackApiResolver.php @@ -5,10 +5,8 @@ use App\Exceptions\ValidationException; use Illuminate\Http\Request; -class AndroidGatewayCallbackApiResolver implements ApiResolverInterface -{ - public function resolveCompanyId(Request $request): int - { +class AndroidGatewayCallbackApiResolver implements ApiResolverInterface { + public function resolveCompanyId(Request $request): int { $segments = $request->segments(); if (count($segments) !== 5) { throw new ValidationException('failed to parse company identifier from the webhook'); diff --git a/src/backend/app/modules/Sharding/ApiResolvers/ApiResolverInterface.php b/src/backend/app/modules/Sharding/ApiResolvers/ApiResolverInterface.php index 34748eb1a..6b674e1c4 100644 --- a/src/backend/app/modules/Sharding/ApiResolvers/ApiResolverInterface.php +++ b/src/backend/app/modules/Sharding/ApiResolvers/ApiResolverInterface.php @@ -4,7 +4,6 @@ use Illuminate\Http\Request; -interface ApiResolverInterface -{ +interface ApiResolverInterface { public function resolveCompanyId(Request $request): int; } diff --git a/src/backend/app/modules/Sharding/ApiResolvers/Data/ApiResolverMap.php b/src/backend/app/modules/Sharding/ApiResolvers/Data/ApiResolverMap.php index af99669aa..a5d85138e 100644 --- a/src/backend/app/modules/Sharding/ApiResolvers/Data/ApiResolverMap.php +++ b/src/backend/app/modules/Sharding/ApiResolvers/Data/ApiResolverMap.php @@ -12,8 +12,7 @@ use MPM\Sharding\ApiResolvers\ViberMessagingApiResolver; use MPM\Sharding\ApiResolvers\WaveMoneyApiResolver; -class ApiResolverMap -{ +class ApiResolverMap { public const VIBER_API = 'api/viber-messaging/webhook'; public const TEST_API = 'api/testApi'; @@ -48,13 +47,11 @@ class ApiResolverMap self::DATA_EXPORTING_API => DataExportResolver::class, ]; - public function getResolvableApis(): array - { + public function getResolvableApis(): array { return self::RESOLVABLE_APIS; } - public function getApiResolver(string $api): string - { + public function getApiResolver(string $api): string { return self::API_RESOLVER[$api]; } } diff --git a/src/backend/app/modules/Sharding/ApiResolvers/DataExportResolver.php b/src/backend/app/modules/Sharding/ApiResolvers/DataExportResolver.php index d9018b46d..15f02ba1c 100644 --- a/src/backend/app/modules/Sharding/ApiResolvers/DataExportResolver.php +++ b/src/backend/app/modules/Sharding/ApiResolvers/DataExportResolver.php @@ -6,14 +6,10 @@ use Illuminate\Http\Request; use MPM\DatabaseProxy\DatabaseProxyManagerService; -class DataExportResolver implements ApiResolverInterface -{ - public function __construct(private DatabaseProxyManagerService $databaseProxyManager) - { - } +class DataExportResolver implements ApiResolverInterface { + public function __construct(private DatabaseProxyManagerService $databaseProxyManager) {} - public function resolveCompanyId(Request $request): int - { + public function resolveCompanyId(Request $request): int { $segments = $request->segments(); if (count($segments) !== 4) { throw new ValidationException('failed to parse company identifier from the webhook'); diff --git a/src/backend/app/modules/Sharding/ApiResolvers/DownloadingReportsResolver.php b/src/backend/app/modules/Sharding/ApiResolvers/DownloadingReportsResolver.php index b0fc3f7c0..393aa6edb 100644 --- a/src/backend/app/modules/Sharding/ApiResolvers/DownloadingReportsResolver.php +++ b/src/backend/app/modules/Sharding/ApiResolvers/DownloadingReportsResolver.php @@ -5,10 +5,8 @@ use App\Exceptions\ValidationException; use Illuminate\Http\Request; -class DownloadingReportsResolver implements ApiResolverInterface -{ - public function resolveCompanyId(Request $request): int - { +class DownloadingReportsResolver implements ApiResolverInterface { + public function resolveCompanyId(Request $request): int { $segments = $request->segments(); if (count($segments) !== 5) { throw new ValidationException('failed to parse company identifier from the webhook'); diff --git a/src/backend/app/modules/Sharding/ApiResolvers/JetsonApiResolver.php b/src/backend/app/modules/Sharding/ApiResolvers/JetsonApiResolver.php index eaab9f4ca..d8021b25b 100644 --- a/src/backend/app/modules/Sharding/ApiResolvers/JetsonApiResolver.php +++ b/src/backend/app/modules/Sharding/ApiResolvers/JetsonApiResolver.php @@ -5,10 +5,8 @@ use App\Exceptions\ValidationException; use Illuminate\Http\Request; -class JetsonApiResolver implements ApiResolverInterface -{ - public function resolveCompanyId(Request $request): int - { +class JetsonApiResolver implements ApiResolverInterface { + public function resolveCompanyId(Request $request): int { $segments = $request->segments(); if (count($segments) < 6) { throw new ValidationException('failed to parse company identifier from the webhook'); diff --git a/src/backend/app/modules/Sharding/ApiResolvers/SwiftaPaymentApiResolver.php b/src/backend/app/modules/Sharding/ApiResolvers/SwiftaPaymentApiResolver.php index 2fea62fbb..edd2127cd 100644 --- a/src/backend/app/modules/Sharding/ApiResolvers/SwiftaPaymentApiResolver.php +++ b/src/backend/app/modules/Sharding/ApiResolvers/SwiftaPaymentApiResolver.php @@ -4,10 +4,8 @@ use Illuminate\Http\Request; -class SwiftaPaymentApiResolver implements ApiResolverInterface -{ - public function resolveCompanyId(Request $request): int - { +class SwiftaPaymentApiResolver implements ApiResolverInterface { + public function resolveCompanyId(Request $request): int { return (int) auth()->payload()->get('companyId'); } } diff --git a/src/backend/app/modules/Sharding/ApiResolvers/TestApiResolver.php b/src/backend/app/modules/Sharding/ApiResolvers/TestApiResolver.php index d499c42ed..7306a0d0e 100644 --- a/src/backend/app/modules/Sharding/ApiResolvers/TestApiResolver.php +++ b/src/backend/app/modules/Sharding/ApiResolvers/TestApiResolver.php @@ -8,12 +8,10 @@ use Illuminate\Http\Request; // test-api passes the company id within the callback url -class TestApiResolver implements ApiResolverInterface -{ +class TestApiResolver implements ApiResolverInterface { private const QUERY_PARAM_COMPANY_ID = 'c'; - public function resolveCompanyId(Request $request): int - { + public function resolveCompanyId(Request $request): int { $companyId = $request->input(self::QUERY_PARAM_COMPANY_ID); if (!is_numeric($companyId)) { throw new ValidationException('the field which is used to identify the company is not provided'); diff --git a/src/backend/app/modules/Sharding/ApiResolvers/ViberMessagingApiResolver.php b/src/backend/app/modules/Sharding/ApiResolvers/ViberMessagingApiResolver.php index 1a6be172e..4f8110ac2 100644 --- a/src/backend/app/modules/Sharding/ApiResolvers/ViberMessagingApiResolver.php +++ b/src/backend/app/modules/Sharding/ApiResolvers/ViberMessagingApiResolver.php @@ -7,10 +7,8 @@ use App\Exceptions\ValidationException; use Illuminate\Http\Request; -class ViberMessagingApiResolver implements ApiResolverInterface -{ - public function resolveCompanyId(Request $request): int - { +class ViberMessagingApiResolver implements ApiResolverInterface { + public function resolveCompanyId(Request $request): int { $segments = $request->segments(); if (count($segments) !== 4) { throw new ValidationException('failed to parse company identifier from the webhook'); diff --git a/src/backend/app/modules/Sharding/ApiResolvers/WaveMoneyApiResolver.php b/src/backend/app/modules/Sharding/ApiResolvers/WaveMoneyApiResolver.php index 919d59667..0edd39db8 100644 --- a/src/backend/app/modules/Sharding/ApiResolvers/WaveMoneyApiResolver.php +++ b/src/backend/app/modules/Sharding/ApiResolvers/WaveMoneyApiResolver.php @@ -5,10 +5,8 @@ use App\Exceptions\ValidationException; use Illuminate\Http\Request; -class WaveMoneyApiResolver implements ApiResolverInterface -{ - public function resolveCompanyId(Request $request): int - { +class WaveMoneyApiResolver implements ApiResolverInterface { + public function resolveCompanyId(Request $request): int { $segments = $request->segments(); if (count($segments) !== 5) { throw new ValidationException('failed to parse company identifier from the webhook'); diff --git a/src/backend/app/modules/SolarHomeSystem/SolarHomeSystemDeviceService.php b/src/backend/app/modules/SolarHomeSystem/SolarHomeSystemDeviceService.php index a814deb30..2fc8a2496 100644 --- a/src/backend/app/modules/SolarHomeSystem/SolarHomeSystemDeviceService.php +++ b/src/backend/app/modules/SolarHomeSystem/SolarHomeSystemDeviceService.php @@ -9,24 +9,20 @@ /** * @implements IAssignationService */ -class SolarHomeSystemDeviceService implements IAssignationService -{ +class SolarHomeSystemDeviceService implements IAssignationService { private Device $device; protected SolarHomeSystem $shs; - public function setAssigned($assigned): void - { + public function setAssigned($assigned): void { $this->device = $assigned; } - public function setAssignee($assignee): void - { + public function setAssignee($assignee): void { $this->shs = $assignee; } - public function assign(): Device - { + public function assign(): Device { $this->device->device()->associate($this->shs); return $this->device; diff --git a/src/backend/app/modules/SolarHomeSystem/SolarHomeSystemService.php b/src/backend/app/modules/SolarHomeSystem/SolarHomeSystemService.php index b9b9c8c9a..521e18f08 100644 --- a/src/backend/app/modules/SolarHomeSystem/SolarHomeSystemService.php +++ b/src/backend/app/modules/SolarHomeSystem/SolarHomeSystemService.php @@ -10,14 +10,10 @@ /** * @implements IBaseService */ -class SolarHomeSystemService implements IBaseService -{ - public function __construct(private SolarHomeSystem $solarHomeSystem) - { - } +class SolarHomeSystemService implements IBaseService { + public function __construct(private SolarHomeSystem $solarHomeSystem) {} - public function getAll(?int $limit = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null): Collection|LengthAwarePaginator { if ($limit) { return $this->solarHomeSystem->newQuery()->with(['manufacturer', 'appliance', 'device.person'])->paginate($limit); } @@ -25,8 +21,7 @@ public function getAll(?int $limit = null): Collection|LengthAwarePaginator return $this->solarHomeSystem->newQuery()->with(['manufacturer', 'appliance', 'device.person'])->get(); } - public function getById(int $id): SolarHomeSystem - { + public function getById(int $id): SolarHomeSystem { /** @var SolarHomeSystem|null $result */ $result = $this->solarHomeSystem->newQuery() ->with(['manufacturer', 'appliance', 'device.person']) @@ -35,16 +30,14 @@ public function getById(int $id): SolarHomeSystem return $result; } - public function create(array $data): SolarHomeSystem - { + public function create(array $data): SolarHomeSystem { /** @var SolarHomeSystem $result */ $result = $this->solarHomeSystem->newQuery()->create($data); return $result; } - public function search($term, $paginate): LengthAwarePaginator - { + public function search($term, $paginate): LengthAwarePaginator { return $this->solarHomeSystem->newQuery() ->with(['manufacturer', 'appliance', 'device.person']) ->whereHas( @@ -62,13 +55,11 @@ public function search($term, $paginate): LengthAwarePaginator )->paginate($paginate); } - public function update($model, array $data): SolarHomeSystem - { + public function update($model, array $data): SolarHomeSystem { throw new \Exception('not implemented'); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('not implemented'); } } diff --git a/src/backend/app/modules/Target/TargetAssignable.php b/src/backend/app/modules/Target/TargetAssignable.php index 3bdd14d62..c09a05565 100644 --- a/src/backend/app/modules/Target/TargetAssignable.php +++ b/src/backend/app/modules/Target/TargetAssignable.php @@ -2,6 +2,4 @@ namespace MPM\Target; -interface TargetAssignable -{ -} +interface TargetAssignable {} diff --git a/src/backend/app/modules/Transaction/ApplianceTransactionService.php b/src/backend/app/modules/Transaction/ApplianceTransactionService.php index d8e6cbe78..47a9a38ce 100644 --- a/src/backend/app/modules/Transaction/ApplianceTransactionService.php +++ b/src/backend/app/modules/Transaction/ApplianceTransactionService.php @@ -2,6 +2,4 @@ namespace MPM\Transaction; -class ApplianceTransactionService -{ -} +class ApplianceTransactionService {} diff --git a/src/backend/app/modules/Transaction/EBikeTransactionService.php b/src/backend/app/modules/Transaction/EBikeTransactionService.php index d2bf4123b..278870fbc 100644 --- a/src/backend/app/modules/Transaction/EBikeTransactionService.php +++ b/src/backend/app/modules/Transaction/EBikeTransactionService.php @@ -5,11 +5,8 @@ use App\Models\EBike; use App\Models\Transaction\Transaction; -class EBikeTransactionService -{ - public function __construct(private Transaction $transaction) - { - } +class EBikeTransactionService { + public function __construct(private Transaction $transaction) {} public function search( ?string $serialNumber = null, diff --git a/src/backend/app/modules/Transaction/Export/TransactionExportService.php b/src/backend/app/modules/Transaction/Export/TransactionExportService.php index 4d17556e7..90acf6a87 100644 --- a/src/backend/app/modules/Transaction/Export/TransactionExportService.php +++ b/src/backend/app/modules/Transaction/Export/TransactionExportService.php @@ -4,14 +4,12 @@ use App\Services\AbstractExportService; -class TransactionExportService extends AbstractExportService -{ +class TransactionExportService extends AbstractExportService { private $path = __DIR__.'/export_transactions_template.xlsx'; private $transactionData; - public function writeTransactionData(): void - { + public function writeTransactionData(): void { $this->setActivatedSheet('Sheet1'); foreach ($this->exportingData as $key => $value) { @@ -29,8 +27,7 @@ public function writeTransactionData(): void } } - public function setExportingData(): void - { + public function setExportingData(): void { $this->exportingData = $this->transactionData->map(function ($transaction) { $status = $transaction->originalTransaction->status == 1 ? 'Success' : ($transaction->status == 0 ? 'Pending' : 'Failed'); $readableAmount = $this->readable($transaction->amount); @@ -47,18 +44,15 @@ public function setExportingData(): void }); } - public function setTransactionData($transactionData): void - { + public function setTransactionData($transactionData): void { $this->transactionData = $transactionData; } - public function getTemplatePath(): string - { + public function getTemplatePath(): string { return storage_path('transaction/export_transactions_template.xlsx'); } - public function getPrefix(): string - { + public function getPrefix(): string { return 'TransactionExport'; } } diff --git a/src/backend/app/modules/Transaction/FullySupportedTransactionInterface.php b/src/backend/app/modules/Transaction/FullySupportedTransactionInterface.php index 8a87439b8..f0f4374da 100644 --- a/src/backend/app/modules/Transaction/FullySupportedTransactionInterface.php +++ b/src/backend/app/modules/Transaction/FullySupportedTransactionInterface.php @@ -4,7 +4,6 @@ namespace MPM\Transaction; -interface FullySupportedTransactionInterface -{ +interface FullySupportedTransactionInterface { public static function getTransactionName(): string; } diff --git a/src/backend/app/modules/Transaction/MeterTransactionService.php b/src/backend/app/modules/Transaction/MeterTransactionService.php index b72071e1a..3a2db9e5b 100644 --- a/src/backend/app/modules/Transaction/MeterTransactionService.php +++ b/src/backend/app/modules/Transaction/MeterTransactionService.php @@ -5,11 +5,8 @@ use App\Models\Meter\Meter; use App\Models\Transaction\Transaction; -class MeterTransactionService -{ - public function __construct(private Transaction $transaction) - { - } +class MeterTransactionService { + public function __construct(private Transaction $transaction) {} public function search( ?string $serialNumber = null, diff --git a/src/backend/app/modules/Transaction/Provider/AgentTransactionProvider.php b/src/backend/app/modules/Transaction/Provider/AgentTransactionProvider.php index c57ba5a5e..dcbf7548d 100644 --- a/src/backend/app/modules/Transaction/Provider/AgentTransactionProvider.php +++ b/src/backend/app/modules/Transaction/Provider/AgentTransactionProvider.php @@ -12,19 +12,16 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\ModelNotFoundException; -class AgentTransactionProvider implements ITransactionProvider -{ +class AgentTransactionProvider implements ITransactionProvider { private array $validData; public function __construct( private AgentTransactionModel $agentTransaction, private Transaction $transaction, private FirebaseService $fireBaseService, - ) { - } + ) {} - public function saveTransaction(): void - { + public function saveTransaction(): void { $this->agentTransaction = new AgentTransactionModel(); $this->transaction = new Transaction(); // assign data @@ -33,8 +30,7 @@ public function saveTransaction(): void $this->saveData($this->agentTransaction); } - private function assignData(array $data): void - { + private function assignData(array $data): void { // provider specific data $this->agentTransaction->agent_id = (int) $data['agent_id']; $this->agentTransaction->device_id = (int) $data['device_id']; @@ -47,13 +43,11 @@ private function assignData(array $data): void $this->transaction->original_transaction_type = 'agent_transaction'; } - public function saveData(AgentTransactionModel $agentTransaction): void - { + public function saveData(AgentTransactionModel $agentTransaction): void { $agentTransaction->save(); } - public function sendResult(bool $requestType, Transaction $transaction): void - { + public function sendResult(bool $requestType, Transaction $transaction): void { $this->agentTransaction->update(['status' => $requestType === true ? 1 : -1]); $agent = $this->agentTransaction->agent; @@ -95,8 +89,7 @@ public function sendResult(bool $requestType, Transaction $transaction): void $this->fireBaseService->sendNotify($agent->fire_base_token, $body); } - private function prepareBodySuccess(Transaction $transaction): array - { + private function prepareBodySuccess(Transaction $transaction): array { $transaction = Transaction::with( 'token', 'originalTransaction', @@ -118,8 +111,7 @@ private function prepareBodySuccess(Transaction $transaction): array ]; } - private function prepareBodyFail(Transaction $transaction): array - { + private function prepareBodyFail(Transaction $transaction): array { return [ 'message' => 'Transaction failed', 'type' => 'agent_transaction', @@ -129,8 +121,7 @@ private function prepareBodyFail(Transaction $transaction): array ]; } - public function validateRequest($request): void - { + public function validateRequest($request): void { $deviceId = request()->header('device-id'); $agent = Agent::query()->find(auth('agent_api')->user()->id); $agentId = $agent->id; @@ -151,39 +142,32 @@ public function validateRequest($request): void $this->validData['agent_id'] = $agentId; } - public function confirm(): void - { + public function confirm(): void { // No need to confirm the trigger request } - public function getMessage(): string - { + public function getMessage(): string { return $this->transaction->message; } - public function getAmount(): int - { + public function getAmount(): int { return $this->transaction->amount; } - public function getSender(): string - { + public function getSender(): string { return $this->transaction->sender; } - public function saveCommonData(): Model - { + public function saveCommonData(): Model { return $this->agentTransaction->transaction()->save($this->transaction); } - public function init($transaction): void - { + public function init($transaction): void { $this->agentTransaction = $transaction; $this->transaction = $transaction->transaction()->first(); } - public function addConflict(?string $message): void - { + public function addConflict(?string $message): void { $conflict = new TransactionConflicts(); $conflict->state = $message; $conflict->transaction()->associate($this->agentTransaction); @@ -191,8 +175,7 @@ public function addConflict(?string $message): void $this->agentTransaction->update(['status' => -1]); } - public function getTransaction(): Transaction - { + public function getTransaction(): Transaction { return $this->transaction; } } diff --git a/src/backend/app/modules/Transaction/Provider/AirtelTransactionProvider.php b/src/backend/app/modules/Transaction/Provider/AirtelTransactionProvider.php index 02e5022be..a713246fe 100644 --- a/src/backend/app/modules/Transaction/Provider/AirtelTransactionProvider.php +++ b/src/backend/app/modules/Transaction/Provider/AirtelTransactionProvider.php @@ -13,16 +13,12 @@ use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Validator; -class AirtelTransactionProvider implements ITransactionProvider -{ +class AirtelTransactionProvider implements ITransactionProvider { private \SimpleXMLElement $validData; - public function __construct(private AirtelTransaction $airtelTransaction, private Transaction $transaction) - { - } + public function __construct(private AirtelTransaction $airtelTransaction, private Transaction $transaction) {} - public function saveTransaction(): void - { + public function saveTransaction(): void { $this->airtelTransaction = new AirtelTransaction(); $this->transaction = new Transaction(); // assign data @@ -32,8 +28,7 @@ public function saveTransaction(): void $this->saveData($this->airtelTransaction); } - public function sendResult(bool $requestType, Transaction $transaction): void - { + public function sendResult(bool $requestType, Transaction $transaction): void { // approve transaction : airtel transactions are automatically confirmed thus // only save it as successful if ($requestType) { @@ -67,8 +62,7 @@ public function sendResult(bool $requestType, Transaction $transaction): void } } - public function validateRequest($request): bool - { + public function validateRequest($request): bool { $transactionXml = new \SimpleXMLElement($request); $transactionData = json_encode($transactionXml); $transactionData = json_decode($transactionData, true); @@ -97,8 +91,7 @@ public function validateRequest($request): bool return true; } - public function confirm(): void - { + public function confirm(): void { echo $xmlResponse = ''. ''. @@ -112,34 +105,28 @@ public function confirm(): void ''; } - public function getMessage(): string - { + public function getMessage(): string { return $this->transaction->message; } - public function getAmount(): int - { + public function getAmount(): int { return $this->transaction->amount; } - public function getSender(): string - { + public function getSender(): string { return $this->transaction->sender; } - public function saveCommonData(): Model - { + public function saveCommonData(): Model { return $this->airtelTransaction->transaction()->save($this->transaction); } - public function init($transaction): void - { + public function init($transaction): void { $this->airtelTransaction = $transaction; $this->transaction = $transaction->transaction()->first(); } - private function assignData(\SimpleXMLElement $data): void - { + private function assignData(\SimpleXMLElement $data): void { // provider specific data $this->airtelTransaction->interface_id = (string) $data->INTERFACEID; $this->airtelTransaction->business_number = (string) $data->BusinessNumber; @@ -154,22 +141,19 @@ private function assignData(\SimpleXMLElement $data): void /** * Saves the airtel transaction. */ - public function saveData(AirtelTransaction $airtelTransaction): void - { + public function saveData(AirtelTransaction $airtelTransaction): void { $airtelTransaction->save(); event('transaction.confirm'); } - public function addConflict(?string $message): void - { + public function addConflict(?string $message): void { $conflict = new TransactionConflicts(); $conflict->state = $message; $conflict->transaction()->associate($this->airtelTransaction); $conflict->save(); } - public function getTransaction(): Transaction - { + public function getTransaction(): Transaction { return $this->transaction; } diff --git a/src/backend/app/modules/Transaction/Provider/AirtelVoltTerraProvider.php b/src/backend/app/modules/Transaction/Provider/AirtelVoltTerraProvider.php index 9256ab430..a2673006d 100644 --- a/src/backend/app/modules/Transaction/Provider/AirtelVoltTerraProvider.php +++ b/src/backend/app/modules/Transaction/Provider/AirtelVoltTerraProvider.php @@ -16,8 +16,7 @@ use Illuminate\Database\Eloquent\ModelNotFoundException; use Illuminate\Support\Facades\Validator; -class AirtelVoltTerraProvider implements ITransactionProvider -{ +class AirtelVoltTerraProvider implements ITransactionProvider { private $validData; /** @@ -26,11 +25,9 @@ class AirtelVoltTerraProvider implements ITransactionProvider public function __construct( private AirtelTransaction $airtelTransaction, private Transaction $transaction, - ) { - } + ) {} - public function saveTransaction(): void - { + public function saveTransaction(): void { $this->airtelTransaction = new AirtelTransaction(); $this->transaction = new Transaction(); // assign data @@ -40,8 +37,7 @@ public function saveTransaction(): void $this->saveData($this->airtelTransaction); } - public function sendResult(bool $requestType, Transaction $transaction): void - { + public function sendResult(bool $requestType, Transaction $transaction): void { if ($requestType) { $this->airtelTransaction->status = 1; $this->airtelTransaction->save(); @@ -53,14 +49,12 @@ public function sendResult(bool $requestType, Transaction $transaction): void } } - public function init($transaction): void - { + public function init($transaction): void { $this->airtelTransaction = $transaction; $this->transaction = $transaction->transaction()->first(); } - public function validateRequest($request): bool - { + public function validateRequest($request): bool { $meterSerial = $request['meterSerial']; $amount = $request['amount']; $validator = Validator::make([ @@ -112,8 +106,7 @@ public function validateRequest($request): bool return true; } - private function getTransactionSender($meterSerial) - { + private function getTransactionSender($meterSerial) { $meterParameter = MeterParameter::query() ->whereHas( 'meter', @@ -139,8 +132,7 @@ function ($q) use ($personId) { } } - private function assignData(): void - { + private function assignData(): void { // provider specific data $this->airtelTransaction->interface_id = 'Airtel Transactions Email Interface'; $this->airtelTransaction->business_number = 'Airtel Transactions Email Interface'; @@ -152,47 +144,39 @@ private function assignData(): void $this->transaction->message = $this->validData['meterSerial']; } - public function saveData(AirtelTransaction $airtelTransaction): void - { + public function saveData(AirtelTransaction $airtelTransaction): void { $airtelTransaction->save(); event('transaction.confirm'); } - public function saveCommonData(): Model - { + public function saveCommonData(): Model { return $this->airtelTransaction->transaction()->save($this->transaction); } - public function addConflict(?string $message): void - { + public function addConflict(?string $message): void { $conflict = new TransactionConflicts(); $conflict->state = $message; $conflict->transaction()->associate($this->airtelTransaction); $conflict->save(); } - public function confirm(): void - { + public function confirm(): void { throw new \Exception('not implemented'); } - public function getMessage(): string - { + public function getMessage(): string { throw new \Exception('not implemented'); } - public function getAmount(): int - { + public function getAmount(): int { throw new \Exception('not implemented'); } - public function getSender(): string - { + public function getSender(): string { throw new \Exception('not implemented'); } - public function getTransaction(): Transaction - { + public function getTransaction(): Transaction { throw new \Exception('not implemented'); } } diff --git a/src/backend/app/modules/Transaction/Provider/CashTransactionProvider.php b/src/backend/app/modules/Transaction/Provider/CashTransactionProvider.php index 318ac09a4..2dff48b25 100644 --- a/src/backend/app/modules/Transaction/Provider/CashTransactionProvider.php +++ b/src/backend/app/modules/Transaction/Provider/CashTransactionProvider.php @@ -7,18 +7,15 @@ use App\Models\Transaction\TransactionConflicts; use Illuminate\Database\Eloquent\Model; -class CashTransactionProvider implements ITransactionProvider -{ +class CashTransactionProvider implements ITransactionProvider { private array $validData; public function __construct( private CashTransaction $cashTransaction, private Transaction $transaction, - ) { - } + ) {} - public function saveTransaction(): void - { + public function saveTransaction(): void { $this->cashTransaction = new CashTransaction(); $this->transaction = new Transaction(); @@ -29,8 +26,7 @@ public function saveTransaction(): void $this->saveData($this->cashTransaction); } - private function assignData(array $data): void - { + private function assignData(array $data): void { // provider specific data $this->cashTransaction->user_id = (int) $data['user_id']; @@ -41,62 +37,51 @@ private function assignData(array $data): void $this->transaction->original_transaction_type = 'cash_transaction'; } - public function saveData(CashTransaction $cashTransaction): void - { + public function saveData(CashTransaction $cashTransaction): void { $cashTransaction->save(); } - public function sendResult(bool $requestType, Transaction $transaction) - { + public function sendResult(bool $requestType, Transaction $transaction) { // TODO: Implement sendResult() method. } - public function validateRequest($request) - { + public function validateRequest($request) { // TODO: Implement validateRequest() method. } - public function confirm(): void - { + public function confirm(): void { // TODO: Implement confirm() method. } - public function getMessage(): string - { + public function getMessage(): string { return ''; } - public function getAmount(): int - { + public function getAmount(): int { return $this->transaction->amount; } - public function getSender(): string - { + public function getSender(): string { return $this->transaction->sender; } - public function saveCommonData(): Model - { + public function saveCommonData(): Model { return $this->cashTransaction->transaction()->save($this->transaction); } - public function init($transaction): void - { + public function init($transaction): void { $this->cashTransaction = $transaction; $this->transaction = $transaction->transaction()->first(); } - public function addConflict(?string $message): void - { + public function addConflict(?string $message): void { $conflict = new TransactionConflicts(); $conflict->state = $message; $conflict->transaction()->associate($this->cashTransaction); $conflict->save(); } - public function getTransaction(): Transaction - { + public function getTransaction(): Transaction { return $this->transaction; } } diff --git a/src/backend/app/modules/Transaction/Provider/ITransactionProvider.php b/src/backend/app/modules/Transaction/Provider/ITransactionProvider.php index d01e639c2..ce7a048c7 100644 --- a/src/backend/app/modules/Transaction/Provider/ITransactionProvider.php +++ b/src/backend/app/modules/Transaction/Provider/ITransactionProvider.php @@ -5,8 +5,7 @@ use App\Models\Transaction\Transaction; use Illuminate\Database\Eloquent\Model; -interface ITransactionProvider -{ +interface ITransactionProvider { // saves the main transaction public function saveTransaction(); diff --git a/src/backend/app/modules/Transaction/Provider/TransactionAdapter.php b/src/backend/app/modules/Transaction/Provider/TransactionAdapter.php index 9bb19e780..4ee7e5048 100644 --- a/src/backend/app/modules/Transaction/Provider/TransactionAdapter.php +++ b/src/backend/app/modules/Transaction/Provider/TransactionAdapter.php @@ -9,13 +9,11 @@ use Inensus\WavecomPaymentProvider\Models\WaveComTransaction; use Inensus\WaveMoneyPaymentProvider\Models\WaveMoneyTransaction; -class TransactionAdapter -{ +class TransactionAdapter { /** * @param ITransactionProvider $transactionProvider */ - public static function getTransaction($transactionProvider): ?ITransactionProvider - { + public static function getTransaction($transactionProvider): ?ITransactionProvider { if ($transactionProvider instanceof VodacomTransaction) { $baseTransaction = resolve('VodacomPaymentProvider'); $baseTransaction->init($transactionProvider); diff --git a/src/backend/app/modules/Transaction/Provider/VodacomTransactionProvider.php b/src/backend/app/modules/Transaction/Provider/VodacomTransactionProvider.php index c48fa6e4f..41e6efdfe 100644 --- a/src/backend/app/modules/Transaction/Provider/VodacomTransactionProvider.php +++ b/src/backend/app/modules/Transaction/Provider/VodacomTransactionProvider.php @@ -15,8 +15,7 @@ use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Validator; -class VodacomTransactionProvider implements ITransactionProvider -{ +class VodacomTransactionProvider implements ITransactionProvider { private VodacomTransaction $vodacomTransaction; private Transaction $transaction; @@ -26,8 +25,7 @@ class VodacomTransactionProvider implements ITransactionProvider /** * Is responsible for the whole incoming Transaction process. */ - public function saveTransaction(): void - { + public function saveTransaction(): void { // initializes needed model $this->vodacomTransaction = new VodacomTransaction(); @@ -42,8 +40,7 @@ public function saveTransaction(): void /** * Sends the final state of the transaction based on resultType. */ - public function sendResult(bool $requestType, Transaction $transaction): void - { + public function sendResult(bool $requestType, Transaction $transaction): void { if (!app()->environment('production')) { return; } @@ -126,8 +123,7 @@ public function sendResult(bool $requestType, Transaction $transaction): void * * @throws \Exception */ - public function validateRequest($request): void - { + public function validateRequest($request): void { if ($request === 'JUMEME') { throw new VodacomHeartBeatException('heartbeat'); } @@ -162,8 +158,7 @@ public function validateRequest($request): void * Send a confirmation (output for incoming api request) that the transaction passed validation and will be * processed. */ - public function confirm(): void - { + public function confirm(): void { echo $xmlResponse = ''. ''. @@ -182,24 +177,21 @@ public function confirm(): void /** * The message which is been typed by the user. */ - public function getMessage(): string - { + public function getMessage(): string { return $this->transaction->message; } /** * The amount sent by the user. */ - public function getAmount(): int - { + public function getAmount(): int { return $this->transaction->amount; } /** * The number, which sent money. */ - public function getSender(): string - { + public function getSender(): string { return $this->transaction->sender; } @@ -208,16 +200,14 @@ public function getSender(): string * * @return Transaction */ - public function saveCommonData(): Model - { + public function saveCommonData(): Model { return $this->vodacomTransaction->transaction()->save($this->transaction); } /** * Assign request data to model. */ - private function assignData(\SimpleXMLElement $data): void - { + private function assignData(\SimpleXMLElement $data): void { $transaction_data = $data->request->transaction; $this->vodacomTransaction->conversation_id = (string) $transaction_data->conversationID; $this->vodacomTransaction->originator_conversation_id = (string) $transaction_data->originatorConversationID; @@ -230,15 +220,13 @@ private function assignData(\SimpleXMLElement $data): void $this->transaction->message = (string) $transaction_data->accountReference; } - public function saveData(VodacomTransaction $vodacomTransaction): void - { + public function saveData(VodacomTransaction $vodacomTransaction): void { $vodacomTransaction->save(); // confirm transaction with event('transaction.confirm', $this); } - private function prepareRequest(bool $requestType): string - { + private function prepareRequest(bool $requestType): string { $time = date('YmdHis'); $providerPassword = $this->encryptProviderPassword($time); $phonePassword = $this->encryptPhonePassword(); @@ -307,8 +295,7 @@ private function serveResult( '; } - private function encryptProviderPassword(string $time): string - { + private function encryptProviderPassword(string $time): string { $password = strtoupper( hash( 'sha256', @@ -328,8 +315,7 @@ private function encryptProviderPassword(string $time): string /** * @return string */ - private function encryptPhonePassword() - { + private function encryptPhonePassword() { $keyFile = fopen(\config()->get('services.vodacom.certs.broker'), 'rb'); $publicKey = fread($keyFile, 8192); fclose($keyFile); @@ -338,22 +324,19 @@ private function encryptPhonePassword() return base64_encode($encrypted); } - public function init($transaction): void - { + public function init($transaction): void { $this->vodacomTransaction = $transaction; $this->transaction = $transaction->transaction()->first(); } - public function addConflict(?string $message): void - { + public function addConflict(?string $message): void { $conflict = new TransactionConflicts(); $conflict->state = $message; $conflict->transaction()->associate($this->vodacomTransaction); $conflict->save(); } - public function getTransaction(): Transaction - { + public function getTransaction(): Transaction { return $this->transaction; } } diff --git a/src/backend/app/modules/Transaction/SolarHomeSystemTransactionService.php b/src/backend/app/modules/Transaction/SolarHomeSystemTransactionService.php index 14f01472f..d02b70461 100644 --- a/src/backend/app/modules/Transaction/SolarHomeSystemTransactionService.php +++ b/src/backend/app/modules/Transaction/SolarHomeSystemTransactionService.php @@ -5,11 +5,8 @@ use App\Models\SolarHomeSystem; use App\Models\Transaction\Transaction; -class SolarHomeSystemTransactionService -{ - public function __construct(private Transaction $transaction) - { - } +class SolarHomeSystemTransactionService { + public function __construct(private Transaction $transaction) {} public function search( ?string $serialNumber = null, diff --git a/src/backend/app/modules/Transaction/TransactionPaymentProcessor.php b/src/backend/app/modules/Transaction/TransactionPaymentProcessor.php index ea4c9c78d..cc22e6457 100644 --- a/src/backend/app/modules/Transaction/TransactionPaymentProcessor.php +++ b/src/backend/app/modules/Transaction/TransactionPaymentProcessor.php @@ -9,8 +9,7 @@ use App\Models\SolarHomeSystem; use MPM\Device\DeviceService; -class TransactionPaymentProcessor -{ +class TransactionPaymentProcessor { protected const PROCESSORS_BY_DEVICE_TYPE = [ Meter::RELATION_NAME => EnergyTransactionProcessor::class, SolarHomeSystem::RELATION_NAME => ApplianceTransactionProcessor::class, @@ -23,8 +22,7 @@ class TransactionPaymentProcessor EBike::RELATION_NAME => 'payment', ]; - public static function process(int $transactionId): void - { + public static function process(int $transactionId): void { $transactionService = app()->make(TransactionService::class); $transaction = $transactionService->getById($transactionId); $serialNumber = $transaction->message; diff --git a/src/backend/app/modules/Transaction/TransactionService.php b/src/backend/app/modules/Transaction/TransactionService.php index 73ab67246..ecdb90d70 100644 --- a/src/backend/app/modules/Transaction/TransactionService.php +++ b/src/backend/app/modules/Transaction/TransactionService.php @@ -15,8 +15,7 @@ * @implements IAssociative * @implements IBaseService */ -class TransactionService implements IAssociative, IBaseService -{ +class TransactionService implements IAssociative, IBaseService { public const YESTERDAY = 0; public const SAME_DAY_LAST_WEEK = 1; @@ -33,11 +32,9 @@ public function __construct( private SolarHomeSystemTransactionService $solarHomeSystemTransactionService, private ApplianceTransactionService $applianceTransactionService, private EBikeTransactionService $eBikeTransactionService, - ) { - } + ) {} - private function getTotalAmountOfConfirmedTransaction($transactionIds) - { + private function getTotalAmountOfConfirmedTransaction($transactionIds) { return $this->transaction->newQuery()->whereHasMorph( 'originalTransaction', '*', @@ -47,8 +44,7 @@ private function getTotalAmountOfConfirmedTransaction($transactionIds) ->sum('amount'); } - private function getTransactionCountByStatus($transactionIds, bool $status): int - { + private function getTransactionCountByStatus($transactionIds, bool $status): int { $status = $status === true ? 1 : 0; return $this->transaction->newQuery()->whereHasMorph( @@ -60,8 +56,7 @@ private function getTransactionCountByStatus($transactionIds, bool $status): int ->count(); } - private function getPercentage(int $base, int $wanted, bool $baseShouldGreater = true): float - { + private function getPercentage(int $base, int $wanted, bool $baseShouldGreater = true): float { if ($base === 0 || $wanted === 0) { return 0; } @@ -75,8 +70,7 @@ private function getPercentage(int $base, int $wanted, bool $baseShouldGreater = return round($percentage - 100, 2); } - public function getRelatedService(string $type): ApplianceTransactionService|MeterTransactionService|SolarHomeSystemTransactionService|EBikeTransactionService - { + public function getRelatedService(string $type): ApplianceTransactionService|MeterTransactionService|SolarHomeSystemTransactionService|EBikeTransactionService { switch ($type) { case SolarHomeSystem::RELATION_NAME: return $this->solarHomeSystemTransactionService; @@ -89,8 +83,7 @@ public function getRelatedService(string $type): ApplianceTransactionService|Met } } - public function determinePeriod($period): ?array - { + public function determinePeriod($period): ?array { $comparisonPeriod = null; switch ($period) { case self::YESTERDAY: @@ -152,8 +145,7 @@ public function determinePeriod($period): ?array return $comparisonPeriod; } - public function getByComparisonPeriod(array $comparisonPeriod): array - { + public function getByComparisonPeriod(array $comparisonPeriod): array { $currentTransactions = $this->transaction->newQuery()->whereBetween( 'created_at', [ @@ -177,8 +169,7 @@ public function getByComparisonPeriod(array $comparisonPeriod): array ]; } - public function getAnalysis($transactionIds): ?array - { + public function getAnalysis($transactionIds): ?array { if (count($transactionIds) === 0) { return null; } @@ -205,8 +196,7 @@ public function getAnalysis($transactionIds): ?array ]; } - public function getEmptyCompareResult(): array - { + public function getEmptyCompareResult(): array { return [ 'total' => 0, 'amount' => 0, @@ -217,8 +207,7 @@ public function getEmptyCompareResult(): array ]; } - public function comparePeriods(array $currentTransactions, array $pastTransactions): array - { + public function comparePeriods(array $currentTransactions, array $pastTransactions): array { $totalPercentage = $this->getPercentage($pastTransactions['total'], $currentTransactions['total'], false); $confirmationPercentage = round( $currentTransactions['confirmedPercentage'] - $pastTransactions['confirmedPercentage'], @@ -250,18 +239,15 @@ public function comparePeriods(array $currentTransactions, array $pastTransactio ]; } - public function make(array $transactionData): Transaction - { + public function make(array $transactionData): Transaction { return $this->transaction->newQuery()->make($transactionData); } - public function save($transaction): bool - { + public function save($transaction): bool { return $transaction->save(); } - public function getById(int $id): Transaction - { + public function getById(int $id): Transaction { return $this->transaction->newQuery()->with([ 'token', 'originalTransaction', @@ -271,8 +257,7 @@ public function getById(int $id): Transaction 'device' => fn ($q) => $q->whereHas('person')->with(['device', 'person'])])->find($id); } - public function getAll(?int $limit = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null): Collection|LengthAwarePaginator { if ($limit) { return $this->transaction->newQuery()->with(['originalTransaction'])->latest()->paginate($limit); } @@ -280,18 +265,15 @@ public function getAll(?int $limit = null): Collection|LengthAwarePaginator return $this->transaction->newQuery()->latest()->get(); } - public function create(array $data): Transaction - { + public function create(array $data): Transaction { throw new \Exception('Method create() not yet implemented.'); } - public function update($model, array $data): Transaction - { + public function update($model, array $data): Transaction { throw new \Exception('Method update() not yet implemented.'); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } } diff --git a/src/backend/app/modules/User/Events/UserCreatedEvent.php b/src/backend/app/modules/User/Events/UserCreatedEvent.php index 0e9a16609..28939de07 100644 --- a/src/backend/app/modules/User/Events/UserCreatedEvent.php +++ b/src/backend/app/modules/User/Events/UserCreatedEvent.php @@ -6,9 +6,6 @@ use App\Models\User; -class UserCreatedEvent -{ - public function __construct(public User $user, public bool $shouldSyncUser) - { - } +class UserCreatedEvent { + public function __construct(public User $user, public bool $shouldSyncUser) {} } diff --git a/src/backend/app/modules/User/UserEventSubscriber.php b/src/backend/app/modules/User/UserEventSubscriber.php index 6dcc4b39e..37e73d4e9 100644 --- a/src/backend/app/modules/User/UserEventSubscriber.php +++ b/src/backend/app/modules/User/UserEventSubscriber.php @@ -7,10 +7,8 @@ use Illuminate\Events\Dispatcher; use MPM\User\Events\UserCreatedEvent; -class UserEventSubscriber -{ - public function subscribe(Dispatcher $events) - { +class UserEventSubscriber { + public function subscribe(Dispatcher $events) { $events->listen([UserCreatedEvent::class], UserListener::class); } } diff --git a/src/backend/app/modules/User/UserListener.php b/src/backend/app/modules/User/UserListener.php index 66ff8a0a2..73fe1e534 100644 --- a/src/backend/app/modules/User/UserListener.php +++ b/src/backend/app/modules/User/UserListener.php @@ -11,26 +11,22 @@ use Inensus\Ticket\Services\TicketUserService; use MPM\User\Events\UserCreatedEvent; -class UserListener -{ +class UserListener { public function __construct( private DatabaseProxyService $databaseProxyService, private CompanyDatabaseService $companyDatabaseService, private TicketUserService $ticketUserService, private CompanyService $companyService, private MailHelperInterface $mailHelper, - ) { - } + ) {} - public function handle($event): void - { + public function handle($event): void { if ($event instanceof UserCreatedEvent) { $this->handleUserCreatedEvent($event); } } - public function handleUserCreatedEvent(UserCreatedEvent $event): void - { + public function handleUserCreatedEvent(UserCreatedEvent $event): void { if ($event->shouldSyncUser) { $companyDatabase = $this->companyDatabaseService->findByCompanyId($event->user->getCompanyId()); diff --git a/src/backend/composer.json b/src/backend/composer.json index 3bb59e983..d6af505e7 100644 --- a/src/backend/composer.json +++ b/src/backend/composer.json @@ -36,7 +36,6 @@ "friendsofphp/php-cs-fixer": "^3.64", "knuckleswtf/scribe": "^4.38", "larastan/larastan": "^2.0", - "laravel/pint": "^1.18", "mockery/mockery": "^1.0", "nunomaduro/collision": "^6.1", "phpstan/phpstan": "^1.1", @@ -104,8 +103,7 @@ "php-cs-fixer-fix": "php-cs-fixer fix --diff", "php-cs-fixer-check": "php-cs-fixer check --diff", "php-cs-fixer-version": "php-cs-fixer --version", - "phpstan-analyse": "phpstan analyse --memory-limit=2G --no-progress", - "lint-test":"pint --test", - "lint-repair":"pint --repair" + "phpstan-analyse": "phpstan analyse --memory-limit=2G --no-progress" + } } diff --git a/src/backend/composer.lock b/src/backend/composer.lock index d08260119..808059911 100644 --- a/src/backend/composer.lock +++ b/src/backend/composer.lock @@ -9391,72 +9391,6 @@ ], "time": "2024-10-15T19:41:22+00:00" }, - { - "name": "laravel/pint", - "version": "v1.18.1", - "source": { - "type": "git", - "url": "https://github.com/laravel/pint.git", - "reference": "35c00c05ec43e6b46d295efc0f4386ceb30d50d9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/35c00c05ec43e6b46d295efc0f4386ceb30d50d9", - "reference": "35c00c05ec43e6b46d295efc0f4386ceb30d50d9", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-mbstring": "*", - "ext-tokenizer": "*", - "ext-xml": "*", - "php": "^8.1.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^3.64.0", - "illuminate/view": "^10.48.20", - "larastan/larastan": "^2.9.8", - "laravel-zero/framework": "^10.4.0", - "mockery/mockery": "^1.6.12", - "nunomaduro/termwind": "^1.15.1", - "pestphp/pest": "^2.35.1" - }, - "bin": [ - "builds/pint" - ], - "type": "project", - "autoload": { - "psr-4": { - "App\\": "app/", - "Database\\Seeders\\": "database/seeders/", - "Database\\Factories\\": "database/factories/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nuno Maduro", - "email": "enunomaduro@gmail.com" - } - ], - "description": "An opinionated code formatter for PHP.", - "homepage": "https://laravel.com", - "keywords": [ - "format", - "formatter", - "lint", - "linter", - "php" - ], - "support": { - "issues": "https://github.com/laravel/pint/issues", - "source": "https://github.com/laravel/pint" - }, - "time": "2024-09-24T17:22:50+00:00" - }, { "name": "league/glide", "version": "2.3.0", diff --git a/src/backend/database/factories/AccessRate/AccessRateFactory.php b/src/backend/database/factories/AccessRate/AccessRateFactory.php index 247fe91d1..a82403d3a 100644 --- a/src/backend/database/factories/AccessRate/AccessRateFactory.php +++ b/src/backend/database/factories/AccessRate/AccessRateFactory.php @@ -5,12 +5,10 @@ use App\Models\AccessRate\AccessRate; use Illuminate\Database\Eloquent\Factories\Factory; -class AccessRateFactory extends Factory -{ +class AccessRateFactory extends Factory { protected $model = AccessRate::class; - public function definition(): array - { + public function definition(): array { return [ 'amount' => $this->faker->randomElement([7500, 15000]), 'period' => $this->faker->randomElement([7, 30]), diff --git a/src/backend/database/factories/AccessRatePaymentFactory.php b/src/backend/database/factories/AccessRatePaymentFactory.php index c9ca48ed9..474280d3a 100644 --- a/src/backend/database/factories/AccessRatePaymentFactory.php +++ b/src/backend/database/factories/AccessRatePaymentFactory.php @@ -6,8 +6,7 @@ use Carbon\Carbon; use Illuminate\Database\Eloquent\Factories\Factory; -class AccessRatePaymentFactory extends Factory -{ +class AccessRatePaymentFactory extends Factory { protected $model = AccessRatePayment::class; /** @@ -15,8 +14,7 @@ class AccessRatePaymentFactory extends Factory * * @return array */ - public function definition() - { + public function definition() { return [ 'debt' => 0, 'due_date' => Carbon::now()->addDays(7), diff --git a/src/backend/database/factories/Address/AddressFactory.php b/src/backend/database/factories/Address/AddressFactory.php index 80da555a6..a576201b0 100644 --- a/src/backend/database/factories/Address/AddressFactory.php +++ b/src/backend/database/factories/Address/AddressFactory.php @@ -5,8 +5,7 @@ use App\Models\Address\Address; use Illuminate\Database\Eloquent\Factories\Factory; -class AddressFactory extends Factory -{ +class AddressFactory extends Factory { protected $model = Address::class; /** @@ -14,8 +13,7 @@ class AddressFactory extends Factory * * @return array */ - public function definition() - { + public function definition() { return [ 'email' => $this->faker->unique()->safeEmail, 'phone' => $this->faker->unique()->e164PhoneNumber(), diff --git a/src/backend/database/factories/AgentAssignedApplianceFactory.php b/src/backend/database/factories/AgentAssignedApplianceFactory.php index a310a2200..e5528c9b5 100644 --- a/src/backend/database/factories/AgentAssignedApplianceFactory.php +++ b/src/backend/database/factories/AgentAssignedApplianceFactory.php @@ -5,8 +5,7 @@ use App\Models\AgentAssignedAppliances; use Illuminate\Database\Eloquent\Factories\Factory; -class AgentAssignedApplianceFactory extends Factory -{ +class AgentAssignedApplianceFactory extends Factory { protected $model = AgentAssignedAppliances::class; /** @@ -14,8 +13,7 @@ class AgentAssignedApplianceFactory extends Factory * * @return array */ - public function definition() - { + public function definition() { return [ 'agent_id' => $this->faker->numberBetween(1, 10), 'appliance_type_id' => $this->faker->numberBetween(1, 10), diff --git a/src/backend/database/factories/AgentBalanceHistoryFactory.php b/src/backend/database/factories/AgentBalanceHistoryFactory.php index cb30af397..8ec9a01e7 100644 --- a/src/backend/database/factories/AgentBalanceHistoryFactory.php +++ b/src/backend/database/factories/AgentBalanceHistoryFactory.php @@ -5,8 +5,7 @@ use App\Models\AgentBalanceHistory; use Illuminate\Database\Eloquent\Factories\Factory; -class AgentBalanceHistoryFactory extends Factory -{ +class AgentBalanceHistoryFactory extends Factory { protected $model = AgentBalanceHistory::class; /** @@ -14,8 +13,7 @@ class AgentBalanceHistoryFactory extends Factory * * @return array */ - public function definition() - { + public function definition() { return [ 'agent_id' => $this->faker->numberBetween(1, 10), 'amount' => $this->faker->randomFloat(2, 1, 100), diff --git a/src/backend/database/factories/AgentChargeFactory.php b/src/backend/database/factories/AgentChargeFactory.php index 3476cc0d4..62f2d8433 100644 --- a/src/backend/database/factories/AgentChargeFactory.php +++ b/src/backend/database/factories/AgentChargeFactory.php @@ -5,8 +5,7 @@ use App\Models\AgentCharge; use Illuminate\Database\Eloquent\Factories\Factory; -class AgentChargeFactory extends Factory -{ +class AgentChargeFactory extends Factory { protected $model = AgentCharge::class; /** @@ -14,8 +13,7 @@ class AgentChargeFactory extends Factory * * @return array */ - public function definition() - { + public function definition() { return [ 'user_id' => 1, 'amount' => $this->faker->randomDigitNotNull() * 100000, diff --git a/src/backend/database/factories/AgentCommissionFactory.php b/src/backend/database/factories/AgentCommissionFactory.php index 66edf430e..6a8bd80cd 100644 --- a/src/backend/database/factories/AgentCommissionFactory.php +++ b/src/backend/database/factories/AgentCommissionFactory.php @@ -5,8 +5,7 @@ use App\Models\AgentCommission; use Illuminate\Database\Eloquent\Factories\Factory; -class AgentCommissionFactory extends Factory -{ +class AgentCommissionFactory extends Factory { protected $model = AgentCommission::class; /** @@ -14,8 +13,7 @@ class AgentCommissionFactory extends Factory * * @return array */ - public function definition() - { + public function definition() { return [ 'name' => 'Sample Commission', 'energy_commission' => 0.05, diff --git a/src/backend/database/factories/AgentFactory.php b/src/backend/database/factories/AgentFactory.php index 2f3a0270c..d40056224 100644 --- a/src/backend/database/factories/AgentFactory.php +++ b/src/backend/database/factories/AgentFactory.php @@ -5,8 +5,7 @@ use App\Models\Agent; use Illuminate\Database\Eloquent\Factories\Factory; -class AgentFactory extends Factory -{ +class AgentFactory extends Factory { protected $model = Agent::class; /** @@ -14,8 +13,7 @@ class AgentFactory extends Factory * * @return array */ - public function definition() - { + public function definition() { return [ 'password' => '123456', 'email' => $this->faker->unique()->safeEmail, diff --git a/src/backend/database/factories/AgentReceiptFactory.php b/src/backend/database/factories/AgentReceiptFactory.php index 1c47ab510..1489f7062 100644 --- a/src/backend/database/factories/AgentReceiptFactory.php +++ b/src/backend/database/factories/AgentReceiptFactory.php @@ -5,8 +5,7 @@ use App\Models\AgentReceipt; use Illuminate\Database\Eloquent\Factories\Factory; -class AgentReceiptFactory extends Factory -{ +class AgentReceiptFactory extends Factory { protected $model = AgentReceipt::class; /** @@ -14,8 +13,7 @@ class AgentReceiptFactory extends Factory * * @return array */ - public function definition() - { + public function definition() { return [ 'user_id' => $this->faker->numberBetween(1, 10), 'agent_id' => $this->faker->numberBetween(1, 10), diff --git a/src/backend/database/factories/AgentSoldApplianceFactory.php b/src/backend/database/factories/AgentSoldApplianceFactory.php index 158533b2c..e6763271e 100644 --- a/src/backend/database/factories/AgentSoldApplianceFactory.php +++ b/src/backend/database/factories/AgentSoldApplianceFactory.php @@ -4,15 +4,13 @@ use Illuminate\Database\Eloquent\Factories\Factory; -class AgentSoldApplianceFactory extends Factory -{ +class AgentSoldApplianceFactory extends Factory { /** * Define the model's default state. * * @return array */ - public function definition() - { + public function definition() { return [ 'person_id' => $this->faker->randomNumber(), 'agent_assigned_appliance_id' => $this->faker->randomNumber(), diff --git a/src/backend/database/factories/AgentTransactionFactory.php b/src/backend/database/factories/AgentTransactionFactory.php index 6026abef6..f1c398856 100644 --- a/src/backend/database/factories/AgentTransactionFactory.php +++ b/src/backend/database/factories/AgentTransactionFactory.php @@ -5,8 +5,7 @@ use App\Models\Transaction\AgentTransaction; use Illuminate\Database\Eloquent\Factories\Factory; -class AgentTransactionFactory extends Factory -{ +class AgentTransactionFactory extends Factory { protected $model = AgentTransaction::class; /** @@ -14,8 +13,7 @@ class AgentTransactionFactory extends Factory * * @return array */ - public function definition() - { + public function definition() { return [ 'agent_id' => 1, 'device_id' => '123456789', diff --git a/src/backend/database/factories/AppliancePersonFactory.php b/src/backend/database/factories/AppliancePersonFactory.php index 40a196010..9bf1ff3d8 100644 --- a/src/backend/database/factories/AppliancePersonFactory.php +++ b/src/backend/database/factories/AppliancePersonFactory.php @@ -5,8 +5,7 @@ use App\Models\AssetPerson; use Illuminate\Database\Eloquent\Factories\Factory; -class AppliancePersonFactory extends Factory -{ +class AppliancePersonFactory extends Factory { protected $model = AssetPerson::class; /** @@ -14,8 +13,7 @@ class AppliancePersonFactory extends Factory * * @return array */ - public function definition() - { + public function definition() { return [ 'person_id' => $this->faker->numberBetween(1, 10), 'first_payment_date' => $this->faker->date(), diff --git a/src/backend/database/factories/AssetFactory.php b/src/backend/database/factories/AssetFactory.php index 870a088d8..9032d1945 100644 --- a/src/backend/database/factories/AssetFactory.php +++ b/src/backend/database/factories/AssetFactory.php @@ -5,8 +5,7 @@ use App\Models\Asset; use Illuminate\Database\Eloquent\Factories\Factory; -class AssetFactory extends Factory -{ +class AssetFactory extends Factory { protected $model = Asset::class; /** @@ -14,8 +13,7 @@ class AssetFactory extends Factory * * @return array */ - public function definition() - { + public function definition() { return [ 'name' => $this->faker->word, 'price' => $this->faker->randomDigitNotNull() * 100000, diff --git a/src/backend/database/factories/AssetTypeFactory.php b/src/backend/database/factories/AssetTypeFactory.php index b90b97225..915c376f0 100644 --- a/src/backend/database/factories/AssetTypeFactory.php +++ b/src/backend/database/factories/AssetTypeFactory.php @@ -5,8 +5,7 @@ use App\Models\AssetType; use Illuminate\Database\Eloquent\Factories\Factory; -class AssetTypeFactory extends Factory -{ +class AssetTypeFactory extends Factory { protected $model = AssetType::class; /** @@ -14,8 +13,7 @@ class AssetTypeFactory extends Factory * * @return array */ - public function definition() - { + public function definition() { return [ 'name' => $this->faker->word, ]; diff --git a/src/backend/database/factories/CityFactory.php b/src/backend/database/factories/CityFactory.php index 55b211486..54d0a3f8c 100644 --- a/src/backend/database/factories/CityFactory.php +++ b/src/backend/database/factories/CityFactory.php @@ -6,8 +6,7 @@ use Faker\Provider\en_NG\Address; use Illuminate\Database\Eloquent\Factories\Factory; -class CityFactory extends Factory -{ +class CityFactory extends Factory { protected $model = City::class; public function __construct( @@ -21,8 +20,7 @@ public function __construct( * * @return array */ - public function definition() - { + public function definition() { return [ 'name' => $this->faker->city, 'country_id' => 1, diff --git a/src/backend/database/factories/ClusterFactory.php b/src/backend/database/factories/ClusterFactory.php index 66f86e5a7..918ac05ea 100644 --- a/src/backend/database/factories/ClusterFactory.php +++ b/src/backend/database/factories/ClusterFactory.php @@ -6,8 +6,7 @@ use Faker\Provider\en_NG\Address; use Illuminate\Database\Eloquent\Factories\Factory; -class ClusterFactory extends Factory -{ +class ClusterFactory extends Factory { protected $model = Cluster::class; public function __construct( @@ -21,8 +20,7 @@ public function __construct( * * @return array */ - public function definition() - { + public function definition() { return [ 'name' => 'Cluster '.$this->faker->county, 'geo_data' => '{"leaflet_id":416,"type":"manual","geojson":{"type":"Polygon","coordinates":[[[-1.0021831137920607,34.09735878800838],[-1.0037278294879668,34.08104951280351],[-0.9961758791705448,34.08001945331692],[-0.9831315606570004,34.079332746992485],[-0.9745497443261169,34.08036280647911],[-0.9889671831741885,34.09890387723834]]]},"display_name":"My Cluster","selected":true,"draw_type":"draw","lat":-0.991455885101313,"lon":34.08617119747313}', diff --git a/src/backend/database/factories/CompanyDatabaseFactory.php b/src/backend/database/factories/CompanyDatabaseFactory.php index 28080bec2..c15fe1635 100644 --- a/src/backend/database/factories/CompanyDatabaseFactory.php +++ b/src/backend/database/factories/CompanyDatabaseFactory.php @@ -5,8 +5,7 @@ use App\Models\CompanyDatabase; use Illuminate\Database\Eloquent\Factories\Factory; -class CompanyDatabaseFactory extends Factory -{ +class CompanyDatabaseFactory extends Factory { protected $model = CompanyDatabase::class; /** @@ -14,8 +13,7 @@ class CompanyDatabaseFactory extends Factory * * @return array */ - public function definition() - { + public function definition() { return [ 'company_id' => 1, 'database_name' => 'test_company_db', diff --git a/src/backend/database/factories/CompanyFactory.php b/src/backend/database/factories/CompanyFactory.php index a3ec5ad2a..0e1ae5097 100644 --- a/src/backend/database/factories/CompanyFactory.php +++ b/src/backend/database/factories/CompanyFactory.php @@ -6,8 +6,7 @@ use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Database\Eloquent\Model; -class CompanyFactory extends Factory -{ +class CompanyFactory extends Factory { protected $model = Company::class; /** @@ -15,8 +14,7 @@ class CompanyFactory extends Factory * * @return array */ - public function definition() - { + public function definition() { return [ 'name' => $this->faker->company, 'phone' => $this->faker->phoneNumber, @@ -26,8 +24,7 @@ public function definition() ]; } - public function createWithEmail(string $email): Model - { + public function createWithEmail(string $email): Model { $base = $this->definition(); $base['email'] = $email; diff --git a/src/backend/database/factories/ConnectionGroupFactory.php b/src/backend/database/factories/ConnectionGroupFactory.php index 776fd918f..aa8661d12 100644 --- a/src/backend/database/factories/ConnectionGroupFactory.php +++ b/src/backend/database/factories/ConnectionGroupFactory.php @@ -5,12 +5,10 @@ use App\Models\ConnectionGroup; use Illuminate\Database\Eloquent\Factories\Factory; -class ConnectionGroupFactory extends Factory -{ +class ConnectionGroupFactory extends Factory { protected $model = ConnectionGroup::class; - public function definition(): array - { + public function definition(): array { return [ 'name' => $this->faker->name, ]; diff --git a/src/backend/database/factories/ConnectionTypeFactory.php b/src/backend/database/factories/ConnectionTypeFactory.php index d6238f0ea..97bbe266f 100644 --- a/src/backend/database/factories/ConnectionTypeFactory.php +++ b/src/backend/database/factories/ConnectionTypeFactory.php @@ -5,12 +5,10 @@ use App\Models\ConnectionType; use Illuminate\Database\Eloquent\Factories\Factory; -class ConnectionTypeFactory extends Factory -{ +class ConnectionTypeFactory extends Factory { protected $model = ConnectionType::class; - public function definition(): array - { + public function definition(): array { return [ 'name' => $this->faker->name, ]; diff --git a/src/backend/database/factories/DeviceFactory.php b/src/backend/database/factories/DeviceFactory.php index a64a2dd32..b563631ce 100644 --- a/src/backend/database/factories/DeviceFactory.php +++ b/src/backend/database/factories/DeviceFactory.php @@ -4,15 +4,13 @@ use Illuminate\Database\Eloquent\Factories\Factory; -class DeviceFactory extends Factory -{ +class DeviceFactory extends Factory { /** * Define the model's default state. * * @return array */ - public function definition() - { + public function definition() { return [ 'device_serial' => $this->faker->unique()->uuid, ]; diff --git a/src/backend/database/factories/GeographicalInformationFactory.php b/src/backend/database/factories/GeographicalInformationFactory.php index 78bc235f7..e8fc300a0 100644 --- a/src/backend/database/factories/GeographicalInformationFactory.php +++ b/src/backend/database/factories/GeographicalInformationFactory.php @@ -5,12 +5,10 @@ use App\Models\GeographicalInformation; use Illuminate\Database\Eloquent\Factories\Factory; -class GeographicalInformationFactory extends Factory -{ +class GeographicalInformationFactory extends Factory { protected $model = GeographicalInformation::class; - private function add_random_offset_to_coordinates(string $coord_string, int $distance): string - { + private function add_random_offset_to_coordinates(string $coord_string, int $distance): string { [$lat, $lng] = explode(',', $coord_string); $lat = (float) $lat; @@ -28,8 +26,7 @@ private function add_random_offset_to_coordinates(string $coord_string, int $dis * * @return Factory */ - public function randomizePointsInVillage() - { + public function randomizePointsInVillage() { return $this->state(function (array $attributes) { return [ 'points' => $this->add_random_offset_to_coordinates($attributes['points'], 1000), @@ -42,8 +39,7 @@ public function randomizePointsInVillage() * * @return Factory */ - public function randomizePointsInHousehold() - { + public function randomizePointsInHousehold() { return $this->state(function (array $attributes) { return [ 'points' => $this->add_random_offset_to_coordinates($attributes['points'], 10), @@ -51,8 +47,7 @@ public function randomizePointsInHousehold() }); } - public function definition() - { + public function definition() { return [ 'points' => '0.000000,0.000000', ]; diff --git a/src/backend/database/factories/MainSettingsFactory.php b/src/backend/database/factories/MainSettingsFactory.php index 741c2c9c9..fb6acd078 100644 --- a/src/backend/database/factories/MainSettingsFactory.php +++ b/src/backend/database/factories/MainSettingsFactory.php @@ -6,12 +6,10 @@ use Carbon\Carbon; use Illuminate\Database\Eloquent\Factories\Factory; -class MainSettingsFactory extends Factory -{ +class MainSettingsFactory extends Factory { protected $model = MainSettingsAlias::class; - public function definition(): array - { + public function definition(): array { return [ 'site_title' => 'MPM - The easiest way to manage your Mini-Grid', 'company_name' => 'MicroPowerManager', diff --git a/src/backend/database/factories/ManufacturerFactory.php b/src/backend/database/factories/ManufacturerFactory.php index 36c654a43..dd87c423d 100644 --- a/src/backend/database/factories/ManufacturerFactory.php +++ b/src/backend/database/factories/ManufacturerFactory.php @@ -6,8 +6,7 @@ use Doctrine\Inflector\InflectorFactory; use Illuminate\Database\Eloquent\Factories\Factory; -class ManufacturerFactory extends Factory -{ +class ManufacturerFactory extends Factory { protected $model = Manufacturer::class; /** @@ -15,8 +14,7 @@ class ManufacturerFactory extends Factory * * @return Factory */ - public function isMeterManufacturer() - { + public function isMeterManufacturer() { return $this->state(function (array $attributes) { return [ 'type' => 'meter', @@ -29,8 +27,7 @@ public function isMeterManufacturer() * * @return Factory */ - public function isShsManufacturer() - { + public function isShsManufacturer() { return $this->state(function (array $attributes) { return [ 'type' => 'shs', @@ -38,8 +35,7 @@ public function isShsManufacturer() }); } - public function definition(): array - { + public function definition(): array { $inflector = InflectorFactory::create()->build(); $companyName = $this->faker->company; diff --git a/src/backend/database/factories/Meter/MeterFactory.php b/src/backend/database/factories/Meter/MeterFactory.php index 5c7417dfc..4c851ddea 100644 --- a/src/backend/database/factories/Meter/MeterFactory.php +++ b/src/backend/database/factories/Meter/MeterFactory.php @@ -5,12 +5,10 @@ use App\Models\Meter\Meter; use Illuminate\Database\Eloquent\Factories\Factory; -class MeterFactory extends Factory -{ +class MeterFactory extends Factory { protected $model = Meter::class; - public function definition() - { + public function definition() { return [ 'meter_type_id' => $this->faker->randomNumber(1), 'in_use' => false, diff --git a/src/backend/database/factories/Meter/MeterTariffFactory.php b/src/backend/database/factories/Meter/MeterTariffFactory.php index 70d7f4c07..23d0405bf 100644 --- a/src/backend/database/factories/Meter/MeterTariffFactory.php +++ b/src/backend/database/factories/Meter/MeterTariffFactory.php @@ -5,12 +5,10 @@ use App\Models\Meter\MeterTariff; use Illuminate\Database\Eloquent\Factories\Factory; -class MeterTariffFactory extends Factory -{ +class MeterTariffFactory extends Factory { protected $model = MeterTariff::class; - public function definition() - { + public function definition() { return [ 'name' => $this->faker->randomElement(['Productive Usage', 'Household Usage', 'Commercial Usage']), 'price' => 100000, diff --git a/src/backend/database/factories/Meter/MeterTypeFactory.php b/src/backend/database/factories/Meter/MeterTypeFactory.php index c1851a912..d54e9004a 100644 --- a/src/backend/database/factories/Meter/MeterTypeFactory.php +++ b/src/backend/database/factories/Meter/MeterTypeFactory.php @@ -5,8 +5,7 @@ use App\Models\Meter\MeterType; use Illuminate\Database\Eloquent\Factories\Factory; -class MeterTypeFactory extends Factory -{ +class MeterTypeFactory extends Factory { protected $model = MeterType::class; /** @@ -14,8 +13,7 @@ class MeterTypeFactory extends Factory * * @return Factory */ - public function isOnline() - { + public function isOnline() { return $this->state(function (array $attributes) { return [ 'online' => 1, @@ -23,8 +21,7 @@ public function isOnline() }); } - public function definition(): array - { + public function definition(): array { return [ 'online' => 0, 'phase' => 1, diff --git a/src/backend/database/factories/MeterConsumptionFactory.php b/src/backend/database/factories/MeterConsumptionFactory.php index f7c716242..6c328bb49 100644 --- a/src/backend/database/factories/MeterConsumptionFactory.php +++ b/src/backend/database/factories/MeterConsumptionFactory.php @@ -6,8 +6,7 @@ use Carbon\Carbon; use Illuminate\Database\Eloquent\Factories\Factory; -class MeterConsumptionFactory extends Factory -{ +class MeterConsumptionFactory extends Factory { protected $model = MeterConsumption::class; /** @@ -15,8 +14,7 @@ class MeterConsumptionFactory extends Factory * * @return array */ - public function definition() - { + public function definition() { return [ 'meter_id' => 1, 'total_consumption' => $this->faker->randomFloat(2, 0, 100), diff --git a/src/backend/database/factories/MeterParameterFactory.php b/src/backend/database/factories/MeterParameterFactory.php index 6544ff487..b964fb54c 100644 --- a/src/backend/database/factories/MeterParameterFactory.php +++ b/src/backend/database/factories/MeterParameterFactory.php @@ -5,8 +5,7 @@ use App\Models\Meter\MeterParameter; use Illuminate\Database\Eloquent\Factories\Factory; -class MeterParameterFactory extends Factory -{ +class MeterParameterFactory extends Factory { protected $model = MeterParameter::class; /** @@ -14,8 +13,7 @@ class MeterParameterFactory extends Factory * * @return array */ - public function definition() - { + public function definition() { return [ 'owner_type' => 'person', 'owner_id' => $this->faker->randomNumber(1), diff --git a/src/backend/database/factories/MeterTokenFactory.php b/src/backend/database/factories/MeterTokenFactory.php index c194249bb..0cac9dc71 100644 --- a/src/backend/database/factories/MeterTokenFactory.php +++ b/src/backend/database/factories/MeterTokenFactory.php @@ -5,8 +5,7 @@ use App\Models\Meter\MeterToken; use Illuminate\Database\Eloquent\Factories\Factory; -class MeterTokenFactory extends Factory -{ +class MeterTokenFactory extends Factory { protected $model = MeterToken::class; /** @@ -14,8 +13,7 @@ class MeterTokenFactory extends Factory * * @return array */ - public function definition() - { + public function definition() { return [ 'transaction_id' => 1, 'meter_id' => 1, diff --git a/src/backend/database/factories/MiniGridFactory.php b/src/backend/database/factories/MiniGridFactory.php index f68a51992..ad566469f 100644 --- a/src/backend/database/factories/MiniGridFactory.php +++ b/src/backend/database/factories/MiniGridFactory.php @@ -6,8 +6,7 @@ use Faker\Provider\en_NG\Address; use Illuminate\Database\Eloquent\Factories\Factory; -class MiniGridFactory extends Factory -{ +class MiniGridFactory extends Factory { protected $model = MiniGrid::class; public function __construct( @@ -21,8 +20,7 @@ public function __construct( * * @return array */ - public function definition() - { + public function definition() { return [ 'name' => 'MiniGrid '.$this->faker->region, ]; diff --git a/src/backend/database/factories/PaymentHistoryFactory.php b/src/backend/database/factories/PaymentHistoryFactory.php index f1ac99f3d..8445344c0 100644 --- a/src/backend/database/factories/PaymentHistoryFactory.php +++ b/src/backend/database/factories/PaymentHistoryFactory.php @@ -5,8 +5,7 @@ use App\Models\PaymentHistory; use Illuminate\Database\Eloquent\Factories\Factory; -class PaymentHistoryFactory extends Factory -{ +class PaymentHistoryFactory extends Factory { protected $model = PaymentHistory::class; /** @@ -14,8 +13,7 @@ class PaymentHistoryFactory extends Factory * * @return array */ - public function definition() - { + public function definition() { return [ 'id' => 1, 'transaction_id' => 1, diff --git a/src/backend/database/factories/Person/PersonFactory.php b/src/backend/database/factories/Person/PersonFactory.php index 3a3fee240..0b123b291 100644 --- a/src/backend/database/factories/Person/PersonFactory.php +++ b/src/backend/database/factories/Person/PersonFactory.php @@ -5,8 +5,7 @@ use App\Models\Person\Person; use Illuminate\Database\Eloquent\Factories\Factory; -class PersonFactory extends Factory -{ +class PersonFactory extends Factory { protected $model = Person::class; /** @@ -14,8 +13,7 @@ class PersonFactory extends Factory * * @return Factory */ - public function isCustomer() - { + public function isCustomer() { return $this->state(function (array $attributes) { return [ 'is_customer' => true, @@ -28,8 +26,7 @@ public function isCustomer() * * @return Factory */ - public function isAgent($village_name = 'Demo') - { + public function isAgent($village_name = 'Demo') { return $this->state(function (array $attributes) use ($village_name) { return [ 'is_customer' => false, @@ -42,8 +39,7 @@ public function isAgent($village_name = 'Demo') /** * Define the model's default state. */ - public function definition(): array - { + public function definition(): array { $sex = fake()->randomKey(['male', 'female']); $gender = $sex === 0 ? 'male' diff --git a/src/backend/database/factories/SmsResendInformationKeyFactory.php b/src/backend/database/factories/SmsResendInformationKeyFactory.php index 64cd743d5..fa7cf3429 100644 --- a/src/backend/database/factories/SmsResendInformationKeyFactory.php +++ b/src/backend/database/factories/SmsResendInformationKeyFactory.php @@ -5,12 +5,10 @@ use App\Models\SmsResendInformationKey; use Illuminate\Database\Eloquent\Factories\Factory; -class SmsResendInformationKeyFactory extends Factory -{ +class SmsResendInformationKeyFactory extends Factory { protected $model = SmsResendInformationKey::class; - public function definition() - { + public function definition() { return [ 'key' => 'Resend', ]; diff --git a/src/backend/database/factories/SolarHomeSystemFactory.php b/src/backend/database/factories/SolarHomeSystemFactory.php index 416670063..8b371c988 100644 --- a/src/backend/database/factories/SolarHomeSystemFactory.php +++ b/src/backend/database/factories/SolarHomeSystemFactory.php @@ -5,12 +5,10 @@ use App\Models\SolarHomeSystem; use Illuminate\Database\Eloquent\Factories\Factory; -class SolarHomeSystemFactory extends Factory -{ +class SolarHomeSystemFactory extends Factory { protected $model = SolarHomeSystem::class; - public function definition(): array - { + public function definition(): array { return [ // 'asset_id' => 1, 'serial_number' => $this->faker->unique()->uuid, diff --git a/src/backend/database/factories/SubConnectionTypeFactory.php b/src/backend/database/factories/SubConnectionTypeFactory.php index d418cb3f1..8a500ccbc 100644 --- a/src/backend/database/factories/SubConnectionTypeFactory.php +++ b/src/backend/database/factories/SubConnectionTypeFactory.php @@ -5,8 +5,7 @@ use App\Models\SubConnectionType; use Illuminate\Database\Eloquent\Factories\Factory; -class SubConnectionTypeFactory extends Factory -{ +class SubConnectionTypeFactory extends Factory { protected $model = SubConnectionType::class; /** @@ -14,8 +13,7 @@ class SubConnectionTypeFactory extends Factory * * @return array */ - public function definition() - { + public function definition() { return [ 'name' => $this->faker->word, 'connection_type_id' => $this->faker->numberBetween(1, 10), diff --git a/src/backend/database/factories/SubTargetFactory.php b/src/backend/database/factories/SubTargetFactory.php index d5e6da8ab..986ed981b 100644 --- a/src/backend/database/factories/SubTargetFactory.php +++ b/src/backend/database/factories/SubTargetFactory.php @@ -5,8 +5,7 @@ use App\Models\SubTarget; use Illuminate\Database\Eloquent\Factories\Factory; -class SubTargetFactory extends Factory -{ +class SubTargetFactory extends Factory { protected $model = SubTarget::class; /** @@ -14,8 +13,7 @@ class SubTargetFactory extends Factory * * @return array */ - public function definition() - { + public function definition() { return [ 'target_id' => $this->faker->randomNumber(1, 10), 'connection_id' => $this->faker->randomNumber(1, 10), diff --git a/src/backend/database/factories/TargetFactory.php b/src/backend/database/factories/TargetFactory.php index e87d61dc8..023ca2553 100644 --- a/src/backend/database/factories/TargetFactory.php +++ b/src/backend/database/factories/TargetFactory.php @@ -5,8 +5,7 @@ use App\Models\Target; use Illuminate\Database\Eloquent\Factories\Factory; -class TargetFactory extends Factory -{ +class TargetFactory extends Factory { protected $model = Target::class; /** @@ -14,8 +13,7 @@ class TargetFactory extends Factory * * @return array */ - public function definition() - { + public function definition() { return [ 'target_date' => $this->faker->date('Y-m-d'), 'type' => $this->faker->randomElement(['mini-grid', 'cluster']), diff --git a/src/backend/database/factories/TicketBoardFactory.php b/src/backend/database/factories/TicketBoardFactory.php index d282a9cb8..0364b847a 100644 --- a/src/backend/database/factories/TicketBoardFactory.php +++ b/src/backend/database/factories/TicketBoardFactory.php @@ -5,8 +5,7 @@ use Illuminate\Database\Eloquent\Factories\Factory; use Inensus\Ticket\Models\TicketBoard; -class TicketBoardFactory extends Factory -{ +class TicketBoardFactory extends Factory { protected $model = TicketBoard::class; /** @@ -14,8 +13,7 @@ class TicketBoardFactory extends Factory * * @return array */ - public function definition() - { + public function definition() { // includes existing board id in trello for testing return [ 'board_id' => '6291424c4e11631cfad78a37', diff --git a/src/backend/database/factories/TicketCardFactory.php b/src/backend/database/factories/TicketCardFactory.php index aaefdd8b3..9b72820a8 100644 --- a/src/backend/database/factories/TicketCardFactory.php +++ b/src/backend/database/factories/TicketCardFactory.php @@ -5,8 +5,7 @@ use Illuminate\Database\Eloquent\Factories\Factory; use Inensus\Ticket\Models\TicketCard; -class TicketCardFactory extends Factory -{ +class TicketCardFactory extends Factory { protected $model = TicketCard::class; /** @@ -14,8 +13,7 @@ class TicketCardFactory extends Factory * * @return array */ - public function definition() - { + public function definition() { // includes existing list id in trello as card_id for testing return [ 'card_id' => '62914ca11509c55ab1c1ba56', diff --git a/src/backend/database/factories/TicketFactory.php b/src/backend/database/factories/TicketFactory.php index 9a4aed5ae..f46a37ea8 100644 --- a/src/backend/database/factories/TicketFactory.php +++ b/src/backend/database/factories/TicketFactory.php @@ -5,8 +5,7 @@ use Illuminate\Database\Eloquent\Factories\Factory; use Inensus\Ticket\Models\Ticket; -class TicketFactory extends Factory -{ +class TicketFactory extends Factory { protected $model = Ticket::class; /** @@ -14,8 +13,7 @@ class TicketFactory extends Factory * * @return array */ - public function definition() - { + public function definition() { return [ 'ticket_id' => strval($this->faker->uuid), 'creator_id' => $this->faker->numberBetween(1, 10), diff --git a/src/backend/database/factories/TicketOutsourceFactory.php b/src/backend/database/factories/TicketOutsourceFactory.php index 9af5aec16..383a7210d 100644 --- a/src/backend/database/factories/TicketOutsourceFactory.php +++ b/src/backend/database/factories/TicketOutsourceFactory.php @@ -5,8 +5,7 @@ use Illuminate\Database\Eloquent\Factories\Factory; use Inensus\Ticket\Models\TicketOutsource; -class TicketOutsourceFactory extends Factory -{ +class TicketOutsourceFactory extends Factory { protected $model = TicketOutsource::class; /** @@ -14,8 +13,7 @@ class TicketOutsourceFactory extends Factory * * @return array */ - public function definition() - { + public function definition() { return [ 'ticket_id' => $this->faker->numberBetween(1, 10), 'amount' => $this->faker->numberBetween(1, 10), diff --git a/src/backend/database/factories/TicketOutsourceReportFactory.php b/src/backend/database/factories/TicketOutsourceReportFactory.php index 62e05d3b2..2fcaacf0e 100644 --- a/src/backend/database/factories/TicketOutsourceReportFactory.php +++ b/src/backend/database/factories/TicketOutsourceReportFactory.php @@ -5,8 +5,7 @@ use Illuminate\Database\Eloquent\Factories\Factory; use Inensus\Ticket\Models\TicketOutsourceReport; -class TicketOutsourceReportFactory extends Factory -{ +class TicketOutsourceReportFactory extends Factory { protected $model = TicketOutsourceReport::class; /** @@ -14,8 +13,7 @@ class TicketOutsourceReportFactory extends Factory * * @return array */ - public function definition() - { + public function definition() { return [ 'date' => $this->faker->date(), 'path' => $this->faker->url, diff --git a/src/backend/database/factories/TicketUserFactory.php b/src/backend/database/factories/TicketUserFactory.php index 1579ff051..f0f5baf06 100644 --- a/src/backend/database/factories/TicketUserFactory.php +++ b/src/backend/database/factories/TicketUserFactory.php @@ -5,8 +5,7 @@ use Illuminate\Database\Eloquent\Factories\Factory; use Inensus\Ticket\Models\TicketUser; -class TicketUserFactory extends Factory -{ +class TicketUserFactory extends Factory { protected $model = TicketUser::class; /** @@ -14,8 +13,7 @@ class TicketUserFactory extends Factory * * @return array */ - public function definition() - { + public function definition() { return [ 'user_name' => $this->faker->name, 'user_tag' => $this->faker->word, diff --git a/src/backend/database/factories/TimeOfUsageFactory.php b/src/backend/database/factories/TimeOfUsageFactory.php index b951bb2fc..0393ba9f6 100644 --- a/src/backend/database/factories/TimeOfUsageFactory.php +++ b/src/backend/database/factories/TimeOfUsageFactory.php @@ -5,8 +5,7 @@ use App\Models\TimeOfUsage; use Illuminate\Database\Eloquent\Factories\Factory; -class TimeOfUsageFactory extends Factory -{ +class TimeOfUsageFactory extends Factory { protected $model = TimeOfUsage::class; /** @@ -14,8 +13,7 @@ class TimeOfUsageFactory extends Factory * * @return array */ - public function definition() - { + public function definition() { return [ 'tariff_id' => 1, 'start' => '00:00', diff --git a/src/backend/database/factories/TransactionFactory.php b/src/backend/database/factories/TransactionFactory.php index 27c3ad3b7..10bb700d9 100644 --- a/src/backend/database/factories/TransactionFactory.php +++ b/src/backend/database/factories/TransactionFactory.php @@ -5,12 +5,10 @@ use App\Models\Transaction\Transaction; use Illuminate\Database\Eloquent\Factories\Factory; -class TransactionFactory extends Factory -{ +class TransactionFactory extends Factory { protected $model = Transaction::class; - public function definition(): array - { + public function definition(): array { return [ 'id' => $this->faker->unique()->randomNumber(), 'amount' => $this->faker->unique()->randomNumber(), diff --git a/src/backend/database/factories/UserFactory.php b/src/backend/database/factories/UserFactory.php index bd8ddd498..73a063715 100644 --- a/src/backend/database/factories/UserFactory.php +++ b/src/backend/database/factories/UserFactory.php @@ -7,8 +7,7 @@ use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Facades\Hash; -class UserFactory extends Factory -{ +class UserFactory extends Factory { protected $model = User::class; /** @@ -16,8 +15,7 @@ class UserFactory extends Factory * * @return Factory */ - public function clusterAdmin() - { + public function clusterAdmin() { return $this->state(function (array $attributes) { return [ 'name' => 'Cluster Admin', @@ -25,8 +23,7 @@ public function clusterAdmin() }); } - public function definition() - { + public function definition() { return [ 'name' => $this->faker->name, 'company_id' => DummyCompany::DUMMY_COMPANY_ID, diff --git a/src/backend/database/factories/VodacomTransactionFactory.php b/src/backend/database/factories/VodacomTransactionFactory.php index ed7982a77..2cb701498 100644 --- a/src/backend/database/factories/VodacomTransactionFactory.php +++ b/src/backend/database/factories/VodacomTransactionFactory.php @@ -5,8 +5,7 @@ use App\Models\Transaction\VodacomTransaction; use Illuminate\Database\Eloquent\Factories\Factory; -class VodacomTransactionFactory extends Factory -{ +class VodacomTransactionFactory extends Factory { /** * The name of the factory's corresponding model. * @@ -17,8 +16,7 @@ class VodacomTransactionFactory extends Factory /** * Define the model's default state. */ - public function definition(): array - { + public function definition(): array { return [ 'conversation_id' => $this->faker->unique()->randomNumber(), 'originator_conversation_id' => $this->faker->unique(true)->randomNumber(), diff --git a/src/backend/database/migrations/2022_03_10_120408_create_companies_table.php b/src/backend/database/migrations/2022_03_10_120408_create_companies_table.php index 86d746c4e..e6f0ec929 100644 --- a/src/backend/database/migrations/2022_03_10_120408_create_companies_table.php +++ b/src/backend/database/migrations/2022_03_10_120408_create_companies_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::create('companies', function (Blueprint $table) { $table->id(); $table->string('name'); @@ -27,8 +26,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::dropIfExists('companies'); } }; diff --git a/src/backend/database/migrations/2022_03_10_134450_create_company_databases_table.php b/src/backend/database/migrations/2022_03_10_134450_create_company_databases_table.php index d2b568602..038a2e2b4 100644 --- a/src/backend/database/migrations/2022_03_10_134450_create_company_databases_table.php +++ b/src/backend/database/migrations/2022_03_10_134450_create_company_databases_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::create('company_databases', function (Blueprint $table) { $table->id(); $table->integer('company_id')->unsigned(); @@ -25,8 +24,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::dropIfExists('company_databases'); } }; diff --git a/src/backend/database/migrations/2022_06_18_204649_create_database_proxies_table.php b/src/backend/database/migrations/2022_06_18_204649_create_database_proxies_table.php index 6f51e02b3..59bd8ac9c 100644 --- a/src/backend/database/migrations/2022_06_18_204649_create_database_proxies_table.php +++ b/src/backend/database/migrations/2022_06_18_204649_create_database_proxies_table.php @@ -5,8 +5,7 @@ use Illuminate\Support\Facades\Schema; return new class extends Migration { - public function up(): void - { + public function up(): void { Schema::create('database_proxies', function (Blueprint $table) { $table->id(); $table->string('email'); @@ -16,8 +15,7 @@ public function up(): void }); } - public function down(): void - { + public function down(): void { Schema::dropIfExists('database_proxies'); } }; diff --git a/src/backend/database/migrations/2022_06_21_102121_create_mpm_plugins_table.php b/src/backend/database/migrations/2022_06_21_102121_create_mpm_plugins_table.php index 252e717ed..d9907ad43 100644 --- a/src/backend/database/migrations/2022_06_21_102121_create_mpm_plugins_table.php +++ b/src/backend/database/migrations/2022_06_21_102121_create_mpm_plugins_table.php @@ -13,8 +13,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::create('mpm_plugins', function (Blueprint $table) { $table->id(); $table->string('name'); @@ -87,8 +86,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::dropIfExists('mpm_plugins'); } }; diff --git a/src/backend/database/migrations/2022_06_21_122032_add_email_to_companies_table.php b/src/backend/database/migrations/2022_06_21_122032_add_email_to_companies_table.php index 683ee1f16..21bbdd4d9 100644 --- a/src/backend/database/migrations/2022_06_21_122032_add_email_to_companies_table.php +++ b/src/backend/database/migrations/2022_06_21_122032_add_email_to_companies_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::table('companies', function (Blueprint $table) { $table->string('email'); }); @@ -22,8 +21,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::table('companies', function (Blueprint $table) { $table->dropColumn('email'); }); diff --git a/src/backend/database/migrations/2022_07_05_093903_add_tail_tag_to_mpm_plugins_table.php b/src/backend/database/migrations/2022_07_05_093903_add_tail_tag_to_mpm_plugins_table.php index 2f2079520..6210cbd40 100644 --- a/src/backend/database/migrations/2022_07_05_093903_add_tail_tag_to_mpm_plugins_table.php +++ b/src/backend/database/migrations/2022_07_05_093903_add_tail_tag_to_mpm_plugins_table.php @@ -13,8 +13,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::table('mpm_plugins', function (Blueprint $table) { $table->string('tail_tag')->nullable(); }); @@ -43,8 +42,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::table('mpm_plugins', function (Blueprint $table) { $table->dropColumn('tail_tag'); }); diff --git a/src/backend/database/migrations/2022_07_07_140545_add_installation_command_to_mpm_plugins_table.php b/src/backend/database/migrations/2022_07_07_140545_add_installation_command_to_mpm_plugins_table.php index 693d3017d..fdd6753df 100644 --- a/src/backend/database/migrations/2022_07_07_140545_add_installation_command_to_mpm_plugins_table.php +++ b/src/backend/database/migrations/2022_07_07_140545_add_installation_command_to_mpm_plugins_table.php @@ -13,8 +13,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::table('mpm_plugins', function (Blueprint $table) { $table->string('installation_command')->nullable(); }); @@ -43,8 +42,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::table('mpm_plugins', function (Blueprint $table) { $table->dropColumn('installation_command'); }); diff --git a/src/backend/database/migrations/2022_09_20_0000000_add_bulk_registration_to_mpm_plugin_table.php b/src/backend/database/migrations/2022_09_20_0000000_add_bulk_registration_to_mpm_plugin_table.php index 141572263..f843f64bd 100644 --- a/src/backend/database/migrations/2022_09_20_0000000_add_bulk_registration_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2022_09_20_0000000_add_bulk_registration_to_mpm_plugin_table.php @@ -6,8 +6,7 @@ use Illuminate\Support\Facades\DB; return new class extends Migration { - public function up() - { + public function up() { DB::table('mpm_plugins')->insert([ [ 'id' => MpmPlugin::BULK_REGISTRATION, @@ -21,8 +20,7 @@ public function up() ]); } - public function down() - { + public function down() { DB::table('mpm_plugins') ->where('id', MpmPlugin::BULK_REGISTRATION) ->delete(); diff --git a/src/backend/database/migrations/2022_11_08_0000000_add_viber_messaging_to_mpm_plugin_table.php b/src/backend/database/migrations/2022_11_08_0000000_add_viber_messaging_to_mpm_plugin_table.php index a623dc146..6fd6a8f5e 100644 --- a/src/backend/database/migrations/2022_11_08_0000000_add_viber_messaging_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2022_11_08_0000000_add_viber_messaging_to_mpm_plugin_table.php @@ -6,8 +6,7 @@ use Illuminate\Support\Facades\DB; return new class extends Migration { - public function up() - { + public function up() { DB::table('mpm_plugins')->insert([ [ 'id' => MpmPlugin::VIBER_MESSAGING, @@ -21,8 +20,7 @@ public function up() ]); } - public function down() - { + public function down() { DB::table('mpm_plugins') ->where('id', MpmPlugin::VIBER_MESSAGING) ->delete(); diff --git a/src/backend/database/migrations/2022_11_08_154321_update_email_field_for_database_proxies_table.php b/src/backend/database/migrations/2022_11_08_154321_update_email_field_for_database_proxies_table.php index b5873bd60..717b0a66d 100644 --- a/src/backend/database/migrations/2022_11_08_154321_update_email_field_for_database_proxies_table.php +++ b/src/backend/database/migrations/2022_11_08_154321_update_email_field_for_database_proxies_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::table('database_proxies', function (Blueprint $table) { $table->string('email')->unique()->change(); }); @@ -22,8 +21,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::table('database_proxies', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/2022_11_21_000000_add_wave_money_payment_to_mpm_plugin_table.php b/src/backend/database/migrations/2022_11_21_000000_add_wave_money_payment_to_mpm_plugin_table.php index 0f7e83fed..2f9f4ce5b 100644 --- a/src/backend/database/migrations/2022_11_21_000000_add_wave_money_payment_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2022_11_21_000000_add_wave_money_payment_to_mpm_plugin_table.php @@ -6,8 +6,7 @@ use Illuminate\Support\Facades\DB; return new class extends Migration { - public function up() - { + public function up() { DB::table('mpm_plugins')->insert([ [ 'id' => MpmPlugin::WAVE_MONEY_PAYMENT_PROVIDER, @@ -21,8 +20,7 @@ public function up() ]); } - public function down() - { + public function down() { DB::table('mpm_plugins') ->where('id', MpmPlugin::WAVE_MONEY_PAYMENT_PROVIDER) ->delete(); diff --git a/src/backend/database/migrations/2022_11_25_085948_create_jobs_table.php b/src/backend/database/migrations/2022_11_25_085948_create_jobs_table.php index 1be9e8a80..90d9ead73 100644 --- a/src/backend/database/migrations/2022_11_25_085948_create_jobs_table.php +++ b/src/backend/database/migrations/2022_11_25_085948_create_jobs_table.php @@ -4,15 +4,13 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class CreateJobsTable extends Migration -{ +class CreateJobsTable extends Migration { /** * Run the migrations. * * @return void */ - public function up() - { + public function up() { Schema::create('jobs', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('queue')->index(); @@ -29,8 +27,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::dropIfExists('jobs'); } } diff --git a/src/backend/database/migrations/2022_11_25_091725_create_company_jobs.php b/src/backend/database/migrations/2022_11_25_091725_create_company_jobs.php index f5cb6bfaf..47043d85e 100644 --- a/src/backend/database/migrations/2022_11_25_091725_create_company_jobs.php +++ b/src/backend/database/migrations/2022_11_25_091725_create_company_jobs.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::create('company_jobs', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('job_name'); @@ -27,8 +26,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::disableForeignKeyConstraints(); Schema::dropIfExists('company_jobs'); Schema::enableForeignKeyConstraints(); diff --git a/src/backend/database/migrations/2022_11_29_000000_add_micro_star_to_mpm_plugin_table.php b/src/backend/database/migrations/2022_11_29_000000_add_micro_star_to_mpm_plugin_table.php index 2fbfd37e8..bfb8f8663 100644 --- a/src/backend/database/migrations/2022_11_29_000000_add_micro_star_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2022_11_29_000000_add_micro_star_to_mpm_plugin_table.php @@ -6,8 +6,7 @@ use Illuminate\Support\Facades\DB; return new class extends Migration { - public function up() - { + public function up() { DB::table('mpm_plugins')->insert([ [ 'id' => MpmPlugin::MICRO_STAR_METERS, @@ -21,8 +20,7 @@ public function up() ]); } - public function down() - { + public function down() { DB::table('mpm_plugins') ->where('id', MpmPlugin::MICRO_STAR_METERS) ->delete(); diff --git a/src/backend/database/migrations/2022_12_12_000000_add_root_class_to_mpm_plugins_table.php b/src/backend/database/migrations/2022_12_12_000000_add_root_class_to_mpm_plugins_table.php index 052cf053a..242b651bd 100644 --- a/src/backend/database/migrations/2022_12_12_000000_add_root_class_to_mpm_plugins_table.php +++ b/src/backend/database/migrations/2022_12_12_000000_add_root_class_to_mpm_plugins_table.php @@ -13,8 +13,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::table('mpm_plugins', function (Blueprint $table) { $table->string('root_class')->nullable(); }); @@ -47,8 +46,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::table('mpm_plugins', function (Blueprint $table) { $table->dropColumn('root_class'); }); diff --git a/src/backend/database/migrations/2022_14_12_000000_add_sun_king_to_mpm_plugin_table.php b/src/backend/database/migrations/2022_14_12_000000_add_sun_king_to_mpm_plugin_table.php index ee5dee0f3..e68465e30 100644 --- a/src/backend/database/migrations/2022_14_12_000000_add_sun_king_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2022_14_12_000000_add_sun_king_to_mpm_plugin_table.php @@ -6,8 +6,7 @@ use Illuminate\Support\Facades\DB; return new class extends Migration { - public function up() - { + public function up() { DB::table('mpm_plugins')->insert([ [ 'id' => MpmPlugin::SUN_KING_SHS, @@ -22,8 +21,7 @@ public function up() ]); } - public function down() - { + public function down() { DB::table('mpm_plugins') ->where('id', MpmPlugin::SUN_KING_SHS) ->delete(); diff --git a/src/backend/database/migrations/2023_01_24_110414_create_protected_pages_table.php b/src/backend/database/migrations/2023_01_24_110414_create_protected_pages_table.php index 37e51a3b8..2adbdaa6b 100644 --- a/src/backend/database/migrations/2023_01_24_110414_create_protected_pages_table.php +++ b/src/backend/database/migrations/2023_01_24_110414_create_protected_pages_table.php @@ -12,8 +12,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::create('protected_pages', function (Blueprint $table) { $table->id(); $table->string('name'); @@ -179,8 +178,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::dropIfExists('protected_pages'); } }; diff --git a/src/backend/database/migrations/2023_01_24_112359_add_protected_page_password_to_companies_table.php b/src/backend/database/migrations/2023_01_24_112359_add_protected_page_password_to_companies_table.php index 0ed96210f..dec84277d 100644 --- a/src/backend/database/migrations/2023_01_24_112359_add_protected_page_password_to_companies_table.php +++ b/src/backend/database/migrations/2023_01_24_112359_add_protected_page_password_to_companies_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::table('companies', function (Blueprint $table) { $table->string('protected_page_password')->nullable(); }); @@ -22,8 +21,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::table('companies', function (Blueprint $table) { $table->dropColumn('protected_page_password'); }); diff --git a/src/backend/database/migrations/2023_02_06_000000_add_gome_long_to_mpm_plugin_table.php b/src/backend/database/migrations/2023_02_06_000000_add_gome_long_to_mpm_plugin_table.php index 7bacd70cf..522846f9c 100644 --- a/src/backend/database/migrations/2023_02_06_000000_add_gome_long_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2023_02_06_000000_add_gome_long_to_mpm_plugin_table.php @@ -6,8 +6,7 @@ use Illuminate\Support\Facades\DB; return new class extends Migration { - public function up() - { + public function up() { DB::table('mpm_plugins')->insert([ [ 'id' => MpmPlugin::GOME_LONG_METERS, @@ -22,8 +21,7 @@ public function up() ]); } - public function down() - { + public function down() { DB::table('mpm_plugins') ->where('id', MpmPlugin::GOME_LONG_METERS) ->delete(); diff --git a/src/backend/database/migrations/2023_04_02_121811_add_wavecom_to_mpm_plugin_table.php b/src/backend/database/migrations/2023_04_02_121811_add_wavecom_to_mpm_plugin_table.php index b0bf2b309..552ca919d 100644 --- a/src/backend/database/migrations/2023_04_02_121811_add_wavecom_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2023_04_02_121811_add_wavecom_to_mpm_plugin_table.php @@ -6,8 +6,7 @@ use Illuminate\Support\Facades\DB; return new class extends Migration { - public function up() - { + public function up() { DB::table('mpm_plugins')->insert([ [ 'id' => MpmPlugin::WAVECOM_PAYMENT_PROVIDER, @@ -22,8 +21,7 @@ public function up() ]); } - public function down() - { + public function down() { DB::table('mpm_plugins') ->where('id', MpmPlugin::WAVECOM_PAYMENT_PROVIDER) ->delete(); diff --git a/src/backend/database/migrations/2023_11_23_134944_update_description_column_in_mpm_plugins_table.php b/src/backend/database/migrations/2023_11_23_134944_update_description_column_in_mpm_plugins_table.php index 4157e3ac7..09ff8a571 100644 --- a/src/backend/database/migrations/2023_11_23_134944_update_description_column_in_mpm_plugins_table.php +++ b/src/backend/database/migrations/2023_11_23_134944_update_description_column_in_mpm_plugins_table.php @@ -13,8 +13,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::table('mpm_plugins', function (Blueprint $table) { $table->text('description')->change(); }); @@ -37,8 +36,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { $mpm_plugins_mapping = [ MpmPlugin::STEAMACO_METER => 'This plugin integrates Steamaco meters to Micropowermanager. It uses the same credentials as ui.steama.co for authentication. After it got authenticated, the plugin synchronizes Site, Customer ..', MpmPlugin::BULK_REGISTRATION => 'This plugin provides bulk registration of the company\'s existing records. NOTE: Please do not use this plugin to register your Spark & Stemaco meter records. These records will be synchronized automatically once you configure your credential settings for these plugins.', diff --git a/src/backend/database/migrations/2024_01_01_000000_add_daly_bms_to_mpm_plugin_table.php b/src/backend/database/migrations/2024_01_01_000000_add_daly_bms_to_mpm_plugin_table.php index e16792502..beec8e793 100644 --- a/src/backend/database/migrations/2024_01_01_000000_add_daly_bms_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2024_01_01_000000_add_daly_bms_to_mpm_plugin_table.php @@ -6,8 +6,7 @@ use Illuminate\Support\Facades\DB; return new class extends Migration { - public function up() - { + public function up() { DB::table('mpm_plugins')->insert([ [ 'id' => MpmPlugin::DALY_BMS, @@ -22,8 +21,7 @@ public function up() ]); } - public function down() - { + public function down() { DB::table('mpm_plugins') ->where('id', MpmPlugin::DALY_BMS) ->delete(); diff --git a/src/backend/database/migrations/2024_01_12_000000_add_angaza_to_mpm_plugin_table.php b/src/backend/database/migrations/2024_01_12_000000_add_angaza_to_mpm_plugin_table.php index 388e3631b..1927b7929 100644 --- a/src/backend/database/migrations/2024_01_12_000000_add_angaza_to_mpm_plugin_table.php +++ b/src/backend/database/migrations/2024_01_12_000000_add_angaza_to_mpm_plugin_table.php @@ -6,8 +6,7 @@ use Illuminate\Support\Facades\DB; return new class extends Migration { - public function up() - { + public function up() { DB::table('mpm_plugins')->insert([ [ 'id' => MpmPlugin::AGAZA_SHS, @@ -22,8 +21,7 @@ public function up() ]); } - public function down() - { + public function down() { DB::table('mpm_plugins') ->where('id', MpmPlugin::AGAZA_SHS) ->delete(); diff --git a/src/backend/database/migrations/2024_02_07_100345_create_usage_types_table.php b/src/backend/database/migrations/2024_02_07_100345_create_usage_types_table.php index d97075caf..75d2e3707 100644 --- a/src/backend/database/migrations/2024_02_07_100345_create_usage_types_table.php +++ b/src/backend/database/migrations/2024_02_07_100345_create_usage_types_table.php @@ -12,8 +12,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::create('usage_types', function (Blueprint $table) { $table->id(); $table->string('name'); @@ -72,8 +71,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::dropIfExists('usage_types'); } }; diff --git a/src/backend/database/migrations/2024_02_07_113319_add_usage_type_column_to_mpm_plugins_table.php b/src/backend/database/migrations/2024_02_07_113319_add_usage_type_column_to_mpm_plugins_table.php index f8f2db0b7..80e2d3d72 100644 --- a/src/backend/database/migrations/2024_02_07_113319_add_usage_type_column_to_mpm_plugins_table.php +++ b/src/backend/database/migrations/2024_02_07_113319_add_usage_type_column_to_mpm_plugins_table.php @@ -13,8 +13,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::table('mpm_plugins', function (Blueprint $table) { $table->enum('usage_type', [ 'mini-grid', @@ -57,8 +56,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::table('mpm_plugins', function (Blueprint $table) { $table->dropColumn('usage_type'); }); diff --git a/src/backend/database/migrations/2024_03_21_121825_add_message_and_trace_columns_to_company_jobs_table.php b/src/backend/database/migrations/2024_03_21_121825_add_message_and_trace_columns_to_company_jobs_table.php index f2b07ddaa..fb7fc18f9 100644 --- a/src/backend/database/migrations/2024_03_21_121825_add_message_and_trace_columns_to_company_jobs_table.php +++ b/src/backend/database/migrations/2024_03_21_121825_add_message_and_trace_columns_to_company_jobs_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::table('company_jobs', function (Blueprint $table) { $table->string('message')->nullable(); $table->string('trace')->nullable(); @@ -23,8 +22,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::table('company_jobs', function (Blueprint $table) { $table->dropColumn('message'); $table->dropColumn('trace'); diff --git a/src/backend/database/migrations/micropowermanager/2014_10_12_000000_create_users_table.php b/src/backend/database/migrations/micropowermanager/2014_10_12_000000_create_users_table.php index 5a9665ae8..4f6ea16d9 100644 --- a/src/backend/database/migrations/micropowermanager/2014_10_12_000000_create_users_table.php +++ b/src/backend/database/migrations/micropowermanager/2014_10_12_000000_create_users_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('users', function (Blueprint $table) { $table->increments('id'); $table->string('name'); @@ -28,8 +27,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('users'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2014_10_12_100000_create_password_resets_table.php b/src/backend/database/migrations/micropowermanager/2014_10_12_100000_create_password_resets_table.php index f1d5cd1e2..02627ea3d 100644 --- a/src/backend/database/migrations/micropowermanager/2014_10_12_100000_create_password_resets_table.php +++ b/src/backend/database/migrations/micropowermanager/2014_10_12_100000_create_password_resets_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('password_resets', function (Blueprint $table) { $table->string('email')->index(); $table->string('token'); @@ -24,8 +23,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('password_resets'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2018_05_24_195615_create_vodacom_transactions_table.php b/src/backend/database/migrations/micropowermanager/2018_05_24_195615_create_vodacom_transactions_table.php index c7b377d77..037351275 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_24_195615_create_vodacom_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_24_195615_create_vodacom_transactions_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('vodacom_transactions', function (Blueprint $table) { $table->increments('id'); $table->string('conversation_id')->unique(); @@ -29,8 +28,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('vodacom_transactions'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2018_05_24_201051_create_transactions_table.php b/src/backend/database/migrations/micropowermanager/2018_05_24_201051_create_transactions_table.php index 6a2bbb5ae..085069397 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_24_201051_create_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_24_201051_create_transactions_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('transactions', function (Blueprint $table) { $table->increments('id'); $table->integer('original_transaction_id'); @@ -29,8 +28,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('transactions'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2018_05_24_213335_create_airtel_transactions_table.php b/src/backend/database/migrations/micropowermanager/2018_05_24_213335_create_airtel_transactions_table.php index 0ac0b8858..80a941a1f 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_24_213335_create_airtel_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_24_213335_create_airtel_transactions_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('airtel_transactions', function (Blueprint $table) { $table->increments('id'); $table->string('interface_id'); @@ -28,8 +27,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('airtel_transactions'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2018_05_25_131106_create_payment_histories_table.php b/src/backend/database/migrations/micropowermanager/2018_05_25_131106_create_payment_histories_table.php index 0e5f8a612..d867f60af 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_25_131106_create_payment_histories_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_25_131106_create_payment_histories_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('payment_histories', function (Blueprint $table) { $table->increments('id'); $table->integer('amount'); @@ -30,8 +29,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('payment_histories'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2018_05_25_131119_create_meter_tariffs_table.php b/src/backend/database/migrations/micropowermanager/2018_05_25_131119_create_meter_tariffs_table.php index b0744f4d0..b71d598ce 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_25_131119_create_meter_tariffs_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_25_131119_create_meter_tariffs_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('meter_tariffs', function (Blueprint $table) { $table->increments('id'); $table->string('name'); @@ -28,8 +27,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('meter_tariffs'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2018_05_29_071453_create_addresses_table.php b/src/backend/database/migrations/micropowermanager/2018_05_29_071453_create_addresses_table.php index 5428f4d4d..1dddc8cce 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_29_071453_create_addresses_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_29_071453_create_addresses_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('addresses', function (Blueprint $table) { $table->increments('id'); $table->morphs('owner'); // adds owner_id and owner_type automatically @@ -32,8 +31,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('addresses'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2018_05_29_080926_create_geographical_informations_table.php b/src/backend/database/migrations/micropowermanager/2018_05_29_080926_create_geographical_informations_table.php index a52a9b450..ba4547235 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_29_080926_create_geographical_informations_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_29_080926_create_geographical_informations_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('geographical_informations', function (Blueprint $table) { $table->increments('id'); $table->integer('owner_id'); @@ -26,8 +25,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('geographical_informations'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2018_05_29_140926_create_meter_types_table.php b/src/backend/database/migrations/micropowermanager/2018_05_29_140926_create_meter_types_table.php index 0b9b325a4..46d784122 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_29_140926_create_meter_types_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_29_140926_create_meter_types_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('meter_types'); } @@ -20,8 +19,7 @@ public function down() * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('meter_types', function (Blueprint $table) { $table->increments('id'); $table->boolean('online')->default(false); diff --git a/src/backend/database/migrations/micropowermanager/2018_05_30_124521_create_meters_table.php b/src/backend/database/migrations/micropowermanager/2018_05_30_124521_create_meters_table.php index e32b18a61..23eea84ca 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_30_124521_create_meters_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_30_124521_create_meters_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('meters', function (Blueprint $table) { $table->increments('id'); $table->string('serial_number')->unique(); @@ -27,8 +26,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('meters'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2018_05_31_071601_create_manufacturers_table.php b/src/backend/database/migrations/micropowermanager/2018_05_31_071601_create_manufacturers_table.php index 0e15fcd86..036a86046 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_31_071601_create_manufacturers_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_31_071601_create_manufacturers_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('manufacturers', function (Blueprint $table) { $table->increments('id'); $table->string('name'); @@ -27,8 +26,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('manufacturers'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2018_05_31_075346_create_cities_table.php b/src/backend/database/migrations/micropowermanager/2018_05_31_075346_create_cities_table.php index 9529c29fc..f0b36ae13 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_31_075346_create_cities_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_31_075346_create_cities_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('cities', function (Blueprint $table) { $table->increments('id'); $table->string('name'); @@ -27,8 +26,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('cities'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2018_05_31_075353_create_countries_table.php b/src/backend/database/migrations/micropowermanager/2018_05_31_075353_create_countries_table.php index a62992da9..ebc6582a9 100644 --- a/src/backend/database/migrations/micropowermanager/2018_05_31_075353_create_countries_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_05_31_075353_create_countries_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('countries', function (Blueprint $table) { $table->increments('id'); $table->string('country_code'); @@ -25,8 +24,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('countries'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2018_06_01_141845_create_people_table.php b/src/backend/database/migrations/micropowermanager/2018_06_01_141845_create_people_table.php index 0139098bc..e9956cd60 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_01_141845_create_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_01_141845_create_people_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('people', function (Blueprint $table) { $table->increments('id'); $table->string('title', 50)->nullable(); @@ -32,8 +31,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('people'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2018_06_04_124637_create__roles_table.php b/src/backend/database/migrations/micropowermanager/2018_06_04_124637_create__roles_table.php index d0450ff81..c76c0850b 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_04_124637_create__roles_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_04_124637_create__roles_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('role_definitions', function (Blueprint $table) { $table->increments('id'); $table->string('role_name'); @@ -30,8 +29,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('role_definitions'); Schema::connection('shard')->dropIfExists('roles'); } diff --git a/src/backend/database/migrations/micropowermanager/2018_06_07_155444_create_meter_tokens_table.php b/src/backend/database/migrations/micropowermanager/2018_06_07_155444_create_meter_tokens_table.php index 23877aee2..1ad3eaec1 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_07_155444_create_meter_tokens_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_07_155444_create_meter_tokens_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('meter_tokens', function (Blueprint $table) { $table->increments('id'); $table->integer('transaction_id')->unique(); @@ -27,8 +26,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('meter_tokens'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2018_06_08_102610_create_meter_parameters_table.php b/src/backend/database/migrations/micropowermanager/2018_06_08_102610_create_meter_parameters_table.php index a1b6fb9b4..f8955db78 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_08_102610_create_meter_parameters_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_08_102610_create_meter_parameters_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('meter_parameters', function (Blueprint $table) { $table->increments('id'); $table->morphs('owner'); @@ -28,8 +27,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('meter_parameters'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2018_06_11_131951_create_sms_table.php b/src/backend/database/migrations/micropowermanager/2018_06_11_131951_create_sms_table.php index 61220d925..30fa50ddc 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_11_131951_create_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_11_131951_create_sms_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('sms', function (Blueprint $table) { $table->increments('id'); $table->string('receiver'); @@ -29,8 +28,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('sms'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2018_06_15_082352_create_transaction_conflicts_table.php b/src/backend/database/migrations/micropowermanager/2018_06_15_082352_create_transaction_conflicts_table.php index 6252b570d..69ef04948 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_15_082352_create_transaction_conflicts_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_15_082352_create_transaction_conflicts_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('transaction_conflicts', function (Blueprint $table) { $table->increments('id'); $table->morphs('transaction'); @@ -25,8 +24,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('transaction_conflicts'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2018_06_28_080905_create_access_rates_table.php b/src/backend/database/migrations/micropowermanager/2018_06_28_080905_create_access_rates_table.php index 4c36881bc..dd80e5004 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_28_080905_create_access_rates_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_28_080905_create_access_rates_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('access_rates', function (Blueprint $table) { $table->increments('id'); $table->integer('tariff_id'); @@ -26,8 +25,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('access_rates'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2018_06_28_080914_create_access_rate_payments_table.php b/src/backend/database/migrations/micropowermanager/2018_06_28_080914_create_access_rate_payments_table.php index 1d4ac732e..a6c2a1cfb 100644 --- a/src/backend/database/migrations/micropowermanager/2018_06_28_080914_create_access_rate_payments_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_06_28_080914_create_access_rate_payments_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('access_rate_payments', function (Blueprint $table) { $table->increments('id'); $table->integer('meter_id'); @@ -28,8 +27,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('access_rate_payments'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2018_07_11_075002_create_permission_tables.php b/src/backend/database/migrations/micropowermanager/2018_07_11_075002_create_permission_tables.php index 52a64a061..0a42ab8c0 100644 --- a/src/backend/database/migrations/micropowermanager/2018_07_11_075002_create_permission_tables.php +++ b/src/backend/database/migrations/micropowermanager/2018_07_11_075002_create_permission_tables.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { $tableNames = config('permission.table_names'); Schema::connection('shard')->create($tableNames['permissions'], function (Blueprint $table) { @@ -77,8 +76,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { $tableNames = config('permission.table_names'); Schema::connection('shard')->drop($tableNames['role_has_permissions']); diff --git a/src/backend/database/migrations/micropowermanager/2018_07_12_133700_create_loans_table.php b/src/backend/database/migrations/micropowermanager/2018_07_12_133700_create_loans_table.php index 6202eb9a0..e325372c4 100644 --- a/src/backend/database/migrations/micropowermanager/2018_07_12_133700_create_loans_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_07_12_133700_create_loans_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('loans', function (Blueprint $table) { $table->increments('id'); $table->timestamps(); @@ -23,8 +22,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('loans'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2018_07_12_134253_create_customers_table.php b/src/backend/database/migrations/micropowermanager/2018_07_12_134253_create_customers_table.php index a74747af6..b297be88c 100644 --- a/src/backend/database/migrations/micropowermanager/2018_07_12_134253_create_customers_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_07_12_134253_create_customers_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('customers', function (Blueprint $table) { $table->increments('id'); $table->morphs('role_owner'); @@ -24,8 +23,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('customers'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2018_10_04_195503_create_histories_table.php b/src/backend/database/migrations/micropowermanager/2018_10_04_195503_create_histories_table.php index fea4b8872..9b24d6788 100644 --- a/src/backend/database/migrations/micropowermanager/2018_10_04_195503_create_histories_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_10_04_195503_create_histories_table.php @@ -8,8 +8,7 @@ /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::connection('shard')->create('histories', function (Blueprint $table) { $table->increments('id'); $table->morphs('target'); // it contains a the target information @@ -23,8 +22,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::connection('shard')->dropIfExists('histories'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2018_10_12_110924_create_meter_consumptions_table.php b/src/backend/database/migrations/micropowermanager/2018_10_12_110924_create_meter_consumptions_table.php index 3780d7efd..1274451bc 100644 --- a/src/backend/database/migrations/micropowermanager/2018_10_12_110924_create_meter_consumptions_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_10_12_110924_create_meter_consumptions_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('meter_consumptions', function (Blueprint $table) { $table->increments('id'); $table->integer('meter_id'); @@ -28,8 +27,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('meter_consumptions'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2018_10_12_123911_create_payment_profiles_table.php b/src/backend/database/migrations/micropowermanager/2018_10_12_123911_create_payment_profiles_table.php index 9594e3c81..270736fea 100644 --- a/src/backend/database/migrations/micropowermanager/2018_10_12_123911_create_payment_profiles_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_10_12_123911_create_payment_profiles_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('payment_profiles', function (Blueprint $table) { $table->increments('id'); $table->timestamps(); @@ -23,8 +22,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('payment_profiles'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2018_11_29_090603_create_clusters_table.php b/src/backend/database/migrations/micropowermanager/2018_11_29_090603_create_clusters_table.php index 1c4048b7b..1a8536cd6 100644 --- a/src/backend/database/migrations/micropowermanager/2018_11_29_090603_create_clusters_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_11_29_090603_create_clusters_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('clusters', function (Blueprint $table) { $table->increments('id'); $table->string('name'); @@ -26,8 +25,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('clusters'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2018_12_05_144906_create_revenues_table.php b/src/backend/database/migrations/micropowermanager/2018_12_05_144906_create_revenues_table.php index 729380b0e..8950ecf4e 100644 --- a/src/backend/database/migrations/micropowermanager/2018_12_05_144906_create_revenues_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_12_05_144906_create_revenues_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('revenues', function (Blueprint $table) { $table->increments('id'); $table->timestamps(); @@ -23,8 +22,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('revenues'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2018_12_11_083717_create_connection_types_table.php b/src/backend/database/migrations/micropowermanager/2018_12_11_083717_create_connection_types_table.php index e35198c21..b70def4e7 100644 --- a/src/backend/database/migrations/micropowermanager/2018_12_11_083717_create_connection_types_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_12_11_083717_create_connection_types_table.php @@ -12,8 +12,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('connection_types', function (Blueprint $table) { $table->increments('id'); $table->string('name'); @@ -32,8 +31,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('connection_types'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2018_12_13_083722_create_targets_table.php b/src/backend/database/migrations/micropowermanager/2018_12_13_083722_create_targets_table.php index 5f68c0492..912e1c748 100644 --- a/src/backend/database/migrations/micropowermanager/2018_12_13_083722_create_targets_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_12_13_083722_create_targets_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('targets', function (Blueprint $table) { $table->increments('id'); $table->date('target_date'); @@ -26,8 +25,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('targets'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2018_12_13_100738_create_sub_targets_table.php b/src/backend/database/migrations/micropowermanager/2018_12_13_100738_create_sub_targets_table.php index a9d3433fa..75e19a11e 100644 --- a/src/backend/database/migrations/micropowermanager/2018_12_13_100738_create_sub_targets_table.php +++ b/src/backend/database/migrations/micropowermanager/2018_12_13_100738_create_sub_targets_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('sub_targets', function (Blueprint $table) { $table->increments('id'); $table->integer('target_id'); @@ -31,8 +30,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('sub_targets'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2019_04_19_083645_customer_group.php b/src/backend/database/migrations/micropowermanager/2019_04_19_083645_customer_group.php index dc1b08a2d..9258f34b5 100644 --- a/src/backend/database/migrations/micropowermanager/2019_04_19_083645_customer_group.php +++ b/src/backend/database/migrations/micropowermanager/2019_04_19_083645_customer_group.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('customer_groups', function (Blueprint $table) { $table->increments('id'); $table->integer('tariff_id'); @@ -25,8 +24,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('customer_groups'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2019_04_25_092438_create_sub_connection_types_table.php b/src/backend/database/migrations/micropowermanager/2019_04_25_092438_create_sub_connection_types_table.php index 4d2dff495..ebf2c41c4 100644 --- a/src/backend/database/migrations/micropowermanager/2019_04_25_092438_create_sub_connection_types_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_04_25_092438_create_sub_connection_types_table.php @@ -10,8 +10,7 @@ /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::connection('shard')->create('sub_connection_types', static function (Blueprint $table) { $table->increments('id'); $table->string('name'); @@ -32,8 +31,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::connection('shard')->dropIfExists('sub_connection_types'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2019_05_01_103123_create_connection_groups_table.php b/src/backend/database/migrations/micropowermanager/2019_05_01_103123_create_connection_groups_table.php index c19716b7a..26394d193 100644 --- a/src/backend/database/migrations/micropowermanager/2019_05_01_103123_create_connection_groups_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_05_01_103123_create_connection_groups_table.php @@ -12,8 +12,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('connection_groups', function (Blueprint $table) { $table->increments('id'); $table->string('name'); @@ -32,8 +31,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('connection_groups'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2019_05_15_122118_reports.php b/src/backend/database/migrations/micropowermanager/2019_05_15_122118_reports.php index de15e08a0..3f0e8df31 100644 --- a/src/backend/database/migrations/micropowermanager/2019_05_15_122118_reports.php +++ b/src/backend/database/migrations/micropowermanager/2019_05_15_122118_reports.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('reports', static function (Blueprint $table) { $table->increments('id'); $table->string('name'); @@ -26,8 +25,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->drop('reports'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2019_06_24_160040_create_mini_grids_table.php b/src/backend/database/migrations/micropowermanager/2019_06_24_160040_create_mini_grids_table.php index 58ae32ad7..b5a1fdacb 100644 --- a/src/backend/database/migrations/micropowermanager/2019_06_24_160040_create_mini_grids_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_06_24_160040_create_mini_grids_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('mini_grids', function (Blueprint $table) { $table->increments('id'); $table->integer('cluster_id'); @@ -26,8 +25,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('mini_grids'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2019_07_01_133655_create_maintenance_users_table.php b/src/backend/database/migrations/micropowermanager/2019_07_01_133655_create_maintenance_users_table.php index 7ed712525..54a34b1c3 100644 --- a/src/backend/database/migrations/micropowermanager/2019_07_01_133655_create_maintenance_users_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_07_01_133655_create_maintenance_users_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('maintenance_users', function (Blueprint $table) { $table->increments('id'); $table->integer('person_id'); @@ -25,8 +24,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('maintenance_users'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2019_11_06_121116_create_energies_table.php b/src/backend/database/migrations/micropowermanager/2019_11_06_121116_create_energies_table.php index ceb964f95..0a5839607 100644 --- a/src/backend/database/migrations/micropowermanager/2019_11_06_121116_create_energies_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_11_06_121116_create_energies_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('energies', function (Blueprint $table) { $table->increments('id'); $table->integer('mini_grid_id'); @@ -35,8 +34,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('energies'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2019_11_15_102431_create_solars_table.php b/src/backend/database/migrations/micropowermanager/2019_11_15_102431_create_solars_table.php index 092056f67..4f80734a2 100644 --- a/src/backend/database/migrations/micropowermanager/2019_11_15_102431_create_solars_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_11_15_102431_create_solars_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('solars', function (Blueprint $table) { $table->increments('id'); $table->integer('mini_grid_id'); @@ -34,8 +33,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('solars'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2019_11_26_063009_create_batteries_table.php b/src/backend/database/migrations/micropowermanager/2019_11_26_063009_create_batteries_table.php index e84d8693c..5c1af3658 100644 --- a/src/backend/database/migrations/micropowermanager/2019_11_26_063009_create_batteries_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_11_26_063009_create_batteries_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('batteries', function (Blueprint $table) { $table->increments('id'); $table->integer('mini_grid_id'); @@ -44,8 +43,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('batteries'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2019_12_16_090907_create_assets_table.php b/src/backend/database/migrations/micropowermanager/2019_12_16_090907_create_assets_table.php index 864a51c53..541b53561 100644 --- a/src/backend/database/migrations/micropowermanager/2019_12_16_090907_create_assets_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_12_16_090907_create_assets_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('assets', function (Blueprint $table) { $table->increments('id'); $table->string('name'); @@ -27,8 +26,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('assets'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2019_12_16_091934_create_asset_types_table.php b/src/backend/database/migrations/micropowermanager/2019_12_16_091934_create_asset_types_table.php index 7a704050b..e0ae5be26 100644 --- a/src/backend/database/migrations/micropowermanager/2019_12_16_091934_create_asset_types_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_12_16_091934_create_asset_types_table.php @@ -10,8 +10,7 @@ /** * Run the migrations. */ - public function up(): void - { + public function up(): void { Schema::connection('shard')->create('asset_types', static function (Blueprint $table) { $table->increments('id'); $table->string('name'); @@ -44,8 +43,7 @@ public function up(): void /** * Reverse the migrations. */ - public function down(): void - { + public function down(): void { Schema::connection('shard')->dropIfExists('asset_types'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2019_12_16_092044_create_asset_people_table.php b/src/backend/database/migrations/micropowermanager/2019_12_16_092044_create_asset_people_table.php index bf5851245..14a92d61d 100644 --- a/src/backend/database/migrations/micropowermanager/2019_12_16_092044_create_asset_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_12_16_092044_create_asset_people_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('asset_people', function (Blueprint $table) { $table->increments('id'); $table->integer('asset_type_id'); @@ -28,8 +27,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('asset_people'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2019_12_16_093223_create_asset_rates_table.php b/src/backend/database/migrations/micropowermanager/2019_12_16_093223_create_asset_rates_table.php index bf5ff42ba..e30b33b69 100644 --- a/src/backend/database/migrations/micropowermanager/2019_12_16_093223_create_asset_rates_table.php +++ b/src/backend/database/migrations/micropowermanager/2019_12_16_093223_create_asset_rates_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('asset_rates', function (Blueprint $table) { $table->increments('id'); $table->integer('asset_person_id'); @@ -28,8 +27,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('asset_rates'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2020_01_27_135206_create_logs_table.php b/src/backend/database/migrations/micropowermanager/2020_01_27_135206_create_logs_table.php index 8b6eb8dc4..a6114d554 100644 --- a/src/backend/database/migrations/micropowermanager/2020_01_27_135206_create_logs_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_01_27_135206_create_logs_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('logs', static function (Blueprint $table) { $table->increments('id'); $table->morphs('affected'); @@ -26,8 +25,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('logs'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2020_04_05_233604_create_p_v_s_table.php b/src/backend/database/migrations/micropowermanager/2020_04_05_233604_create_p_v_s_table.php index 4248e8a37..d1cb05bbe 100644 --- a/src/backend/database/migrations/micropowermanager/2020_04_05_233604_create_p_v_s_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_04_05_233604_create_p_v_s_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('p_v_s', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('mini_grid_id'); @@ -32,8 +31,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('p_v_s'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2020_04_19_234527_create_restrictions_table.php b/src/backend/database/migrations/micropowermanager/2020_04_19_234527_create_restrictions_table.php index 343eb5b1e..390ff4e8d 100644 --- a/src/backend/database/migrations/micropowermanager/2020_04_19_234527_create_restrictions_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_04_19_234527_create_restrictions_table.php @@ -11,8 +11,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('restrictions', static function (Blueprint $table) { $table->bigIncrements('id'); $table->string('target'); @@ -28,13 +27,11 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('restrictions'); } - public function addDefault() - { + public function addDefault() { $timeStamp = Carbon\Carbon::now(); DB::table('restrictions')->insert([ diff --git a/src/backend/database/migrations/micropowermanager/2020_04_19_235421_create_upgrades_table.php b/src/backend/database/migrations/micropowermanager/2020_04_19_235421_create_upgrades_table.php index 758fd9dc6..a75f70003 100644 --- a/src/backend/database/migrations/micropowermanager/2020_04_19_235421_create_upgrades_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_04_19_235421_create_upgrades_table.php @@ -11,8 +11,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('upgrades', static function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('restriction_id'); @@ -28,14 +27,12 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('upgrades'); } // TODO : add to seeders - public function addDefault() - { + public function addDefault() { DB::table('upgrades')->insert([ 'restriction_id' => 1, 'cost' => 36000, diff --git a/src/backend/database/migrations/micropowermanager/2020_04_20_001454_create_subscriptions_table.php b/src/backend/database/migrations/micropowermanager/2020_04_20_001454_create_subscriptions_table.php index 03f59e136..ace10ba31 100644 --- a/src/backend/database/migrations/micropowermanager/2020_04_20_001454_create_subscriptions_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_04_20_001454_create_subscriptions_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('subscriptions', static function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('upgrade_id'); @@ -26,8 +25,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('subscriptions'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2020_06_20_085555_weather_data.php b/src/backend/database/migrations/micropowermanager/2020_06_20_085555_weather_data.php index 40ce2c983..f8412b701 100644 --- a/src/backend/database/migrations/micropowermanager/2020_06_20_085555_weather_data.php +++ b/src/backend/database/migrations/micropowermanager/2020_06_20_085555_weather_data.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('weather_data', static function (Blueprint $table) { $table->increments('id'); $table->integer('solar_id'); @@ -27,8 +26,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('weather_data'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2020_06_21_131740_create_tariff_pricing_components_table.php b/src/backend/database/migrations/micropowermanager/2020_06_21_131740_create_tariff_pricing_components_table.php index 748b295cb..9142b4e37 100644 --- a/src/backend/database/migrations/micropowermanager/2020_06_21_131740_create_tariff_pricing_components_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_06_21_131740_create_tariff_pricing_components_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('tariff_pricing_components', function (Blueprint $table) { $table->id(); $table->string('name'); @@ -26,8 +25,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('tariff_pricing_components'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2020_06_21_194542_create_social_tariffs_table.php b/src/backend/database/migrations/micropowermanager/2020_06_21_194542_create_social_tariffs_table.php index 26d61b55b..5cd1a8105 100644 --- a/src/backend/database/migrations/micropowermanager/2020_06_21_194542_create_social_tariffs_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_06_21_194542_create_social_tariffs_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('social_tariffs', function (Blueprint $table) { $table->id(); $table->integer('tariff_id'); @@ -28,8 +27,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('social_tariffs'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2020_06_22_085345_create_social_tariff_piggy_banks_table.php b/src/backend/database/migrations/micropowermanager/2020_06_22_085345_create_social_tariff_piggy_banks_table.php index 61697c8b9..3e21f5a40 100644 --- a/src/backend/database/migrations/micropowermanager/2020_06_22_085345_create_social_tariff_piggy_banks_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_06_22_085345_create_social_tariff_piggy_banks_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('social_tariff_piggy_banks', function (Blueprint $table) { $table->id(); $table->integer('savings'); @@ -26,8 +25,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('social_tariff_piggy_banks'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2020_06_22_115405_add_total_price_to_meter_tariffs.php b/src/backend/database/migrations/micropowermanager/2020_06_22_115405_add_total_price_to_meter_tariffs.php index 6d311f3d0..20faeecc8 100644 --- a/src/backend/database/migrations/micropowermanager/2020_06_22_115405_add_total_price_to_meter_tariffs.php +++ b/src/backend/database/migrations/micropowermanager/2020_06_22_115405_add_total_price_to_meter_tariffs.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('meter_tariffs', function (Blueprint $table) { $table->integer('total_price')->unsigned()->nullable(); }); @@ -22,8 +21,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('meter_tariffs', function (Blueprint $table) { $table->dropColumn('total_price'); }); diff --git a/src/backend/database/migrations/micropowermanager/2020_07_12_192802_create_agents_table.php b/src/backend/database/migrations/micropowermanager/2020_07_12_192802_create_agents_table.php index 84b02871f..e5dc05c94 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_12_192802_create_agents_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_12_192802_create_agents_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('agents', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('person_id'); @@ -36,8 +35,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('agents'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2020_07_13_130601_create_agent_transactions_table.php b/src/backend/database/migrations/micropowermanager/2020_07_13_130601_create_agent_transactions_table.php index 86730eb84..ba4bb07e3 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_13_130601_create_agent_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_13_130601_create_agent_transactions_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('agent_transactions', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('agent_id'); @@ -26,8 +25,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('agent_transactions'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2020_07_13_132006_create_agent_balance_histories_table.php b/src/backend/database/migrations/micropowermanager/2020_07_13_132006_create_agent_balance_histories_table.php index e73d0b7c3..b06214f5e 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_13_132006_create_agent_balance_histories_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_13_132006_create_agent_balance_histories_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('agent_balance_histories', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('agent_id'); @@ -29,8 +28,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('agent_balance_histories'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2020_07_13_132423_create_agent_assigned_appliances_table.php b/src/backend/database/migrations/micropowermanager/2020_07_13_132423_create_agent_assigned_appliances_table.php index 6f0e7e097..e094e8d3a 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_13_132423_create_agent_assigned_appliances_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_13_132423_create_agent_assigned_appliances_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('agent_assigned_appliances', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('agent_id'); @@ -27,8 +26,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('agent_assigned_appliances'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2020_07_13_132811_create_agent_sold_appliances_table.php b/src/backend/database/migrations/micropowermanager/2020_07_13_132811_create_agent_sold_appliances_table.php index 1cc6849f5..3a8fe6ff5 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_13_132811_create_agent_sold_appliances_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_13_132811_create_agent_sold_appliances_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('agent_sold_appliances', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('person_id'); @@ -25,8 +24,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('agent_sold_appliances'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2020_07_25_083600_create_agent_commissions_table.php b/src/backend/database/migrations/micropowermanager/2020_07_25_083600_create_agent_commissions_table.php index 9002d5b8a..2321266c6 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_25_083600_create_agent_commissions_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_25_083600_create_agent_commissions_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('agent_commissions', function (Blueprint $table) { $table->id(); $table->string('name'); @@ -27,8 +26,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('agent_commissions'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2020_07_25_155837_create_agent_receipts_table.php b/src/backend/database/migrations/micropowermanager/2020_07_25_155837_create_agent_receipts_table.php index ac1b4a33f..d6e9a714b 100644 --- a/src/backend/database/migrations/micropowermanager/2020_07_25_155837_create_agent_receipts_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_07_25_155837_create_agent_receipts_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('agent_receipts', function (Blueprint $table) { $table->id(); $table->integer('agent_id'); @@ -28,8 +27,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('agent_receipts'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2020_08_03_081836_create_agent_charges_table.php b/src/backend/database/migrations/micropowermanager/2020_08_03_081836_create_agent_charges_table.php index 45f6599bc..b6423b896 100644 --- a/src/backend/database/migrations/micropowermanager/2020_08_03_081836_create_agent_charges_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_08_03_081836_create_agent_charges_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('agent_charges', function (Blueprint $table) { $table->id(); $table->integer('agent_id'); @@ -25,8 +24,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('agent_charges'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2020_08_05_133748_create_agent_receipt_details_table.php b/src/backend/database/migrations/micropowermanager/2020_08_05_133748_create_agent_receipt_details_table.php index 52dd76cea..123ad0f14 100644 --- a/src/backend/database/migrations/micropowermanager/2020_08_05_133748_create_agent_receipt_details_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_08_05_133748_create_agent_receipt_details_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('agent_receipt_details', function (Blueprint $table) { $table->id(); $table->integer('agent_receipt_id'); @@ -29,8 +28,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('agent_receipt_details'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2020_10_02_072509_create_time_of_usages_table.php b/src/backend/database/migrations/micropowermanager/2020_10_02_072509_create_time_of_usages_table.php index c41292352..ac7f33161 100644 --- a/src/backend/database/migrations/micropowermanager/2020_10_02_072509_create_time_of_usages_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_10_02_072509_create_time_of_usages_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('time_of_usages', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('tariff_id'); @@ -27,8 +26,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('time_of_usages'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2020_10_19_122517_create_sub_menu_items_table.php b/src/backend/database/migrations/micropowermanager/2020_10_19_122517_create_sub_menu_items_table.php index 7924e56bb..93ae96c7c 100644 --- a/src/backend/database/migrations/micropowermanager/2020_10_19_122517_create_sub_menu_items_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_10_19_122517_create_sub_menu_items_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('sub_menu_items', function (Blueprint $table) { $table->increments('id'); $table->char('name', 50); @@ -26,8 +25,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('sub_menu_items'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2020_10_19_122649_create_menu_items_table.php b/src/backend/database/migrations/micropowermanager/2020_10_19_122649_create_menu_items_table.php index 2d2512d7b..8bd3c1990 100644 --- a/src/backend/database/migrations/micropowermanager/2020_10_19_122649_create_menu_items_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_10_19_122649_create_menu_items_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('menu_items', function (Blueprint $table) { $table->increments('id'); $table->char('name', 50); @@ -27,8 +26,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('menu_items'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2020_10_29_170007_create_plugins_table.php b/src/backend/database/migrations/micropowermanager/2020_10_29_170007_create_plugins_table.php index b57721df7..4b799c534 100644 --- a/src/backend/database/migrations/micropowermanager/2020_10_29_170007_create_plugins_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_10_29_170007_create_plugins_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('plugins', function (Blueprint $table) { $table->id(); $table->integer('mpm_plugin_id'); @@ -25,8 +24,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('plugins'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2020_12_17_144527_create_main_settings_table.php b/src/backend/database/migrations/micropowermanager/2020_12_17_144527_create_main_settings_table.php index a9bfe2c7f..936504367 100644 --- a/src/backend/database/migrations/micropowermanager/2020_12_17_144527_create_main_settings_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_12_17_144527_create_main_settings_table.php @@ -12,8 +12,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('main_settings', function (Blueprint $table) { $table->increments('id'); $table->char('site_title', 100); @@ -44,8 +43,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('main_settings'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2020_12_23_165814_create_map_settings_table.php b/src/backend/database/migrations/micropowermanager/2020_12_23_165814_create_map_settings_table.php index 3e51dd8c6..e4ef06f47 100644 --- a/src/backend/database/migrations/micropowermanager/2020_12_23_165814_create_map_settings_table.php +++ b/src/backend/database/migrations/micropowermanager/2020_12_23_165814_create_map_settings_table.php @@ -12,8 +12,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('map_settings', function (Blueprint $table) { $table->increments('id'); $table->integer('zoom'); @@ -38,8 +37,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('map_settings'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2021_01_02_130016_add_manufacturer_transaction_to_agent_transactions_table.php b/src/backend/database/migrations/micropowermanager/2021_01_02_130016_add_manufacturer_transaction_to_agent_transactions_table.php index f9102782f..c7a7eac71 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_02_130016_add_manufacturer_transaction_to_agent_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_02_130016_add_manufacturer_transaction_to_agent_transactions_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('agent_transactions', function (Blueprint $table) { $table->string('manufacturer_transaction_type')->nullable(); $table->integer('manufacturer_transaction_id')->nullable(); @@ -23,8 +22,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('agent_transactions', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2021_01_02_130412_create_third_party_transactions.php b/src/backend/database/migrations/micropowermanager/2021_01_02_130412_create_third_party_transactions.php index 0ea1fb8d4..6d909ec95 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_02_130412_create_third_party_transactions.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_02_130412_create_third_party_transactions.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('third_party_transactions', function (Blueprint $table) { $table->id(); $table->string('transaction_id'); @@ -28,8 +27,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('third_party_transactions'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2021_01_02_134152_add_manufacturer_transaction_to_vodacom_transactions_table.php b/src/backend/database/migrations/micropowermanager/2021_01_02_134152_add_manufacturer_transaction_to_vodacom_transactions_table.php index 8d6587a9a..6512e7ed8 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_02_134152_add_manufacturer_transaction_to_vodacom_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_02_134152_add_manufacturer_transaction_to_vodacom_transactions_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('vodacom_transactions', function (Blueprint $table) { $table->string('manufacturer_transaction_type')->nullable(); $table->integer('manufacturer_transaction_id')->nullable(); @@ -23,8 +22,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('vodacom_transactions', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2021_01_02_134212_add_manufacturer_transaction_to_airtel_transactions_table.php b/src/backend/database/migrations/micropowermanager/2021_01_02_134212_add_manufacturer_transaction_to_airtel_transactions_table.php index c8ea0ae32..a5bfe97ff 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_02_134212_add_manufacturer_transaction_to_airtel_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_02_134212_add_manufacturer_transaction_to_airtel_transactions_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('airtel_transactions', function (Blueprint $table) { $table->string('manufacturer_transaction_type')->nullable(); $table->integer('manufacturer_transaction_id')->nullable(); @@ -23,8 +22,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('airtel_transactions', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2021_01_05_234039_create_ticket_settings_table.php b/src/backend/database/migrations/micropowermanager/2021_01_05_234039_create_ticket_settings_table.php index 9cdbe3bda..fd3afc23c 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_05_234039_create_ticket_settings_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_05_234039_create_ticket_settings_table.php @@ -12,8 +12,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('ticket_settings', function (Blueprint $table) { $table->increments('id'); $table->string('name'); @@ -38,8 +37,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('ticket_settings'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2021_01_18_122556_add_columns_to_batteries_table.php b/src/backend/database/migrations/micropowermanager/2021_01_18_122556_add_columns_to_batteries_table.php index 33160094d..53ba4d034 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_18_122556_add_columns_to_batteries_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_18_122556_add_columns_to_batteries_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('batteries', function (Blueprint $table) { $table->boolean('active')->default(0); $table->double('c_total')->default(0); @@ -30,8 +29,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('batteries', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2021_01_18_123245_add_columns_to_p_v_s_table.php b/src/backend/database/migrations/micropowermanager/2021_01_18_123245_add_columns_to_p_v_s_table.php index 0dd8d204d..39e929c52 100644 --- a/src/backend/database/migrations/micropowermanager/2021_01_18_123245_add_columns_to_p_v_s_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_01_18_123245_add_columns_to_p_v_s_table.php @@ -11,8 +11,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('p_v_s', function (Blueprint $table) { $table->double('max_theoretical_output')->default(0); $table->dateTime('reading_date')->default(Carbon::now()->format('Y-m-d H:i:s')); @@ -24,8 +23,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('p_v_s', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_bodies.php b/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_bodies.php index 90c658d13..d8a85c2ca 100644 --- a/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_bodies.php +++ b/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_bodies.php @@ -12,8 +12,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('sms_bodies', function (Blueprint $table) { $table->increments('id'); $table->string('reference', 50)->unique(); @@ -161,8 +160,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('sms_bodies'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_resend_information_keys.php b/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_resend_information_keys.php index 9a80c7383..68d7d38b2 100644 --- a/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_resend_information_keys.php +++ b/src/backend/database/migrations/micropowermanager/2021_02_18_153556_create_sms_resend_information_keys.php @@ -12,8 +12,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('sms_resend_information_keys', function (Blueprint $table) { $table->increments('id'); $table->string('key')->default('Resend'); @@ -32,8 +31,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('sms_resend_information_keys'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2021_02_18_156421_create_sms_appliance_remind_rates.php b/src/backend/database/migrations/micropowermanager/2021_02_18_156421_create_sms_appliance_remind_rates.php index 8ebddbbd0..1e9515978 100644 --- a/src/backend/database/migrations/micropowermanager/2021_02_18_156421_create_sms_appliance_remind_rates.php +++ b/src/backend/database/migrations/micropowermanager/2021_02_18_156421_create_sms_appliance_remind_rates.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('sms_appliance_remind_rates', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('appliance_type_id'); @@ -26,8 +25,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('sms_appliance_remind_rates'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2021_03_03_140758_create_sms_android_settings.php b/src/backend/database/migrations/micropowermanager/2021_03_03_140758_create_sms_android_settings.php index fb89c99c4..d0a1414b2 100644 --- a/src/backend/database/migrations/micropowermanager/2021_03_03_140758_create_sms_android_settings.php +++ b/src/backend/database/migrations/micropowermanager/2021_03_03_140758_create_sms_android_settings.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('sms_android_settings', function (Blueprint $table) { $table->increments('id'); $table->string('url')->default('https://fcm.googleapis.com/fcm/send'); @@ -27,8 +26,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('sms_android_settings'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2021_03_03_141706_create_sms_variable_default_values.php b/src/backend/database/migrations/micropowermanager/2021_03_03_141706_create_sms_variable_default_values.php index c4a52ea02..2b6ccc954 100644 --- a/src/backend/database/migrations/micropowermanager/2021_03_03_141706_create_sms_variable_default_values.php +++ b/src/backend/database/migrations/micropowermanager/2021_03_03_141706_create_sms_variable_default_values.php @@ -12,8 +12,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('sms_variable_default_values', function (Blueprint $table) { $table->id(); $table->string('variable'); @@ -102,8 +101,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('sms_variable_default_values'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2021_03_2_1561251_update_sms_table.php b/src/backend/database/migrations/micropowermanager/2021_03_2_1561251_update_sms_table.php index 370737ae3..cfa0c6d67 100644 --- a/src/backend/database/migrations/micropowermanager/2021_03_2_1561251_update_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_03_2_1561251_update_sms_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('sms', function (Blueprint $table) { $table->integer('status')->default(0)->change(); $table->integer('sender_id')->nullable()->change(); @@ -26,8 +25,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('sms', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2021_04_28_103758_add_additional_json_column_to_people.php b/src/backend/database/migrations/micropowermanager/2021_04_28_103758_add_additional_json_column_to_people.php index 95a98688a..35e43531b 100644 --- a/src/backend/database/migrations/micropowermanager/2021_04_28_103758_add_additional_json_column_to_people.php +++ b/src/backend/database/migrations/micropowermanager/2021_04_28_103758_add_additional_json_column_to_people.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('people', function (Blueprint $table) { $table->json('additional_json')->nullable(); }); @@ -22,8 +21,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('people', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2021_04_28_104840_create_person_documents_table.php b/src/backend/database/migrations/micropowermanager/2021_04_28_104840_create_person_documents_table.php index 665872e34..b3d88ae7a 100644 --- a/src/backend/database/migrations/micropowermanager/2021_04_28_104840_create_person_documents_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_04_28_104840_create_person_documents_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('person_documents', function (Blueprint $table) { $table->id(); $table->unsignedInteger('person_id'); @@ -27,8 +26,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('person_documents'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2021_06_04_085817_update_meter_consumptions_table.php b/src/backend/database/migrations/micropowermanager/2021_06_04_085817_update_meter_consumptions_table.php index 23371ddd6..dc26ea7f8 100644 --- a/src/backend/database/migrations/micropowermanager/2021_06_04_085817_update_meter_consumptions_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_06_04_085817_update_meter_consumptions_table.php @@ -12,8 +12,7 @@ * * @return void */ - public function up() - { + public function up() { if (!Type::hasType('double')) { Type::addType('double', FloatType::class); } @@ -28,8 +27,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('meter_consumptions', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2021_08_17_090801_add_down_payment_to_asset_people_table.php b/src/backend/database/migrations/micropowermanager/2021_08_17_090801_add_down_payment_to_asset_people_table.php index 24351a0b9..f5affa6cc 100644 --- a/src/backend/database/migrations/micropowermanager/2021_08_17_090801_add_down_payment_to_asset_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_08_17_090801_add_down_payment_to_asset_people_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('asset_people', function (Blueprint $table) { $table->double('down_payment')->nullable(); }); @@ -22,8 +21,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('asset_people', function (Blueprint $table) { $table->dropColumn('down_payment'); }); diff --git a/src/backend/database/migrations/micropowermanager/2021_08_17_090913_add_first_payment_date_to_asset_people_table.php b/src/backend/database/migrations/micropowermanager/2021_08_17_090913_add_first_payment_date_to_asset_people_table.php index 6c7f61835..d4b70d375 100644 --- a/src/backend/database/migrations/micropowermanager/2021_08_17_090913_add_first_payment_date_to_asset_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_08_17_090913_add_first_payment_date_to_asset_people_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('asset_people', function (Blueprint $table) { $table->date('first_payment_date')->nullable(); }); @@ -22,8 +21,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('asset_people', function (Blueprint $table) { $table->dropColumn('first_payment_date'); }); diff --git a/src/backend/database/migrations/micropowermanager/2021_09_07_092522_create_cash_transactions_table.php b/src/backend/database/migrations/micropowermanager/2021_09_07_092522_create_cash_transactions_table.php index 0256a7245..2c0459995 100644 --- a/src/backend/database/migrations/micropowermanager/2021_09_07_092522_create_cash_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2021_09_07_092522_create_cash_transactions_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('cash_transactions', function (Blueprint $table) { $table->id(); $table->unsignedInteger('user_id'); @@ -27,8 +26,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('cash_transactions'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2021_10_18_220817_create_mail_settings.php b/src/backend/database/migrations/micropowermanager/2021_10_18_220817_create_mail_settings.php index 6373909e0..8f2a06710 100644 --- a/src/backend/database/migrations/micropowermanager/2021_10_18_220817_create_mail_settings.php +++ b/src/backend/database/migrations/micropowermanager/2021_10_18_220817_create_mail_settings.php @@ -12,8 +12,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('mail_settings', function (Blueprint $table) { $table->increments('id'); $table->string('mail_host'); @@ -40,8 +39,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('mail_settings'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_093215_update_meter_tariffs_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_093215_update_meter_tariffs_table.php index adc97125e..a67b550e7 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_093215_update_meter_tariffs_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_093215_update_meter_tariffs_table.php @@ -12,8 +12,7 @@ * * @return void */ - public function up() - { + public function up() { if (!Type::hasType('double')) { Type::addType('double', FloatType::class); } @@ -28,8 +27,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('meter_tariffs', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_101348_update_social_tariffs_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_101348_update_social_tariffs_table.php index 0e583258e..324cb9611 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_101348_update_social_tariffs_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_101348_update_social_tariffs_table.php @@ -12,8 +12,7 @@ * * @return void */ - public function up() - { + public function up() { if (!Type::hasType('double')) { Type::addType('double', FloatType::class); } @@ -28,8 +27,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('social_tariffs', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_101616_update_tariff_pricing_components_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_101616_update_tariff_pricing_components_table.php index df5be7dff..189d2b7ed 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_101616_update_tariff_pricing_components_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_101616_update_tariff_pricing_components_table.php @@ -12,8 +12,7 @@ * * @return void */ - public function up() - { + public function up() { if (!Type::hasType('double')) { Type::addType('double', FloatType::class); } @@ -27,8 +26,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('tariff_pricing_components', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_101855_update_social_tariff_piggy_banks_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_101855_update_social_tariff_piggy_banks_table.php index 10d1b30a2..ff02eef43 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_101855_update_social_tariff_piggy_banks_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_101855_update_social_tariff_piggy_banks_table.php @@ -12,8 +12,7 @@ * * @return void */ - public function up() - { + public function up() { if (!Type::hasType('double')) { Type::addType('double', FloatType::class); } @@ -27,8 +26,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('social_tariff_piggy_banks', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_102047_update_access_rates_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_102047_update_access_rates_table.php index d16be1a73..13b2c47f3 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_102047_update_access_rates_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_102047_update_access_rates_table.php @@ -12,8 +12,7 @@ * * @return void */ - public function up() - { + public function up() { if (!Type::hasType('double')) { Type::addType('double', FloatType::class); } @@ -27,8 +26,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('access_rates', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_102214_update_access_rate_payments_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_102214_update_access_rate_payments_table.php index 2a000621d..4fa3addf1 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_102214_update_access_rate_payments_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_102214_update_access_rate_payments_table.php @@ -12,8 +12,7 @@ * * @return void */ - public function up() - { + public function up() { if (!Type::hasType('double')) { Type::addType('double', FloatType::class); } @@ -28,8 +27,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('access_rate_payments', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_102507_update_asset_people_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_102507_update_asset_people_table.php index 93a3c8c43..e26cf09df 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_102507_update_asset_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_102507_update_asset_people_table.php @@ -12,8 +12,7 @@ * * @return void */ - public function up() - { + public function up() { if (!Type::hasType('double')) { Type::addType('double', FloatType::class); } @@ -27,8 +26,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('asset_people', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_102649_update_transactions_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_102649_update_transactions_table.php index 1ba707cf1..e5ee75d8e 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_102649_update_transactions_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_102649_update_transactions_table.php @@ -12,8 +12,7 @@ * * @return void */ - public function up() - { + public function up() { if (!Type::hasType('double')) { Type::addType('double', FloatType::class); } @@ -27,8 +26,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('transactions', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2022_05_10_102805_update_payment_histories_table.php b/src/backend/database/migrations/micropowermanager/2022_05_10_102805_update_payment_histories_table.php index 4d26923b2..04c9ae4ff 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_10_102805_update_payment_histories_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_10_102805_update_payment_histories_table.php @@ -12,8 +12,7 @@ * * @return void */ - public function up() - { + public function up() { if (!Type::hasType('double')) { Type::addType('double', FloatType::class); } @@ -27,8 +26,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('payment_histories', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2022_05_19_102938_update_asset_types_table.php b/src/backend/database/migrations/micropowermanager/2022_05_19_102938_update_asset_types_table.php index 685ac3089..f5a8e54f6 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_19_102938_update_asset_types_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_19_102938_update_asset_types_table.php @@ -12,8 +12,7 @@ * * @return void */ - public function up() - { + public function up() { if (!Type::hasType('double')) { Type::addType('double', FloatType::class); } @@ -27,8 +26,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('asset_types', function (Blueprint $table) { $table->integer('price')->unsigned()->nullable()->change(); }); diff --git a/src/backend/database/migrations/micropowermanager/2022_05_23_104138_add_connection_column_to_agents_table.php b/src/backend/database/migrations/micropowermanager/2022_05_23_104138_add_connection_column_to_agents_table.php index a9374728b..51558d492 100644 --- a/src/backend/database/migrations/micropowermanager/2022_05_23_104138_add_connection_column_to_agents_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_05_23_104138_add_connection_column_to_agents_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('agents', function (Blueprint $table) { $table->string('connection'); }); @@ -22,8 +21,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('agents', function (Blueprint $table) { $table->dropColumn('connection'); }); diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090125_create_calin_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090125_create_calin_tables.php index 650ee27f5..0027e12e6 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090125_create_calin_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090125_create_calin_tables.php @@ -5,8 +5,7 @@ use Illuminate\Support\Facades\Schema; return new class extends Migration { - public function up() - { + public function up() { if (!Schema::hasTable('calin_api_credentials')) { Schema::connection('shard')->create('calin_api_credentials', static function (Blueprint $table) { $table->increments('id'); @@ -24,8 +23,7 @@ public function up() } } - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('calin_api_credentials'); Schema::connection('shard')->dropIfExists('calin_transactions'); } diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090327_create_calin_smart_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090327_create_calin_smart_tables.php index 0cbffde97..e743c64d7 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090327_create_calin_smart_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090327_create_calin_smart_tables.php @@ -5,8 +5,7 @@ use Illuminate\Support\Facades\Schema; return new class extends Migration { - public function up() - { + public function up() { if (!Schema::hasTable('calin_smart_api_credentials')) { Schema::connection('shard')->create('calin_smart_api_credentials', static function (Blueprint $table) { $table->increments('id'); @@ -26,8 +25,7 @@ public function up() } } - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('calin_smart_api_credentials'); Schema::connection('shard')->dropIfExists('calin_smart_transactions'); } diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090338_create_kelin_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090338_create_kelin_tables.php index b0c7decd2..cddeafdfa 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090338_create_kelin_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090338_create_kelin_tables.php @@ -5,8 +5,7 @@ use Illuminate\Support\Facades\Schema; return new class extends Migration { - public function up() - { + public function up() { if (!Schema::hasTable('kelin_api_credentials')) { Schema::connection('shard')->create('kelin_api_credentials', static function (Blueprint $table) { $table->increments('id'); @@ -158,8 +157,7 @@ public function up() } } - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('kelin_api_credentials'); Schema::connection('shard')->dropIfExists('kelin_customers'); Schema::connection('shard')->dropIfExists('kelin_meters'); diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090345_create_mesomb_payment_provider_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090345_create_mesomb_payment_provider_tables.php index df8f72421..74d68aa74 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090345_create_mesomb_payment_provider_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090345_create_mesomb_payment_provider_tables.php @@ -5,8 +5,7 @@ use Illuminate\Support\Facades\Schema; return new class extends Migration { - public function up() - { + public function up() { if (!Schema::hasTable('mesomb_transactions')) { Schema::connection('shard')->create('mesomb_transactions', static function (Blueprint $table) { $table->increments('id'); @@ -26,8 +25,7 @@ public function up() } } - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('mesomb_transactions'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090351_create_spark_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090351_create_spark_tables.php index c5fae50c0..756176cb4 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090351_create_spark_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090351_create_spark_tables.php @@ -5,8 +5,7 @@ use Illuminate\Support\Facades\Schema; return new class extends Migration { - public function up() - { + public function up() { if (!Schema::hasTable('sm_api_credentials')) { Schema::connection('shard')->create('sm_api_credentials', static function (Blueprint $table) { $table->increments('id'); @@ -193,8 +192,7 @@ public function up() } } - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('sm_api_credentials'); Schema::connection('shard')->dropIfExists('sm_customers'); Schema::connection('shard')->dropIfExists('sm_meter_models'); diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090402_create_steama_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090402_create_steama_tables.php index b6264ceac..e1e7cebcd 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090402_create_steama_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090402_create_steama_tables.php @@ -5,8 +5,7 @@ use Illuminate\Support\Facades\Schema; return new class extends Migration { - public function up() - { + public function up() { if (!Schema::hasTable('steama_agents')) { Schema::connection('shard')->create('steama_agents', function (Blueprint $table) { $table->increments('id'); @@ -296,8 +295,7 @@ public function up() } } - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('steama_agents'); Schema::connection('shard')->dropIfExists('steama_asset_rates_payment_plans'); Schema::connection('shard')->dropIfExists('steama_credentials'); diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090412_create_stron_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090412_create_stron_tables.php index 8c1e7343f..c554938f3 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090412_create_stron_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090412_create_stron_tables.php @@ -5,8 +5,7 @@ use Illuminate\Support\Facades\Schema; return new class extends Migration { - public function up() - { + public function up() { if (!Schema::hasTable('stron_api_credentials')) { Schema::connection('shard')->create('stron_api_credentials', static function (Blueprint $table) { $table->increments('id'); @@ -27,8 +26,7 @@ public function up() } } - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('stron_api_credentials'); Schema::connection('shard')->dropIfExists('stron_transactions'); } diff --git a/src/backend/database/migrations/micropowermanager/2022_06_21_090425_create_swifta_payment_provider_tables.php b/src/backend/database/migrations/micropowermanager/2022_06_21_090425_create_swifta_payment_provider_tables.php index 39905bf5c..64b57be1a 100644 --- a/src/backend/database/migrations/micropowermanager/2022_06_21_090425_create_swifta_payment_provider_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_06_21_090425_create_swifta_payment_provider_tables.php @@ -5,8 +5,7 @@ use Illuminate\Support\Facades\Schema; return new class extends Migration { - public function up() - { + public function up() { if (!Schema::hasTable('swifta_transactions')) { Schema::connection('shard')->create('swifta_transactions', static function (Blueprint $table) { $table->increments('id'); @@ -30,8 +29,7 @@ public function up() } } - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('swifta_transactions'); Schema::connection('shard')->dropIfExists('swifta_authentication'); } diff --git a/src/backend/database/migrations/micropowermanager/2022_07_05_092948_create_registration_tail_table.php b/src/backend/database/migrations/micropowermanager/2022_07_05_092948_create_registration_tail_table.php index c0f14af3e..7e25d1143 100644 --- a/src/backend/database/migrations/micropowermanager/2022_07_05_092948_create_registration_tail_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_07_05_092948_create_registration_tail_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('registration_tail', function (Blueprint $table) { $table->id(); $table->json('tail'); @@ -25,8 +24,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('registration_tail'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2022_07_20_101605_create_ticketing_tables.php b/src/backend/database/migrations/micropowermanager/2022_07_20_101605_create_ticketing_tables.php index d2b4655c1..6175d8bce 100644 --- a/src/backend/database/migrations/micropowermanager/2022_07_20_101605_create_ticketing_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_07_20_101605_create_ticketing_tables.php @@ -4,15 +4,13 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class CreateTicketingTables extends Migration -{ +class CreateTicketingTables extends Migration { /** * Run the migrations. * * @return void */ - public function up() - { + public function up() { $tableNames = config('tickets.table_names'); Schema::connection('shard')->create($tableNames['ticket'], function (Blueprint $table) { @@ -73,8 +71,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { $tableNames = config('tickets.table_names'); Schema::connection('shard')->drop($tableNames['ticket']); Schema::connection('shard')->drop($tableNames['user']); diff --git a/src/backend/database/migrations/micropowermanager/2022_09_20_0000000_create_bulk_registration_tables.php b/src/backend/database/migrations/micropowermanager/2022_09_20_0000000_create_bulk_registration_tables.php index 5d4adeaeb..7125abd6d 100644 --- a/src/backend/database/migrations/micropowermanager/2022_09_20_0000000_create_bulk_registration_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_09_20_0000000_create_bulk_registration_tables.php @@ -5,8 +5,7 @@ use Illuminate\Support\Facades\Schema; return new class extends Migration { - public function up() - { + public function up() { if (!Schema::connection('shard')->hasTable('bulk_registration_csv_datas')) { Schema::connection('shard')->create('bulk_registration_csv_datas', function (Blueprint $table) { $table->increments('id'); @@ -18,8 +17,7 @@ public function up() } } - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('bulk_registration_csv_datas'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2022_10_27_130327_add_direction_column_to_sms_table.php b/src/backend/database/migrations/micropowermanager/2022_10_27_130327_add_direction_column_to_sms_table.php index 34ad352e9..68b8513ad 100644 --- a/src/backend/database/migrations/micropowermanager/2022_10_27_130327_add_direction_column_to_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_10_27_130327_add_direction_column_to_sms_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('sms', function (Blueprint $table) { $table->integer('direction')->default(1); }); @@ -22,8 +21,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('sms', function (Blueprint $table) { $table->dropColumn('direction'); }); diff --git a/src/backend/database/migrations/micropowermanager/2022_10_27_140945_add_gateway_id_column_to_sms_table.php b/src/backend/database/migrations/micropowermanager/2022_10_27_140945_add_gateway_id_column_to_sms_table.php index ce2821e1d..5de4cf783 100644 --- a/src/backend/database/migrations/micropowermanager/2022_10_27_140945_add_gateway_id_column_to_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_10_27_140945_add_gateway_id_column_to_sms_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('sms', function (Blueprint $table) { $table->integer('gateway_id')->nullable(); }); @@ -22,8 +21,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('sms', function (Blueprint $table) { $table->dropColumn('gateway_id'); }); diff --git a/src/backend/database/migrations/micropowermanager/2022_10_27_142123_add_dispatched_column_to_sms_table.php b/src/backend/database/migrations/micropowermanager/2022_10_27_142123_add_dispatched_column_to_sms_table.php index 02e97429d..ff1e93bf2 100644 --- a/src/backend/database/migrations/micropowermanager/2022_10_27_142123_add_dispatched_column_to_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_10_27_142123_add_dispatched_column_to_sms_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('sms', function (Blueprint $table) { $table->integer('dispatched')->default(-1); }); @@ -22,8 +21,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('sms', function (Blueprint $table) { $table->dropColumn('dispatched'); }); diff --git a/src/backend/database/migrations/micropowermanager/2022_10_27_142319_add_attempts_column_to_sms_table.php b/src/backend/database/migrations/micropowermanager/2022_10_27_142319_add_attempts_column_to_sms_table.php index d8da6df80..efed405fd 100644 --- a/src/backend/database/migrations/micropowermanager/2022_10_27_142319_add_attempts_column_to_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_10_27_142319_add_attempts_column_to_sms_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('sms', function (Blueprint $table) { $table->integer('attempts')->default(0); }); @@ -22,8 +21,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('sms', function (Blueprint $table) { $table->dropColumn('attempts'); }); diff --git a/src/backend/database/migrations/micropowermanager/2022_11_08_0000000_create_viber_messaging_tables.php b/src/backend/database/migrations/micropowermanager/2022_11_08_0000000_create_viber_messaging_tables.php index 48c5c383c..a60981c21 100644 --- a/src/backend/database/migrations/micropowermanager/2022_11_08_0000000_create_viber_messaging_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_11_08_0000000_create_viber_messaging_tables.php @@ -5,8 +5,7 @@ use Illuminate\Support\Facades\Schema; return new class extends Migration { - public function up() - { + public function up() { if (!Schema::hasTable('viber_credentials')) { Schema::connection('shard')->create('viber_credentials', static function (Blueprint $table) { $table->increments('id'); @@ -35,8 +34,7 @@ public function up() } } - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('viber_credentials'); Schema::connection('shard')->dropIfExists('viber_messages'); Schema::connection('shard')->dropIfExists('viber_contacts'); diff --git a/src/backend/database/migrations/micropowermanager/2022_11_14_101338_add_minimum_purchase_amount_to_meter_tariffs_table.php b/src/backend/database/migrations/micropowermanager/2022_11_14_101338_add_minimum_purchase_amount_to_meter_tariffs_table.php index 1bb868b51..21ae5c66a 100644 --- a/src/backend/database/migrations/micropowermanager/2022_11_14_101338_add_minimum_purchase_amount_to_meter_tariffs_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_11_14_101338_add_minimum_purchase_amount_to_meter_tariffs_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('meter_tariffs', function (Blueprint $table) { $table->double('minimum_purchase_amount')->default(0); }); @@ -22,8 +21,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('meter_tariffs', function (Blueprint $table) { $table->dropColumn('minimum_purchase_amount'); }); diff --git a/src/backend/database/migrations/micropowermanager/2022_11_21_000000_create_wave_money_payment_provider_tables.php b/src/backend/database/migrations/micropowermanager/2022_11_21_000000_create_wave_money_payment_provider_tables.php index c2fd8756c..9ddb42d6d 100644 --- a/src/backend/database/migrations/micropowermanager/2022_11_21_000000_create_wave_money_payment_provider_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_11_21_000000_create_wave_money_payment_provider_tables.php @@ -5,8 +5,7 @@ use Illuminate\Support\Facades\Schema; return new class extends Migration { - public function up() - { + public function up() { if (!Schema::hasTable('wave_money_transactions')) { Schema::connection('shard')->create('wave_money_transactions', static function (Blueprint $table) { $table->increments('id'); @@ -36,8 +35,7 @@ public function up() } } - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('wave_money_transactions'); Schema::connection('shard')->dropIfExists('wave_money_credentials'); } diff --git a/src/backend/database/migrations/micropowermanager/2022_11_29_000000_create_micro_star_tables.php b/src/backend/database/migrations/micropowermanager/2022_11_29_000000_create_micro_star_tables.php index f8d27f2e2..cc401dca1 100644 --- a/src/backend/database/migrations/micropowermanager/2022_11_29_000000_create_micro_star_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_11_29_000000_create_micro_star_tables.php @@ -5,8 +5,7 @@ use Illuminate\Support\Facades\Schema; return new class extends Migration { - public function up() - { + public function up() { if (!Schema::hasTable('micro_star_api_credentials')) { Schema::connection('shard')->create('micro_star_api_credentials', static function (Blueprint $table) { $table->increments('id'); @@ -26,8 +25,7 @@ public function up() } } - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('micro_star_api_credentials'); Schema::connection('shard')->dropIfExists('micro_star_transactions'); } diff --git a/src/backend/database/migrations/micropowermanager/2022_12_11_000000_update_swifta_authentication_table.php b/src/backend/database/migrations/micropowermanager/2022_12_11_000000_update_swifta_authentication_table.php index 756749f5a..e94d44582 100644 --- a/src/backend/database/migrations/micropowermanager/2022_12_11_000000_update_swifta_authentication_table.php +++ b/src/backend/database/migrations/micropowermanager/2022_12_11_000000_update_swifta_authentication_table.php @@ -12,8 +12,7 @@ * * @return void */ - public function up() - { + public function up() { if (!Type::hasType('token')) { Type::addType('token', FloatType::class); } @@ -27,8 +26,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('swifta_authentication', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2022_14_12_create_sun_king_tables.php b/src/backend/database/migrations/micropowermanager/2022_14_12_create_sun_king_tables.php index 2836b3223..c0b0f1331 100644 --- a/src/backend/database/migrations/micropowermanager/2022_14_12_create_sun_king_tables.php +++ b/src/backend/database/migrations/micropowermanager/2022_14_12_create_sun_king_tables.php @@ -5,8 +5,7 @@ use Illuminate\Support\Facades\Schema; return new class extends Migration { - public function up() - { + public function up() { if (!Schema::connection('shard')->hasTable('sun_king_api_credentials')) { Schema::connection('shard')->create('sun_king_api_credentials', static function (Blueprint $table) { $table->increments('id'); @@ -27,8 +26,7 @@ public function up() } } - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('sun_king_api_credentials'); Schema::connection('shard')->dropIfExists('sun_king_transactions'); } diff --git a/src/backend/database/migrations/micropowermanager/2023_03_15_092048_add_colums_to_solars_table.php b/src/backend/database/migrations/micropowermanager/2023_03_15_092048_add_colums_to_solars_table.php index 011ac4f62..1e4b95516 100644 --- a/src/backend/database/migrations/micropowermanager/2023_03_15_092048_add_colums_to_solars_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_03_15_092048_add_colums_to_solars_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('solars', function (Blueprint $table) { $table->integer('frequency')->nullable(); $table->double('pv_power')->nullable(); @@ -25,8 +24,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('solars', function (Blueprint $table) { $table->dropColumn('frequency'); $table->dropColumn('pv_power'); diff --git a/src/backend/database/migrations/micropowermanager/2023_03_16_105024_update_solars_table.php b/src/backend/database/migrations/micropowermanager/2023_03_16_105024_update_solars_table.php index 8e54b500f..1bfc816a1 100644 --- a/src/backend/database/migrations/micropowermanager/2023_03_16_105024_update_solars_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_03_16_105024_update_solars_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('solars', function (Blueprint $table) { $table->renameColumn('storage_file_name', 'storage_folder')->change(); }); @@ -22,8 +21,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('solars', function (Blueprint $table) { $table->renameColumn('storage_folder', 'storage_file_name')->change(); }); diff --git a/src/backend/database/migrations/micropowermanager/2023_03_17_234630_update_data_type_values_energies_table.php b/src/backend/database/migrations/micropowermanager/2023_03_17_234630_update_data_type_values_energies_table.php index e180bf954..27d7aed40 100644 --- a/src/backend/database/migrations/micropowermanager/2023_03_17_234630_update_data_type_values_energies_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_03_17_234630_update_data_type_values_energies_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('energies', function (Blueprint $table) { $table->double('used_energy_since_last', 15, 2)->default(0)->change(); $table->double('total_absorbed', 15, 2)->default(0)->change(); @@ -24,8 +23,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('energies', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2023_03_18_014305_update_data_type_values_energies_table.php b/src/backend/database/migrations/micropowermanager/2023_03_18_014305_update_data_type_values_energies_table.php index f2344b9a0..3bd1255de 100644 --- a/src/backend/database/migrations/micropowermanager/2023_03_18_014305_update_data_type_values_energies_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_03_18_014305_update_data_type_values_energies_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('energies', function (Blueprint $table) { $table->double('used_energy_since_last', 8, 4)->default(0)->change(); $table->double('total_absorbed', 8, 4)->default(0)->change(); @@ -24,8 +23,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('energies', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2023_04_02_121811_create_wavecom_tables.php b/src/backend/database/migrations/micropowermanager/2023_04_02_121811_create_wavecom_tables.php index 245fa7a8b..d4a681161 100644 --- a/src/backend/database/migrations/micropowermanager/2023_04_02_121811_create_wavecom_tables.php +++ b/src/backend/database/migrations/micropowermanager/2023_04_02_121811_create_wavecom_tables.php @@ -7,8 +7,7 @@ return new class extends Migration { private const TABLE_NAME = 'wavecom_transactions'; - public function up() - { + public function up() { if (!Schema::hasTable(self::TABLE_NAME)) { Schema::create(self::TABLE_NAME, function (Blueprint $table) { $table->increments('id'); @@ -22,8 +21,7 @@ public function up() } } - public function down() - { + public function down() { Schema::dropIfExists(self::TABLE_NAME); } }; diff --git a/src/backend/database/migrations/micropowermanager/2023_04_04_211421_add_api_type_to_table_transactions.php b/src/backend/database/migrations/micropowermanager/2023_04_04_211421_add_api_type_to_table_transactions.php index 2358fd0b9..a6d9d78a9 100644 --- a/src/backend/database/migrations/micropowermanager/2023_04_04_211421_add_api_type_to_table_transactions.php +++ b/src/backend/database/migrations/micropowermanager/2023_04_04_211421_add_api_type_to_table_transactions.php @@ -9,8 +9,7 @@ * * @return void */ - public function up() - { + public function up() { DB::statement("ALTER TABLE transactions MODIFY COLUMN type ENUM('energy','deferred_payment','unknown','imported','3rd party api sync')"); } @@ -19,8 +18,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { DB::statement("ALTER TABLE transactions MODIFY COLUMN type ENUM('energy','deferred_payment','unknown')"); } }; diff --git a/src/backend/database/migrations/micropowermanager/2023_04_26_223352_update_sms_table.php b/src/backend/database/migrations/micropowermanager/2023_04_26_223352_update_sms_table.php index 4c46c099e..f1f9e50a4 100644 --- a/src/backend/database/migrations/micropowermanager/2023_04_26_223352_update_sms_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_04_26_223352_update_sms_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('sms', function (Blueprint $table) { $table->string('uuid', 50)->change(); $table->dropColumn('attempts'); @@ -24,8 +23,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('sms', function (Blueprint $table) { $table->string('uuid')->change(); $table->integer('attempts')->default(0); diff --git a/src/backend/database/migrations/micropowermanager/2023_06_02_create_gome_long_tables.php b/src/backend/database/migrations/micropowermanager/2023_06_02_create_gome_long_tables.php index 71d96f441..adc406044 100644 --- a/src/backend/database/migrations/micropowermanager/2023_06_02_create_gome_long_tables.php +++ b/src/backend/database/migrations/micropowermanager/2023_06_02_create_gome_long_tables.php @@ -7,8 +7,7 @@ // Despite the migration's name, this migration was actually created on Feb 6h // Name should be 2023-02-06 not 2023-06-02... return new class extends Migration { - public function up() - { + public function up() { if (!Schema::hasTable('gome_long_api_credentials')) { Schema::create('gome_long_api_credentials', static function (Blueprint $table) { $table->increments('id'); @@ -37,8 +36,7 @@ public function up() } } - public function down() - { + public function down() { Schema::dropIfExists('gome_long_api_credentials'); Schema::dropIfExists('gome_long_transactions'); Schema::dropIfExists('gome_long_tariffs'); diff --git a/src/backend/database/migrations/micropowermanager/2023_09_25_232731_update_assets_asset_people_asset_types_tables.php b/src/backend/database/migrations/micropowermanager/2023_09_25_232731_update_assets_asset_people_asset_types_tables.php index c729cdd8b..bf262eae8 100644 --- a/src/backend/database/migrations/micropowermanager/2023_09_25_232731_update_assets_asset_people_asset_types_tables.php +++ b/src/backend/database/migrations/micropowermanager/2023_09_25_232731_update_assets_asset_people_asset_types_tables.php @@ -12,8 +12,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('asset_types', function (Blueprint $table) { $table->dropColumn('price'); }); @@ -34,8 +33,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('agent_assigned_appliances', function (Blueprint $table) { $table->renameColumn('appliance_id', 'appliance_type_id'); }); diff --git a/src/backend/database/migrations/micropowermanager/2023_09_28_130619_update_sms_appliance_remind_rates_table.php b/src/backend/database/migrations/micropowermanager/2023_09_28_130619_update_sms_appliance_remind_rates_table.php index 6182a8d76..a68fe70cd 100644 --- a/src/backend/database/migrations/micropowermanager/2023_09_28_130619_update_sms_appliance_remind_rates_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_09_28_130619_update_sms_appliance_remind_rates_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('sms_appliance_remind_rates', function (Blueprint $table) { $table->renameColumn('appliance_type_id', 'appliance_id'); }); @@ -22,7 +21,5 @@ public function up() * * @return void */ - public function down() - { - } + public function down() {} }; diff --git a/src/backend/database/migrations/micropowermanager/2023_10_25_074114_update_wavecom_wavemoney_tables.php b/src/backend/database/migrations/micropowermanager/2023_10_25_074114_update_wavecom_wavemoney_tables.php index 78b331283..f3ea808b3 100644 --- a/src/backend/database/migrations/micropowermanager/2023_10_25_074114_update_wavecom_wavemoney_tables.php +++ b/src/backend/database/migrations/micropowermanager/2023_10_25_074114_update_wavecom_wavemoney_tables.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('wave_money_transactions', function (Blueprint $table) { $table->string('manufacturer_transaction_type')->nullable(); $table->integer('manufacturer_transaction_id')->nullable(); @@ -28,7 +27,5 @@ public function up() * * @return void */ - public function down() - { - } + public function down() {} }; diff --git a/src/backend/database/migrations/micropowermanager/2023_11_03_112202_create_devices_table.php b/src/backend/database/migrations/micropowermanager/2023_11_03_112202_create_devices_table.php index 45ac7b542..7cdb45688 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_03_112202_create_devices_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_03_112202_create_devices_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('devices', function (Blueprint $table) { $table->id(); $table->integer('person_id')->unsigned(); @@ -26,8 +25,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('devices'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2023_11_03_120614_create_solar_home_systems_table.php b/src/backend/database/migrations/micropowermanager/2023_11_03_120614_create_solar_home_systems_table.php index bfa0ee70a..312111634 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_03_120614_create_solar_home_systems_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_03_120614_create_solar_home_systems_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('solar_home_systems', function (Blueprint $table) { $table->id(); $table->string('serial_number'); @@ -25,8 +24,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('solar_home_systems'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2023_11_03_121740_add_configuration_columns_to_meters_table.php b/src/backend/database/migrations/micropowermanager/2023_11_03_121740_add_configuration_columns_to_meters_table.php index 4bfc16837..fcb7274e9 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_03_121740_add_configuration_columns_to_meters_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_03_121740_add_configuration_columns_to_meters_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('meters', function (Blueprint $table) { $table->integer('connection_type_id'); $table->integer('connection_group_id'); @@ -24,8 +23,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('meters', function (Blueprint $table) { $table->dropColumn('connection_type_id'); $table->dropColumn('connection_group_id'); diff --git a/src/backend/database/migrations/micropowermanager/2023_11_11_142307_update_action_field_type_logs_table.php b/src/backend/database/migrations/micropowermanager/2023_11_11_142307_update_action_field_type_logs_table.php index 2fe634fb0..4937e342a 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_11_142307_update_action_field_type_logs_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_11_142307_update_action_field_type_logs_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('logs', function (Blueprint $table) { $table->text('action')->change(); }); @@ -22,7 +21,5 @@ public function up() * * @return void */ - public function down() - { - } + public function down() {} }; diff --git a/src/backend/database/migrations/micropowermanager/2023_11_14_160711_drop_geo_id_column_from_address_table.php b/src/backend/database/migrations/micropowermanager/2023_11_14_160711_drop_geo_id_column_from_address_table.php index c0df218ad..2602dd77b 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_14_160711_drop_geo_id_column_from_address_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_14_160711_drop_geo_id_column_from_address_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('addresses', function (Blueprint $table) { $table->dropColumn('geo_id'); }); @@ -22,8 +21,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('addresses', function (Blueprint $table) { $table->integer('geo_id')->nullable(); }); diff --git a/src/backend/database/migrations/micropowermanager/2023_11_16_175649_add_type_column_to_manufacturers_table.php b/src/backend/database/migrations/micropowermanager/2023_11_16_175649_add_type_column_to_manufacturers_table.php index b3cf72cad..eba7bc7b9 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_16_175649_add_type_column_to_manufacturers_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_16_175649_add_type_column_to_manufacturers_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('manufacturers', function (Blueprint $table) { $table->enum('type', ['meter', 'shs', 'e-bike'])->default('meter')->after('id'); }); @@ -22,8 +21,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('manufacturers', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2023_11_16_175940_add_asset_id_column_to_solar_home_systems_table.php b/src/backend/database/migrations/micropowermanager/2023_11_16_175940_add_asset_id_column_to_solar_home_systems_table.php index 88cc96d66..5ddbe8217 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_16_175940_add_asset_id_column_to_solar_home_systems_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_16_175940_add_asset_id_column_to_solar_home_systems_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('solar_home_systems', function (Blueprint $table) { $table->integer('asset_id')->after('id'); }); @@ -22,8 +21,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('solar_home_systems', function (Blueprint $table) { $table->dropColumn('asset_id'); }); diff --git a/src/backend/database/migrations/micropowermanager/2023_11_16_220432_update_person_id_column_in_devices_table.php b/src/backend/database/migrations/micropowermanager/2023_11_16_220432_update_person_id_column_in_devices_table.php index d664a8186..62b2b741d 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_16_220432_update_person_id_column_in_devices_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_16_220432_update_person_id_column_in_devices_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('devices', function (Blueprint $table) { $table->integer('person_id')->nullable()->change(); }); @@ -22,8 +21,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('devices', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2023_11_16_220931_update_device_serial_column_in_devices_table.php b/src/backend/database/migrations/micropowermanager/2023_11_16_220931_update_device_serial_column_in_devices_table.php index ae99fec1a..30b8b1f37 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_16_220931_update_device_serial_column_in_devices_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_16_220931_update_device_serial_column_in_devices_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('devices', function (Blueprint $table) { $table->string('device_serial')->unique()->change(); }); @@ -22,8 +21,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('devices', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2023_11_16_221111_update_serial_number_column_in_solar_home_systems_table.php b/src/backend/database/migrations/micropowermanager/2023_11_16_221111_update_serial_number_column_in_solar_home_systems_table.php index 55c5ddce8..810432eb1 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_16_221111_update_serial_number_column_in_solar_home_systems_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_16_221111_update_serial_number_column_in_solar_home_systems_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('solar_home_systems', function (Blueprint $table) { $table->string('serial_number')->unique()->change(); }); @@ -22,8 +21,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('solar_home_systems', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2023_11_17_095204_create_tokens_table.php b/src/backend/database/migrations/micropowermanager/2023_11_17_095204_create_tokens_table.php index a96a4b81a..4f038d9da 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_17_095204_create_tokens_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_17_095204_create_tokens_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('tokens', function (Blueprint $table) { $table->increments('id'); $table->integer('transaction_id')->unique(); @@ -26,8 +25,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('tokens'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2023_11_18_190332_add_device_serial_column_to_asset_people_table.php b/src/backend/database/migrations/micropowermanager/2023_11_18_190332_add_device_serial_column_to_asset_people_table.php index f082d21e1..9ef0f4219 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_18_190332_add_device_serial_column_to_asset_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_18_190332_add_device_serial_column_to_asset_people_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('asset_people', function (Blueprint $table) { $table->string('device_serial'); }); @@ -22,8 +21,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('asset_people', function (Blueprint $table) { $table->dropColumn('device_serial'); }); diff --git a/src/backend/database/migrations/micropowermanager/2023_11_21_090129_update_derice_serial_column_in_asset_people_table.php b/src/backend/database/migrations/micropowermanager/2023_11_21_090129_update_derice_serial_column_in_asset_people_table.php index dc9926242..afd86cd01 100644 --- a/src/backend/database/migrations/micropowermanager/2023_11_21_090129_update_derice_serial_column_in_asset_people_table.php +++ b/src/backend/database/migrations/micropowermanager/2023_11_21_090129_update_derice_serial_column_in_asset_people_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('asset_people', function (Blueprint $table) { $table->string('device_serial')->nullable()->default(null)->change(); }); @@ -22,8 +21,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('asset_people', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2024_01_01_create_daly_bms_tables.php b/src/backend/database/migrations/micropowermanager/2024_01_01_create_daly_bms_tables.php index af89ef270..162e9183c 100644 --- a/src/backend/database/migrations/micropowermanager/2024_01_01_create_daly_bms_tables.php +++ b/src/backend/database/migrations/micropowermanager/2024_01_01_create_daly_bms_tables.php @@ -5,8 +5,7 @@ use Illuminate\Support\Facades\Schema; return new class extends Migration { - public function up() - { + public function up() { if (!Schema::hasTable('daly_bms_api_credentials')) { Schema::create('daly_bms_api_credentials', static function (Blueprint $table) { $table->increments('id'); @@ -26,8 +25,7 @@ public function up() } } - public function down() - { + public function down() { Schema::dropIfExists('daly_bms_api_credentials'); Schema::dropIfExists('daly_bms_transactions'); } diff --git a/src/backend/database/migrations/micropowermanager/2024_01_02_124146_create_e_bikes_table.php b/src/backend/database/migrations/micropowermanager/2024_01_02_124146_create_e_bikes_table.php index c600d582c..5855600d9 100644 --- a/src/backend/database/migrations/micropowermanager/2024_01_02_124146_create_e_bikes_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_01_02_124146_create_e_bikes_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->create('e_bikes', function (Blueprint $table) { $table->id(); $table->string('serial_number')->unique(); @@ -35,8 +34,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('e_bikes'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2024_01_12_create_angaza_tables.php b/src/backend/database/migrations/micropowermanager/2024_01_12_create_angaza_tables.php index 78200f4b5..3d8bfb2eb 100644 --- a/src/backend/database/migrations/micropowermanager/2024_01_12_create_angaza_tables.php +++ b/src/backend/database/migrations/micropowermanager/2024_01_12_create_angaza_tables.php @@ -5,8 +5,7 @@ use Illuminate\Support\Facades\Schema; return new class extends Migration { - public function up() - { + public function up() { if (!Schema::connection('shard')->hasTable('angaza_api_credentials')) { Schema::connection('shard')->create('angaza_api_credentials', static function (Blueprint $table) { $table->increments('id'); @@ -24,8 +23,7 @@ public function up() } } - public function down() - { + public function down() { Schema::connection('shard')->dropIfExists('angaza_api_credentials'); Schema::connection('shard')->dropIfExists('angaza_transactions'); } diff --git a/src/backend/database/migrations/micropowermanager/2024_02_07_102305_add_usage_type_column_to_main_settings_table.php b/src/backend/database/migrations/micropowermanager/2024_02_07_102305_add_usage_type_column_to_main_settings_table.php index d977f2a13..2da63c1b9 100644 --- a/src/backend/database/migrations/micropowermanager/2024_02_07_102305_add_usage_type_column_to_main_settings_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_02_07_102305_add_usage_type_column_to_main_settings_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('main_settings', function (Blueprint $table) { $table->enum('usage_type', [ 'mini-grid', @@ -30,8 +29,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('main_settings', function (Blueprint $table) {}); } }; diff --git a/src/backend/database/migrations/micropowermanager/2024_02_07_113710_add_usage_type_column_to_menu_items_table.php b/src/backend/database/migrations/micropowermanager/2024_02_07_113710_add_usage_type_column_to_menu_items_table.php index d16cd7fb9..a21a58d3f 100644 --- a/src/backend/database/migrations/micropowermanager/2024_02_07_113710_add_usage_type_column_to_menu_items_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_02_07_113710_add_usage_type_column_to_menu_items_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('menu_items', function (Blueprint $table) { $table->string('usage_type')->default('general')->after('id'); }); @@ -22,8 +21,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('menu_items', function (Blueprint $table) { $table->dropColumn('usage_type'); }); diff --git a/src/backend/database/migrations/micropowermanager/2024_09_30_113302_remove_siderbar_tables.php b/src/backend/database/migrations/micropowermanager/2024_09_30_113302_remove_siderbar_tables.php index 3d7fe14f9..9ad61ab47 100644 --- a/src/backend/database/migrations/micropowermanager/2024_09_30_113302_remove_siderbar_tables.php +++ b/src/backend/database/migrations/micropowermanager/2024_09_30_113302_remove_siderbar_tables.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->dropIfExists('menu_items'); Schema::connection('shard')->dropIfExists('sub_menu_items'); } @@ -21,8 +20,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->create('menu_items', function (Blueprint $table) { $table->increments('id'); $table->string('usage_type', 191)->default('general'); diff --git a/src/backend/database/migrations/micropowermanager/2024_10_23_153042_add_amount_to_agent_charge.php b/src/backend/database/migrations/micropowermanager/2024_10_23_153042_add_amount_to_agent_charge.php index a0f9ed99e..5ca3589dc 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_23_153042_add_amount_to_agent_charge.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_23_153042_add_amount_to_agent_charge.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('agent_charges', function (Blueprint $table) { $table->float('amount')->after('user_id'); }); @@ -22,8 +21,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('agent_charges', function (Blueprint $table) { $table->dropColumn('amount'); }); diff --git a/src/backend/database/migrations/micropowermanager/2024_10_30_154625_create_notifications_table.php b/src/backend/database/migrations/micropowermanager/2024_10_30_154625_create_notifications_table.php index 3d6cbf7f8..65e602e12 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_30_154625_create_notifications_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_30_154625_create_notifications_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::create('notifications', function (Blueprint $table) { $table->uuid('id')->primary(); $table->string('type'); @@ -27,8 +26,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::dropIfExists('notifications'); } }; diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180458_remove_batteries_table.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180458_remove_batteries_table.php index 4da0bd72e..bf62b709b 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180458_remove_batteries_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180458_remove_batteries_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->dropIfExists('batteries'); } @@ -20,8 +19,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->create('batteries', function (Blueprint $table) { $table->increments('id'); $table->integer('mini_grid_id'); diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180510_remove_energies_table.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180510_remove_energies_table.php index 55994d8e8..a48fb5063 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180510_remove_energies_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180510_remove_energies_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->dropIfExists('energies'); } @@ -20,8 +19,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->create('energies', function (Blueprint $table) { $table->increments('id'); $table->integer('mini_grid_id'); diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180524_remove_mini_grid_frequencies_table.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180524_remove_mini_grid_frequencies_table.php index 4a350e0eb..9e39a0e35 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180524_remove_mini_grid_frequencies_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180524_remove_mini_grid_frequencies_table.php @@ -9,8 +9,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->dropIfExists('mini_grid_frequencies'); } @@ -19,8 +18,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { // This table never had any migration files and hence never existed // on fresh installations of MPM. } diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180539_remove_pvs_table.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180539_remove_pvs_table.php index 3b6fb8e94..f14e497ee 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180539_remove_pvs_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180539_remove_pvs_table.php @@ -11,8 +11,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->dropIfExists('p_v_s'); } @@ -21,8 +20,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->create('p_v_s', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('mini_grid_id'); diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180546_remove_solars_table.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180546_remove_solars_table.php index 87b6114b5..94b958d24 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180546_remove_solars_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180546_remove_solars_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->dropIfExists('solars'); } @@ -20,8 +19,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->create('solars', function (Blueprint $table) { $table->increments('id'); $table->integer('mini_grid_id'); diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180605_remove_weather_data_table.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180605_remove_weather_data_table.php index 35d582874..a14ba4d5a 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180605_remove_weather_data_table.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180605_remove_weather_data_table.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->dropIfExists('weather_data'); } @@ -20,8 +19,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->create('weather_data', static function (Blueprint $table) { $table->increments('id'); $table->integer('solar_id'); diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_180852_remove_agent_tickets.php b/src/backend/database/migrations/micropowermanager/2024_10_31_180852_remove_agent_tickets.php index d81b62db0..9b433c424 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_180852_remove_agent_tickets.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_180852_remove_agent_tickets.php @@ -9,8 +9,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->dropIfExists('agent_tickets'); } @@ -19,8 +18,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { // This table never had any migration files and hence never existed // on fresh installations of MPM. } diff --git a/src/backend/database/migrations/micropowermanager/2024_10_31_181016_remove_city_clusters.php b/src/backend/database/migrations/micropowermanager/2024_10_31_181016_remove_city_clusters.php index afc95f4a0..d53d862a1 100644 --- a/src/backend/database/migrations/micropowermanager/2024_10_31_181016_remove_city_clusters.php +++ b/src/backend/database/migrations/micropowermanager/2024_10_31_181016_remove_city_clusters.php @@ -9,8 +9,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->dropIfExists('city_clusters'); } @@ -19,8 +18,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { // This table never had any migration files and hence never existed // on fresh installations of MPM. } diff --git a/src/backend/database/migrations/micropowermanager/2024_11_11_130340_drop_data_stream_column_from_mini_grid.php b/src/backend/database/migrations/micropowermanager/2024_11_11_130340_drop_data_stream_column_from_mini_grid.php index 2f89d59cb..73940c871 100644 --- a/src/backend/database/migrations/micropowermanager/2024_11_11_130340_drop_data_stream_column_from_mini_grid.php +++ b/src/backend/database/migrations/micropowermanager/2024_11_11_130340_drop_data_stream_column_from_mini_grid.php @@ -10,8 +10,7 @@ * * @return void */ - public function up() - { + public function up() { Schema::connection('shard')->table('mini_grids', function (Blueprint $table) { $table->dropColumn('data_stream'); }); @@ -22,8 +21,7 @@ public function up() * * @return void */ - public function down() - { + public function down() { Schema::connection('shard')->table('mini_grids', function (Blueprint $table) { $table->integer('data_stream')->default(0)->after('name'); }); diff --git a/src/backend/database/seeders/AgentSeeder.php b/src/backend/database/seeders/AgentSeeder.php index 595db0c48..00da70d21 100644 --- a/src/backend/database/seeders/AgentSeeder.php +++ b/src/backend/database/seeders/AgentSeeder.php @@ -12,8 +12,7 @@ use Illuminate\Database\Seeder; use MPM\DatabaseProxy\DatabaseProxyManagerService; -class AgentSeeder extends Seeder -{ +class AgentSeeder extends Seeder { public function __construct( private DatabaseProxyManagerService $databaseProxyManagerService, ) { @@ -25,8 +24,7 @@ public function __construct( * * @return void */ - public function run() - { + public function run() { $agentCommission = AgentCommission::factory() ->create(); @@ -38,20 +36,20 @@ public function run() $village = $minigrid->cities()->get()->random(); $person = Person::factory() - ->isAgent($village->name) - ->has( - Address::factory() - ->for($village) - ->has( - GeographicalInformation::factory() - ->state(function (array $attributes, Address $address) { - return ['points' => $address->city->location->points]; - }) - ->randomizePointsInVillage(), - 'geo' - ) - ) - ->create(); + ->isAgent($village->name) + ->has( + Address::factory() + ->for($village) + ->has( + GeographicalInformation::factory() + ->state(function (array $attributes, Address $address) { + return ['points' => $address->city->location->points]; + }) + ->randomizePointsInVillage(), + 'geo' + ) + ) + ->create(); $agent = Agent::factory() ->for($minigrid) diff --git a/src/backend/database/seeders/ClusterSeeder.php b/src/backend/database/seeders/ClusterSeeder.php index 6aba9fc63..5c1e60572 100644 --- a/src/backend/database/seeders/ClusterSeeder.php +++ b/src/backend/database/seeders/ClusterSeeder.php @@ -10,8 +10,7 @@ use Illuminate\Database\Seeder; use MPM\DatabaseProxy\DatabaseProxyManagerService; -class ClusterSeeder extends Seeder -{ +class ClusterSeeder extends Seeder { public function __construct( private DatabaseProxyManagerService $databaseProxyManagerService, ) { @@ -23,8 +22,7 @@ public function __construct( * * @return void */ - public function run() - { + public function run() { $clusterAdmin = User::factory() ->clusterAdmin() ->create(); diff --git a/src/backend/database/seeders/CustomerSeeder.php b/src/backend/database/seeders/CustomerSeeder.php index 88a1e2022..ca7303b69 100644 --- a/src/backend/database/seeders/CustomerSeeder.php +++ b/src/backend/database/seeders/CustomerSeeder.php @@ -9,8 +9,7 @@ use Illuminate\Database\Seeder; use MPM\DatabaseProxy\DatabaseProxyManagerService; -class CustomerSeeder extends Seeder -{ +class CustomerSeeder extends Seeder { public function __construct( private DatabaseProxyManagerService $databaseProxyManagerService, ) { @@ -22,29 +21,28 @@ public function __construct( * * @return void */ - public function run() - { + public function run() { // Get available Villages $villages = City::all(); // For each Village generate customers foreach ($villages as $village) { Person::factory() - ->count(50) - ->isCustomer() - ->has( - Address::factory() - ->for($village) - ->has( - GeographicalInformation::factory() - ->state(function (array $attributes, Address $address) { - return ['points' => $address->city->location->points]; - }) - ->randomizePointsInVillage(), - 'geo' - ) - ) - ->create(); + ->count(50) + ->isCustomer() + ->has( + Address::factory() + ->for($village) + ->has( + GeographicalInformation::factory() + ->state(function (array $attributes, Address $address) { + return ['points' => $address->city->location->points]; + }) + ->randomizePointsInVillage(), + 'geo' + ) + ) + ->create(); } } } diff --git a/src/backend/database/seeders/DatabaseSeeder.php b/src/backend/database/seeders/DatabaseSeeder.php index ef2badd5f..be04116aa 100644 --- a/src/backend/database/seeders/DatabaseSeeder.php +++ b/src/backend/database/seeders/DatabaseSeeder.php @@ -4,15 +4,13 @@ use Illuminate\Database\Seeder; -class DatabaseSeeder extends Seeder -{ +class DatabaseSeeder extends Seeder { /** * Run the database seeds. * * @return void */ - public function run() - { + public function run() { $this->call([ TenantSeeder::class, ClusterSeeder::class, diff --git a/src/backend/database/seeders/MeterSeeder.php b/src/backend/database/seeders/MeterSeeder.php index 9b87ff906..6490e1a09 100644 --- a/src/backend/database/seeders/MeterSeeder.php +++ b/src/backend/database/seeders/MeterSeeder.php @@ -16,8 +16,7 @@ use Illuminate\Database\Seeder; use MPM\DatabaseProxy\DatabaseProxyManagerService; -class MeterSeeder extends Seeder -{ +class MeterSeeder extends Seeder { public function __construct( private DatabaseProxyManagerService $databaseProxyManagerService, ) { @@ -29,8 +28,7 @@ public function __construct( * * @return void */ - public function run() - { + public function run() { // Manufacturer // Here, we adding some dummy Manufacturers for seeding. // Additional (actual) manufacturers can be added by diff --git a/src/backend/database/seeders/SolarHomeSystemSeeder.php b/src/backend/database/seeders/SolarHomeSystemSeeder.php index e9505edd5..8bbf50f45 100644 --- a/src/backend/database/seeders/SolarHomeSystemSeeder.php +++ b/src/backend/database/seeders/SolarHomeSystemSeeder.php @@ -10,8 +10,7 @@ use Illuminate\Database\Seeder; use MPM\DatabaseProxy\DatabaseProxyManagerService; -class SolarHomeSystemSeeder extends Seeder -{ +class SolarHomeSystemSeeder extends Seeder { public function __construct( private DatabaseProxyManagerService $databaseProxyManagerService, ) { @@ -23,8 +22,7 @@ public function __construct( * * @return void */ - public function run() - { + public function run() { // Manufacturer // Here, we adding some dummy Manufacturers for seeding. // Additional (actual) manufacturers can be added by diff --git a/src/backend/database/seeders/TenantSeeder.php b/src/backend/database/seeders/TenantSeeder.php index 640786320..c3ca9d37a 100644 --- a/src/backend/database/seeders/TenantSeeder.php +++ b/src/backend/database/seeders/TenantSeeder.php @@ -29,8 +29,7 @@ 'name' => 'Dummy Company Admin', ]; -class TenantSeeder extends Seeder -{ +class TenantSeeder extends Seeder { public function __construct( private CompanyDatabaseService $companyDatabaseService, private CompanyService $companyService, @@ -38,16 +37,14 @@ public function __construct( private DatabaseProxyManagerService $databaseProxyManagerService, private RegistrationTailService $registrationTailService, private MainSettingsService $mainSettingsService, - ) { - } + ) {} /** * Run the database seeds. * * @return void */ - public function run() - { + public function run() { // Only proceed if database is empty. // In some seeders we rely on the DummyCompany having id=1. $companies = $this->companyService->getAll(); diff --git a/src/backend/database/seeders/TicketSeeder.php b/src/backend/database/seeders/TicketSeeder.php index 97944fbcb..3af874046 100644 --- a/src/backend/database/seeders/TicketSeeder.php +++ b/src/backend/database/seeders/TicketSeeder.php @@ -6,8 +6,7 @@ use Inensus\Ticket\Models\TicketCategory; use MPM\DatabaseProxy\DatabaseProxyManagerService; -class TicketSeeder extends Seeder -{ +class TicketSeeder extends Seeder { public function __construct( private DatabaseProxyManagerService $databaseProxyManagerService, ) { @@ -19,8 +18,7 @@ public function __construct( * * @return void */ - public function run() - { + public function run() { // Create Ticket categories TicketCategory::newFactory() ->count(2) diff --git a/src/backend/packages/inensus/angaza-shs/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/angaza-shs/src/Console/Commands/InstallPackage.php index 6b5219641..e3b53fec8 100644 --- a/src/backend/packages/inensus/angaza-shs/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/angaza-shs/src/Console/Commands/InstallPackage.php @@ -6,8 +6,7 @@ use Inensus\AngazaSHS\Services\AngazaCredentialService; use Inensus\AngazaSHS\Services\ManufacturerService; -class InstallPackage extends Command -{ +class InstallPackage extends Command { protected $signature = 'angaza-shs:install'; protected $description = 'Install AngazaSHS Package'; @@ -19,8 +18,7 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { $this->info('Installing AngazaSHS Integration Package\n'); $this->manufacturerService->register(); $this->credentialService->createCredentials(); diff --git a/src/backend/packages/inensus/angaza-shs/src/Exceptions/AngazaApiResponseException.php b/src/backend/packages/inensus/angaza-shs/src/Exceptions/AngazaApiResponseException.php index e39b3dee1..c422c03db 100644 --- a/src/backend/packages/inensus/angaza-shs/src/Exceptions/AngazaApiResponseException.php +++ b/src/backend/packages/inensus/angaza-shs/src/Exceptions/AngazaApiResponseException.php @@ -2,10 +2,8 @@ namespace Inensus\AngazaSHS\Exceptions; -class AngazaApiResponseException extends \Exception -{ - public function __construct($message) - { +class AngazaApiResponseException extends \Exception { + public function __construct($message) { parent::__construct($message); } } diff --git a/src/backend/packages/inensus/angaza-shs/src/Http/Controllers/AngazaCredentialController.php b/src/backend/packages/inensus/angaza-shs/src/Http/Controllers/AngazaCredentialController.php index 27228446b..6061f99a0 100644 --- a/src/backend/packages/inensus/angaza-shs/src/Http/Controllers/AngazaCredentialController.php +++ b/src/backend/packages/inensus/angaza-shs/src/Http/Controllers/AngazaCredentialController.php @@ -7,19 +7,14 @@ use Inensus\AngazaSHS\Http\Resources\AngazaResource; use Inensus\AngazaSHS\Services\AngazaCredentialService; -class AngazaCredentialController extends Controller -{ - public function __construct(private AngazaCredentialService $credentialService) - { - } +class AngazaCredentialController extends Controller { + public function __construct(private AngazaCredentialService $credentialService) {} - public function show(): AngazaResource - { + public function show(): AngazaResource { return AngazaResource::make($this->credentialService->getCredentials()); } - public function update(AngazaCredentialRequest $request): AngazaResource - { + public function update(AngazaCredentialRequest $request): AngazaResource { $credentials = $this->credentialService->getCredentials(); $updateData = $request->only([ 'client_id', diff --git a/src/backend/packages/inensus/angaza-shs/src/Http/Requests/AngazaCredentialRequest.php b/src/backend/packages/inensus/angaza-shs/src/Http/Requests/AngazaCredentialRequest.php index 5d75da699..edd79d0cb 100644 --- a/src/backend/packages/inensus/angaza-shs/src/Http/Requests/AngazaCredentialRequest.php +++ b/src/backend/packages/inensus/angaza-shs/src/Http/Requests/AngazaCredentialRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class AngazaCredentialRequest extends FormRequest -{ +class AngazaCredentialRequest extends FormRequest { /** * Get the validation rules that apply to the request. * * @return array */ - public function rules() - { + public function rules() { return [ 'client_id' => ['required'], 'client_secret' => ['required'], diff --git a/src/backend/packages/inensus/angaza-shs/src/Http/Resources/AngazaResource.php b/src/backend/packages/inensus/angaza-shs/src/Http/Resources/AngazaResource.php index 4cd7c6ade..aa7c92501 100644 --- a/src/backend/packages/inensus/angaza-shs/src/Http/Resources/AngazaResource.php +++ b/src/backend/packages/inensus/angaza-shs/src/Http/Resources/AngazaResource.php @@ -5,8 +5,7 @@ use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\JsonResource; -class AngazaResource extends JsonResource -{ +class AngazaResource extends JsonResource { /** * Transform the resource into an array. * @@ -14,8 +13,7 @@ class AngazaResource extends JsonResource * * @return array */ - public function toArray($request) - { + public function toArray($request) { return parent::toArray($request); } } diff --git a/src/backend/packages/inensus/angaza-shs/src/Models/AngazaCredential.php b/src/backend/packages/inensus/angaza-shs/src/Models/AngazaCredential.php index 7665206b3..50b1b41d0 100644 --- a/src/backend/packages/inensus/angaza-shs/src/Models/AngazaCredential.php +++ b/src/backend/packages/inensus/angaza-shs/src/Models/AngazaCredential.php @@ -4,22 +4,18 @@ use App\Models\Base\BaseModel; -class AngazaCredential extends BaseModel -{ +class AngazaCredential extends BaseModel { protected $table = 'angaza_api_credentials'; - public function getClientSecret() - { + public function getClientSecret() { return $this->client_secret; } - public function getClientId() - { + public function getClientId() { return $this->client_id; } - public function getApiUrl() - { + public function getApiUrl() { return $this->api_url; } } diff --git a/src/backend/packages/inensus/angaza-shs/src/Models/AngazaTransaction.php b/src/backend/packages/inensus/angaza-shs/src/Models/AngazaTransaction.php index 7c6de08ea..91c2c1554 100644 --- a/src/backend/packages/inensus/angaza-shs/src/Models/AngazaTransaction.php +++ b/src/backend/packages/inensus/angaza-shs/src/Models/AngazaTransaction.php @@ -4,7 +4,6 @@ use App\Models\Base\BaseModel; -class AngazaTransaction extends BaseModel -{ +class AngazaTransaction extends BaseModel { protected $table = 'angaza_transactions'; } diff --git a/src/backend/packages/inensus/angaza-shs/src/Modules/Api/AngazaSHSApi.php b/src/backend/packages/inensus/angaza-shs/src/Modules/Api/AngazaSHSApi.php index 5b4338c6a..df4ed9672 100644 --- a/src/backend/packages/inensus/angaza-shs/src/Modules/Api/AngazaSHSApi.php +++ b/src/backend/packages/inensus/angaza-shs/src/Modules/Api/AngazaSHSApi.php @@ -12,19 +12,16 @@ use Inensus\AngazaSHS\Models\AngazaTransaction; use Inensus\AngazaSHS\Services\AngazaCredentialService; -class AngazaSHSApi implements IManufacturerAPI -{ +class AngazaSHSApi implements IManufacturerAPI { public const API_CALL_UNIT_CREDIT = '/unit_credit'; public function __construct( private AngazaCredentialService $credentialService, private AngazaTransaction $angazaTransaction, private ApiRequests $apiRequests, - ) { - } + ) {} - public function chargeMeter(TransactionDataContainer $transactionContainer): array - { + public function chargeMeter(TransactionDataContainer $transactionContainer): array { $dayDifferenceBetweenTwoInstallments = $transactionContainer->dayDifferenceBetweenTwoInstallments; $minimumPurchaseAmount = $transactionContainer->installmentCost; $minimumPurchaseAmountPerDay = @@ -88,8 +85,7 @@ public function chargeMeter(TransactionDataContainer $transactionContainer): arr * * @throws ApiCallDoesNotSupportedException */ - public function clearMeter(Meter $meters) - { + public function clearMeter(Meter $meters) { throw new ApiCallDoesNotSupportedException('This api call does not supported'); } } diff --git a/src/backend/packages/inensus/angaza-shs/src/Modules/Api/ApiRequests.php b/src/backend/packages/inensus/angaza-shs/src/Modules/Api/ApiRequests.php index 438668e60..ecf3aa84d 100644 --- a/src/backend/packages/inensus/angaza-shs/src/Modules/Api/ApiRequests.php +++ b/src/backend/packages/inensus/angaza-shs/src/Modules/Api/ApiRequests.php @@ -7,15 +7,12 @@ use Inensus\AngazaSHS\Exceptions\AngazaApiResponseException; use Inensus\AngazaSHS\Models\AngazaCredential; -class ApiRequests -{ +class ApiRequests { public function __construct( private Client $httpClient, - ) { - } + ) {} - public function get(AngazaCredential $credentials, array $params, string $slug) - { + public function get(AngazaCredential $credentials, array $params, string $slug) { $url = $credentials->getApiUrl().$slug; foreach ($params as $key => $value) { $url .= $key.'='.$value.'&'; @@ -41,8 +38,7 @@ public function get(AngazaCredential $credentials, array $params, string $slug) } } - public function put(AngazaCredential $credentials, array $params, string $slug) - { + public function put(AngazaCredential $credentials, array $params, string $slug) { $url = $credentials->getApiUrl().$slug; try { $request = $this->httpClient->put( @@ -70,8 +66,7 @@ public function put(AngazaCredential $credentials, array $params, string $slug) } } - private function getBasicAuthHeader($credentials) - { + private function getBasicAuthHeader($credentials) { $username = $credentials->getClientId(); $password = $credentials->getClientSecret(); $credentials = $username.':'.$password; diff --git a/src/backend/packages/inensus/angaza-shs/src/Providers/AngazaSHSServiceProvider.php b/src/backend/packages/inensus/angaza-shs/src/Providers/AngazaSHSServiceProvider.php index 6fb005cc4..50321dabb 100644 --- a/src/backend/packages/inensus/angaza-shs/src/Providers/AngazaSHSServiceProvider.php +++ b/src/backend/packages/inensus/angaza-shs/src/Providers/AngazaSHSServiceProvider.php @@ -8,10 +8,8 @@ use Inensus\AngazaSHS\Console\Commands\InstallPackage; use Inensus\AngazaSHS\Modules\Api\AngazaSHSApi; -class AngazaSHSServiceProvider extends ServiceProvider -{ - public function boot(Filesystem $filesystem) - { +class AngazaSHSServiceProvider extends ServiceProvider { + public function boot(Filesystem $filesystem) { $this->app->register(RouteServiceProvider::class); if ($this->app->runningInConsole()) { $this->publishConfigFiles(); @@ -21,37 +19,32 @@ public function boot(Filesystem $filesystem) } } - public function register() - { + public function register() { $this->mergeConfigFrom(__DIR__.'/../../config/angaza-shs.php', 'angaza-shs'); $this->app->register(EventServiceProvider::class); $this->app->register(ObserverServiceProvider::class); $this->app->bind('AngazaSHSApi', AngazaSHSApi::class); } - public function publishConfigFiles() - { + public function publishConfigFiles() { $this->publishes([ __DIR__.'/../../config/angaza-shs.php' => config_path('angaza-shs.php'), ]); } - public function publishVueFiles() - { + public function publishVueFiles() { $this->publishes([ __DIR__.'/../resources/assets' => resource_path('assets/js/plugins/angaza-shs'), ], 'vue-components'); } - public function publishMigrations($filesystem) - { + public function publishMigrations($filesystem) { $this->publishes([ __DIR__.'/../../database/migrations/create_angaza_tables.php.stub' => $this->getMigrationFileName($filesystem), ], 'migrations'); } - protected function getMigrationFileName(Filesystem $filesystem): string - { + protected function getMigrationFileName(Filesystem $filesystem): string { $timestamp = date('Y_m_d_His'); return Collection::make($this->app->databasePath().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR) diff --git a/src/backend/packages/inensus/angaza-shs/src/Providers/EventServiceProvider.php b/src/backend/packages/inensus/angaza-shs/src/Providers/EventServiceProvider.php index 59a4b23f9..3254a5390 100644 --- a/src/backend/packages/inensus/angaza-shs/src/Providers/EventServiceProvider.php +++ b/src/backend/packages/inensus/angaza-shs/src/Providers/EventServiceProvider.php @@ -4,8 +4,7 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; -class EventServiceProvider extends ServiceProvider -{ +class EventServiceProvider extends ServiceProvider { protected $subscribe = [ ]; @@ -14,8 +13,7 @@ class EventServiceProvider extends ServiceProvider * * @return void */ - public function boot() - { + public function boot() { parent::boot(); } } diff --git a/src/backend/packages/inensus/angaza-shs/src/Providers/ObserverServiceProvider.php b/src/backend/packages/inensus/angaza-shs/src/Providers/ObserverServiceProvider.php index 7f32ed28b..288bcb048 100644 --- a/src/backend/packages/inensus/angaza-shs/src/Providers/ObserverServiceProvider.php +++ b/src/backend/packages/inensus/angaza-shs/src/Providers/ObserverServiceProvider.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; -class ObserverServiceProvider extends ServiceProvider -{ +class ObserverServiceProvider extends ServiceProvider { /** * Register any events for your application. * * @return void */ - public function boot() - { + public function boot() { parent::boot(); } } diff --git a/src/backend/packages/inensus/angaza-shs/src/Providers/RouteServiceProvider.php b/src/backend/packages/inensus/angaza-shs/src/Providers/RouteServiceProvider.php index f4f389b69..85f5324d3 100644 --- a/src/backend/packages/inensus/angaza-shs/src/Providers/RouteServiceProvider.php +++ b/src/backend/packages/inensus/angaza-shs/src/Providers/RouteServiceProvider.php @@ -5,22 +5,18 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Support\Facades\Route; -class RouteServiceProvider extends ServiceProvider -{ +class RouteServiceProvider extends ServiceProvider { protected $namespace = 'Inensus\AngazaSHS\Http\Controllers'; - public function boot() - { + public function boot() { parent::boot(); } - public function map() - { + public function map() { $this->mapApiRoutes(); } - protected function mapApiRoutes() - { + protected function mapApiRoutes() { Route::prefix('api') ->middleware('api') ->namespace($this->namespace) diff --git a/src/backend/packages/inensus/angaza-shs/src/Services/AngazaCredentialService.php b/src/backend/packages/inensus/angaza-shs/src/Services/AngazaCredentialService.php index e63b14d25..6362c5ad1 100644 --- a/src/backend/packages/inensus/angaza-shs/src/Services/AngazaCredentialService.php +++ b/src/backend/packages/inensus/angaza-shs/src/Services/AngazaCredentialService.php @@ -4,43 +4,36 @@ use Inensus\AngazaSHS\Models\AngazaCredential; -class AngazaCredentialService -{ +class AngazaCredentialService { public function __construct( private AngazaCredential $credential, - ) { - } + ) {} /** * This function uses one time on installation of the package. */ - public function createCredentials() - { + public function createCredentials() { return $this->credential->newQuery()->firstOrCreate(['id' => 1], [ 'client_id' => null, 'client_secret' => null, ]); } - public function getCredentials() - { + public function getCredentials() { return $this->credential->newQuery()->first(); } - public function updateCredentials($credentials, $updateData) - { + public function updateCredentials($credentials, $updateData) { $credentials->update($updateData); return $credentials->fresh(); } - public function getById($id) - { + public function getById($id) { return $this->credential->newQuery()->findOrFail($id); } - public function isAccessTokenValid($credential) - { + public function isAccessTokenValid($credential) { $accessToken = $credential->getAccessToken(); if ($accessToken == null) { diff --git a/src/backend/packages/inensus/angaza-shs/src/Services/ManufacturerService.php b/src/backend/packages/inensus/angaza-shs/src/Services/ManufacturerService.php index 5b6179c7c..464edf848 100644 --- a/src/backend/packages/inensus/angaza-shs/src/Services/ManufacturerService.php +++ b/src/backend/packages/inensus/angaza-shs/src/Services/ManufacturerService.php @@ -4,14 +4,10 @@ use App\Models\Manufacturer; -class ManufacturerService -{ - public function __construct(private Manufacturer $manufacturer) - { - } +class ManufacturerService { + public function __construct(private Manufacturer $manufacturer) {} - public function register() - { + public function register() { $api = $this->manufacturer->newQuery()->where('api_name', 'AngazaSHSApi')->first(); if (!$api) { $this->manufacturer->newQuery()->create([ diff --git a/src/backend/packages/inensus/bulk-registration/database/migrations/create_bulk_registration_tables.php b/src/backend/packages/inensus/bulk-registration/database/migrations/create_bulk_registration_tables.php index 987381d2d..c3cabb04d 100644 --- a/src/backend/packages/inensus/bulk-registration/database/migrations/create_bulk_registration_tables.php +++ b/src/backend/packages/inensus/bulk-registration/database/migrations/create_bulk_registration_tables.php @@ -5,8 +5,7 @@ use Illuminate\Support\Facades\Schema; return new class extends Migration { - public function up() - { + public function up() { if (!Schema::hasTable('bulk_registration_csv_datas')) { Schema::create('bulk_registration_csv_datas', function (Blueprint $table) { $table->increments('id'); @@ -18,8 +17,7 @@ public function up() } } - public function down() - { + public function down() { Schema::dropIfExists('bulk_registration_csv_datas'); } }; diff --git a/src/backend/packages/inensus/bulk-registration/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/bulk-registration/src/Console/Commands/InstallPackage.php index a4b803653..15cfa3191 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/bulk-registration/src/Console/Commands/InstallPackage.php @@ -5,8 +5,7 @@ use Illuminate\Console\Command; use Inensus\BulkRegistration\Services\MeterTypeService; -class InstallPackage extends Command -{ +class InstallPackage extends Command { protected $signature = 'bulk-registration:install'; protected $description = 'Install Bulk Registration Package'; @@ -17,8 +16,7 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { $this->info('Installing BulkRegistration Integration Package\n'); $this->meterTypeService->createDefaultMeterTypeIfDoesNotExistAny(); @@ -26,8 +24,7 @@ public function handle(): void $this->info('Package installed successfully..'); } - private function publishConfigurations() - { + private function publishConfigurations() { $this->info('Copying configurations\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\BulkRegistration\Providers\BulkRegistrationServiceProvider", @@ -35,8 +32,7 @@ private function publishConfigurations() ]); } - private function publishMigrations() - { + private function publishMigrations() { $this->info('Copying migrations\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\BulkRegistration\Providers\BulkRegistrationServiceProvider", @@ -44,14 +40,12 @@ private function publishMigrations() ]); } - private function createDatabaseTables() - { + private function createDatabaseTables() { $this->info('Creating database tables\n'); $this->call('migrate'); } - private function publishVueFiles() - { + private function publishVueFiles() { $this->info('Copying vue files\n'); $this->call('vendor:publish', [ @@ -61,8 +55,7 @@ private function publishVueFiles() ]); } - private function createPluginRecord() - { + private function createPluginRecord() { $this->call('plugin:add', [ 'name' => 'BulkRegistration', 'composer_name' => 'inensus/bulk-registration', diff --git a/src/backend/packages/inensus/bulk-registration/src/Console/Commands/UpdatePackage.php b/src/backend/packages/inensus/bulk-registration/src/Console/Commands/UpdatePackage.php index 51a1f0db0..5641ccb77 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Console/Commands/UpdatePackage.php +++ b/src/backend/packages/inensus/bulk-registration/src/Console/Commands/UpdatePackage.php @@ -6,8 +6,7 @@ use Illuminate\Filesystem\Filesystem; use Illuminate\Support\Facades\DB; -class UpdatePackage extends Command -{ +class UpdatePackage extends Command { protected $signature = 'bulk-registration:update'; protected $description = 'Update Bulk Registration Package'; @@ -18,8 +17,7 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { $this->info('Bulk Registration Updating Started\n'); $this->removeOldVersionOfPackage(); $this->installNewVersionOfPackage(); @@ -33,8 +31,7 @@ public function handle(): void $this->info('Package updated successfully..'); } - private function publishConfigurations() - { + private function publishConfigurations() { $this->info('Copying configurations\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\BulkRegistration\Providers\BulkRegistrationServiceProvider", @@ -42,20 +39,17 @@ private function publishConfigurations() ]); } - private function removeOldVersionOfPackage() - { + private function removeOldVersionOfPackage() { $this->info('Removing former version of package\n'); echo shell_exec('COMPOSER_MEMORY_LIMIT=-1 ../composer.phar remove inensus/bulk-registration'); } - private function installNewVersionOfPackage() - { + private function installNewVersionOfPackage() { $this->info('Installing last version of package\n'); echo shell_exec('COMPOSER_MEMORY_LIMIT=-1 ../composer.phar require inensus/bulk-registration'); } - private function deleteMigration(Filesystem $filesystem) - { + private function deleteMigration(Filesystem $filesystem) { $migrationFile = $filesystem->glob(database_path().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR.'*_create_bulk-registration_tables.php')[0]; $migration = DB::table('migrations') ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->first(); @@ -67,8 +61,7 @@ private function deleteMigration(Filesystem $filesystem) ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->delete(); } - private function publishMigrationsAgain() - { + private function publishMigrationsAgain() { $this->info('Copying migrations\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\BulkRegistration\Providers\BulkRegistrationServiceProvider", @@ -76,14 +69,12 @@ private function publishMigrationsAgain() ]); } - private function updateDatabase() - { + private function updateDatabase() { $this->info('Updating database tables\n'); $this->call('migrate'); } - private function publishVueFilesAgain() - { + private function publishVueFilesAgain() { $this->info('Copying vue files\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\BulkRegistration\Providers\BulkRegistrationServiceProvider", diff --git a/src/backend/packages/inensus/bulk-registration/src/Exceptions/ClusterNotFoundException.php b/src/backend/packages/inensus/bulk-registration/src/Exceptions/ClusterNotFoundException.php index 092c0ee75..ad3f1f299 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Exceptions/ClusterNotFoundException.php +++ b/src/backend/packages/inensus/bulk-registration/src/Exceptions/ClusterNotFoundException.php @@ -2,6 +2,4 @@ namespace Inensus\BulkRegistration\Exceptions; -class ClusterNotFoundException extends MissingDataException -{ -} +class ClusterNotFoundException extends MissingDataException {} diff --git a/src/backend/packages/inensus/bulk-registration/src/Exceptions/CsvDataParserException.php b/src/backend/packages/inensus/bulk-registration/src/Exceptions/CsvDataParserException.php index 3a75722a3..e5e8bcf3c 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Exceptions/CsvDataParserException.php +++ b/src/backend/packages/inensus/bulk-registration/src/Exceptions/CsvDataParserException.php @@ -2,6 +2,4 @@ namespace Inensus\BulkRegistration\Exceptions; -class CsvDataParserException extends \Exception -{ -} +class CsvDataParserException extends \Exception {} diff --git a/src/backend/packages/inensus/bulk-registration/src/Exceptions/GoogleMapsApiException.php b/src/backend/packages/inensus/bulk-registration/src/Exceptions/GoogleMapsApiException.php index 0b206f491..b4bd95f1a 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Exceptions/GoogleMapsApiException.php +++ b/src/backend/packages/inensus/bulk-registration/src/Exceptions/GoogleMapsApiException.php @@ -2,10 +2,8 @@ namespace Inensus\BulkRegistration\Exceptions; -class GoogleMapsApiException extends Exception -{ - public function render($request) - { +class GoogleMapsApiException extends Exception { + public function render($request) { return response()->json([ 'errors' => [ 'code' => 422, diff --git a/src/backend/packages/inensus/bulk-registration/src/Exceptions/Handler.php b/src/backend/packages/inensus/bulk-registration/src/Exceptions/Handler.php index 0e1cf57d0..a1d6d5d9e 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Exceptions/Handler.php +++ b/src/backend/packages/inensus/bulk-registration/src/Exceptions/Handler.php @@ -5,8 +5,7 @@ use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Spatie\Geocoder\Exceptions\CouldNotGeocode; -class Handler extends ExceptionHandler -{ +class Handler extends ExceptionHandler { /** * A list of the exception types that are not reported. * @@ -32,8 +31,7 @@ class Handler extends ExceptionHandler * * @throws \Exception */ - public function report(\Throwable $exception) - { + public function report(\Throwable $exception) { parent::report($exception); } @@ -46,8 +44,7 @@ public function report(\Throwable $exception) * * @throws \Throwable */ - public function render($request, \Throwable $exception) - { + public function render($request, \Throwable $exception) { if ($exception instanceof CouldNotGeocode) { new GoogleMapsApiException(json_encode($exception->errors())); } diff --git a/src/backend/packages/inensus/bulk-registration/src/Exceptions/ManufacturerNotSupportedException.php b/src/backend/packages/inensus/bulk-registration/src/Exceptions/ManufacturerNotSupportedException.php index 96e3416d8..6e1867634 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Exceptions/ManufacturerNotSupportedException.php +++ b/src/backend/packages/inensus/bulk-registration/src/Exceptions/ManufacturerNotSupportedException.php @@ -2,6 +2,4 @@ namespace Inensus\BulkRegistration\Exceptions; -class ManufacturerNotSupportedException extends MissingDataException -{ -} +class ManufacturerNotSupportedException extends MissingDataException {} diff --git a/src/backend/packages/inensus/bulk-registration/src/Exceptions/MiniGridNotFoundException.php b/src/backend/packages/inensus/bulk-registration/src/Exceptions/MiniGridNotFoundException.php index 956684318..1cd8960ed 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Exceptions/MiniGridNotFoundException.php +++ b/src/backend/packages/inensus/bulk-registration/src/Exceptions/MiniGridNotFoundException.php @@ -2,6 +2,4 @@ namespace Inensus\BulkRegistration\Exceptions; -class MiniGridNotFoundException extends MissingDataException -{ -} +class MiniGridNotFoundException extends MissingDataException {} diff --git a/src/backend/packages/inensus/bulk-registration/src/Exceptions/MissingDataException.php b/src/backend/packages/inensus/bulk-registration/src/Exceptions/MissingDataException.php index 7fbfa41f4..b0e06e839 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Exceptions/MissingDataException.php +++ b/src/backend/packages/inensus/bulk-registration/src/Exceptions/MissingDataException.php @@ -2,6 +2,4 @@ namespace Inensus\BulkRegistration\Exceptions; -class MissingDataException extends \Exception -{ -} +class MissingDataException extends \Exception {} diff --git a/src/backend/packages/inensus/bulk-registration/src/Exceptions/VillageNotFoundException.php b/src/backend/packages/inensus/bulk-registration/src/Exceptions/VillageNotFoundException.php index 135be2881..fd7eec95e 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Exceptions/VillageNotFoundException.php +++ b/src/backend/packages/inensus/bulk-registration/src/Exceptions/VillageNotFoundException.php @@ -2,6 +2,4 @@ namespace Inensus\BulkRegistration\Exceptions; -class VillageNotFoundException extends MissingDataException -{ -} +class VillageNotFoundException extends MissingDataException {} diff --git a/src/backend/packages/inensus/bulk-registration/src/Helpers/CsvDataProcessor.php b/src/backend/packages/inensus/bulk-registration/src/Helpers/CsvDataProcessor.php index cba669c12..3533acd28 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Helpers/CsvDataProcessor.php +++ b/src/backend/packages/inensus/bulk-registration/src/Helpers/CsvDataProcessor.php @@ -6,8 +6,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Log; -class CsvDataProcessor -{ +class CsvDataProcessor { public const CONNECTION_GROUP = 1; private $geographicalLocationFinder; @@ -16,8 +15,7 @@ class CsvDataProcessor private $recentlyCreatedRecords; - public function __construct(GeographicalLocationFinder $geographicalLocationFinder) - { + public function __construct(GeographicalLocationFinder $geographicalLocationFinder) { $this->geographicalLocationFinder = $geographicalLocationFinder; $this->reflections = config('bulk-registration.reflections'); $this->recentlyCreatedRecords = [ @@ -32,8 +30,7 @@ public function __construct(GeographicalLocationFinder $geographicalLocationFind ]; } - public function processParsedCsvData($csvData) - { + public function processParsedCsvData($csvData) { Collect($csvData)->each(function ($row) { try { DB::connection('shard')->beginTransaction(); @@ -101,15 +98,13 @@ public function processParsedCsvData($csvData) return $this->recentlyCreatedRecords; } - private function createRecordFromCsv($row, $serviceName) - { + private function createRecordFromCsv($row, $serviceName) { $service = app()->make($serviceName); return $service->resolveCsvDataFromComingRow($row); } - private function checkRecordWasRecentlyCreated($record, $type) - { + private function checkRecordWasRecentlyCreated($record, $type) { if ($record->wasRecentlyCreated) { ++$this->recentlyCreatedRecords[$type]; } diff --git a/src/backend/packages/inensus/bulk-registration/src/Helpers/CsvFileParser.php b/src/backend/packages/inensus/bulk-registration/src/Helpers/CsvFileParser.php index 099f05e88..0db5e0e4a 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Helpers/CsvFileParser.php +++ b/src/backend/packages/inensus/bulk-registration/src/Helpers/CsvFileParser.php @@ -4,17 +4,14 @@ use ParseCsv\Csv; -class CsvFileParser -{ +class CsvFileParser { private $csv; - public function __construct() - { + public function __construct() { $this->csv = new Csv(); } - public function parseCsvFromFilePath($path) - { + public function parseCsvFromFilePath($path) { $this->csv->auto($path); return $this->csv->data; diff --git a/src/backend/packages/inensus/bulk-registration/src/Helpers/GeographicalLocationFinder.php b/src/backend/packages/inensus/bulk-registration/src/Helpers/GeographicalLocationFinder.php index 0c1d8f3b8..bcf1015ae 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Helpers/GeographicalLocationFinder.php +++ b/src/backend/packages/inensus/bulk-registration/src/Helpers/GeographicalLocationFinder.php @@ -4,10 +4,8 @@ use Spatie\Geocoder\Geocoder; -class GeographicalLocationFinder -{ - public function getCoordinatesGivenAddress($address) - { +class GeographicalLocationFinder { + public function getCoordinatesGivenAddress($address) { $client = new \GuzzleHttp\Client(); $geocoder = new Geocoder($client); $geocoder->setApiKey(config('bulk-registration.geocoder.key')); diff --git a/src/backend/packages/inensus/bulk-registration/src/Http/Controllers/ImportCsvController.php b/src/backend/packages/inensus/bulk-registration/src/Http/Controllers/ImportCsvController.php index bf92cb4df..1d5b21314 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Http/Controllers/ImportCsvController.php +++ b/src/backend/packages/inensus/bulk-registration/src/Http/Controllers/ImportCsvController.php @@ -7,18 +7,15 @@ use Inensus\BulkRegistration\Http\Resources\CsvData as CsvDataResource; use Inensus\BulkRegistration\Services\CsvDataService; -class ImportCsvController extends Controller -{ +class ImportCsvController extends Controller { private $csvDataService; - public function __construct(CsvDataService $csvDataService) - { + public function __construct(CsvDataService $csvDataService) { set_time_limit(8000000); $this->csvDataService = $csvDataService; } - public function store(ImportCsvRequest $request) - { + public function store(ImportCsvRequest $request) { return new CsvDataResource($this->csvDataService->create($request)); } } diff --git a/src/backend/packages/inensus/bulk-registration/src/Http/Requests/ImportCsvRequest.php b/src/backend/packages/inensus/bulk-registration/src/Http/Requests/ImportCsvRequest.php index 1f71bcb5c..036762d3b 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Http/Requests/ImportCsvRequest.php +++ b/src/backend/packages/inensus/bulk-registration/src/Http/Requests/ImportCsvRequest.php @@ -4,23 +4,20 @@ use Illuminate\Foundation\Http\FormRequest; -class ImportCsvRequest extends FormRequest -{ +class ImportCsvRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } /** * Get the validation rules that apply to the request. */ - public function rules(): array - { + public function rules(): array { return ['csv' => 'required|mimes:csv,txt']; } } diff --git a/src/backend/packages/inensus/bulk-registration/src/Http/Resources/CsvData.php b/src/backend/packages/inensus/bulk-registration/src/Http/Resources/CsvData.php index 4914185d5..b1efaa41d 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Http/Resources/CsvData.php +++ b/src/backend/packages/inensus/bulk-registration/src/Http/Resources/CsvData.php @@ -4,10 +4,8 @@ use Illuminate\Http\Resources\Json\JsonResource; -class CsvData extends JsonResource -{ - public function toArray($request) - { +class CsvData extends JsonResource { + public function toArray($request) { return [ 'data' => [ 'type' => 'csv_data', diff --git a/src/backend/packages/inensus/bulk-registration/src/Models/BaseModel.php b/src/backend/packages/inensus/bulk-registration/src/Models/BaseModel.php index e2bba09e6..a571ff2ea 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Models/BaseModel.php +++ b/src/backend/packages/inensus/bulk-registration/src/Models/BaseModel.php @@ -4,14 +4,12 @@ use Illuminate\Database\Eloquent\Model; -class BaseModel extends Model -{ +class BaseModel extends Model { protected $guarded = ['id']; public static $rules = []; - public function resolveChildRouteBinding($childType, $value, $field) - { + public function resolveChildRouteBinding($childType, $value, $field) { // TODO: Implement resolveChildRouteBinding() method. } } diff --git a/src/backend/packages/inensus/bulk-registration/src/Models/CsvData.php b/src/backend/packages/inensus/bulk-registration/src/Models/CsvData.php index 6e58bb289..8e7cfc867 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Models/CsvData.php +++ b/src/backend/packages/inensus/bulk-registration/src/Models/CsvData.php @@ -4,7 +4,6 @@ use App\Models\Base\BaseModel; -class CsvData extends BaseModel -{ +class CsvData extends BaseModel { protected $table = 'bulk_registration_csv_datas'; } diff --git a/src/backend/packages/inensus/bulk-registration/src/Providers/BulkRegistrationServiceProvider.php b/src/backend/packages/inensus/bulk-registration/src/Providers/BulkRegistrationServiceProvider.php index 1b340af76..94bb54c75 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Providers/BulkRegistrationServiceProvider.php +++ b/src/backend/packages/inensus/bulk-registration/src/Providers/BulkRegistrationServiceProvider.php @@ -8,10 +8,8 @@ use Inensus\BulkRegistration\Console\Commands\InstallPackage; use Inensus\BulkRegistration\Console\Commands\UpdatePackage; -class BulkRegistrationServiceProvider extends ServiceProvider -{ - public function boot(Filesystem $filesystem) - { +class BulkRegistrationServiceProvider extends ServiceProvider { + public function boot(Filesystem $filesystem) { $this->app->register(RouteServiceProvider::class); if ($this->app->runningInConsole()) { $this->publishConfigFiles(); @@ -21,8 +19,7 @@ public function boot(Filesystem $filesystem) } } - public function register() - { + public function register() { $this->mergeConfigFrom( __DIR__.'/../../config/bulk-registration.php', 'bulk-registration' @@ -34,15 +31,13 @@ public function register() });*/ } - public function publishConfigFiles() - { + public function publishConfigFiles() { $this->publishes([ __DIR__.'/../../config/bulk-registration.php' => config_path('bulk-registration.php'), ], 'configurations'); } - public function publishVueFiles() - { + public function publishVueFiles() { $this->publishes([ __DIR__.'/../resources/assets' => resource_path( 'assets/js/plugins/bulk-registration' @@ -50,15 +45,13 @@ public function publishVueFiles() ], 'vue-components'); } - public function publishMigrations($filesystem) - { + public function publishMigrations($filesystem) { $this->publishes([ __DIR__.'/../../database/migrations/create_bulk_registration_tables.php' => $this->getMigrationFileName($filesystem), ], 'migrations'); } - protected function getMigrationFileName(Filesystem $filesystem): string - { + protected function getMigrationFileName(Filesystem $filesystem): string { $timestamp = date('Y_m_d_His'); return Collection::make($this->app->databasePath().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR) diff --git a/src/backend/packages/inensus/bulk-registration/src/Providers/EventServiceProvider.php b/src/backend/packages/inensus/bulk-registration/src/Providers/EventServiceProvider.php index ffc1a4a0e..8e4be4e8b 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Providers/EventServiceProvider.php +++ b/src/backend/packages/inensus/bulk-registration/src/Providers/EventServiceProvider.php @@ -4,8 +4,7 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; -class EventServiceProvider extends ServiceProvider -{ +class EventServiceProvider extends ServiceProvider { protected $subscribe = [ ]; @@ -14,8 +13,7 @@ class EventServiceProvider extends ServiceProvider * * @return void */ - public function boot() - { + public function boot() { parent::boot(); } } diff --git a/src/backend/packages/inensus/bulk-registration/src/Providers/ObserverServiceProvider.php b/src/backend/packages/inensus/bulk-registration/src/Providers/ObserverServiceProvider.php index 5a2a517c9..7678526ff 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Providers/ObserverServiceProvider.php +++ b/src/backend/packages/inensus/bulk-registration/src/Providers/ObserverServiceProvider.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; -class ObserverServiceProvider extends ServiceProvider -{ +class ObserverServiceProvider extends ServiceProvider { /** * Register any events for your application. * * @return void */ - public function boot() - { + public function boot() { parent::boot(); } } diff --git a/src/backend/packages/inensus/bulk-registration/src/Providers/RouteServiceProvider.php b/src/backend/packages/inensus/bulk-registration/src/Providers/RouteServiceProvider.php index f6aa8ae52..0e0ef405e 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Providers/RouteServiceProvider.php +++ b/src/backend/packages/inensus/bulk-registration/src/Providers/RouteServiceProvider.php @@ -5,22 +5,18 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Support\Facades\Route; -class RouteServiceProvider extends ServiceProvider -{ +class RouteServiceProvider extends ServiceProvider { protected $namespace = 'Inensus\BulkRegistration\Http\Controllers'; - public function boot() - { + public function boot() { parent::boot(); } - public function map() - { + public function map() { $this->mapApiRoutes(); } - protected function mapApiRoutes() - { + protected function mapApiRoutes() { Route::prefix('api') ->middleware('api') ->namespace($this->namespace) diff --git a/src/backend/packages/inensus/bulk-registration/src/Services/AddressService.php b/src/backend/packages/inensus/bulk-registration/src/Services/AddressService.php index 066865143..e8af4a097 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Services/AddressService.php +++ b/src/backend/packages/inensus/bulk-registration/src/Services/AddressService.php @@ -4,22 +4,18 @@ use App\Models\Address\Address; -class AddressService extends CreatorService -{ - public function __construct(Address $address) - { +class AddressService extends CreatorService { + public function __construct(Address $address) { parent::__construct($address); } - public function createRelatedDataIfDoesNotExists($addresses) - { + public function createRelatedDataIfDoesNotExists($addresses) { foreach ($addresses as $address) { Address::query()->firstOrCreate($address, $address); } } - public function resolveCsvDataFromComingRow($csvData) - { + public function resolveCsvDataFromComingRow($csvData) { $addressConfig = config('bulk-registration.csv_fields.address'); $returnAddresses = []; $firstAddressData = [ @@ -43,8 +39,7 @@ public function resolveCsvDataFromComingRow($csvData) $this->createRelatedDataIfDoesNotExists($returnAddresses); } - public function createForPerson(int $personId, int $cityId, ?string $phone, ?string $email, ?string $street, bool $isPrimary): Address - { + public function createForPerson(int $personId, int $cityId, ?string $phone, ?string $email, ?string $street, bool $isPrimary): Address { $address = new Address(); $address->setOwner($personId, 'person'); $address->setCityId($cityId); diff --git a/src/backend/packages/inensus/bulk-registration/src/Services/ApplianceTypeService.php b/src/backend/packages/inensus/bulk-registration/src/Services/ApplianceTypeService.php index a145f3a48..3d2c65a04 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Services/ApplianceTypeService.php +++ b/src/backend/packages/inensus/bulk-registration/src/Services/ApplianceTypeService.php @@ -4,22 +4,18 @@ use App\Models\AssetType; -class ApplianceTypeService extends CreatorService -{ - public function __construct(AssetType $assetType) - { +class ApplianceTypeService extends CreatorService { + public function __construct(AssetType $assetType) { parent::__construct($assetType); } - public function createRelatedDataIfDoesNotExists($appliances) - { + public function createRelatedDataIfDoesNotExists($appliances) { foreach ($appliances as $appliance) { AssetType::query()->firstOrCreate($appliance, $appliance); } } - public function resolveCsvDataFromComingRow($csvData) - { + public function resolveCsvDataFromComingRow($csvData) { $applianceTypeConfig = config('bulk-registration.csv_fields.appliance_type'); $applianceTypes = config('bulk-registration.appliance_types'); diff --git a/src/backend/packages/inensus/bulk-registration/src/Services/CityService.php b/src/backend/packages/inensus/bulk-registration/src/Services/CityService.php index 690d62dea..e04e29255 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Services/CityService.php +++ b/src/backend/packages/inensus/bulk-registration/src/Services/CityService.php @@ -5,15 +5,12 @@ use App\Models\City; use Inensus\BulkRegistration\Exceptions\VillageNotFoundException; -class CityService extends CreatorService -{ - public function __construct(City $city) - { +class CityService extends CreatorService { + public function __construct(City $city) { parent::__construct($city); } - public function resolveCsvDataFromComingRow($csvData) - { + public function resolveCsvDataFromComingRow($csvData) { $cityConfig = config('bulk-registration.csv_fields.city'); if (!$csvData[$cityConfig['name']]) { diff --git a/src/backend/packages/inensus/bulk-registration/src/Services/ClusterService.php b/src/backend/packages/inensus/bulk-registration/src/Services/ClusterService.php index bfde714e2..5954a180d 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Services/ClusterService.php +++ b/src/backend/packages/inensus/bulk-registration/src/Services/ClusterService.php @@ -6,15 +6,12 @@ use App\Models\User; use Inensus\BulkRegistration\Exceptions\ClusterNotFoundException; -class ClusterService extends CreatorService -{ - public function __construct(Cluster $cluster) - { +class ClusterService extends CreatorService { + public function __construct(Cluster $cluster) { parent::__construct($cluster); } - public function resolveCsvDataFromComingRow($csvData) - { + public function resolveCsvDataFromComingRow($csvData) { $clusterConfig = config('bulk-registration.csv_fields.cluster'); if (!$csvData[$clusterConfig['name']]) { diff --git a/src/backend/packages/inensus/bulk-registration/src/Services/ConnectionGroupService.php b/src/backend/packages/inensus/bulk-registration/src/Services/ConnectionGroupService.php index 410e717d1..4df46eae0 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Services/ConnectionGroupService.php +++ b/src/backend/packages/inensus/bulk-registration/src/Services/ConnectionGroupService.php @@ -4,15 +4,12 @@ use App\Models\ConnectionGroup; -class ConnectionGroupService extends CreatorService -{ - public function __construct(ConnectionGroup $connectionGroup) - { +class ConnectionGroupService extends CreatorService { + public function __construct(ConnectionGroup $connectionGroup) { parent::__construct($connectionGroup); } - public function resolveCsvDataFromComingRow($csvData) - { + public function resolveCsvDataFromComingRow($csvData) { $connectionGroupConfig = config('bulk-registration.csv_fields.connection_group'); $connectionGroupData = [ 'name' => $csvData[$connectionGroupConfig['name']], diff --git a/src/backend/packages/inensus/bulk-registration/src/Services/ConnectionTypeService.php b/src/backend/packages/inensus/bulk-registration/src/Services/ConnectionTypeService.php index 3874ddec4..25cb26138 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Services/ConnectionTypeService.php +++ b/src/backend/packages/inensus/bulk-registration/src/Services/ConnectionTypeService.php @@ -4,15 +4,12 @@ use App\Models\ConnectionType; -class ConnectionTypeService extends CreatorService -{ - public function __construct(ConnectionType $connectionType) - { +class ConnectionTypeService extends CreatorService { + public function __construct(ConnectionType $connectionType) { parent::__construct($connectionType); } - public function resolveCsvDataFromComingRow($csvData) - { + public function resolveCsvDataFromComingRow($csvData) { $connectionTypeConfig = config('bulk-registration.csv_fields.connection_type'); $connectionTypeData = [ 'name' => $csvData[$connectionTypeConfig['name']], diff --git a/src/backend/packages/inensus/bulk-registration/src/Services/CreatorService.php b/src/backend/packages/inensus/bulk-registration/src/Services/CreatorService.php index e90c8fefc..5971fcf59 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Services/CreatorService.php +++ b/src/backend/packages/inensus/bulk-registration/src/Services/CreatorService.php @@ -2,17 +2,14 @@ namespace Inensus\BulkRegistration\Services; -abstract class CreatorService implements ICreatorService -{ +abstract class CreatorService implements ICreatorService { protected $model; - public function __construct($model) - { + public function __construct($model) { $this->model = $model; } - public function createRelatedDataIfDoesNotExists($resolvedCsvData) - { + public function createRelatedDataIfDoesNotExists($resolvedCsvData) { return $this->model->newQuery()->firstOrCreate($resolvedCsvData, $resolvedCsvData); } diff --git a/src/backend/packages/inensus/bulk-registration/src/Services/CsvDataService.php b/src/backend/packages/inensus/bulk-registration/src/Services/CsvDataService.php index 4c8b23f84..f5f7ff881 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Services/CsvDataService.php +++ b/src/backend/packages/inensus/bulk-registration/src/Services/CsvDataService.php @@ -7,23 +7,20 @@ use Inensus\BulkRegistration\Helpers\CsvFileParser; use Inensus\BulkRegistration\Models\CsvData; -class CsvDataService -{ +class CsvDataService { private $csvData; private $csvDataProcessor; private $csvFileParser; - public function __construct(CsvData $csvData, CsvFileParser $csvFileParser, CsvDataProcessor $csvDataProcessor) - { + public function __construct(CsvData $csvData, CsvFileParser $csvFileParser, CsvDataProcessor $csvDataProcessor) { $this->csvData = $csvData; $this->csvDataProcessor = $csvDataProcessor; $this->csvFileParser = $csvFileParser; } - public function create($request) - { + public function create($request) { $path = $request->file('csv'); $parsedCsvData = $this->csvFileParser->parseCsvFromFilePath($path); $message = ''; diff --git a/src/backend/packages/inensus/bulk-registration/src/Services/GeographicalInformationService.php b/src/backend/packages/inensus/bulk-registration/src/Services/GeographicalInformationService.php index 07bcea68e..49a2c1063 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Services/GeographicalInformationService.php +++ b/src/backend/packages/inensus/bulk-registration/src/Services/GeographicalInformationService.php @@ -7,12 +7,10 @@ use App\Models\MiniGrid; use Inensus\BulkRegistration\Helpers\GeographicalLocationFinder; -class GeographicalInformationService -{ +class GeographicalInformationService { private $geographicalInformationConfig; - public function createRelatedDataIfDoesNotExists($geographicalInformationData, $ownerModel) - { + public function createRelatedDataIfDoesNotExists($geographicalInformationData, $ownerModel) { if ($geographicalInformationData) { $geographicalInformation = GeographicalInformation::query()->make($geographicalInformationData); $geographicalInformation->owner()->associate($ownerModel); @@ -20,8 +18,7 @@ public function createRelatedDataIfDoesNotExists($geographicalInformationData, $ } } - public function resolveCsvDataFromComingRow($csvData, $ownerModel) - { + public function resolveCsvDataFromComingRow($csvData, $ownerModel) { $this->geographicalInformationConfig = config('bulk-registration.csv_fields.geographical_information'); $geographicalInformationData = ['points' => '']; if ($ownerModel instanceof MiniGrid) { @@ -36,8 +33,7 @@ public function resolveCsvDataFromComingRow($csvData, $ownerModel) } } - private function createMiniGridRelatedGeographicalInformation($ownerModel) - { + private function createMiniGridRelatedGeographicalInformation($ownerModel) { $miniGridId = $ownerModel->id; $geographicalInformation = GeographicalInformation::query()->with(['owner']) ->whereHasMorph( diff --git a/src/backend/packages/inensus/bulk-registration/src/Services/ICreatorService.php b/src/backend/packages/inensus/bulk-registration/src/Services/ICreatorService.php index 844aeabce..10d0bad1a 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Services/ICreatorService.php +++ b/src/backend/packages/inensus/bulk-registration/src/Services/ICreatorService.php @@ -2,7 +2,6 @@ namespace Inensus\BulkRegistration\Services; -interface ICreatorService -{ +interface ICreatorService { public function createRelatedDataIfDoesNotExists($resolvedCsvData); } diff --git a/src/backend/packages/inensus/bulk-registration/src/Services/ManufacturerService.php b/src/backend/packages/inensus/bulk-registration/src/Services/ManufacturerService.php index 697f8e7dd..219b46ca3 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Services/ManufacturerService.php +++ b/src/backend/packages/inensus/bulk-registration/src/Services/ManufacturerService.php @@ -5,8 +5,7 @@ use App\Models\Manufacturer; use Inensus\BulkRegistration\Exceptions\ManufacturerNotSupportedException; -class ManufacturerService extends CreatorService -{ +class ManufacturerService extends CreatorService { private $manufacturers = [ 'Calin Meter', 'Calin Smart Meter', @@ -17,13 +16,11 @@ class ManufacturerService extends CreatorService 'SunKing SHS', ]; - public function __construct(Manufacturer $manufacturer) - { + public function __construct(Manufacturer $manufacturer) { parent::__construct($manufacturer); } - public function resolveCsvDataFromComingRow($csvData) - { + public function resolveCsvDataFromComingRow($csvData) { $manufacturerConfig = config('bulk-registration.csv_fields.manufacturer'); if (!in_array($csvData[$manufacturerConfig['name']], $this->manufacturers)) { diff --git a/src/backend/packages/inensus/bulk-registration/src/Services/MeterParameterService.php b/src/backend/packages/inensus/bulk-registration/src/Services/MeterParameterService.php index b00e89894..0eedaf31c 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Services/MeterParameterService.php +++ b/src/backend/packages/inensus/bulk-registration/src/Services/MeterParameterService.php @@ -4,15 +4,12 @@ use App\Models\Meter\MeterParameter; -class MeterParameterService extends CreatorService -{ - public function __construct(MeterParameter $meterParameter) - { +class MeterParameterService extends CreatorService { + public function __construct(MeterParameter $meterParameter) { parent::__construct($meterParameter); } - public function resolveCsvDataFromComingRow($csvData) - { + public function resolveCsvDataFromComingRow($csvData) { $meterParameterConfig = config('bulk-registration.csv_fields.meter_parameter'); $meterParameterData = [ 'owner_type' => $meterParameterConfig['owner_type'], diff --git a/src/backend/packages/inensus/bulk-registration/src/Services/MeterService.php b/src/backend/packages/inensus/bulk-registration/src/Services/MeterService.php index 1f2e9439b..1dcb8f92d 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Services/MeterService.php +++ b/src/backend/packages/inensus/bulk-registration/src/Services/MeterService.php @@ -4,18 +4,15 @@ use App\Models\Meter\Meter; -class MeterService extends CreatorService -{ +class MeterService extends CreatorService { private $meterTypeService; - public function __construct(Meter $meter, MeterTypeService $meterTypeService) - { + public function __construct(Meter $meter, MeterTypeService $meterTypeService) { parent::__construct($meter); $this->meterTypeService = $meterTypeService; } - public function resolveCsvDataFromComingRow($csvData) - { + public function resolveCsvDataFromComingRow($csvData) { $meterConfig = config('bulk-registration.csv_fields.meter'); if (strlen(preg_replace('/\s+/', '', $csvData[$meterConfig['serial_number']])) > 0) { diff --git a/src/backend/packages/inensus/bulk-registration/src/Services/MeterTypeService.php b/src/backend/packages/inensus/bulk-registration/src/Services/MeterTypeService.php index cbe298363..310d5d641 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Services/MeterTypeService.php +++ b/src/backend/packages/inensus/bulk-registration/src/Services/MeterTypeService.php @@ -4,17 +4,14 @@ use App\Models\Meter\MeterType; -class MeterTypeService -{ +class MeterTypeService { private $meterType; - public function __construct(MeterType $meterType) - { + public function __construct(MeterType $meterType) { $this->meterType = $meterType; } - public function createDefaultMeterTypeIfDoesNotExistAny() - { + public function createDefaultMeterTypeIfDoesNotExistAny() { return $this->meterType->newQuery()->firstOrCreate(['id' => 1]); } } diff --git a/src/backend/packages/inensus/bulk-registration/src/Services/MiniGridService.php b/src/backend/packages/inensus/bulk-registration/src/Services/MiniGridService.php index d6cb31d50..78f22ffb7 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Services/MiniGridService.php +++ b/src/backend/packages/inensus/bulk-registration/src/Services/MiniGridService.php @@ -5,15 +5,12 @@ use App\Models\MiniGrid; use Inensus\BulkRegistration\Exceptions\MiniGridNotFoundException; -class MiniGridService extends CreatorService -{ - public function __construct(MiniGrid $miniGrid) - { +class MiniGridService extends CreatorService { + public function __construct(MiniGrid $miniGrid) { parent::__construct($miniGrid); } - public function resolveCsvDataFromComingRow($csvData) - { + public function resolveCsvDataFromComingRow($csvData) { $miniGridConfig = config('bulk-registration.csv_fields.mini_grid'); if (!$csvData[$miniGridConfig['name']]) { diff --git a/src/backend/packages/inensus/bulk-registration/src/Services/PersonDocumentService.php b/src/backend/packages/inensus/bulk-registration/src/Services/PersonDocumentService.php index bb47793d5..d7d117ef0 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Services/PersonDocumentService.php +++ b/src/backend/packages/inensus/bulk-registration/src/Services/PersonDocumentService.php @@ -4,22 +4,18 @@ use App\Models\PersonDocument; -class PersonDocumentService extends CreatorService -{ - public function __construct(PersonDocument $personDocument) - { +class PersonDocumentService extends CreatorService { + public function __construct(PersonDocument $personDocument) { parent::__construct($personDocument); } - public function createRelatedDataIfDoesNotExists($personDocuments) - { + public function createRelatedDataIfDoesNotExists($personDocuments) { foreach ($personDocuments as $personDocument) { PersonDocument::query()->firstOrCreate($personDocument, $personDocument); } } - public function resolveCsvDataFromComingRow($csvData) - { + public function resolveCsvDataFromComingRow($csvData) { $personDocsConfig = config('bulk-registration.csv_fields.person_docs'); $personDocuments = []; diff --git a/src/backend/packages/inensus/bulk-registration/src/Services/PersonService.php b/src/backend/packages/inensus/bulk-registration/src/Services/PersonService.php index e49af5889..64b57b688 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Services/PersonService.php +++ b/src/backend/packages/inensus/bulk-registration/src/Services/PersonService.php @@ -4,15 +4,12 @@ use App\Models\Person\Person; -class PersonService extends CreatorService -{ - public function __construct(Person $person) - { +class PersonService extends CreatorService { + public function __construct(Person $person) { parent::__construct($person); } - public function resolveCsvDataFromComingRow($csvData) - { + public function resolveCsvDataFromComingRow($csvData) { $personConfig = config('bulk-registration.csv_fields.person'); $personData = [ 'name' => $csvData[$personConfig['name']], diff --git a/src/backend/packages/inensus/bulk-registration/src/Services/TariffService.php b/src/backend/packages/inensus/bulk-registration/src/Services/TariffService.php index 259211c36..61513d5ea 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Services/TariffService.php +++ b/src/backend/packages/inensus/bulk-registration/src/Services/TariffService.php @@ -5,15 +5,12 @@ use App\Models\MainSettings; use App\Models\Meter\MeterTariff; -class TariffService extends CreatorService -{ - public function __construct(MeterTariff $meterTariff) - { +class TariffService extends CreatorService { + public function __construct(MeterTariff $meterTariff) { parent::__construct($meterTariff); } - public function resolveCsvDataFromComingRow($csvData) - { + public function resolveCsvDataFromComingRow($csvData) { $tariffConfig = config('bulk-registration.csv_fields.tariff'); $tariffData = [ diff --git a/src/backend/packages/inensus/bulk-registration/src/Test/Feature/ImportCsv.php b/src/backend/packages/inensus/bulk-registration/src/Test/Feature/ImportCsv.php index d457ceb95..777b82f1d 100644 --- a/src/backend/packages/inensus/bulk-registration/src/Test/Feature/ImportCsv.php +++ b/src/backend/packages/inensus/bulk-registration/src/Test/Feature/ImportCsv.php @@ -9,13 +9,11 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class ImportCsv extends TestCase -{ +class ImportCsv extends TestCase { use RefreshDatabase; /** @test */ - public function isUserSentCsv() - { + public function isUserSentCsv() { $this->withoutExceptionHandling(); $user = factory(User::class)->create(); @@ -40,8 +38,7 @@ public function isUserSentCsv() ]); } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); diff --git a/src/backend/packages/inensus/calin-meter/src/CalinMeterApi.php b/src/backend/packages/inensus/calin-meter/src/CalinMeterApi.php index b83a1cdf2..731c33617 100644 --- a/src/backend/packages/inensus/calin-meter/src/CalinMeterApi.php +++ b/src/backend/packages/inensus/calin-meter/src/CalinMeterApi.php @@ -12,8 +12,7 @@ use Inensus\CalinMeter\Models\CalinCredential; use Inensus\CalinMeter\Models\CalinTransaction; -class CalinMeterApi implements IManufacturerAPI -{ +class CalinMeterApi implements IManufacturerAPI { public const CREDIT_TOKEN = 'CreditToken'; protected $api; @@ -29,8 +28,7 @@ public function __construct( $this->api = $httpClient; } - public function chargeDevice(TransactionDataContainer $transactionContainer): array - { + public function chargeDevice(TransactionDataContainer $transactionContainer): array { $meter = $transactionContainer->device->device; $tariff = $transactionContainer->tariff; // we round the energy to be charged to 1 decimal place because the api only accepts 1 decimal place. @@ -68,8 +66,7 @@ public function chargeDevice(TransactionDataContainer $transactionContainer): ar ]; } - public function clearDevice(Device $device) - { + public function clearDevice(Device $device) { throw new ApiCallDoesNotSupportedException('This api call does not supported'); } } diff --git a/src/backend/packages/inensus/calin-meter/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/calin-meter/src/Console/Commands/InstallPackage.php index 5ed7b7a50..9bef0b95a 100644 --- a/src/backend/packages/inensus/calin-meter/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/calin-meter/src/Console/Commands/InstallPackage.php @@ -6,8 +6,7 @@ use Inensus\CalinMeter\Helpers\ApiHelpers; use Inensus\CalinMeter\Services\CalinCredentialService; -class InstallPackage extends Command -{ +class InstallPackage extends Command { protected $signature = 'calin-meter:install'; protected $description = 'Install CalinMeter Package'; @@ -19,16 +18,14 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { $this->info('Installing CalinMeter Integration Package\n'); $this->apiHelpers->registerCalinMeterManufacturer(); $this->credentialService->createCredentials(); $this->info('Package installed successfully..'); } - private function publishMigrations() - { + private function publishMigrations() { $this->info('Copying migrations\n'); $this->call('vendor:publish', [ '--provider' => 'qq', @@ -36,14 +33,12 @@ private function publishMigrations() ]); } - private function createDatabaseTables() - { + private function createDatabaseTables() { $this->info('Creating database tables\n'); $this->call('migrate'); } - private function publishVueFiles() - { + private function publishVueFiles() { $this->info('Copying vue files\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\CalinMeter\Providers\CalinMeterServiceProvider", @@ -51,8 +46,7 @@ private function publishVueFiles() ]); } - private function createPluginRecord() - { + private function createPluginRecord() { $this->call('plugin:add', [ 'name' => 'CalinMeter', 'composer_name' => 'inensus/calin-meter', diff --git a/src/backend/packages/inensus/calin-meter/src/Console/Commands/UpdatePackage.php b/src/backend/packages/inensus/calin-meter/src/Console/Commands/UpdatePackage.php index 779d89343..c8457a4c0 100644 --- a/src/backend/packages/inensus/calin-meter/src/Console/Commands/UpdatePackage.php +++ b/src/backend/packages/inensus/calin-meter/src/Console/Commands/UpdatePackage.php @@ -8,8 +8,7 @@ use Inensus\CalinMeter\Helpers\ApiHelpers; use Inensus\CalinMeter\Services\CalinCredentialService; -class UpdatePackage extends Command -{ +class UpdatePackage extends Command { protected $signature = 'calin-meter:update'; protected $description = 'Update CalinMeter Package'; @@ -22,8 +21,7 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { $this->info('Calin Meter Integration Updating Started\n'); $this->removeOldVersionOfPackage(); $this->installNewVersionOfPackage(); @@ -35,20 +33,17 @@ public function handle(): void $this->info('Package updated successfully..'); } - private function removeOldVersionOfPackage() - { + private function removeOldVersionOfPackage() { $this->info('Removing former version of package\n'); echo shell_exec('COMPOSER_MEMORY_LIMIT=-1 ../composer.phar remove inensus/calin-meter'); } - private function installNewVersionOfPackage() - { + private function installNewVersionOfPackage() { $this->info('Installing last version of package\n'); echo shell_exec('COMPOSER_MEMORY_LIMIT=-1 ../composer.phar require inensus/calin-meter'); } - private function deleteMigration(Filesystem $filesystem) - { + private function deleteMigration(Filesystem $filesystem) { $migrationFile = $filesystem->glob(database_path().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR.'*_create_calin_tables.php')[0]; $migration = DB::table('migrations') ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->first(); @@ -60,8 +55,7 @@ private function deleteMigration(Filesystem $filesystem) ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->delete(); } - private function publishMigrationsAgain() - { + private function publishMigrationsAgain() { $this->info('Copying migrations\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\CalinMeter\Providers\CalinMeterServiceProvider", @@ -69,14 +63,12 @@ private function publishMigrationsAgain() ]); } - private function updateDatabase() - { + private function updateDatabase() { $this->info('Updating database tables\n'); $this->call('migrate'); } - private function publishVueFilesAgain() - { + private function publishVueFilesAgain() { $this->info('Copying vue files\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\CalinMeter\Providers\CalinMeterServiceProvider", diff --git a/src/backend/packages/inensus/calin-meter/src/Exceptions/CalinApiResponseException.php b/src/backend/packages/inensus/calin-meter/src/Exceptions/CalinApiResponseException.php index aaaf40e91..feb525cad 100644 --- a/src/backend/packages/inensus/calin-meter/src/Exceptions/CalinApiResponseException.php +++ b/src/backend/packages/inensus/calin-meter/src/Exceptions/CalinApiResponseException.php @@ -2,6 +2,4 @@ namespace Inensus\CalinMeter\Exceptions; -class CalinApiResponseException extends \Exception -{ -} +class CalinApiResponseException extends \Exception {} diff --git a/src/backend/packages/inensus/calin-meter/src/Helpers/ApiHelpers.php b/src/backend/packages/inensus/calin-meter/src/Helpers/ApiHelpers.php index 5443a5b77..d2e95d89c 100644 --- a/src/backend/packages/inensus/calin-meter/src/Helpers/ApiHelpers.php +++ b/src/backend/packages/inensus/calin-meter/src/Helpers/ApiHelpers.php @@ -5,17 +5,14 @@ use App\Models\Manufacturer; use Inensus\CalinMeter\Exceptions\CalinApiResponseException; -class ApiHelpers -{ +class ApiHelpers { private $manufacturer; - public function __construct(Manufacturer $manufacturerModel) - { + public function __construct(Manufacturer $manufacturerModel) { $this->manufacturer = $manufacturerModel; } - public function registerCalinMeterManufacturer() - { + public function registerCalinMeterManufacturer() { $api = $this->manufacturer->newQuery()->where('api_name', 'CalinMeterApi')->first(); if (!$api) { $this->manufacturer->newQuery()->create([ @@ -26,8 +23,7 @@ public function registerCalinMeterManufacturer() } } - public function checkApiResult($result) - { + public function checkApiResult($result) { if ((int) $result['result_code'] !== 0) { throw new CalinApiResponseException($result['reason']); } diff --git a/src/backend/packages/inensus/calin-meter/src/Http/Controllers/CalinCredentialController.php b/src/backend/packages/inensus/calin-meter/src/Http/Controllers/CalinCredentialController.php index aaacd9ee1..da3899250 100644 --- a/src/backend/packages/inensus/calin-meter/src/Http/Controllers/CalinCredentialController.php +++ b/src/backend/packages/inensus/calin-meter/src/Http/Controllers/CalinCredentialController.php @@ -7,22 +7,18 @@ use Inensus\CalinMeter\Http\Resources\CalinResource; use Inensus\CalinMeter\Services\CalinCredentialService; -class CalinCredentialController extends Controller -{ +class CalinCredentialController extends Controller { private $credentialService; - public function __construct(CalinCredentialService $credentialService) - { + public function __construct(CalinCredentialService $credentialService) { $this->credentialService = $credentialService; } - public function show(): CalinResource - { + public function show(): CalinResource { return new CalinResource($this->credentialService->getCredentials()); } - public function update(CalinCredentialRequest $request): CalinResource - { + public function update(CalinCredentialRequest $request): CalinResource { $credentials = $this->credentialService->updateCredentials($request->only([ 'user_id', 'api_key', diff --git a/src/backend/packages/inensus/calin-meter/src/Http/Requests/CalinCredentialRequest.php b/src/backend/packages/inensus/calin-meter/src/Http/Requests/CalinCredentialRequest.php index 86cecb44a..5c83506fd 100644 --- a/src/backend/packages/inensus/calin-meter/src/Http/Requests/CalinCredentialRequest.php +++ b/src/backend/packages/inensus/calin-meter/src/Http/Requests/CalinCredentialRequest.php @@ -5,15 +5,13 @@ use Illuminate\Foundation\Http\FormRequest; use Illuminate\Validation\Rule; -class CalinCredentialRequest extends FormRequest -{ +class CalinCredentialRequest extends FormRequest { /** * Get the validation rules that apply to the request. * * @return array */ - public function rules() - { + public function rules() { return [ 'user_id' => ['required', Rule::unique('shard.calin_api_credentials')->ignore($this->id)], 'api_key' => ['required', Rule::unique('shard.calin_api_credentials')->ignore($this->id)], diff --git a/src/backend/packages/inensus/calin-meter/src/Http/Requests/CalinMeterApiRequests.php b/src/backend/packages/inensus/calin-meter/src/Http/Requests/CalinMeterApiRequests.php index 29f77622d..822758174 100644 --- a/src/backend/packages/inensus/calin-meter/src/Http/Requests/CalinMeterApiRequests.php +++ b/src/backend/packages/inensus/calin-meter/src/Http/Requests/CalinMeterApiRequests.php @@ -9,8 +9,7 @@ use Inensus\CalinMeter\Helpers\ApiHelpers; use Inensus\CalinMeter\Models\CalinCredential; -class CalinMeterApiRequests -{ +class CalinMeterApiRequests { private $client; private $apiHelpers; @@ -27,8 +26,7 @@ public function __construct( $this->credential = $credentialModel; } - public function post($url, $postParams) - { + public function post($url, $postParams) { try { $request = $this->client->post( $url, @@ -55,8 +53,7 @@ public function post($url, $postParams) } } - public function getCredentials() - { + public function getCredentials() { return $this->credential->newQuery()->firstOrFail(); } } diff --git a/src/backend/packages/inensus/calin-meter/src/Http/Resources/CalinResource.php b/src/backend/packages/inensus/calin-meter/src/Http/Resources/CalinResource.php index 2c5b6dd4b..035345dee 100644 --- a/src/backend/packages/inensus/calin-meter/src/Http/Resources/CalinResource.php +++ b/src/backend/packages/inensus/calin-meter/src/Http/Resources/CalinResource.php @@ -5,8 +5,7 @@ use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\JsonResource; -class CalinResource extends JsonResource -{ +class CalinResource extends JsonResource { /** * Transform the resource into an array. * @@ -14,8 +13,7 @@ class CalinResource extends JsonResource * * @return array */ - public function toArray($request) - { + public function toArray($request) { return parent::toArray($request); } } diff --git a/src/backend/packages/inensus/calin-meter/src/Models/CalinCredential.php b/src/backend/packages/inensus/calin-meter/src/Models/CalinCredential.php index 66bfcf98d..e0a1701da 100644 --- a/src/backend/packages/inensus/calin-meter/src/Models/CalinCredential.php +++ b/src/backend/packages/inensus/calin-meter/src/Models/CalinCredential.php @@ -4,7 +4,6 @@ use App\Models\Base\BaseModel; -class CalinCredential extends BaseModel -{ +class CalinCredential extends BaseModel { protected $table = 'calin_api_credentials'; } diff --git a/src/backend/packages/inensus/calin-meter/src/Models/CalinTransaction.php b/src/backend/packages/inensus/calin-meter/src/Models/CalinTransaction.php index 8f71256f1..50fafc752 100644 --- a/src/backend/packages/inensus/calin-meter/src/Models/CalinTransaction.php +++ b/src/backend/packages/inensus/calin-meter/src/Models/CalinTransaction.php @@ -12,42 +12,34 @@ use Inensus\WaveMoneyPaymentProvider\Models\WaveMoneyTransaction; use MPM\Transaction\Provider\VodacomTransactionProvider; -class CalinTransaction extends BaseModel implements ISubTransaction -{ +class CalinTransaction extends BaseModel implements ISubTransaction { protected $table = 'calin_transactions'; - public function agentTransaction() - { + public function agentTransaction() { return $this->morphOne(AgentTransaction::class, 'manufacturer_transaction'); } - public function vodacomTransaction() - { + public function vodacomTransaction() { return $this->morphOne(VodacomTransactionProvider::class, 'manufacturer_transaction'); } - public function airtelTransaction() - { + public function airtelTransaction() { return $this->morphOne(AirtelTransaction::class, 'manufacturer_transaction'); } - public function thirdPartyTransaction() - { + public function thirdPartyTransaction() { return $this->morphOne(ThirdPartyTransaction::class, 'manufacturer_transaction'); } - public function mesombTransaction() - { + public function mesombTransaction() { return $this->morphOne(MesombTransaction::class, 'manufacturer_transaction'); } - public function swiftaTransaction() - { + public function swiftaTransaction() { return $this->morphOne(SwiftaTransaction::class, 'manufacturer_transaction'); } - public function waveMoneyTransaction() - { + public function waveMoneyTransaction() { return $this->morphOne(WaveMoneyTransaction::class, 'manufacturer_transaction'); } } diff --git a/src/backend/packages/inensus/calin-meter/src/Providers/CalinMeterServiceProvider.php b/src/backend/packages/inensus/calin-meter/src/Providers/CalinMeterServiceProvider.php index b26087944..1e25790f7 100644 --- a/src/backend/packages/inensus/calin-meter/src/Providers/CalinMeterServiceProvider.php +++ b/src/backend/packages/inensus/calin-meter/src/Providers/CalinMeterServiceProvider.php @@ -11,10 +11,8 @@ use Inensus\CalinMeter\Console\Commands\UpdatePackage; use Inensus\CalinMeter\Models\CalinTransaction; -class CalinMeterServiceProvider extends ServiceProvider -{ - public function boot(Filesystem $filesystem) - { +class CalinMeterServiceProvider extends ServiceProvider { + public function boot(Filesystem $filesystem) { $this->app->register(RouteServiceProvider::class); if ($this->app->runningInConsole()) { $this->publishConfigFiles(); @@ -29,37 +27,32 @@ public function boot(Filesystem $filesystem) ); } - public function register() - { + public function register() { $this->mergeConfigFrom(__DIR__.'/../../config/calin-meter.php', 'calin-meter'); $this->app->register(EventServiceProvider::class); $this->app->register(ObserverServiceProvider::class); $this->app->bind('CalinMeterApi', CalinMeterApi::class); } - public function publishConfigFiles() - { + public function publishConfigFiles() { $this->publishes([ __DIR__.'/../../config/calin-meter.php' => config_path('calin-meter.php'), ]); } - public function publishVueFiles() - { + public function publishVueFiles() { $this->publishes([ __DIR__.'/../resources/assets' => resource_path('assets/js/plugins/calin-meter'), ], 'vue-components'); } - public function publishMigrations($filesystem) - { + public function publishMigrations($filesystem) { $this->publishes([ __DIR__.'/../../database/migrations/create_calin_tables.php.stub' => $this->getMigrationFileName($filesystem), ], 'migrations'); } - protected function getMigrationFileName(Filesystem $filesystem): string - { + protected function getMigrationFileName(Filesystem $filesystem): string { $timestamp = date('Y_m_d_His'); return Collection::make($this->app->databasePath().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR) diff --git a/src/backend/packages/inensus/calin-meter/src/Providers/EventServiceProvider.php b/src/backend/packages/inensus/calin-meter/src/Providers/EventServiceProvider.php index d614d1b56..5d85c9972 100644 --- a/src/backend/packages/inensus/calin-meter/src/Providers/EventServiceProvider.php +++ b/src/backend/packages/inensus/calin-meter/src/Providers/EventServiceProvider.php @@ -4,8 +4,7 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; -class EventServiceProvider extends ServiceProvider -{ +class EventServiceProvider extends ServiceProvider { protected $subscribe = [ ]; @@ -14,8 +13,7 @@ class EventServiceProvider extends ServiceProvider * * @return void */ - public function boot() - { + public function boot() { parent::boot(); } } diff --git a/src/backend/packages/inensus/calin-meter/src/Providers/ObserverServiceProvider.php b/src/backend/packages/inensus/calin-meter/src/Providers/ObserverServiceProvider.php index 01a2026b7..d8e33f180 100644 --- a/src/backend/packages/inensus/calin-meter/src/Providers/ObserverServiceProvider.php +++ b/src/backend/packages/inensus/calin-meter/src/Providers/ObserverServiceProvider.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; -class ObserverServiceProvider extends ServiceProvider -{ +class ObserverServiceProvider extends ServiceProvider { /** * Register any events for your application. * * @return void */ - public function boot() - { + public function boot() { parent::boot(); } } diff --git a/src/backend/packages/inensus/calin-meter/src/Providers/RouteServiceProvider.php b/src/backend/packages/inensus/calin-meter/src/Providers/RouteServiceProvider.php index 63e70f896..6d989a685 100644 --- a/src/backend/packages/inensus/calin-meter/src/Providers/RouteServiceProvider.php +++ b/src/backend/packages/inensus/calin-meter/src/Providers/RouteServiceProvider.php @@ -5,22 +5,18 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Support\Facades\Route; -class RouteServiceProvider extends ServiceProvider -{ +class RouteServiceProvider extends ServiceProvider { protected $namespace = 'Inensus\CalinMeter\Http\Controllers'; - public function boot() - { + public function boot() { parent::boot(); } - public function map() - { + public function map() { $this->mapApiRoutes(); } - protected function mapApiRoutes() - { + protected function mapApiRoutes() { Route::prefix('api') ->middleware('api') ->namespace($this->namespace) diff --git a/src/backend/packages/inensus/calin-meter/src/Services/CalinCredentialService.php b/src/backend/packages/inensus/calin-meter/src/Services/CalinCredentialService.php index c4bb47b4a..40005aaa3 100644 --- a/src/backend/packages/inensus/calin-meter/src/Services/CalinCredentialService.php +++ b/src/backend/packages/inensus/calin-meter/src/Services/CalinCredentialService.php @@ -4,8 +4,7 @@ use Inensus\CalinMeter\Models\CalinCredential; -class CalinCredentialService -{ +class CalinCredentialService { private $credential; public function __construct( @@ -17,21 +16,18 @@ public function __construct( /** * This function uses one time on installation of the package. */ - public function createCredentials() - { + public function createCredentials() { return $this->credential->newQuery()->firstOrCreate(['id' => 1], [ 'user_id' => null, 'api_key' => null, ]); } - public function getCredentials() - { + public function getCredentials() { return $this->credential->newQuery()->first(); } - public function updateCredentials($data) - { + public function updateCredentials($data) { $credential = $this->credential->newQuery()->firstOrFail(); $credential->update([ 'user_id' => $data['user_id'], diff --git a/src/backend/packages/inensus/calin-meter/src/Tests/Unit/TokenGenerationTest.php b/src/backend/packages/inensus/calin-meter/src/Tests/Unit/TokenGenerationTest.php index 0056fea84..2d29f0af0 100644 --- a/src/backend/packages/inensus/calin-meter/src/Tests/Unit/TokenGenerationTest.php +++ b/src/backend/packages/inensus/calin-meter/src/Tests/Unit/TokenGenerationTest.php @@ -19,13 +19,11 @@ use Inensus\CalinMeter\Models\CalinCredential; use Tests\TestCase; -class TokenGenerationTest extends TestCase -{ +class TokenGenerationTest extends TestCase { use RefreshDatabase; /** @test */ - public function isTokenGenerated() - { + public function isTokenGenerated() { Queue::fake(); Config::set('app.debug', false); $transaction = $this->initializeData(); @@ -38,8 +36,7 @@ public function isTokenGenerated() Queue::assertPushed(TokenProcessor::class); } - private function initializeData() - { + private function initializeData() { // create person factory(MainSettings::class)->create(); diff --git a/src/backend/packages/inensus/calin-smart-meter/src/CalinSmartMeterApi.php b/src/backend/packages/inensus/calin-smart-meter/src/CalinSmartMeterApi.php index 5940fcd7e..4491d2fed 100644 --- a/src/backend/packages/inensus/calin-smart-meter/src/CalinSmartMeterApi.php +++ b/src/backend/packages/inensus/calin-smart-meter/src/CalinSmartMeterApi.php @@ -14,8 +14,7 @@ use Inensus\CalinSmartMeter\Models\CalinSmartCredential; use Inensus\CalinSmartMeter\Models\CalinSmartTransaction; -class CalinSmartMeterApi implements IManufacturerAPI -{ +class CalinSmartMeterApi implements IManufacturerAPI { protected $api; private $rootUrl = '/POS_Purchase/'; @@ -29,8 +28,7 @@ public function __construct( $this->api = $httpClient; } - public function chargeDevice($transactionContainer): array - { + public function chargeDevice($transactionContainer): array { $meter = $transactionContainer->device->device; $tariff = $transactionContainer->tariff; $transactionContainer->chargedEnergy += $transactionContainer->amount / $tariff->total_price; @@ -79,8 +77,7 @@ public function chargeDevice($transactionContainer): array * * @psalm-return array{result_code: mixed} */ - public function clearDevice(Device $device) - { + public function clearDevice(Device $device) { $meter = $device->device; $root = '/Maintenance_ClearCredit/'; try { diff --git a/src/backend/packages/inensus/calin-smart-meter/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/calin-smart-meter/src/Console/Commands/InstallPackage.php index b51c49f23..c22241c32 100644 --- a/src/backend/packages/inensus/calin-smart-meter/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/calin-smart-meter/src/Console/Commands/InstallPackage.php @@ -6,8 +6,7 @@ use Inensus\CalinSmartMeter\Helpers\ApiHelpers; use Inensus\CalinSmartMeter\Services\CalinSmartCredentialService; -class InstallPackage extends Command -{ +class InstallPackage extends Command { protected $signature = 'calin-smart-meter:install'; protected $description = 'Install CalinSmartMeter Package'; @@ -19,16 +18,14 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { $this->info('Installing CalinSmartMeter Integration Package\n'); $this->apiHelpers->registerCalinMeterManufacturer(); $this->credentialService->createCredentials(); $this->info('Package installed successfully..'); } - private function publishMigrations() - { + private function publishMigrations() { $this->info('Copying migrations\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\CalinSmartMeter\Providers\CalinSmartMeterServiceProvider", @@ -36,14 +33,12 @@ private function publishMigrations() ]); } - private function createDatabaseTables() - { + private function createDatabaseTables() { $this->info('Creating database tables\n'); $this->call('migrate'); } - private function publishVueFiles() - { + private function publishVueFiles() { $this->info('Copying vue files\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\CalinSmartMeter\Providers\CalinSmartMeterServiceProvider", @@ -51,8 +46,7 @@ private function publishVueFiles() ]); } - private function createPluginRecord() - { + private function createPluginRecord() { $this->call('plugin:add', [ 'name' => 'CalinSmartMeter', 'composer_name' => 'inensus/calin-smart-meter', diff --git a/src/backend/packages/inensus/calin-smart-meter/src/Console/Commands/UpdatePackage.php b/src/backend/packages/inensus/calin-smart-meter/src/Console/Commands/UpdatePackage.php index f5426000e..ad8a44cad 100644 --- a/src/backend/packages/inensus/calin-smart-meter/src/Console/Commands/UpdatePackage.php +++ b/src/backend/packages/inensus/calin-smart-meter/src/Console/Commands/UpdatePackage.php @@ -7,8 +7,7 @@ use Illuminate\Support\Facades\DB; use Inensus\CalinSmartMeter\Services\CalinSmartCredentialService; -class UpdatePackage extends Command -{ +class UpdatePackage extends Command { protected $signature = 'calin-smart-meter:update'; protected $description = 'Update CalinSmartMeter Package'; @@ -20,8 +19,7 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { $this->info('Calin Smart Meter Integration Updating Started\n'); $this->removeOldVersionOfPackage(); $this->installNewVersionOfPackage(); @@ -33,20 +31,17 @@ public function handle(): void $this->info('Package updated successfully..'); } - private function removeOldVersionOfPackage() - { + private function removeOldVersionOfPackage() { $this->info('Removing former version of package\n'); echo shell_exec('COMPOSER_MEMORY_LIMIT=-1 ../composer.phar remove inensus/calin-smart-meter'); } - private function installNewVersionOfPackage() - { + private function installNewVersionOfPackage() { $this->info('Installing last version of package\n'); echo shell_exec('COMPOSER_MEMORY_LIMIT=-1 ../composer.phar require inensus/calin-smart-meter'); } - private function deleteMigration(Filesystem $filesystem) - { + private function deleteMigration(Filesystem $filesystem) { $migrationFile = $filesystem->glob(database_path().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR.'*_create_calin_smart_tables.php')[0]; $migration = DB::table('migrations') ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->first(); @@ -58,8 +53,7 @@ private function deleteMigration(Filesystem $filesystem) ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->delete(); } - private function publishMigrationsAgain() - { + private function publishMigrationsAgain() { $this->info('Copying migrations\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\CalinSmartMeter\Providers\CalinSmartMeterServiceProvider", @@ -67,14 +61,12 @@ private function publishMigrationsAgain() ]); } - private function updateDatabase() - { + private function updateDatabase() { $this->info('Updating database tables\n'); $this->call('migrate'); } - private function publishVueFilesAgain() - { + private function publishVueFilesAgain() { $this->info('Copying vue files\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\CalinSmartMeter\Providers\CalinSmartMeterServiceProvider", diff --git a/src/backend/packages/inensus/calin-smart-meter/src/Exceptions/CalinSmartApiResponseException.php b/src/backend/packages/inensus/calin-smart-meter/src/Exceptions/CalinSmartApiResponseException.php index 8e2bd77cd..ccb1a2365 100644 --- a/src/backend/packages/inensus/calin-smart-meter/src/Exceptions/CalinSmartApiResponseException.php +++ b/src/backend/packages/inensus/calin-smart-meter/src/Exceptions/CalinSmartApiResponseException.php @@ -2,6 +2,4 @@ namespace Inensus\CalinSmartMeter\Exceptions; -class CalinSmartApiResponseException extends \Exception -{ -} +class CalinSmartApiResponseException extends \Exception {} diff --git a/src/backend/packages/inensus/calin-smart-meter/src/Exceptions/CalinSmartCreadentialsNotFoundException.php b/src/backend/packages/inensus/calin-smart-meter/src/Exceptions/CalinSmartCreadentialsNotFoundException.php index 32d3b4a70..05c58899b 100644 --- a/src/backend/packages/inensus/calin-smart-meter/src/Exceptions/CalinSmartCreadentialsNotFoundException.php +++ b/src/backend/packages/inensus/calin-smart-meter/src/Exceptions/CalinSmartCreadentialsNotFoundException.php @@ -2,6 +2,4 @@ namespace Inensus\CalinSmartMeter\Exceptions; -class CalinSmartCreadentialsNotFoundException extends \Exception -{ -} +class CalinSmartCreadentialsNotFoundException extends \Exception {} diff --git a/src/backend/packages/inensus/calin-smart-meter/src/Helpers/ApiHelpers.php b/src/backend/packages/inensus/calin-smart-meter/src/Helpers/ApiHelpers.php index 550b05bbb..773e43986 100644 --- a/src/backend/packages/inensus/calin-smart-meter/src/Helpers/ApiHelpers.php +++ b/src/backend/packages/inensus/calin-smart-meter/src/Helpers/ApiHelpers.php @@ -5,17 +5,14 @@ use App\Models\Manufacturer; use Inensus\CalinSmartMeter\Exceptions\CalinSmartApiResponseException; -class ApiHelpers -{ +class ApiHelpers { private $manufacturer; - public function __construct(Manufacturer $manufacturerModel) - { + public function __construct(Manufacturer $manufacturerModel) { $this->manufacturer = $manufacturerModel; } - public function registerCalinMeterManufacturer() - { + public function registerCalinMeterManufacturer() { $api = $this->manufacturer->newQuery()->where('api_name', 'CalinSmartMeterApi')->first(); if (!$api) { $this->manufacturer->newQuery()->create([ @@ -26,8 +23,7 @@ public function registerCalinMeterManufacturer() } } - public function checkApiResult($result) - { + public function checkApiResult($result) { if ((int) $result['result_code'] !== 0) { throw new CalinSmartApiResponseException($result['reason']); } diff --git a/src/backend/packages/inensus/calin-smart-meter/src/Http/Controllers/CalinSmartCredentialController.php b/src/backend/packages/inensus/calin-smart-meter/src/Http/Controllers/CalinSmartCredentialController.php index ddf6aafef..972db89a9 100644 --- a/src/backend/packages/inensus/calin-smart-meter/src/Http/Controllers/CalinSmartCredentialController.php +++ b/src/backend/packages/inensus/calin-smart-meter/src/Http/Controllers/CalinSmartCredentialController.php @@ -7,22 +7,18 @@ use Inensus\CalinSmartMeter\Http\Resources\CalinSmartResource; use Inensus\CalinSmartMeter\Services\CalinSmartCredentialService; -class CalinSmartCredentialController extends Controller -{ +class CalinSmartCredentialController extends Controller { private $credentialService; - public function __construct(CalinSmartCredentialService $credentialService) - { + public function __construct(CalinSmartCredentialService $credentialService) { $this->credentialService = $credentialService; } - public function show(): CalinSmartResource - { + public function show(): CalinSmartResource { return new CalinSmartResource($this->credentialService->getCredentials()); } - public function update(CalinSmartCredentialRequest $request): CalinSmartResource - { + public function update(CalinSmartCredentialRequest $request): CalinSmartResource { $credentials = $this->credentialService->updateCredentials($request->only([ 'id', 'company_name', diff --git a/src/backend/packages/inensus/calin-smart-meter/src/Http/Requests/CalinSmartCredentialRequest.php b/src/backend/packages/inensus/calin-smart-meter/src/Http/Requests/CalinSmartCredentialRequest.php index de29f4958..b134857d7 100644 --- a/src/backend/packages/inensus/calin-smart-meter/src/Http/Requests/CalinSmartCredentialRequest.php +++ b/src/backend/packages/inensus/calin-smart-meter/src/Http/Requests/CalinSmartCredentialRequest.php @@ -5,15 +5,13 @@ use Illuminate\Foundation\Http\FormRequest; use Illuminate\Validation\Rule; -class CalinSmartCredentialRequest extends FormRequest -{ +class CalinSmartCredentialRequest extends FormRequest { /** * Get the validation rules that apply to the request. * * @return array */ - public function rules() - { + public function rules() { return [ 'company_name' => ['required'], 'user_name' => ['required', Rule::unique('shard.calin_smart_api_credentials')->ignore($this->id)], diff --git a/src/backend/packages/inensus/calin-smart-meter/src/Http/Requests/CalinSmartMeterApiRequests.php b/src/backend/packages/inensus/calin-smart-meter/src/Http/Requests/CalinSmartMeterApiRequests.php index e3a0582a1..7ddaae579 100644 --- a/src/backend/packages/inensus/calin-smart-meter/src/Http/Requests/CalinSmartMeterApiRequests.php +++ b/src/backend/packages/inensus/calin-smart-meter/src/Http/Requests/CalinSmartMeterApiRequests.php @@ -9,8 +9,7 @@ use Inensus\CalinSmartMeter\Helpers\ApiHelpers; use Inensus\CalinSmartMeter\Models\CalinSmartCredential; -class CalinSmartMeterApiRequests -{ +class CalinSmartMeterApiRequests { private $client; private $apiHelpers; @@ -27,8 +26,7 @@ public function __construct( $this->credential = $credentialModel; } - public function post($url, $postParams) - { + public function post($url, $postParams) { try { $request = $this->client->post( $url, diff --git a/src/backend/packages/inensus/calin-smart-meter/src/Http/Resources/CalinSmartResource.php b/src/backend/packages/inensus/calin-smart-meter/src/Http/Resources/CalinSmartResource.php index 0be320896..7ddccee69 100644 --- a/src/backend/packages/inensus/calin-smart-meter/src/Http/Resources/CalinSmartResource.php +++ b/src/backend/packages/inensus/calin-smart-meter/src/Http/Resources/CalinSmartResource.php @@ -5,8 +5,7 @@ use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\JsonResource; -class CalinSmartResource extends JsonResource -{ +class CalinSmartResource extends JsonResource { /** * Transform the resource into an array. * @@ -14,8 +13,7 @@ class CalinSmartResource extends JsonResource * * @return array */ - public function toArray($request) - { + public function toArray($request) { return parent::toArray($request); } } diff --git a/src/backend/packages/inensus/calin-smart-meter/src/Models/CalinSmartCredential.php b/src/backend/packages/inensus/calin-smart-meter/src/Models/CalinSmartCredential.php index 6dadaea7d..4cfe40274 100644 --- a/src/backend/packages/inensus/calin-smart-meter/src/Models/CalinSmartCredential.php +++ b/src/backend/packages/inensus/calin-smart-meter/src/Models/CalinSmartCredential.php @@ -4,7 +4,6 @@ use App\Models\Base\BaseModel; -class CalinSmartCredential extends BaseModel -{ +class CalinSmartCredential extends BaseModel { protected $table = 'calin_smart_api_credentials'; } diff --git a/src/backend/packages/inensus/calin-smart-meter/src/Models/CalinSmartTransaction.php b/src/backend/packages/inensus/calin-smart-meter/src/Models/CalinSmartTransaction.php index bfbb9ce5d..ba1934026 100644 --- a/src/backend/packages/inensus/calin-smart-meter/src/Models/CalinSmartTransaction.php +++ b/src/backend/packages/inensus/calin-smart-meter/src/Models/CalinSmartTransaction.php @@ -12,42 +12,34 @@ use Inensus\WaveMoneyPaymentProvider\Models\WaveMoneyTransaction; use MPM\Transaction\Provider\VodacomTransactionProvider; -class CalinSmartTransaction extends BaseModel implements ISubTransaction -{ +class CalinSmartTransaction extends BaseModel implements ISubTransaction { protected $table = 'calin_smart_transactions'; - public function agentTransaction() - { + public function agentTransaction() { return $this->morphOne(AgentTransaction::class, 'manufacturer_transaction'); } - public function vodacomTransaction() - { + public function vodacomTransaction() { return $this->morphOne(VodacomTransactionProvider::class, 'manufacturer_transaction'); } - public function airtelTransaction() - { + public function airtelTransaction() { return $this->morphOne(AirtelTransaction::class, 'manufacturer_transaction'); } - public function thirdPartyTransaction() - { + public function thirdPartyTransaction() { return $this->morphOne(ThirdPartyTransaction::class, 'manufacturer_transaction'); } - public function mesombTransaction() - { + public function mesombTransaction() { return $this->morphOne(MesombTransaction::class, 'manufacturer_transaction'); } - public function swiftaTransaction() - { + public function swiftaTransaction() { return $this->morphOne(SwiftaTransaction::class, 'manufacturer_transaction'); } - public function waveMoneyTransaction() - { + public function waveMoneyTransaction() { return $this->morphOne(WaveMoneyTransaction::class, 'manufacturer_transaction'); } } diff --git a/src/backend/packages/inensus/calin-smart-meter/src/Providers/CalinSmartMeterServiceProvider.php b/src/backend/packages/inensus/calin-smart-meter/src/Providers/CalinSmartMeterServiceProvider.php index 55d59900f..52533bca8 100644 --- a/src/backend/packages/inensus/calin-smart-meter/src/Providers/CalinSmartMeterServiceProvider.php +++ b/src/backend/packages/inensus/calin-smart-meter/src/Providers/CalinSmartMeterServiceProvider.php @@ -11,10 +11,8 @@ use Inensus\CalinSmartMeter\Console\Commands\UpdatePackage; use Inensus\CalinSmartMeter\Models\CalinSmartTransaction; -class CalinSmartMeterServiceProvider extends ServiceProvider -{ - public function boot(Filesystem $filesystem) - { +class CalinSmartMeterServiceProvider extends ServiceProvider { + public function boot(Filesystem $filesystem) { $this->app->register(RouteServiceProvider::class); if ($this->app->runningInConsole()) { $this->publishConfigFiles(); @@ -29,37 +27,32 @@ public function boot(Filesystem $filesystem) ); } - public function register() - { + public function register() { $this->mergeConfigFrom(__DIR__.'/../../config/calin-smart-meter.php', 'calin-smart-meter'); $this->app->register(EventServiceProvider::class); $this->app->register(ObserverServiceProvider::class); $this->app->bind('CalinSmartMeterApi', CalinSmartMeterApi::class); } - public function publishConfigFiles() - { + public function publishConfigFiles() { $this->publishes([ __DIR__.'/../../config/calin-smart-meter.php' => config_path('calin-smart-meter.php'), ]); } - public function publishVueFiles() - { + public function publishVueFiles() { $this->publishes([ __DIR__.'/../resources/assets' => resource_path('assets/js/plugins/calin-smart-meter'), ], 'vue-components'); } - public function publishMigrations($filesystem) - { + public function publishMigrations($filesystem) { $this->publishes([ __DIR__.'/../../database/migrations/create_calin_smart_tables.php.stub' => $this->getMigrationFileName($filesystem), ], 'migrations'); } - protected function getMigrationFileName(Filesystem $filesystem): string - { + protected function getMigrationFileName(Filesystem $filesystem): string { $timestamp = date('Y_m_d_His'); return Collection::make($this->app->databasePath().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR) diff --git a/src/backend/packages/inensus/calin-smart-meter/src/Providers/EventServiceProvider.php b/src/backend/packages/inensus/calin-smart-meter/src/Providers/EventServiceProvider.php index f074a8b2d..02cef0309 100644 --- a/src/backend/packages/inensus/calin-smart-meter/src/Providers/EventServiceProvider.php +++ b/src/backend/packages/inensus/calin-smart-meter/src/Providers/EventServiceProvider.php @@ -4,8 +4,7 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; -class EventServiceProvider extends ServiceProvider -{ +class EventServiceProvider extends ServiceProvider { protected $subscribe = [ ]; @@ -14,8 +13,7 @@ class EventServiceProvider extends ServiceProvider * * @return void */ - public function boot() - { + public function boot() { parent::boot(); } } diff --git a/src/backend/packages/inensus/calin-smart-meter/src/Providers/ObserverServiceProvider.php b/src/backend/packages/inensus/calin-smart-meter/src/Providers/ObserverServiceProvider.php index a5793ea1f..dcc4fb87a 100644 --- a/src/backend/packages/inensus/calin-smart-meter/src/Providers/ObserverServiceProvider.php +++ b/src/backend/packages/inensus/calin-smart-meter/src/Providers/ObserverServiceProvider.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; -class ObserverServiceProvider extends ServiceProvider -{ +class ObserverServiceProvider extends ServiceProvider { /** * Register any events for your application. * * @return void */ - public function boot() - { + public function boot() { parent::boot(); } } diff --git a/src/backend/packages/inensus/calin-smart-meter/src/Providers/RouteServiceProvider.php b/src/backend/packages/inensus/calin-smart-meter/src/Providers/RouteServiceProvider.php index e8a87be74..9c0de2276 100644 --- a/src/backend/packages/inensus/calin-smart-meter/src/Providers/RouteServiceProvider.php +++ b/src/backend/packages/inensus/calin-smart-meter/src/Providers/RouteServiceProvider.php @@ -5,22 +5,18 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Support\Facades\Route; -class RouteServiceProvider extends ServiceProvider -{ +class RouteServiceProvider extends ServiceProvider { protected $namespace = 'Inensus\CalinSmartMeter\Http\Controllers'; - public function boot() - { + public function boot() { parent::boot(); } - public function map() - { + public function map() { $this->mapApiRoutes(); } - protected function mapApiRoutes() - { + protected function mapApiRoutes() { Route::prefix('api') ->middleware('api') ->namespace($this->namespace) diff --git a/src/backend/packages/inensus/calin-smart-meter/src/Services/CalinSmartCredentialService.php b/src/backend/packages/inensus/calin-smart-meter/src/Services/CalinSmartCredentialService.php index d0bdaa6b3..724bc7808 100644 --- a/src/backend/packages/inensus/calin-smart-meter/src/Services/CalinSmartCredentialService.php +++ b/src/backend/packages/inensus/calin-smart-meter/src/Services/CalinSmartCredentialService.php @@ -4,8 +4,7 @@ use Inensus\CalinSmartMeter\Models\CalinSmartCredential; -class CalinSmartCredentialService -{ +class CalinSmartCredentialService { private $credential; public function __construct( @@ -17,8 +16,7 @@ public function __construct( /** * This function uses one time on installation of the package. */ - public function createCredentials() - { + public function createCredentials() { return $this->credential->newQuery()->firstOrCreate(['id' => 1], [ 'company_name' => null, 'user_name' => null, @@ -27,13 +25,11 @@ public function createCredentials() ]); } - public function getCredentials() - { + public function getCredentials() { return $this->credential->newQuery()->first(); } - public function updateCredentials($data) - { + public function updateCredentials($data) { $credential = $this->credential->newQuery()->find($data['id']); $credential->update([ 'company_name' => $data['company_name'], diff --git a/src/backend/packages/inensus/calin-smart-meter/src/Tests/Unit/TokenGenerationTest.php b/src/backend/packages/inensus/calin-smart-meter/src/Tests/Unit/TokenGenerationTest.php index 466c0cb09..861775b3d 100644 --- a/src/backend/packages/inensus/calin-smart-meter/src/Tests/Unit/TokenGenerationTest.php +++ b/src/backend/packages/inensus/calin-smart-meter/src/Tests/Unit/TokenGenerationTest.php @@ -19,13 +19,11 @@ use Inensus\CalinSmartMeter\Models\CalinSmartCredential; use Tests\TestCase; -class TokenGenerationTest extends TestCase -{ +class TokenGenerationTest extends TestCase { use RefreshDatabase; /** @test */ - public function isTokenGenerated() - { + public function isTokenGenerated() { Queue::fake(); Config::set('app.debug', false); $transaction = $this->initializeData(); @@ -37,8 +35,7 @@ public function isTokenGenerated() Queue::assertPushed(TokenProcessor::class); } - private function initializeData() - { + private function initializeData() { // create person factory(MainSettings::class)->create(); diff --git a/src/backend/packages/inensus/daly-bms/src/Console/Commands/CheckPayments.php b/src/backend/packages/inensus/daly-bms/src/Console/Commands/CheckPayments.php index da62dc0dc..aa833449d 100644 --- a/src/backend/packages/inensus/daly-bms/src/Console/Commands/CheckPayments.php +++ b/src/backend/packages/inensus/daly-bms/src/Console/Commands/CheckPayments.php @@ -11,8 +11,7 @@ use Inensus\DalyBms\Modules\Api\DalyBmsApi; use MPM\EBike\EBikeService; -class CheckPayments extends AbstractSharedCommand -{ +class CheckPayments extends AbstractSharedCommand { use ScheduledPluginCommand; public const MPM_PLUGIN_ID = 16; @@ -35,8 +34,7 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } @@ -70,8 +68,7 @@ public function handle(): void $this->info('#############################'); } - private function lockTheBike($installment): bool - { + private function lockTheBike($installment): bool { $eBike = $this->eBikeService->getBySerialNumber($installment->assetPerson->device_serial); if ($eBike->manufacturer->name != self::MANUFACTURER_NAME) { diff --git a/src/backend/packages/inensus/daly-bms/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/daly-bms/src/Console/Commands/InstallPackage.php index 166343643..e58231541 100644 --- a/src/backend/packages/inensus/daly-bms/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/daly-bms/src/Console/Commands/InstallPackage.php @@ -6,8 +6,7 @@ use Inensus\DalyBms\Services\DalyBmsCredentialService; use Inensus\DalyBms\Services\ManufacturerService; -class InstallPackage extends Command -{ +class InstallPackage extends Command { protected $signature = 'daly-bms:install'; protected $description = 'Install DalyBms Package'; @@ -19,8 +18,7 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { $this->info('Installing DalyBms Integration Package\n'); $this->manufacturerService->register(); $this->credentialService->createCredentials(); diff --git a/src/backend/packages/inensus/daly-bms/src/Console/Commands/SyncBikes.php b/src/backend/packages/inensus/daly-bms/src/Console/Commands/SyncBikes.php index d6d82c812..df73e52a4 100644 --- a/src/backend/packages/inensus/daly-bms/src/Console/Commands/SyncBikes.php +++ b/src/backend/packages/inensus/daly-bms/src/Console/Commands/SyncBikes.php @@ -9,8 +9,7 @@ use MPM\Device\DeviceAddressService; use MPM\EBike\EBikeService; -class SyncBikes extends AbstractSharedCommand -{ +class SyncBikes extends AbstractSharedCommand { use ScheduledPluginCommand; public const MPM_PLUGIN_ID = 16; @@ -29,8 +28,7 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } @@ -59,8 +57,7 @@ public function handle(): void $this->info('#############################'); } - private function updateBike($deviceData) - { + private function updateBike($deviceData) { $updatingData = [ 'receive_time' => $deviceData['ReceiveTime'], 'lat' => strval($deviceData['Lat']), diff --git a/src/backend/packages/inensus/daly-bms/src/Exceptions/DalyBmsApiResponseException.php b/src/backend/packages/inensus/daly-bms/src/Exceptions/DalyBmsApiResponseException.php index 6d52a892a..5a377291d 100644 --- a/src/backend/packages/inensus/daly-bms/src/Exceptions/DalyBmsApiResponseException.php +++ b/src/backend/packages/inensus/daly-bms/src/Exceptions/DalyBmsApiResponseException.php @@ -2,10 +2,8 @@ namespace Inensus\DalyBms\Exceptions; -class DalyBmsApiResponseException extends \Exception -{ - public function __construct($message) - { +class DalyBmsApiResponseException extends \Exception { + public function __construct($message) { parent::__construct($message); } } diff --git a/src/backend/packages/inensus/daly-bms/src/Http/Controllers/DalyBmsCredentialController.php b/src/backend/packages/inensus/daly-bms/src/Http/Controllers/DalyBmsCredentialController.php index 371744bf2..fe5c465ce 100644 --- a/src/backend/packages/inensus/daly-bms/src/Http/Controllers/DalyBmsCredentialController.php +++ b/src/backend/packages/inensus/daly-bms/src/Http/Controllers/DalyBmsCredentialController.php @@ -7,20 +7,16 @@ use Inensus\DalyBms\Http\Resources\DalyBmsResource; use Inensus\DalyBms\Services\DalyBmsCredentialService; -class DalyBmsCredentialController extends Controller -{ +class DalyBmsCredentialController extends Controller { public function __construct( private DalyBmsCredentialService $credentialService, - ) { - } + ) {} - public function show(): DalyBmsResource - { + public function show(): DalyBmsResource { return DalyBmsResource::make($this->credentialService->getCredentials()); } - public function update(DalyBmsCredentialRequest $request): DalyBmsResource - { + public function update(DalyBmsCredentialRequest $request): DalyBmsResource { $credentials = $this->credentialService->getCredentials(); $updateData = $request->only([ 'user_name', diff --git a/src/backend/packages/inensus/daly-bms/src/Http/Requests/DalyBmsCredentialRequest.php b/src/backend/packages/inensus/daly-bms/src/Http/Requests/DalyBmsCredentialRequest.php index 6776b01de..ce951749a 100644 --- a/src/backend/packages/inensus/daly-bms/src/Http/Requests/DalyBmsCredentialRequest.php +++ b/src/backend/packages/inensus/daly-bms/src/Http/Requests/DalyBmsCredentialRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class DalyBmsCredentialRequest extends FormRequest -{ +class DalyBmsCredentialRequest extends FormRequest { /** * Get the validation rules that apply to the request. * * @return array */ - public function rules() - { + public function rules() { return [ 'user_name' => ['required'], 'password' => ['required'], diff --git a/src/backend/packages/inensus/daly-bms/src/Http/Resources/DalyBmsResource.php b/src/backend/packages/inensus/daly-bms/src/Http/Resources/DalyBmsResource.php index 0e7cc1363..6647ae3ba 100644 --- a/src/backend/packages/inensus/daly-bms/src/Http/Resources/DalyBmsResource.php +++ b/src/backend/packages/inensus/daly-bms/src/Http/Resources/DalyBmsResource.php @@ -5,8 +5,7 @@ use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\JsonResource; -class DalyBmsResource extends JsonResource -{ +class DalyBmsResource extends JsonResource { /** * Transform the resource into an array. * @@ -14,8 +13,7 @@ class DalyBmsResource extends JsonResource * * @return array */ - public function toArray($request) - { + public function toArray($request) { return parent::toArray($request); } } diff --git a/src/backend/packages/inensus/daly-bms/src/Models/DalyBmsCredential.php b/src/backend/packages/inensus/daly-bms/src/Models/DalyBmsCredential.php index bc90110ec..1838cadfd 100644 --- a/src/backend/packages/inensus/daly-bms/src/Models/DalyBmsCredential.php +++ b/src/backend/packages/inensus/daly-bms/src/Models/DalyBmsCredential.php @@ -4,32 +4,26 @@ use App\Models\Base\BaseModel; -class DalyBmsCredential extends BaseModel -{ +class DalyBmsCredential extends BaseModel { protected $table = 'daly_bms_api_credentials'; - public function getUserName() - { + public function getUserName() { return $this->user_name; } - public function getPassword() - { + public function getPassword() { return $this->password; } - public function getApiUrl() - { + public function getApiUrl() { return $this->api_url; } - public function getAccessToken() - { + public function getAccessToken() { return $this->access_token; } - public function getExpirationTime() - { + public function getExpirationTime() { return $this->token_expires_in; } } diff --git a/src/backend/packages/inensus/daly-bms/src/Models/DalyBmsDevice.php b/src/backend/packages/inensus/daly-bms/src/Models/DalyBmsDevice.php index 8a00d2ab5..af8f91f49 100644 --- a/src/backend/packages/inensus/daly-bms/src/Models/DalyBmsDevice.php +++ b/src/backend/packages/inensus/daly-bms/src/Models/DalyBmsDevice.php @@ -4,7 +4,6 @@ use App\Models\Base\BaseModel; -class DalyBmsDevice extends BaseModel -{ +class DalyBmsDevice extends BaseModel { protected $table = 'daly_bms_devices'; } diff --git a/src/backend/packages/inensus/daly-bms/src/Models/DalyBmsTransaction.php b/src/backend/packages/inensus/daly-bms/src/Models/DalyBmsTransaction.php index c02f10391..7b4b348fe 100644 --- a/src/backend/packages/inensus/daly-bms/src/Models/DalyBmsTransaction.php +++ b/src/backend/packages/inensus/daly-bms/src/Models/DalyBmsTransaction.php @@ -4,7 +4,6 @@ use App\Models\Base\BaseModel; -class DalyBmsTransaction extends BaseModel -{ +class DalyBmsTransaction extends BaseModel { protected $table = 'daly_bms_transactions'; } diff --git a/src/backend/packages/inensus/daly-bms/src/Modules/Api/ApiRequests.php b/src/backend/packages/inensus/daly-bms/src/Modules/Api/ApiRequests.php index 6b9b21775..d753c25b8 100644 --- a/src/backend/packages/inensus/daly-bms/src/Modules/Api/ApiRequests.php +++ b/src/backend/packages/inensus/daly-bms/src/Modules/Api/ApiRequests.php @@ -8,15 +8,12 @@ use Inensus\DalyBms\Exceptions\DalyBmsApiResponseException; use Inensus\DalyBms\Models\DalyBmsCredential; -class ApiRequests -{ +class ApiRequests { public function __construct( private Client $httpClient, - ) { - } + ) {} - public function authentication($credential): array - { + public function authentication($credential): array { try { $slug = '/Login/Authenticate?'; $userName = $credential->getUserName(); @@ -47,8 +44,7 @@ public function authentication($credential): array } } - public function postWithBodyParams(DalyBmsCredential $credentials, array $params, string $slug) - { + public function postWithBodyParams(DalyBmsCredential $credentials, array $params, string $slug) { $url = $credentials->getApiUrl().$slug; try { $response = $this->httpClient->post( @@ -82,8 +78,7 @@ public function postWithBodyParams(DalyBmsCredential $credentials, array $params } } - public function postWithQueryParams(DalyBmsCredential $credentials, array $params, string $slug) - { + public function postWithQueryParams(DalyBmsCredential $credentials, array $params, string $slug) { $url = $credentials->getApiUrl().$slug; if (strpos($url, '?') === false) { diff --git a/src/backend/packages/inensus/daly-bms/src/Modules/Api/DalyBmsApi.php b/src/backend/packages/inensus/daly-bms/src/Modules/Api/DalyBmsApi.php index e5d2417a6..809e74d51 100644 --- a/src/backend/packages/inensus/daly-bms/src/Modules/Api/DalyBmsApi.php +++ b/src/backend/packages/inensus/daly-bms/src/Modules/Api/DalyBmsApi.php @@ -13,8 +13,7 @@ use Inensus\DalyBms\Services\DalyBmsCredentialService; use MPM\EBike\EBikeService; -class DalyBmsApi implements IManufacturerAPI -{ +class DalyBmsApi implements IManufacturerAPI { // works with query params public const COMMAND_DEVICES_LIST = '/Monitor/Refresh'; @@ -29,11 +28,9 @@ public function __construct( private DalyBmsTransaction $dalyBmsTransaction, private EBikeService $eBikeService, private ApiRequests $apiRequests, - ) { - } + ) {} - public function getDevices(array $deviceSerials) - { + public function getDevices(array $deviceSerials) { $params = [ 'codes' => $deviceSerials, ]; @@ -56,8 +53,7 @@ public function getDevices(array $deviceSerials) } } - public function getDevice(string $code) - { + public function getDevice(string $code) { $params = [ 'Code' => $code, ]; @@ -79,8 +75,7 @@ public function getDevice(string $code) } } - public function switchDevice(string $code, bool $isOn) - { + public function switchDevice(string $code, bool $isOn) { $params = [ 'cmdKey' => '8500_004', 'data' => [ @@ -103,8 +98,7 @@ public function switchDevice(string $code, bool $isOn) } } - public function chargeDevice(TransactionDataContainer $transactionContainer): array - { + public function chargeDevice(TransactionDataContainer $transactionContainer): array { $transactionId = $transactionContainer->transaction->id; $dayDifferenceBetweenTwoInstallments = $transactionContainer->dayDifferenceBetweenTwoInstallments; $minimumPurchaseAmount = $transactionContainer->installmentCost; @@ -153,8 +147,7 @@ public function chargeDevice(TransactionDataContainer $transactionContainer): ar ]; } - public function clearDevice(Device $device) - { + public function clearDevice(Device $device) { throw new ApiCallDoesNotSupportedException('This api call does not supported'); } } diff --git a/src/backend/packages/inensus/daly-bms/src/Providers/DalyBmsServiceProvider.php b/src/backend/packages/inensus/daly-bms/src/Providers/DalyBmsServiceProvider.php index 3b2479b77..8df72998c 100644 --- a/src/backend/packages/inensus/daly-bms/src/Providers/DalyBmsServiceProvider.php +++ b/src/backend/packages/inensus/daly-bms/src/Providers/DalyBmsServiceProvider.php @@ -11,10 +11,8 @@ use Inensus\DalyBms\Console\Commands\SyncBikes; use Inensus\DalyBms\Modules\Api\DalyBmsApi; -class DalyBmsServiceProvider extends ServiceProvider -{ - public function boot(Filesystem $filesystem) - { +class DalyBmsServiceProvider extends ServiceProvider { + public function boot(Filesystem $filesystem) { $this->app->register(RouteServiceProvider::class); if ($this->app->runningInConsole()) { $this->publishConfigFiles(); @@ -32,30 +30,26 @@ public function boot(Filesystem $filesystem) }); } - public function register() - { + public function register() { $this->mergeConfigFrom(__DIR__.'/../../config/daly-bms.php', 'daly-bms.php'); $this->app->register(EventServiceProvider::class); $this->app->register(ObserverServiceProvider::class); $this->app->bind('DalyBmsApi', DalyBmsApi::class); } - public function publishConfigFiles() - { + public function publishConfigFiles() { $this->publishes([ __DIR__.'/../../config/daly-bms.php' => config_path('daly-bms.php'), ]); } - public function publishMigrations($filesystem) - { + public function publishMigrations($filesystem) { $this->publishes([ __DIR__.'/../../database/migrations/create_daly_bms_tables.php.stub' => $this->getMigrationFileName($filesystem), ], 'migrations'); } - protected function getMigrationFileName(Filesystem $filesystem): string - { + protected function getMigrationFileName(Filesystem $filesystem): string { $timestamp = date('Y_m_d_His'); return Collection::make($this->app->databasePath().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR) diff --git a/src/backend/packages/inensus/daly-bms/src/Providers/EventServiceProvider.php b/src/backend/packages/inensus/daly-bms/src/Providers/EventServiceProvider.php index 860f76d8b..7d0749da0 100644 --- a/src/backend/packages/inensus/daly-bms/src/Providers/EventServiceProvider.php +++ b/src/backend/packages/inensus/daly-bms/src/Providers/EventServiceProvider.php @@ -4,8 +4,7 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; -class EventServiceProvider extends ServiceProvider -{ +class EventServiceProvider extends ServiceProvider { protected $subscribe = [ ]; @@ -14,8 +13,7 @@ class EventServiceProvider extends ServiceProvider * * @return void */ - public function boot() - { + public function boot() { parent::boot(); } } diff --git a/src/backend/packages/inensus/daly-bms/src/Providers/ObserverServiceProvider.php b/src/backend/packages/inensus/daly-bms/src/Providers/ObserverServiceProvider.php index b2f547049..2109957c9 100644 --- a/src/backend/packages/inensus/daly-bms/src/Providers/ObserverServiceProvider.php +++ b/src/backend/packages/inensus/daly-bms/src/Providers/ObserverServiceProvider.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; -class ObserverServiceProvider extends ServiceProvider -{ +class ObserverServiceProvider extends ServiceProvider { /** * Register any events for your application. * * @return void */ - public function boot() - { + public function boot() { parent::boot(); } } diff --git a/src/backend/packages/inensus/daly-bms/src/Providers/RouteServiceProvider.php b/src/backend/packages/inensus/daly-bms/src/Providers/RouteServiceProvider.php index 30a1053df..5e0e844b6 100644 --- a/src/backend/packages/inensus/daly-bms/src/Providers/RouteServiceProvider.php +++ b/src/backend/packages/inensus/daly-bms/src/Providers/RouteServiceProvider.php @@ -5,22 +5,18 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Support\Facades\Route; -class RouteServiceProvider extends ServiceProvider -{ +class RouteServiceProvider extends ServiceProvider { protected $namespace = 'Inensus\DalyBms\Http\Controllers'; - public function boot() - { + public function boot() { parent::boot(); } - public function map() - { + public function map() { $this->mapApiRoutes(); } - protected function mapApiRoutes() - { + protected function mapApiRoutes() { Route::prefix('api') ->middleware('api') ->namespace($this->namespace) diff --git a/src/backend/packages/inensus/daly-bms/src/Services/DalyBmsCredentialService.php b/src/backend/packages/inensus/daly-bms/src/Services/DalyBmsCredentialService.php index 231cf47d9..95df2c412 100644 --- a/src/backend/packages/inensus/daly-bms/src/Services/DalyBmsCredentialService.php +++ b/src/backend/packages/inensus/daly-bms/src/Services/DalyBmsCredentialService.php @@ -4,43 +4,36 @@ use Inensus\DalyBms\Models\DalyBmsCredential; -class DalyBmsCredentialService -{ +class DalyBmsCredentialService { public function __construct( private DalyBmsCredential $credential, - ) { - } + ) {} /** * This function uses one time on installation of the package. */ - public function createCredentials() - { + public function createCredentials() { return $this->credential->newQuery()->firstOrCreate(['id' => 1], [ 'user_name' => null, 'password' => null, ]); } - public function getCredentials() - { + public function getCredentials() { return $this->credential->newQuery()->first(); } - public function updateCredentials($credentials, $updateData) - { + public function updateCredentials($credentials, $updateData) { $credentials->update($updateData); return $credentials->fresh(); } - public function getById($id) - { + public function getById($id) { return $this->credential->newQuery()->findOrFail($id); } - public function isAccessTokenValid($credential) - { + public function isAccessTokenValid($credential) { $accessToken = $credential->getAccessToken(); if ($accessToken == null) { diff --git a/src/backend/packages/inensus/daly-bms/src/Services/ManufacturerService.php b/src/backend/packages/inensus/daly-bms/src/Services/ManufacturerService.php index f9902e410..fd8b651fc 100644 --- a/src/backend/packages/inensus/daly-bms/src/Services/ManufacturerService.php +++ b/src/backend/packages/inensus/daly-bms/src/Services/ManufacturerService.php @@ -4,14 +4,10 @@ use App\Models\Manufacturer; -class ManufacturerService -{ - public function __construct(private Manufacturer $manufacturer) - { - } +class ManufacturerService { + public function __construct(private Manufacturer $manufacturer) {} - public function register() - { + public function register() { $api = $this->manufacturer->newQuery()->where('api_name', 'DalyBmsApi')->first(); if (!$api) { $this->manufacturer->newQuery()->create([ diff --git a/src/backend/packages/inensus/gome-long-meter/src/Console/Commands/GomeLongMeterDataSynchronizer.php b/src/backend/packages/inensus/gome-long-meter/src/Console/Commands/GomeLongMeterDataSynchronizer.php index 3a10b4c60..cd8eeca3f 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Console/Commands/GomeLongMeterDataSynchronizer.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Console/Commands/GomeLongMeterDataSynchronizer.php @@ -7,8 +7,7 @@ use Inensus\GomeLongMeter\Exceptions\CronJobException; use Inensus\GomeLongMeter\Services\GomeLongTariffService; -class GomeLongMeterDataSynchronizer extends AbstractSharedCommand -{ +class GomeLongMeterDataSynchronizer extends AbstractSharedCommand { protected $signature = 'gome-long-meter:dataSync'; protected $description = 'Synchronize data that needs to be updated from GomeLong Meter Meter.'; @@ -19,8 +18,7 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { $timeStart = microtime(true); $this->info('#############################'); $this->info('# GomeLong Meter Package #'); diff --git a/src/backend/packages/inensus/gome-long-meter/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/gome-long-meter/src/Console/Commands/InstallPackage.php index c8d3eff31..f3cf47aad 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Console/Commands/InstallPackage.php @@ -6,8 +6,7 @@ use Inensus\GomeLongMeter\Services\GomeLongCredentialService; use Inensus\GomeLongMeter\Services\ManufacturerService; -class InstallPackage extends Command -{ +class InstallPackage extends Command { protected $signature = 'gome-long-meter:install'; protected $description = 'Install GomeLongMeter Package'; @@ -19,8 +18,7 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { $this->info('Installing GomeLongMeter Integration Package\n'); $this->manufacturerService->register(); diff --git a/src/backend/packages/inensus/gome-long-meter/src/Exceptions/CronJobException.php b/src/backend/packages/inensus/gome-long-meter/src/Exceptions/CronJobException.php index f2eca50cc..2b9a10779 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Exceptions/CronJobException.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Exceptions/CronJobException.php @@ -2,6 +2,4 @@ namespace Inensus\GomeLongMeter\Exceptions; -class CronJobException extends \Exception -{ -} +class CronJobException extends \Exception {} diff --git a/src/backend/packages/inensus/gome-long-meter/src/Exceptions/GomeLongApiResponseException.php b/src/backend/packages/inensus/gome-long-meter/src/Exceptions/GomeLongApiResponseException.php index 26ec56c9b..3ed9d30f6 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Exceptions/GomeLongApiResponseException.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Exceptions/GomeLongApiResponseException.php @@ -2,10 +2,8 @@ namespace Inensus\GomeLongMeter\Exceptions; -class GomeLongApiResponseException extends \Exception -{ - public function __construct($message) - { +class GomeLongApiResponseException extends \Exception { + public function __construct($message) { parent::__construct($message); } } diff --git a/src/backend/packages/inensus/gome-long-meter/src/Http/Controllers/GomeLongCredentialController.php b/src/backend/packages/inensus/gome-long-meter/src/Http/Controllers/GomeLongCredentialController.php index c93d1f52a..7b2c21f7c 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Http/Controllers/GomeLongCredentialController.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Http/Controllers/GomeLongCredentialController.php @@ -7,20 +7,16 @@ use Inensus\GomeLongMeter\Http\Resources\GomeLongResource; use Inensus\GomeLongMeter\Services\GomeLongCredentialService; -class GomeLongCredentialController extends Controller -{ +class GomeLongCredentialController extends Controller { public function __construct( private GomeLongCredentialService $credentialService, - ) { - } + ) {} - public function show(): GomeLongResource - { + public function show(): GomeLongResource { return GomeLongResource::make($this->credentialService->getCredentials()); } - public function update(GomeLongCredentialRequest $request): GomeLongResource - { + public function update(GomeLongCredentialRequest $request): GomeLongResource { $credentials = $this->credentialService->getCredentials(); $updateData = $request->only([ 'user_id', diff --git a/src/backend/packages/inensus/gome-long-meter/src/Http/Requests/GomeLongCredentialRequest.php b/src/backend/packages/inensus/gome-long-meter/src/Http/Requests/GomeLongCredentialRequest.php index 31bd580b7..593c059b8 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Http/Requests/GomeLongCredentialRequest.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Http/Requests/GomeLongCredentialRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class GomeLongCredentialRequest extends FormRequest -{ +class GomeLongCredentialRequest extends FormRequest { /** * Get the validation rules that apply to the request. * * @return array */ - public function rules() - { + public function rules() { return [ 'user_id' => ['required'], 'user_password' => ['required'], diff --git a/src/backend/packages/inensus/gome-long-meter/src/Http/Resources/GomeLongResource.php b/src/backend/packages/inensus/gome-long-meter/src/Http/Resources/GomeLongResource.php index 2cae87243..265378732 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Http/Resources/GomeLongResource.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Http/Resources/GomeLongResource.php @@ -5,8 +5,7 @@ use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\JsonResource; -class GomeLongResource extends JsonResource -{ +class GomeLongResource extends JsonResource { /** * Transform the resource into an array. * @@ -14,8 +13,7 @@ class GomeLongResource extends JsonResource * * @return array */ - public function toArray($request) - { + public function toArray($request) { return parent::toArray($request); } } diff --git a/src/backend/packages/inensus/gome-long-meter/src/Models/GomeLongCredential.php b/src/backend/packages/inensus/gome-long-meter/src/Models/GomeLongCredential.php index b395dd484..3e6b05d1d 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Models/GomeLongCredential.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Models/GomeLongCredential.php @@ -4,22 +4,18 @@ use App\Models\Base\BaseModel; -class GomeLongCredential extends BaseModel -{ +class GomeLongCredential extends BaseModel { protected $table = 'gome_long_api_credentials'; - public function getUserId() - { + public function getUserId() { return $this->user_id; } - public function getUserPassword() - { + public function getUserPassword() { return $this->user_password; } - public function getApiUrl() - { + public function getApiUrl() { return $this->api_url; } } diff --git a/src/backend/packages/inensus/gome-long-meter/src/Models/GomeLongTariff.php b/src/backend/packages/inensus/gome-long-meter/src/Models/GomeLongTariff.php index 56f6d0d24..6673c7117 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Models/GomeLongTariff.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Models/GomeLongTariff.php @@ -5,17 +5,14 @@ use App\Models\Base\BaseModel; use App\Models\Meter\MeterTariff; -class GomeLongTariff extends BaseModel -{ +class GomeLongTariff extends BaseModel { protected $table = 'gome_long_tariffs'; - public function mpmTariff() - { + public function mpmTariff() { return $this->belongsTo(MeterTariff::class, 'mpm_tariff_id'); } - public function getTariffId() - { + public function getTariffId() { return $this->tariff_id; } } diff --git a/src/backend/packages/inensus/gome-long-meter/src/Models/GomeLongTransaction.php b/src/backend/packages/inensus/gome-long-meter/src/Models/GomeLongTransaction.php index 85cdb399f..5f719126e 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Models/GomeLongTransaction.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Models/GomeLongTransaction.php @@ -4,7 +4,6 @@ use App\Models\Base\BaseModel; -class GomeLongTransaction extends BaseModel -{ +class GomeLongTransaction extends BaseModel { protected $table = 'gome_long_transactions'; } diff --git a/src/backend/packages/inensus/gome-long-meter/src/Modules/Api/ApiRequests.php b/src/backend/packages/inensus/gome-long-meter/src/Modules/Api/ApiRequests.php index 545825988..259a1a69b 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Modules/Api/ApiRequests.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Modules/Api/ApiRequests.php @@ -8,15 +8,12 @@ use Inensus\GomeLongMeter\Exceptions\GomeLongApiResponseException; use Inensus\GomeLongMeter\Models\GomeLongCredential; -class ApiRequests -{ +class ApiRequests { public function __construct( private Client $httpClient, - ) { - } + ) {} - public function get(GomeLongCredential $credentials, array $params, string $slug) - { + public function get(GomeLongCredential $credentials, array $params, string $slug) { $url = $credentials->getApiUrl().$slug; foreach ($params as $key => $value) { $url .= $key.'='.$value.'&'; @@ -45,8 +42,7 @@ public function get(GomeLongCredential $credentials, array $params, string $slug } } - public function post(GomeLongCredential $credentials, array $params, string $slug) - { + public function post(GomeLongCredential $credentials, array $params, string $slug) { $url = $credentials->getApiUrl().$slug; try { $request = $this->httpClient->post( diff --git a/src/backend/packages/inensus/gome-long-meter/src/Modules/Api/GomeLongMeterApi.php b/src/backend/packages/inensus/gome-long-meter/src/Modules/Api/GomeLongMeterApi.php index 34fcec610..7be2c5d4b 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Modules/Api/GomeLongMeterApi.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Modules/Api/GomeLongMeterApi.php @@ -10,19 +10,16 @@ use Inensus\GomeLongMeter\Models\GomeLongTransaction; use Inensus\GomeLongMeter\Services\GomeLongCredentialService; -class GomeLongMeterApi implements IManufacturerAPI -{ +class GomeLongMeterApi implements IManufacturerAPI { public const API_CALL_TOKEN_GENERATION = '/EKPower'; public function __construct( private GomeLongCredentialService $credentialService, private GomeLongTransaction $gomeLongTransaction, private ApiRequests $apiRequests, - ) { - } + ) {} - public function chargeDevice(TransactionDataContainer $transactionContainer): array - { + public function chargeDevice(TransactionDataContainer $transactionContainer): array { $meter = $transactionContainer->device->device; $tariff = $transactionContainer->tariff; $transactionContainer->chargedEnergy += $transactionContainer->amount / $tariff->total_price; @@ -60,8 +57,7 @@ public function chargeDevice(TransactionDataContainer $transactionContainer): ar } } - public function clearDevice(Device $device) - { + public function clearDevice(Device $device) { throw new ApiCallDoesNotSupportedException('This api call does not supported'); } } diff --git a/src/backend/packages/inensus/gome-long-meter/src/Observers/MeterTariffObserver.php b/src/backend/packages/inensus/gome-long-meter/src/Observers/MeterTariffObserver.php index 7db874da3..24c050309 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Observers/MeterTariffObserver.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Observers/MeterTariffObserver.php @@ -9,18 +9,15 @@ use Inensus\GomeLongMeter\Services\GomeLongCredentialService; use Inensus\GomeLongMeter\Services\GomeLongTariffService; -class MeterTariffObserver -{ +class MeterTariffObserver { use ScheduledPluginCommand; public function __construct( private GomeLongTariffService $gomeLongTariffService, private GomeLongCredentialService $credentialService, - ) { - } + ) {} - public function created(MeterTariff $tariff) - { + public function created(MeterTariff $tariff) { if (!$this->checkForPluginStatusIsActive(MpmPlugin::GOME_LONG_METERS)) { return; } @@ -30,8 +27,7 @@ public function created(MeterTariff $tariff) } } - public function updated(MeterTariff $tariff) - { + public function updated(MeterTariff $tariff) { if (!$this->checkForPluginStatusIsActive(MpmPlugin::GOME_LONG_METERS)) { return; } @@ -42,8 +38,7 @@ public function updated(MeterTariff $tariff) } } - public function deleted(MeterTariff $tariff) - { + public function deleted(MeterTariff $tariff) { if (!$this->checkForPluginStatusIsActive(MpmPlugin::GOME_LONG_METERS)) { return; } diff --git a/src/backend/packages/inensus/gome-long-meter/src/Providers/EventServiceProvider.php b/src/backend/packages/inensus/gome-long-meter/src/Providers/EventServiceProvider.php index 91002d07c..de6352789 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Providers/EventServiceProvider.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Providers/EventServiceProvider.php @@ -4,8 +4,7 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; -class EventServiceProvider extends ServiceProvider -{ +class EventServiceProvider extends ServiceProvider { protected $subscribe = [ ]; @@ -14,8 +13,7 @@ class EventServiceProvider extends ServiceProvider * * @return void */ - public function boot() - { + public function boot() { parent::boot(); } } diff --git a/src/backend/packages/inensus/gome-long-meter/src/Providers/GomeLongMeterServiceProvider.php b/src/backend/packages/inensus/gome-long-meter/src/Providers/GomeLongMeterServiceProvider.php index 0704f5c95..8eb0f6fa1 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Providers/GomeLongMeterServiceProvider.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Providers/GomeLongMeterServiceProvider.php @@ -10,10 +10,8 @@ use Inensus\GomeLongMeter\Console\Commands\InstallPackage; use Inensus\GomeLongMeter\Modules\Api\GomeLongMeterApi; -class GomeLongMeterServiceProvider extends ServiceProvider -{ - public function boot(Filesystem $filesystem) - { +class GomeLongMeterServiceProvider extends ServiceProvider { + public function boot(Filesystem $filesystem) { $this->app->register(RouteServiceProvider::class); if ($this->app->runningInConsole()) { $this->publishConfigFiles(); @@ -29,37 +27,32 @@ public function boot(Filesystem $filesystem) }); } - public function register() - { + public function register() { $this->mergeConfigFrom(__DIR__.'/../../config/gome-long-meter.php', 'gome-long-meter'); $this->app->register(EventServiceProvider::class); $this->app->register(ObserverServiceProvider::class); $this->app->bind('GomeLongMeterApi', GomeLongMeterApi::class); } - public function publishConfigFiles() - { + public function publishConfigFiles() { $this->publishes([ __DIR__.'/../../config/gome-long-meter.php' => config_path('gome-long-meter.php'), ]); } - public function publishVueFiles() - { + public function publishVueFiles() { $this->publishes([ __DIR__.'/../resources/assets' => resource_path('assets/js/plugins/gome-long-meter'), ], 'vue-components'); } - public function publishMigrations($filesystem) - { + public function publishMigrations($filesystem) { $this->publishes([ __DIR__.'/../../database/migrations/create_gome_long_tables.php.stub' => $this->getMigrationFileName($filesystem), ], 'migrations'); } - protected function getMigrationFileName(Filesystem $filesystem): string - { + protected function getMigrationFileName(Filesystem $filesystem): string { $timestamp = date('Y_m_d_His'); return Collection::make($this->app->databasePath().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR) diff --git a/src/backend/packages/inensus/gome-long-meter/src/Providers/ObserverServiceProvider.php b/src/backend/packages/inensus/gome-long-meter/src/Providers/ObserverServiceProvider.php index 014a765cd..60dcaa385 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Providers/ObserverServiceProvider.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Providers/ObserverServiceProvider.php @@ -6,15 +6,13 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; use Inensus\GomeLongMeter\Observers\MeterTariffObserver; -class ObserverServiceProvider extends ServiceProvider -{ +class ObserverServiceProvider extends ServiceProvider { /** * Register any events for your application. * * @return void */ - public function boot() - { + public function boot() { parent::boot(); // removed observing of tariffs since GomeLong's API does not support it // MeterTariff::observe(MeterTariffObserver::class); diff --git a/src/backend/packages/inensus/gome-long-meter/src/Providers/RouteServiceProvider.php b/src/backend/packages/inensus/gome-long-meter/src/Providers/RouteServiceProvider.php index 6aef9d23b..344886aaf 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Providers/RouteServiceProvider.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Providers/RouteServiceProvider.php @@ -5,22 +5,18 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Support\Facades\Route; -class RouteServiceProvider extends ServiceProvider -{ +class RouteServiceProvider extends ServiceProvider { protected $namespace = 'Inensus\GomeLongMeter\Http\Controllers'; - public function boot() - { + public function boot() { parent::boot(); } - public function map() - { + public function map() { $this->mapApiRoutes(); } - protected function mapApiRoutes() - { + protected function mapApiRoutes() { Route::prefix('api') ->middleware('api') ->namespace($this->namespace) diff --git a/src/backend/packages/inensus/gome-long-meter/src/Services/GomeLongCredentialService.php b/src/backend/packages/inensus/gome-long-meter/src/Services/GomeLongCredentialService.php index 64a980d94..2514408f2 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Services/GomeLongCredentialService.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Services/GomeLongCredentialService.php @@ -4,38 +4,32 @@ use Inensus\GomeLongMeter\Models\GomeLongCredential; -class GomeLongCredentialService -{ +class GomeLongCredentialService { public function __construct( private GomeLongCredential $credential, - ) { - } + ) {} /** * This function uses one time on installation of the package. */ - public function createCredentials() - { + public function createCredentials() { return $this->credential->newQuery()->firstOrCreate(['id' => 1], [ 'user_id' => null, 'user_password' => null, ]); } - public function getCredentials() - { + public function getCredentials() { return $this->credential->newQuery()->first(); } - public function updateCredentials($credentials, $updateData) - { + public function updateCredentials($credentials, $updateData) { $credentials->update($updateData); return $credentials->fresh(); } - public function getById($id) - { + public function getById($id) { return $this->credential->newQuery()->findOrFail($id); } } diff --git a/src/backend/packages/inensus/gome-long-meter/src/Services/GomeLongTariffService.php b/src/backend/packages/inensus/gome-long-meter/src/Services/GomeLongTariffService.php index d9fdc1cff..bbbbbbe73 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Services/GomeLongTariffService.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Services/GomeLongTariffService.php @@ -8,8 +8,7 @@ use Inensus\GomeLongMeter\Models\GomeLongTariff; use Inensus\GomeLongMeter\Modules\Api\ApiRequests; -class GomeLongTariffService -{ +class GomeLongTariffService { public const API_CALL_TARIFF_LIST = '/UTSearch'; public const API_CALL_TARIFF_CREATE = '/UTAdd'; @@ -26,16 +25,13 @@ public function __construct( private GomeLongTariff $gomeLongTariff, private GomeLongCredentialService $credentialService, private MainSettings $mainSettings, - ) { - } + ) {} - public function getByMpmTariffId($mpmTariffId) - { + public function getByMpmTariffId($mpmTariffId) { return $this->gomeLongTariff->where('mpm_tariff_id', $mpmTariffId)->first(); } - public function createGomeLongTariff($tariff) - { + public function createGomeLongTariff($tariff) { $gomeLongTariff = $this->getByMpmTariffId($tariff->id); if (!$gomeLongTariff) { @@ -60,8 +56,7 @@ public function createGomeLongTariff($tariff) } } - public function updateGomeLongTariff($tariff) - { + public function updateGomeLongTariff($tariff) { try { $gomeLongTariff = $this->getByMpmTariffId($tariff->id); @@ -90,8 +85,7 @@ public function updateGomeLongTariff($tariff) } } - public function deleteGomeLongTariff($tariff) - { + public function deleteGomeLongTariff($tariff) { try { $gomeLongTariff = $this->getByMpmTariffId($tariff->id); @@ -117,8 +111,7 @@ public function deleteGomeLongTariff($tariff) } } - public function sync() - { + public function sync() { try { $credentials = $this->credentialService->getCredentials(); diff --git a/src/backend/packages/inensus/gome-long-meter/src/Services/ManufacturerService.php b/src/backend/packages/inensus/gome-long-meter/src/Services/ManufacturerService.php index 0ee2502ee..bb9416361 100644 --- a/src/backend/packages/inensus/gome-long-meter/src/Services/ManufacturerService.php +++ b/src/backend/packages/inensus/gome-long-meter/src/Services/ManufacturerService.php @@ -4,14 +4,10 @@ use App\Models\Manufacturer; -class ManufacturerService -{ - public function __construct(private Manufacturer $manufacturer) - { - } +class ManufacturerService { + public function __construct(private Manufacturer $manufacturer) {} - public function register() - { + public function register() { $api = $this->manufacturer->newQuery()->where('api_name', 'GomeLongMeterApi')->first(); if (!$api) { $this->manufacturer->newQuery()->create([ diff --git a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/AccessTokenRefresher.php b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/AccessTokenRefresher.php index b69d93720..fc6e8f3bc 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/AccessTokenRefresher.php +++ b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/AccessTokenRefresher.php @@ -7,8 +7,7 @@ use Carbon\Carbon; use Inensus\KelinMeter\Services\KelinCredentialService; -class AccessTokenRefresher extends AbstractSharedCommand -{ +class AccessTokenRefresher extends AbstractSharedCommand { use ScheduledPluginCommand; public const MPM_PLUGIN_ID = 5; @@ -17,13 +16,11 @@ class AccessTokenRefresher extends AbstractSharedCommand protected $description = 'Refreshes access token per each one hour.'; - public function __construct(private KelinCredentialService $credentialService) - { + public function __construct(private KelinCredentialService $credentialService) { parent::__construct(); } - public function handle(): void - { + public function handle(): void { if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } diff --git a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/DataSynchronizer.php b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/DataSynchronizer.php index 792134e89..6658fb4a1 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/DataSynchronizer.php +++ b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/DataSynchronizer.php @@ -16,8 +16,7 @@ use Inensus\KelinMeter\Services\KelinSyncActionService; use Inensus\KelinMeter\Services\KelinSyncSettingService; -class DataSynchronizer extends AbstractSharedCommand -{ +class DataSynchronizer extends AbstractSharedCommand { use ScheduledPluginCommand; public const MPM_PLUGIN_ID = 5; @@ -37,8 +36,7 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } diff --git a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/InstallPackage.php index 908fc8bfe..a367b8f76 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/InstallPackage.php @@ -7,8 +7,7 @@ use Inensus\KelinMeter\Services\KelinCredentialService; use Inensus\KelinMeter\Services\PackageInstallationService; -class InstallPackage extends Command -{ +class InstallPackage extends Command { protected $signature = 'kelin-meter:install'; protected $description = 'Install KelinMeters Package'; @@ -21,8 +20,7 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { $this->info('Installing KelinMeters Integration Package\n'); $this->packageInstallationService->createDefaultSettingRecords(); $this->apiHelpers->registerMeterManufacturer(); @@ -30,8 +28,7 @@ public function handle(): void $this->info('Package installed successfully..'); } - private function publishConfigurations() - { + private function publishConfigurations() { $this->info('Copying configurations\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\KelinMeter\Providers\KelinMeterServiceProvider", @@ -39,8 +36,7 @@ private function publishConfigurations() ]); } - private function publishMigrations() - { + private function publishMigrations() { $this->info('Copying migrations\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\KelinMeter\Providers\KelinMeterServiceProvider", @@ -48,14 +44,12 @@ private function publishMigrations() ]); } - private function createDatabaseTables() - { + private function createDatabaseTables() { $this->info('Creating database tables\n'); $this->call('migrate'); } - private function publishVueFiles() - { + private function publishVueFiles() { $this->info('Copying vue files\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\KelinMeter\Providers\KelinMeterServiceProvider", @@ -63,8 +57,7 @@ private function publishVueFiles() ]); } - private function createPluginRecord() - { + private function createPluginRecord() { $this->call('plugin:add', [ 'name' => 'KelinMeters', 'composer_name' => 'inensus/kelin-meter', diff --git a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/ReadDailyMeterConsumptions.php b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/ReadDailyMeterConsumptions.php index cec9d61b9..2398feb2e 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/ReadDailyMeterConsumptions.php +++ b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/ReadDailyMeterConsumptions.php @@ -8,8 +8,7 @@ use Inensus\KelinMeter\Services\DailyConsumptionService; use Inensus\KelinMeter\Services\KelinCredentialService; -class ReadDailyMeterConsumptions extends AbstractSharedCommand -{ +class ReadDailyMeterConsumptions extends AbstractSharedCommand { use ScheduledPluginCommand; public const MPM_PLUGIN_ID = 5; @@ -25,8 +24,7 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } diff --git a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/ReadMinutelyMeterConsumptions.php b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/ReadMinutelyMeterConsumptions.php index 5d8d26f14..79d4f52ab 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/ReadMinutelyMeterConsumptions.php +++ b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/ReadMinutelyMeterConsumptions.php @@ -8,8 +8,7 @@ use Inensus\KelinMeter\Services\KelinCredentialService; use Inensus\KelinMeter\Services\MinutelyConsumptionService; -class ReadMinutelyMeterConsumptions extends AbstractSharedCommand -{ +class ReadMinutelyMeterConsumptions extends AbstractSharedCommand { use ScheduledPluginCommand; public const MPM_PLUGIN_ID = 5; @@ -25,8 +24,7 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } diff --git a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/UpdatePackage.php b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/UpdatePackage.php index e09c67120..997794c0c 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Console/Commands/UpdatePackage.php +++ b/src/backend/packages/inensus/kelin-meter/src/Console/Commands/UpdatePackage.php @@ -9,8 +9,7 @@ use Inensus\KelinMeter\Services\KelinCredentialService; use Inensus\KelinMeter\Services\PackageInstallationService; -class UpdatePackage extends Command -{ +class UpdatePackage extends Command { protected $signature = 'kelin-meter:update'; protected $description = 'Update Kelin Meter Package'; @@ -24,8 +23,7 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { $this->info('Kelin Meter Integration Updating Started\n'); $this->removeOldVersionOfPackage(); @@ -39,20 +37,17 @@ public function handle(): void $this->info('Package updated successfully..'); } - private function removeOldVersionOfPackage() - { + private function removeOldVersionOfPackage() { $this->info('Removing former version of package\n'); echo shell_exec('COMPOSER_MEMORY_LIMIT=-1 ../composer.phar remove inensus/kelin-meter'); } - private function installNewVersionOfPackage() - { + private function installNewVersionOfPackage() { $this->info('Installing last version of package\n'); echo shell_exec('COMPOSER_MEMORY_LIMIT=-1 ../composer.phar require inensus/kelin-meter'); } - private function deleteMigration(Filesystem $filesystem) - { + private function deleteMigration(Filesystem $filesystem) { $migrationFile = $filesystem->glob(database_path().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR.'*_create_kelin_tables.php')[0]; $migration = DB::table('migrations') ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->first(); @@ -64,8 +59,7 @@ private function deleteMigration(Filesystem $filesystem) ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->delete(); } - private function publishMigrationsAgain() - { + private function publishMigrationsAgain() { $this->info('Copying migrations\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\KelinMeter\Providers\KelinMeterServiceProvider", @@ -73,14 +67,12 @@ private function publishMigrationsAgain() ]); } - private function updateDatabase() - { + private function updateDatabase() { $this->info('Updating database tables\n'); $this->call('migrate'); } - private function publishVueFilesAgain() - { + private function publishVueFilesAgain() { $this->info('Copying vue files\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\KelinMeter\Providers\KelinMeterServiceProvider", diff --git a/src/backend/packages/inensus/kelin-meter/src/Exceptions/CronJobException.php b/src/backend/packages/inensus/kelin-meter/src/Exceptions/CronJobException.php index 4db7ad337..dc7168cce 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Exceptions/CronJobException.php +++ b/src/backend/packages/inensus/kelin-meter/src/Exceptions/CronJobException.php @@ -2,6 +2,4 @@ namespace Inensus\KelinMeter\Exceptions; -class CronJobException extends \Exception -{ -} +class CronJobException extends \Exception {} diff --git a/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiAuthenticationException.php b/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiAuthenticationException.php index c05efe0a1..faf39f98e 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiAuthenticationException.php +++ b/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiAuthenticationException.php @@ -2,6 +2,4 @@ namespace Inensus\KelinMeter\Exceptions; -class KelinApiAuthenticationException extends \Exception -{ -} +class KelinApiAuthenticationException extends \Exception {} diff --git a/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiCredentialsNotFoundException.php b/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiCredentialsNotFoundException.php index 2246d9d4c..34301a174 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiCredentialsNotFoundException.php +++ b/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiCredentialsNotFoundException.php @@ -2,6 +2,4 @@ namespace Inensus\KelinMeter\Exceptions; -class KelinApiCredentialsNotFoundException extends \Exception -{ -} +class KelinApiCredentialsNotFoundException extends \Exception {} diff --git a/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiEmtyDataException.php b/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiEmtyDataException.php index 68bd2b579..ff3866d80 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiEmtyDataException.php +++ b/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiEmtyDataException.php @@ -2,6 +2,4 @@ namespace Inensus\KelinMeter\Exceptions; -class KelinApiEmtyDataException extends \Exception -{ -} +class KelinApiEmtyDataException extends \Exception {} diff --git a/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiResponseException.php b/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiResponseException.php index 63919970c..89c16c12d 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiResponseException.php +++ b/src/backend/packages/inensus/kelin-meter/src/Exceptions/KelinApiResponseException.php @@ -2,6 +2,4 @@ namespace Inensus\KelinMeter\Exceptions; -class KelinApiResponseException extends \Exception -{ -} +class KelinApiResponseException extends \Exception {} diff --git a/src/backend/packages/inensus/kelin-meter/src/Helpers/ApiHelpers.php b/src/backend/packages/inensus/kelin-meter/src/Helpers/ApiHelpers.php index d4e2f4c6e..a96c2caad 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Helpers/ApiHelpers.php +++ b/src/backend/packages/inensus/kelin-meter/src/Helpers/ApiHelpers.php @@ -7,17 +7,14 @@ use Inensus\KelinMeter\Exceptions\KelinApiEmtyDataException; use Inensus\KelinMeter\Exceptions\KelinApiResponseException; -class ApiHelpers -{ +class ApiHelpers { private $manufacturer; - public function __construct(Manufacturer $manufacturerModel) - { + public function __construct(Manufacturer $manufacturerModel) { $this->manufacturer = $manufacturerModel; } - public function registerMeterManufacturer() - { + public function registerMeterManufacturer() { $this->manufacturer->newQuery()->firstOrCreate(['api_name' => 'KelinMeterApi'], [ 'name' => 'Kelin Meters', 'website' => '-', @@ -25,8 +22,7 @@ public function registerMeterManufacturer() ]); } - public function checkApiResult($result) - { + public function checkApiResult($result) { if (!$result) { throw new KelinApiEmtyDataException('Null result returned.'); } @@ -43,8 +39,7 @@ public function checkApiResult($result) return $result; } - public function makeHash($data) - { + public function makeHash($data) { return md5(implode('', $data)); } } diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Clients/KelinMeterApiClient.php b/src/backend/packages/inensus/kelin-meter/src/Http/Clients/KelinMeterApiClient.php index 13be19e58..b05170004 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Clients/KelinMeterApiClient.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Clients/KelinMeterApiClient.php @@ -10,8 +10,7 @@ use Inensus\KelinMeter\Helpers\ApiHelpers; use Inensus\KelinMeter\Models\KelinCredential; -class KelinMeterApiClient -{ +class KelinMeterApiClient { private $client; private $apiHelpers; @@ -28,8 +27,7 @@ public function __construct( $this->credential = $credential; } - public function token($url, $queryParams) - { + public function token($url, $queryParams) { try { $credential = $this->getCredentials(); } catch (\Exception $e) { @@ -47,8 +45,7 @@ public function token($url, $queryParams) return $this->apiHelpers->checkApiResult(json_decode((string) $response->getBody(), true)); } - public function get($url, $queryParams = null) - { + public function get($url, $queryParams = null) { try { $credential = $this->getCredentials(); } catch (ModelNotFoundException $e) { @@ -71,8 +68,7 @@ public function get($url, $queryParams = null) return $this->apiHelpers->checkApiResult(json_decode((string) $response->getBody(), true)); } - public function getCredentials() - { + public function getCredentials() { return $this->credential->newQuery()->firstOrFail(); } } diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/IBaseController.php b/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/IBaseController.php index a470f1c13..13f153c65 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/IBaseController.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/IBaseController.php @@ -2,8 +2,7 @@ namespace Inensus\KelinMeter\Http\Controllers; -interface IBaseController -{ +interface IBaseController { public function sync(); public function checkSync(); diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinCredentialController.php b/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinCredentialController.php index 87f60b78b..939786cec 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinCredentialController.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinCredentialController.php @@ -7,22 +7,18 @@ use Inensus\KelinMeter\Http\Resources\KelinCredentialResource; use Inensus\KelinMeter\Services\KelinCredentialService; -class KelinCredentialController extends Controller -{ +class KelinCredentialController extends Controller { private $credentialService; - public function __construct(KelinCredentialService $credentialService) - { + public function __construct(KelinCredentialService $credentialService) { $this->credentialService = $credentialService; } - public function show(): KelinCredentialResource - { + public function show(): KelinCredentialResource { return new KelinCredentialResource($this->credentialService->getCredentials()); } - public function update(KelinCredentialRequest $request): KelinCredentialResource - { + public function update(KelinCredentialRequest $request): KelinCredentialResource { return new KelinCredentialResource($this->credentialService->updateCredentials($request->only([ 'id', 'username', diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinCustomerController.php b/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinCustomerController.php index 538af78e6..f3ef4883b 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinCustomerController.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinCustomerController.php @@ -8,27 +8,22 @@ use Inensus\KelinMeter\Http\Resources\KelinResource; use Inensus\KelinMeter\Services\KelinCustomerService; -class KelinCustomerController extends Controller implements IBaseController -{ +class KelinCustomerController extends Controller implements IBaseController { private $customerService; - public function __construct(KelinCustomerService $customerService) - { + public function __construct(KelinCustomerService $customerService) { $this->customerService = $customerService; } - public function index(Request $request) - { + public function index(Request $request) { return KelinCustomerResource::collection($this->customerService->getCustomers($request)); } - public function sync() - { + public function sync() { return KelinCustomerResource::collection($this->customerService->sync()); } - public function checkSync(): KelinResource - { + public function checkSync(): KelinResource { return new KelinResource($this->customerService->syncCheck()); } } diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinDailyConsumptionController.php b/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinDailyConsumptionController.php index 9290b972c..647eca176 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinDailyConsumptionController.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinDailyConsumptionController.php @@ -7,17 +7,14 @@ use Inensus\KelinMeter\Models\KelinMeter; use Inensus\KelinMeter\Services\DailyConsumptionService; -class KelinDailyConsumptionController extends Controller -{ +class KelinDailyConsumptionController extends Controller { private $dailyConsumptionService; - public function __construct(DailyConsumptionService $dailyConsumptionService) - { + public function __construct(DailyConsumptionService $dailyConsumptionService) { $this->dailyConsumptionService = $dailyConsumptionService; } - public function index(KelinMeter $meter) - { + public function index(KelinMeter $meter) { $perPage = \request()->get('per_page') ?? 15; return DailyConsumptionResource::collection( diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinMeterController.php b/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinMeterController.php index 71703b94a..70d27df63 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinMeterController.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinMeterController.php @@ -8,27 +8,22 @@ use Inensus\KelinMeter\Http\Resources\KelinResource; use Inensus\KelinMeter\Services\KelinMeterService; -class KelinMeterController extends Controller -{ +class KelinMeterController extends Controller { private $meterService; - public function __construct(KelinMeterService $meterService) - { + public function __construct(KelinMeterService $meterService) { $this->meterService = $meterService; } - public function index(Request $request) - { + public function index(Request $request) { return KelinMeterResource::collection($this->meterService->getMeters($request)); } - public function sync() - { + public function sync() { return KelinMeterResource::collection($this->meterService->sync()); } - public function checkSync(): KelinResource - { + public function checkSync(): KelinResource { return new KelinResource($this->meterService->syncCheck()); } } diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinMinutelyConsumptionController.php b/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinMinutelyConsumptionController.php index b0f08fe6e..4b3f9cb9e 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinMinutelyConsumptionController.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinMinutelyConsumptionController.php @@ -7,17 +7,14 @@ use Inensus\KelinMeter\Models\KelinMeter; use Inensus\KelinMeter\Services\MinutelyConsumptionService; -class KelinMinutelyConsumptionController extends Controller -{ +class KelinMinutelyConsumptionController extends Controller { private $minutelyConsumptionService; - public function __construct(MinutelyConsumptionService $minutelyConsumptionService) - { + public function __construct(MinutelyConsumptionService $minutelyConsumptionService) { $this->minutelyConsumptionService = $minutelyConsumptionService; } - public function index(KelinMeter $meter) - { + public function index(KelinMeter $meter) { $perPage = \request()->get('per_page') ?? 15; return MinutelyConsumptionResource::collection($this->minutelyConsumptionService->getDailyData( diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinSettingController.php b/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinSettingController.php index 8227d66af..32647dae0 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinSettingController.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinSettingController.php @@ -6,17 +6,14 @@ use Inensus\KelinMeter\Http\Resources\KelinSettingResource; use Inensus\KelinMeter\Services\KelinSettingService; -class KelinSettingController extends Controller -{ +class KelinSettingController extends Controller { private $settingService; - public function __construct(KelinSettingService $settingService) - { + public function __construct(KelinSettingService $settingService) { $this->settingService = $settingService; } - public function index() - { + public function index() { return KelinSettingResource::collection($this->settingService->getSettings()); } } diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinStatusController.php b/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinStatusController.php index af37a49c3..e9a23828d 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinStatusController.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinStatusController.php @@ -9,22 +9,18 @@ use Inensus\KelinMeter\Models\KelinMeter; use Inensus\KelinMeter\Services\KelinMeterStatusService; -class KelinStatusController extends Controller -{ +class KelinStatusController extends Controller { private $kelinMeterStatusService; - public function __construct(KelinMeterStatusService $kelinMeterStatusService) - { + public function __construct(KelinMeterStatusService $kelinMeterStatusService) { $this->kelinMeterStatusService = $kelinMeterStatusService; } - public function show(KelinMeter $meter) - { + public function show(KelinMeter $meter) { return new KelinMeterStatusResource($this->kelinMeterStatusService->getStatusOfMeter($meter)); } - public function update(Request $request, KelinMeter $meter) - { + public function update(Request $request, KelinMeter $meter) { return new KelinResource($this->kelinMeterStatusService->changeStatusOfMeter($meter->meter_address, $request->input('status'))); } } diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinSyncSettingController.php b/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinSyncSettingController.php index 92720f525..390261f67 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinSyncSettingController.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Controllers/KelinSyncSettingController.php @@ -7,17 +7,14 @@ use Inensus\KelinMeter\Http\Resources\KelinResource; use Inensus\KelinMeter\Services\KelinSyncSettingService; -class KelinSyncSettingController extends Controller -{ +class KelinSyncSettingController extends Controller { private $syncSettingService; - public function __construct(KelinSyncSettingService $syncSettingService) - { + public function __construct(KelinSyncSettingService $syncSettingService) { $this->syncSettingService = $syncSettingService; } - public function update(Request $request): KelinResource - { + public function update(Request $request): KelinResource { return new KelinResource($this->syncSettingService->updateSyncSettings($request->all())); } } diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Requests/KelinCredentialRequest.php b/src/backend/packages/inensus/kelin-meter/src/Http/Requests/KelinCredentialRequest.php index a72e55493..9dfcd716d 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Requests/KelinCredentialRequest.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Requests/KelinCredentialRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class KelinCredentialRequest extends FormRequest -{ +class KelinCredentialRequest extends FormRequest { /** * Get the validation rules that apply to the request. * * @return array */ - public function rules() - { + public function rules() { return [ 'username' => ['required'], 'password' => 'required', diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/DailyConsumptionCollection.php b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/DailyConsumptionCollection.php index e3c9b2908..363494730 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/DailyConsumptionCollection.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/DailyConsumptionCollection.php @@ -4,8 +4,7 @@ use Illuminate\Http\Resources\Json\ResourceCollection; -class DailyConsumptionCollection extends ResourceCollection -{ +class DailyConsumptionCollection extends ResourceCollection { /** * Transform the resource collection into an array. * @@ -13,8 +12,7 @@ class DailyConsumptionCollection extends ResourceCollection * * @return array */ - public function toArray($request) - { + public function toArray($request) { return [ 'data' => $this->collection, ]; diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/DailyConsumptionResource.php b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/DailyConsumptionResource.php index 7ccfc69b2..eff111a82 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/DailyConsumptionResource.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/DailyConsumptionResource.php @@ -4,10 +4,8 @@ use Illuminate\Http\Resources\Json\JsonResource; -class DailyConsumptionResource extends JsonResource -{ - public function toArray($request) - { +class DailyConsumptionResource extends JsonResource { + public function toArray($request) { return [ 'data' => [ 'type' => 'daily_consumption', diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinCredentialResource.php b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinCredentialResource.php index 884259754..fe7d6fa84 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinCredentialResource.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinCredentialResource.php @@ -4,10 +4,8 @@ use Illuminate\Http\Resources\Json\JsonResource; -class KelinCredentialResource extends JsonResource -{ - public function toArray($request) - { +class KelinCredentialResource extends JsonResource { + public function toArray($request) { return [ 'data' => [ 'type' => 'credentials', @@ -22,8 +20,7 @@ public function toArray($request) ]; } - private function alertType($authenticationStatus) - { + private function alertType($authenticationStatus) { switch ($authenticationStatus) { case true: return [ diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinCustomerCollection.php b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinCustomerCollection.php index e5d3baeba..d875b8532 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinCustomerCollection.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinCustomerCollection.php @@ -4,8 +4,7 @@ use Illuminate\Http\Resources\Json\ResourceCollection; -class KelinCustomerCollection extends ResourceCollection -{ +class KelinCustomerCollection extends ResourceCollection { /** * Transform the resource collection into an array. * @@ -13,8 +12,7 @@ class KelinCustomerCollection extends ResourceCollection * * @return array */ - public function toArray($request) - { + public function toArray($request) { return [ 'data' => $this->collection, ]; diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinCustomerResource.php b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinCustomerResource.php index b0f13d04b..28e96a639 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinCustomerResource.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinCustomerResource.php @@ -4,10 +4,8 @@ use Illuminate\Http\Resources\Json\JsonResource; -class KelinCustomerResource extends JsonResource -{ - public function toArray($request) - { +class KelinCustomerResource extends JsonResource { + public function toArray($request) { return [ 'data' => [ 'type' => 'customer', diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinMeterCollection.php b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinMeterCollection.php index ad033f477..6456e896d 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinMeterCollection.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinMeterCollection.php @@ -4,8 +4,7 @@ use Illuminate\Http\Resources\Json\ResourceCollection; -class KelinMeterCollection extends ResourceCollection -{ +class KelinMeterCollection extends ResourceCollection { /** * Transform the resource collection into an array. * @@ -13,8 +12,7 @@ class KelinMeterCollection extends ResourceCollection * * @return array */ - public function toArray($request) - { + public function toArray($request) { return [ 'data' => $this->collection, ]; diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinMeterResource.php b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinMeterResource.php index 18fed4787..6fe8a335c 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinMeterResource.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinMeterResource.php @@ -4,10 +4,8 @@ use Illuminate\Http\Resources\Json\JsonResource; -class KelinMeterResource extends JsonResource -{ - public function toArray($request) - { +class KelinMeterResource extends JsonResource { + public function toArray($request) { return [ 'data' => [ 'type' => 'setting', diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinMeterStatusResource.php b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinMeterStatusResource.php index ac2b6c2b6..4e990d5c2 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinMeterStatusResource.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinMeterStatusResource.php @@ -4,10 +4,8 @@ use Illuminate\Http\Resources\Json\JsonResource; -class KelinMeterStatusResource extends JsonResource -{ - public function toArray($request) - { +class KelinMeterStatusResource extends JsonResource { + public function toArray($request) { return [ 'data' => [ 'type' => 'meter-status', diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinResource.php b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinResource.php index 5c5b2694f..7ec9d80a3 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinResource.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinResource.php @@ -5,8 +5,7 @@ use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\JsonResource; -class KelinResource extends JsonResource -{ +class KelinResource extends JsonResource { /** * Transform the resource into an array. * @@ -14,8 +13,7 @@ class KelinResource extends JsonResource * * @return array */ - public function toArray($request) - { + public function toArray($request) { return parent::toArray($request); } } diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinSettingCollection.php b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinSettingCollection.php index 560514960..7c7768ad6 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinSettingCollection.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinSettingCollection.php @@ -4,8 +4,7 @@ use Illuminate\Http\Resources\Json\ResourceCollection; -class KelinSettingCollection extends ResourceCollection -{ +class KelinSettingCollection extends ResourceCollection { /** * Transform the resource collection into an array. * @@ -13,8 +12,7 @@ class KelinSettingCollection extends ResourceCollection * * @return array */ - public function toArray($request) - { + public function toArray($request) { return [ 'data' => $this->collection, ]; diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinSettingResource.php b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinSettingResource.php index efe076175..cdaf1e157 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinSettingResource.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/KelinSettingResource.php @@ -4,10 +4,8 @@ use Illuminate\Http\Resources\Json\JsonResource; -class KelinSettingResource extends JsonResource -{ - public function toArray($request) - { +class KelinSettingResource extends JsonResource { + public function toArray($request) { return [ 'data' => [ 'type' => 'setting', diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/MinutelyConsumptionCollection.php b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/MinutelyConsumptionCollection.php index e5f600943..a519e6216 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/MinutelyConsumptionCollection.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/MinutelyConsumptionCollection.php @@ -4,8 +4,7 @@ use Illuminate\Http\Resources\Json\ResourceCollection; -class MinutelyConsumptionCollection extends ResourceCollection -{ +class MinutelyConsumptionCollection extends ResourceCollection { /** * Transform the resource collection into an array. * @@ -13,8 +12,7 @@ class MinutelyConsumptionCollection extends ResourceCollection * * @return array */ - public function toArray($request) - { + public function toArray($request) { return [ 'data' => $this->collection, ]; diff --git a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/MinutelyConsumptionResource.php b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/MinutelyConsumptionResource.php index 8b9006fa8..36a9b6eb8 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Http/Resources/MinutelyConsumptionResource.php +++ b/src/backend/packages/inensus/kelin-meter/src/Http/Resources/MinutelyConsumptionResource.php @@ -4,10 +4,8 @@ use Illuminate\Http\Resources\Json\JsonResource; -class MinutelyConsumptionResource extends JsonResource -{ - public function toArray($request) - { +class MinutelyConsumptionResource extends JsonResource { + public function toArray($request) { return [ 'data' => [ 'type' => 'minutely_consumption', diff --git a/src/backend/packages/inensus/kelin-meter/src/KelinMeterApi.php b/src/backend/packages/inensus/kelin-meter/src/KelinMeterApi.php index 3d7da8919..a60e58ff2 100644 --- a/src/backend/packages/inensus/kelin-meter/src/KelinMeterApi.php +++ b/src/backend/packages/inensus/kelin-meter/src/KelinMeterApi.php @@ -13,19 +13,16 @@ use Inensus\KelinMeter\Models\KelinMeter; use Inensus\KelinMeter\Models\KelinTransaction; -class KelinMeterApi implements IManufacturerAPI -{ +class KelinMeterApi implements IManufacturerAPI { private $rootUrl = '/recharge'; public function __construct( private KelinMeter $kelinMeter, private KelinTransaction $kelinTransaction, private KelinMeterApiClient $kelinApi, - ) { - } + ) {} - public function chargeDevice($transactionContainer): array - { + public function chargeDevice($transactionContainer): array { $meter = $transactionContainer->device->device; $tariff = $transactionContainer->tariff; $transactionContainer->chargedEnergy += $transactionContainer->amount / $tariff->total_price; @@ -114,7 +111,5 @@ public function chargeDevice($transactionContainer): array } } - public function clearDevice(Device $device) - { - } + public function clearDevice(Device $device) {} } diff --git a/src/backend/packages/inensus/kelin-meter/src/Models/KelinCredential.php b/src/backend/packages/inensus/kelin-meter/src/Models/KelinCredential.php index 0a04bf263..a9ebc0d6b 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Models/KelinCredential.php +++ b/src/backend/packages/inensus/kelin-meter/src/Models/KelinCredential.php @@ -4,7 +4,6 @@ use App\Models\Base\BaseModel; -class KelinCredential extends BaseModel -{ +class KelinCredential extends BaseModel { protected $table = 'kelin_api_credentials'; } diff --git a/src/backend/packages/inensus/kelin-meter/src/Models/KelinCustomer.php b/src/backend/packages/inensus/kelin-meter/src/Models/KelinCustomer.php index 769fca357..a188eb897 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Models/KelinCustomer.php +++ b/src/backend/packages/inensus/kelin-meter/src/Models/KelinCustomer.php @@ -5,17 +5,14 @@ use App\Models\Base\BaseModel; use App\Models\Person\Person; -class KelinCustomer extends BaseModel -{ +class KelinCustomer extends BaseModel { protected $table = 'kelin_customers'; - public function mpmPerson() - { + public function mpmPerson() { return $this->belongsTo(Person::class, 'mpm_customer_id'); } - public function kelinMeters() - { + public function kelinMeters() { return $this->hasMany(KelinMeter::class, 'customer_no', 'customer_no'); } } diff --git a/src/backend/packages/inensus/kelin-meter/src/Models/KelinMeter.php b/src/backend/packages/inensus/kelin-meter/src/Models/KelinMeter.php index 92821bdc4..124b6049f 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Models/KelinMeter.php +++ b/src/backend/packages/inensus/kelin-meter/src/Models/KelinMeter.php @@ -5,17 +5,14 @@ use App\Models\Base\BaseModel; use App\Models\Meter\Meter; -class KelinMeter extends BaseModel -{ +class KelinMeter extends BaseModel { protected $table = 'kelin_meters'; - public function mpmMeter() - { + public function mpmMeter() { return $this->belongsTo(Meter::class, 'mpm_meter_id'); } - public function kelinCustomer() - { + public function kelinCustomer() { return $this->belongsTo(KelinCustomer::class, 'customer_no', 'customer_no'); } } diff --git a/src/backend/packages/inensus/kelin-meter/src/Models/KelinMeterConsumption.php b/src/backend/packages/inensus/kelin-meter/src/Models/KelinMeterConsumption.php index d67028cdf..768fa1316 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Models/KelinMeterConsumption.php +++ b/src/backend/packages/inensus/kelin-meter/src/Models/KelinMeterConsumption.php @@ -5,12 +5,10 @@ use App\Models\Base\BaseModel; use App\Models\Meter\Meter; -class KelinMeterConsumption extends BaseModel -{ +class KelinMeterConsumption extends BaseModel { protected $table = 'kelin_meter_consumptions'; - public function meter() - { + public function meter() { return $this->belongsTo(Meter::class); } } diff --git a/src/backend/packages/inensus/kelin-meter/src/Models/KelinMeterDailyData.php b/src/backend/packages/inensus/kelin-meter/src/Models/KelinMeterDailyData.php index f5742487d..b3f3ecde9 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Models/KelinMeterDailyData.php +++ b/src/backend/packages/inensus/kelin-meter/src/Models/KelinMeterDailyData.php @@ -4,7 +4,6 @@ use App\Models\Base\BaseModel; -class KelinMeterDailyData extends BaseModel -{ +class KelinMeterDailyData extends BaseModel { protected $table = 'kelin_meter_daily_datas'; } diff --git a/src/backend/packages/inensus/kelin-meter/src/Models/KelinMeterMinutelyData.php b/src/backend/packages/inensus/kelin-meter/src/Models/KelinMeterMinutelyData.php index 9acc94d13..5c9d46134 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Models/KelinMeterMinutelyData.php +++ b/src/backend/packages/inensus/kelin-meter/src/Models/KelinMeterMinutelyData.php @@ -4,7 +4,6 @@ use App\Models\Base\BaseModel; -class KelinMeterMinutelyData extends BaseModel -{ +class KelinMeterMinutelyData extends BaseModel { protected $table = 'kelin_meter_minutely_datas'; } diff --git a/src/backend/packages/inensus/kelin-meter/src/Models/KelinSetting.php b/src/backend/packages/inensus/kelin-meter/src/Models/KelinSetting.php index 8f0ff2689..5e5dfdaa9 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Models/KelinSetting.php +++ b/src/backend/packages/inensus/kelin-meter/src/Models/KelinSetting.php @@ -5,12 +5,10 @@ use App\Models\Base\BaseModel; use Illuminate\Database\Eloquent\Relations\MorphTo; -class KelinSetting extends BaseModel -{ +class KelinSetting extends BaseModel { protected $table = 'kelin_settings'; - public function setting(): MorphTo - { + public function setting(): MorphTo { return $this->morphTo(); } } diff --git a/src/backend/packages/inensus/kelin-meter/src/Models/KelinSyncAction.php b/src/backend/packages/inensus/kelin-meter/src/Models/KelinSyncAction.php index fdfd78d8a..1014e1013 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Models/KelinSyncAction.php +++ b/src/backend/packages/inensus/kelin-meter/src/Models/KelinSyncAction.php @@ -4,12 +4,10 @@ use App\Models\Base\BaseModel; -class KelinSyncAction extends BaseModel -{ +class KelinSyncAction extends BaseModel { protected $table = 'kelin_sync_actions'; - public function synSetting() - { + public function synSetting() { return $this->belongsTo(KelinSyncSetting::class, 'sync_setting_id'); } } diff --git a/src/backend/packages/inensus/kelin-meter/src/Models/KelinSyncSetting.php b/src/backend/packages/inensus/kelin-meter/src/Models/KelinSyncSetting.php index 6b80cdebb..5e4c06fba 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Models/KelinSyncSetting.php +++ b/src/backend/packages/inensus/kelin-meter/src/Models/KelinSyncSetting.php @@ -4,17 +4,14 @@ use App\Models\Base\BaseModel; -class KelinSyncSetting extends BaseModel -{ +class KelinSyncSetting extends BaseModel { protected $table = 'kelin_sync_settings'; - public function syncAction() - { + public function syncAction() { return $this->hasOne(KelinSyncAction::class); } - public function setting() - { + public function setting() { return $this->morphOne(KelinSetting::class, 'setting'); } } diff --git a/src/backend/packages/inensus/kelin-meter/src/Models/KelinTransaction.php b/src/backend/packages/inensus/kelin-meter/src/Models/KelinTransaction.php index 807e2a83d..1a9202b2c 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Models/KelinTransaction.php +++ b/src/backend/packages/inensus/kelin-meter/src/Models/KelinTransaction.php @@ -12,42 +12,34 @@ use Inensus\WaveMoneyPaymentProvider\Models\WaveMoneyTransaction; use MPM\Transaction\Provider\VodacomTransactionProvider; -class KelinTransaction extends BaseModel implements ISubTransaction -{ +class KelinTransaction extends BaseModel implements ISubTransaction { protected $table = 'kelin_transactions'; - public function agentTransaction() - { + public function agentTransaction() { return $this->morphOne(AgentTransaction::class, 'manufacturer_transaction'); } - public function vodacomTransaction() - { + public function vodacomTransaction() { return $this->morphOne(VodacomTransactionProvider::class, 'manufacturer_transaction'); } - public function airtelTransaction() - { + public function airtelTransaction() { return $this->morphOne(AirtelTransaction::class, 'manufacturer_transaction'); } - public function thirdPartyTransaction() - { + public function thirdPartyTransaction() { return $this->morphOne(ThirdPartyTransaction::class, 'manufacturer_transaction'); } - public function mesombTransaction() - { + public function mesombTransaction() { return $this->morphOne(MesombTransaction::class, 'manufacturer_transaction'); } - public function swiftaTransaction() - { + public function swiftaTransaction() { return $this->morphOne(SwiftaTransaction::class, 'manufacturer_transaction'); } - public function waveMoneyTransaction() - { + public function waveMoneyTransaction() { return $this->morphOne(WaveMoneyTransaction::class, 'manufacturer_transaction'); } } diff --git a/src/backend/packages/inensus/kelin-meter/src/Models/SyncStatus.php b/src/backend/packages/inensus/kelin-meter/src/Models/SyncStatus.php index 9a8bf44ed..36e373e8b 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Models/SyncStatus.php +++ b/src/backend/packages/inensus/kelin-meter/src/Models/SyncStatus.php @@ -2,8 +2,7 @@ namespace Inensus\KelinMeter\Models; -abstract class SyncStatus -{ +abstract class SyncStatus { public const SYNCED = 1; public const MODIFIED = 2; diff --git a/src/backend/packages/inensus/kelin-meter/src/Observers/PersonObserver.php b/src/backend/packages/inensus/kelin-meter/src/Observers/PersonObserver.php index 9f192ca82..e51e03848 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Observers/PersonObserver.php +++ b/src/backend/packages/inensus/kelin-meter/src/Observers/PersonObserver.php @@ -7,8 +7,7 @@ use Inensus\KelinMeter\Models\KelinCustomer; use Inensus\KelinMeter\Services\KelinCustomerService; -class PersonObserver -{ +class PersonObserver { private $customerService; private $apiHelpers; @@ -29,8 +28,7 @@ public function __construct( $this->kelinCustomer = $kelinCustomer; } - public function updated(Person $person) - { + public function updated(Person $person) { $kelinCustomer = $this->kelinCustomer->newQuery()->where('mpm_customer_id', $person->id)->first(); if ($kelinCustomer) { diff --git a/src/backend/packages/inensus/kelin-meter/src/Providers/EventServiceProvider.php b/src/backend/packages/inensus/kelin-meter/src/Providers/EventServiceProvider.php index 6e09ae90b..864372784 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Providers/EventServiceProvider.php +++ b/src/backend/packages/inensus/kelin-meter/src/Providers/EventServiceProvider.php @@ -4,8 +4,7 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; -class EventServiceProvider extends ServiceProvider -{ +class EventServiceProvider extends ServiceProvider { protected $subscribe = [ ]; @@ -14,8 +13,7 @@ class EventServiceProvider extends ServiceProvider * * @return void */ - public function boot() - { + public function boot() { parent::boot(); } } diff --git a/src/backend/packages/inensus/kelin-meter/src/Providers/KelinMeterServiceProvider.php b/src/backend/packages/inensus/kelin-meter/src/Providers/KelinMeterServiceProvider.php index 1e7ae738a..1a8534d9c 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Providers/KelinMeterServiceProvider.php +++ b/src/backend/packages/inensus/kelin-meter/src/Providers/KelinMeterServiceProvider.php @@ -25,10 +25,8 @@ use Inensus\KelinMeter\Services\KelinCustomerService; use Inensus\KelinMeter\Services\KelinMeterService; -class KelinMeterServiceProvider extends ServiceProvider -{ - public function boot(Filesystem $filesystem) - { +class KelinMeterServiceProvider extends ServiceProvider { + public function boot(Filesystem $filesystem) { $this->app->register(RouteServiceProvider::class); if ($this->app->runningInConsole()) { $this->publishConfigFiles(); @@ -61,8 +59,7 @@ public function boot(Filesystem $filesystem) ); } - public function register() - { + public function register() { $this->mergeConfigFrom(__DIR__.'/../../config/kelin-meter.php', 'kelin-meter'); $this->app->register(EventServiceProvider::class); $this->app->register(ObserverServiceProvider::class); @@ -81,15 +78,13 @@ public function register() }); } - public function publishConfigFiles() - { + public function publishConfigFiles() { $this->publishes([ __DIR__.'/../../config/kelin-meter.php' => config_path('kelin-meter.php'), ], 'configurations'); } - public function publishVueFiles() - { + public function publishVueFiles() { $this->publishes([ __DIR__.'/../resources/assets' => resource_path( 'assets/js/plugins/kelin-meter' @@ -97,15 +92,13 @@ public function publishVueFiles() ], 'vue-components'); } - public function publishMigrations($filesystem) - { + public function publishMigrations($filesystem) { $this->publishes([ __DIR__.'/../../database/migrations/create_kelin_tables.php.stub' => $this->getMigrationFileName($filesystem), ], 'migrations'); } - protected function getMigrationFileName(Filesystem $filesystem): string - { + protected function getMigrationFileName(Filesystem $filesystem): string { $timestamp = date('Y_m_d_His'); return Collection::make($this->app->databasePath().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR) diff --git a/src/backend/packages/inensus/kelin-meter/src/Providers/ObserverServiceProvider.php b/src/backend/packages/inensus/kelin-meter/src/Providers/ObserverServiceProvider.php index ea9dd165c..470fb95cc 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Providers/ObserverServiceProvider.php +++ b/src/backend/packages/inensus/kelin-meter/src/Providers/ObserverServiceProvider.php @@ -6,15 +6,13 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; use Inensus\KelinMeter\Observers\PersonObserver; -class ObserverServiceProvider extends ServiceProvider -{ +class ObserverServiceProvider extends ServiceProvider { /** * Register any events for your application. * * @return void */ - public function boot() - { + public function boot() { parent::boot(); Person::observe(PersonObserver::class); } diff --git a/src/backend/packages/inensus/kelin-meter/src/Providers/RouteServiceProvider.php b/src/backend/packages/inensus/kelin-meter/src/Providers/RouteServiceProvider.php index 8c031439b..45dca8ca1 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Providers/RouteServiceProvider.php +++ b/src/backend/packages/inensus/kelin-meter/src/Providers/RouteServiceProvider.php @@ -5,22 +5,18 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Support\Facades\Route; -class RouteServiceProvider extends ServiceProvider -{ +class RouteServiceProvider extends ServiceProvider { protected $namespace = 'Inensus\KelinMeter\Http\Controllers'; - public function boot() - { + public function boot() { parent::boot(); } - public function map() - { + public function map() { $this->mapApiRoutes(); } - protected function mapApiRoutes() - { + protected function mapApiRoutes() { Route::prefix('api') ->middleware('api') ->namespace($this->namespace) diff --git a/src/backend/packages/inensus/kelin-meter/src/Services/DailyConsumptionService.php b/src/backend/packages/inensus/kelin-meter/src/Services/DailyConsumptionService.php index 161c47c70..ef729de51 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Services/DailyConsumptionService.php +++ b/src/backend/packages/inensus/kelin-meter/src/Services/DailyConsumptionService.php @@ -7,8 +7,7 @@ use Inensus\KelinMeter\Http\Clients\KelinMeterApiClient; use Inensus\KelinMeter\Models\KelinMeterDailyData; -class DailyConsumptionService -{ +class DailyConsumptionService { private $rootUrl = '/getDayData'; private $kelinApi; @@ -23,8 +22,7 @@ public function __construct( $this->kelinMeterDailyData = $kelinMeterDailyData; } - public function getDailyDataFromAPI() - { + public function getDailyDataFromAPI() { $startDay = Carbon::now()->subDays(1)->format('Ymd'); $endDay = Carbon::now()->format('His'); $pageNo = 1; @@ -75,8 +73,7 @@ public function getDailyDataFromAPI() } while ($result['dataCount'] > 0); } - public function getDailyData($meterAddress, $perPage) - { + public function getDailyData($meterAddress, $perPage) { return $this->kelinMeterDailyData->newQuery()->where('address_of_meter', $meterAddress)->orderByDesc('id')->paginate($perPage); } } diff --git a/src/backend/packages/inensus/kelin-meter/src/Services/ISynchronizeService.php b/src/backend/packages/inensus/kelin-meter/src/Services/ISynchronizeService.php index 305c973e8..42ed6646f 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Services/ISynchronizeService.php +++ b/src/backend/packages/inensus/kelin-meter/src/Services/ISynchronizeService.php @@ -2,8 +2,7 @@ namespace Inensus\KelinMeter\Services; -interface ISynchronizeService -{ +interface ISynchronizeService { public function sync(); public function syncCheck(); diff --git a/src/backend/packages/inensus/kelin-meter/src/Services/KelinCredentialService.php b/src/backend/packages/inensus/kelin-meter/src/Services/KelinCredentialService.php index b9ab61dfc..0b881890e 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Services/KelinCredentialService.php +++ b/src/backend/packages/inensus/kelin-meter/src/Services/KelinCredentialService.php @@ -8,8 +8,7 @@ use Inensus\KelinMeter\Http\Clients\KelinMeterApiClient; use Inensus\KelinMeter\Models\KelinCredential; -class KelinCredentialService -{ +class KelinCredentialService { private $rootUrl = '/login'; private $credential; @@ -27,8 +26,7 @@ public function __construct( /** * This function uses one time on installation of the package. */ - public function createCredentials() - { + public function createCredentials() { return $this->credential->newQuery()->firstOrCreate(['id' => 1], [ 'username' => null, 'password' => null, @@ -38,13 +36,11 @@ public function createCredentials() ]); } - public function getCredentials() - { + public function getCredentials() { return $this->credential->newQuery()->first(); } - public function updateCredentials($data) - { + public function updateCredentials($data) { $credential = $this->getCredentials(); $credential->update([ 'username' => $data['username'], @@ -77,8 +73,7 @@ public function updateCredentials($data) return $credential->fresh(); } - public function refreshAccessToken() - { + public function refreshAccessToken() { $credential = $this->getCredentials(); if (!$credential->username && !$credential->password) { Log::debug('KelinMeter credentials is not registered yet.'); diff --git a/src/backend/packages/inensus/kelin-meter/src/Services/KelinCustomerService.php b/src/backend/packages/inensus/kelin-meter/src/Services/KelinCustomerService.php index d10d9f44f..ed8291f77 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Services/KelinCustomerService.php +++ b/src/backend/packages/inensus/kelin-meter/src/Services/KelinCustomerService.php @@ -14,8 +14,7 @@ use Inensus\KelinMeter\Models\KelinCustomer; use Inensus\KelinMeter\Models\SyncStatus; -class KelinCustomerService implements ISynchronizeService -{ +class KelinCustomerService implements ISynchronizeService { private $rootUrl = '/listCons'; private $kelinCustomer; @@ -46,8 +45,7 @@ public function __construct( $this->syncSettingService = $syncSettingService; } - public function sync() - { + public function sync() { $synSetting = $this->syncSettingService->getSyncSettingsByActionName('Customers'); $syncAction = $this->syncActionService->getSyncActionBySynSettingId($synSetting->id); try { @@ -122,8 +120,7 @@ public function sync() } } - public function syncCheck($returnData = false) - { + public function syncCheck($returnData = false) { try { $url = $this->rootUrl; $result = $this->kelinApiClient->get($url); @@ -181,8 +178,7 @@ public function syncCheck($returnData = false) return $returnData ? ['data' => $customersCollection, 'result' => true] : ['result' => true]; } - public function createRelatedPerson($customer) - { + public function createRelatedPerson($customer) { $names = explode(' ', $customer['consName']); $phone = ltrim($customer['mobile'], $customer['mobile'][0]); @@ -221,8 +217,7 @@ public function createRelatedPerson($customer) return $person; } - public function updateRelatedPerson($customer, $person) - { + public function updateRelatedPerson($customer, $person) { $names = explode(' ', $customer['consName']); if (count($names) == 1) { $name = $customer['consName']; @@ -248,15 +243,13 @@ public function updateRelatedPerson($customer, $person) return $person; } - public function getCustomers($request) - { + public function getCustomers($request) { $perPage = $request->input('per_page') ?? 15; return $this->kelinCustomer->newQuery()->with(['mpmPerson.addresses'])->paginate($perPage); } - private function kelinCustomerHasher($kelinCustomer) - { + private function kelinCustomerHasher($kelinCustomer) { $phone = ltrim($kelinCustomer['mobile'], $kelinCustomer['mobile'][0]); return $this->apiHelpers->makeHash([ @@ -267,8 +260,7 @@ private function kelinCustomerHasher($kelinCustomer) ]); } - private function findRegisteredCustomer($customer) - { + private function findRegisteredCustomer($customer) { return $this->person->newQuery()->where('title', $customer['consNo'])->first(); } } diff --git a/src/backend/packages/inensus/kelin-meter/src/Services/KelinMeterService.php b/src/backend/packages/inensus/kelin-meter/src/Services/KelinMeterService.php index 5dfaa9725..2927d07d6 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Services/KelinMeterService.php +++ b/src/backend/packages/inensus/kelin-meter/src/Services/KelinMeterService.php @@ -22,8 +22,7 @@ use Inensus\KelinMeter\Models\KelinMeter; use Inensus\KelinMeter\Models\SyncStatus; -class KelinMeterService implements ISynchronizeService -{ +class KelinMeterService implements ISynchronizeService { private $meter; private $rootUrl = '/listMeter'; @@ -85,8 +84,7 @@ public function __construct( $this->city = $city; } - public function getMeters($request) - { + public function getMeters($request) { $perPage = $request->input('per_page') ?? 15; return $this->kelinMeter->newQuery()->with([ @@ -95,8 +93,7 @@ public function getMeters($request) ])->paginate($perPage); } - public function sync() - { + public function sync() { $synSetting = $this->syncSettingService->getSyncSettingsByActionName('Meters'); $syncAction = $this->syncActionService->getSyncActionBySynSettingId($synSetting->id); try { @@ -155,8 +152,7 @@ public function sync() } } - public function syncCheck($returnData = false) - { + public function syncCheck($returnData = false) { try { $url = $this->rootUrl; $result = $this->kelinApiClient->get($url); @@ -214,8 +210,7 @@ public function syncCheck($returnData = false) return $returnData ? ['data' => $metersCollection, 'result' => true] : ['result' => true]; } - private function kelinMeterHasher($kelinMeter) - { + private function kelinMeterHasher($kelinMeter) { return $this->apiHelpers->makeHash([ $kelinMeter['consNo'], $kelinMeter['meterAddr'], @@ -229,8 +224,7 @@ private function kelinMeterHasher($kelinMeter) ]); } - public function createRelatedMeter($kelinMeter) - { + public function createRelatedMeter($kelinMeter) { try { DB::connection('shard')->beginTransaction(); $meterSerial = $this->generateMeterSerialNumberInFormat($kelinMeter['meterAddr']); @@ -314,8 +308,7 @@ public function createRelatedMeter($kelinMeter) } } - public function updateRelatedMeter($kelinMeter, $meter) - { + public function updateRelatedMeter($kelinMeter, $meter) { $kelinCustomer = $this->kelinCustomer->newQuery()->with('mpmPerson')->where( 'customer_no', $kelinMeter['consNo'] @@ -337,8 +330,7 @@ public function updateRelatedMeter($kelinMeter, $meter) return $meter; } - private function findRegisteredMeter($kelinMeter) - { + private function findRegisteredMeter($kelinMeter) { $meter = collect($this->earlyRegisteredMeters)->where('meter_serial', $kelinMeter['meterAddr'])->first(); if (!$meter) { return $meter; @@ -347,8 +339,7 @@ private function findRegisteredMeter($kelinMeter) return $this->meter->newQuery()->find($meter['id']); } - private function getEarlyRegisteredMetersWithChangeSerialNumbersAsSimilarAsKalinMeterData() - { + private function getEarlyRegisteredMetersWithChangeSerialNumbersAsSimilarAsKalinMeterData() { $this->earlyRegisteredMeters = $this->meter->newQuery()->get()->map(function ($q) { $string = substr($q->serial_number, 0, -2); $array = explode('-', $string); @@ -361,8 +352,7 @@ private function getEarlyRegisteredMetersWithChangeSerialNumbersAsSimilarAsKalin }); } - private function generateMeterSerialNumberInFormat($meterAddress) - { + private function generateMeterSerialNumberInFormat($meterAddress) { $length = strlen($meterAddress); $newSerial = $meterAddress[0]; for ($i = 0; $i < $length; ++$i) { diff --git a/src/backend/packages/inensus/kelin-meter/src/Services/KelinMeterStatusService.php b/src/backend/packages/inensus/kelin-meter/src/Services/KelinMeterStatusService.php index 61f2dca58..00f4c19a6 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Services/KelinMeterStatusService.php +++ b/src/backend/packages/inensus/kelin-meter/src/Services/KelinMeterStatusService.php @@ -7,19 +7,16 @@ use Inensus\KelinMeter\Exceptions\KelinApiResponseException; use Inensus\KelinMeter\Http\Clients\KelinMeterApiClient; -class KelinMeterStatusService -{ +class KelinMeterStatusService { private $rootUrl = '/getMeterStatus'; private $kelinApiClient; - public function __construct(KelinMeterApiClient $kelinApiClient) - { + public function __construct(KelinMeterApiClient $kelinApiClient) { $this->kelinApiClient = $kelinApiClient; } - public function getStatusOfMeter($meter) - { + public function getStatusOfMeter($meter) { try { $queryParams = [ 'meterType' => 1, @@ -41,8 +38,7 @@ public function getStatusOfMeter($meter) } } - public function changeStatusOfMeter($meterAddress, $status) - { + public function changeStatusOfMeter($meterAddress, $status) { try { $rootUrl = '/meterRemoteControl'; $queryParams = [ diff --git a/src/backend/packages/inensus/kelin-meter/src/Services/KelinSettingService.php b/src/backend/packages/inensus/kelin-meter/src/Services/KelinSettingService.php index 3129723d9..f41ac2561 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Services/KelinSettingService.php +++ b/src/backend/packages/inensus/kelin-meter/src/Services/KelinSettingService.php @@ -4,17 +4,14 @@ use Inensus\KelinMeter\Models\KelinSetting; -class KelinSettingService -{ +class KelinSettingService { private $kelinSetting; - public function __construct(KelinSetting $kelinSetting) - { + public function __construct(KelinSetting $kelinSetting) { $this->kelinSetting = $kelinSetting; } - public function getSettings() - { + public function getSettings() { return $this->kelinSetting->newQuery()->with(['setting'])->get(); } } diff --git a/src/backend/packages/inensus/kelin-meter/src/Services/KelinSyncActionService.php b/src/backend/packages/inensus/kelin-meter/src/Services/KelinSyncActionService.php index 2e192df61..92880cdcf 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Services/KelinSyncActionService.php +++ b/src/backend/packages/inensus/kelin-meter/src/Services/KelinSyncActionService.php @@ -6,32 +6,26 @@ use Carbon\CarbonInterval; use Inensus\KelinMeter\Models\KelinSyncAction; -class KelinSyncActionService -{ +class KelinSyncActionService { private $syncAction; - public function __construct(KelinSyncAction $syncAction) - { + public function __construct(KelinSyncAction $syncAction) { $this->syncAction = $syncAction; } - public function createSyncAction($syncAction) - { + public function createSyncAction($syncAction) { return $this->syncAction->newQuery()->create($syncAction); } - public function getSyncActionBySynSettingId($settingId) - { + public function getSyncActionBySynSettingId($settingId) { return $this->syncAction->newQuery()->where('sync_setting_id', $settingId)->first(); } - public function getActionsNeedsToSync() - { + public function getActionsNeedsToSync() { return $this->syncAction->newQuery()->where('next_sync', '<=', Carbon::now())->orderBy('next_sync')->get(); } - public function updateSyncAction($syncAction, $syncSetting, $syncResult) - { + public function updateSyncAction($syncAction, $syncSetting, $syncResult) { if (!$syncResult) { return $syncAction->update([ 'attempts' => $syncAction->attempts + 1, diff --git a/src/backend/packages/inensus/kelin-meter/src/Services/KelinSyncSettingService.php b/src/backend/packages/inensus/kelin-meter/src/Services/KelinSyncSettingService.php index 6cd9b4712..be75a5813 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Services/KelinSyncSettingService.php +++ b/src/backend/packages/inensus/kelin-meter/src/Services/KelinSyncSettingService.php @@ -8,8 +8,7 @@ use Inensus\KelinMeter\Models\KelinSetting; use Inensus\KelinMeter\Models\KelinSyncSetting; -class KelinSyncSettingService -{ +class KelinSyncSettingService { private $syncSetting; private $setting; @@ -26,8 +25,7 @@ public function __construct( $this->syncActionService = $syncActionService; } - public function createDefaultSettings() - { + public function createDefaultSettings() { $dayInterval = CarbonInterval::make('1day'); $fiveMinInterval = CarbonInterval::make('5minute'); @@ -68,8 +66,7 @@ public function createDefaultSettings() } } - public function updateSyncSettings($syncSettings) - { + public function updateSyncSettings($syncSettings) { foreach ($syncSettings as $setting) { $syncSetting = $this->syncSetting->newQuery()->find($setting['id']); $intervalStr = $setting['sync_in_value_num'].$setting['sync_in_value_str']; @@ -94,13 +91,11 @@ public function updateSyncSettings($syncSettings) return $this->syncSetting->newQuery()->get(); } - public function getSyncSettings() - { + public function getSyncSettings() { return $this->syncSetting->newQuery()->get(); } - public function getSyncSettingsByActionName($actionName) - { + public function getSyncSettingsByActionName($actionName) { try { return $this->syncSetting->newQuery()->where('action_name', $actionName)->firstOrFail(); } catch (\Exception $exception) { diff --git a/src/backend/packages/inensus/kelin-meter/src/Services/MinutelyConsumptionService.php b/src/backend/packages/inensus/kelin-meter/src/Services/MinutelyConsumptionService.php index 3473bf500..e574c9c93 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Services/MinutelyConsumptionService.php +++ b/src/backend/packages/inensus/kelin-meter/src/Services/MinutelyConsumptionService.php @@ -7,8 +7,7 @@ use Inensus\KelinMeter\Http\Clients\KelinMeterApiClient; use Inensus\KelinMeter\Models\KelinMeterMinutelyData; -class MinutelyConsumptionService -{ +class MinutelyConsumptionService { private $rootUrl = '/getMinData'; private $kelinApi; @@ -23,8 +22,7 @@ public function __construct( $this->kelinMeterMinutelyData = $kelinMeterMinutelyData; } - public function getMinutelyDataFromAPI() - { + public function getMinutelyDataFromAPI() { $today = Carbon::now()->format('Ymd'); $moment = Carbon::now()->format('His'); $pageNo = 1; @@ -81,8 +79,7 @@ public function getMinutelyDataFromAPI() } while ($result['data']['dataCount'] > 0); } - public function getDailyData($meterAddress, $perPage) - { + public function getDailyData($meterAddress, $perPage) { return $this->kelinMeterMinutelyData->newQuery()->where('address_of_meter', $meterAddress)->orderByDesc('id')->paginate($perPage); } } diff --git a/src/backend/packages/inensus/kelin-meter/src/Services/PackageInstallationService.php b/src/backend/packages/inensus/kelin-meter/src/Services/PackageInstallationService.php index 34ddee422..bb87d18e7 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Services/PackageInstallationService.php +++ b/src/backend/packages/inensus/kelin-meter/src/Services/PackageInstallationService.php @@ -2,15 +2,12 @@ namespace Inensus\KelinMeter\Services; -class PackageInstallationService -{ +class PackageInstallationService { public function __construct( private KelinSyncSettingService $syncSettingService, - ) { - } + ) {} - public function createDefaultSettingRecords() - { + public function createDefaultSettingRecords() { $this->syncSettingService->createDefaultSettings(); } } diff --git a/src/backend/packages/inensus/kelin-meter/src/Tests/Feature/RechargeMeterTest.php b/src/backend/packages/inensus/kelin-meter/src/Tests/Feature/RechargeMeterTest.php index 9cc76b8ce..10fa1c62a 100644 --- a/src/backend/packages/inensus/kelin-meter/src/Tests/Feature/RechargeMeterTest.php +++ b/src/backend/packages/inensus/kelin-meter/src/Tests/Feature/RechargeMeterTest.php @@ -23,13 +23,11 @@ use Inensus\KelinMeter\Models\KelinMeter; use Tests\TestCase; -class RechargeMeterTest extends TestCase -{ +class RechargeMeterTest extends TestCase { use RefreshDatabase; use WithFaker; - public function testTokenGeneration() - { + public function testTokenGeneration() { Queue::fake(); $this->initData(); $t = Transaction::create([ @@ -47,8 +45,7 @@ public function testTokenGeneration() $this->assertEquals(1, MeterToken::query()->get()->count()); } - private function initData() - { + private function initData() { KelinCredential::query()->create([ 'id' => 1, 'api_url' => 'http://222.222.60.178:62189/EI', diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Console/Commands/InstallPackage.php index df2943196..80f745678 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Console/Commands/InstallPackage.php @@ -4,25 +4,21 @@ use Illuminate\Console\Command; -class InstallPackage extends Command -{ +class InstallPackage extends Command { protected $signature = 'mesomb-payment-provider:install'; protected $description = 'Install MesombPaymentProvider Package'; - public function __construct() - { + public function __construct() { parent::__construct(); } - public function handle(): void - { + public function handle(): void { $this->info('Installing MesombPaymentProvider Integration Package\n'); $this->info('Package installed successfully..'); } - private function publishMigrations() - { + private function publishMigrations() { $this->info('Copying migrations\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\MesombPaymentProvider\Providers\MesombServiceProvider", @@ -30,14 +26,12 @@ private function publishMigrations() ]); } - private function createDatabaseTables() - { + private function createDatabaseTables() { $this->info('Creating database tables\n'); $this->call('migrate'); } - private function createPluginRecord() - { + private function createPluginRecord() { $this->call('plugin:add', [ 'name' => 'MesombPaymentProvider', 'composer_name' => 'inensus/mesomb-payment-provider', diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Console/Commands/UpdatePackage.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Console/Commands/UpdatePackage.php index f9d4463b8..90dade2e0 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Console/Commands/UpdatePackage.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Console/Commands/UpdatePackage.php @@ -6,8 +6,7 @@ use Illuminate\Filesystem\Filesystem; use Illuminate\Support\Facades\DB; -class UpdatePackage extends Command -{ +class UpdatePackage extends Command { protected $signature = 'mesomb-payment-provider:update'; protected $description = 'Update the Mesomb Payment Provider Integration Package'; @@ -21,8 +20,7 @@ public function __construct( /** * Execute the console command. */ - public function handle(): void - { + public function handle(): void { $this->info('Mesomb Payment Provider Integration Updating Started\n'); $this->removeOldVersionOfPackage(); $this->installNewVersionOfPackage(); @@ -32,20 +30,17 @@ public function handle(): void $this->info('Package updated successfully..'); } - private function removeOldVersionOfPackage() - { + private function removeOldVersionOfPackage() { $this->info('Removing former version of package\n'); echo shell_exec('COMPOSER_MEMORY_LIMIT=-1 ../composer.phar remove inensus/mesomb-payment-provider'); } - private function installNewVersionOfPackage() - { + private function installNewVersionOfPackage() { $this->info('Installing last version of package\n'); echo shell_exec('COMPOSER_MEMORY_LIMIT=-1 ../composer.phar require inensus/mesomb-payment-provider'); } - private function deleteMigration(Filesystem $filesystem) - { + private function deleteMigration(Filesystem $filesystem) { $migrationFile = $filesystem->glob(database_path().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR.'*_create_mesomb_payment_provider_tables.php')[0]; $migration = DB::table('migrations') ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->first(); @@ -56,8 +51,7 @@ private function deleteMigration(Filesystem $filesystem) ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->delete(); } - private function publishMigrationsAgain() - { + private function publishMigrationsAgain() { $this->info('Copying migrations\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\MesombPaymentProvider\Providers\MesombServiceProvider", @@ -65,8 +59,7 @@ private function publishMigrationsAgain() ]); } - private function updateDatabase() - { + private function updateDatabase() { $this->info('Updating database tables\n'); $this->call('migrate'); } diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombPayerMustHaveOnlyOneConnectedMeterException.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombPayerMustHaveOnlyOneConnectedMeterException.php index a2bf80122..c65894a50 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombPayerMustHaveOnlyOneConnectedMeterException.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombPayerMustHaveOnlyOneConnectedMeterException.php @@ -2,6 +2,4 @@ namespace Inensus\MesombPaymentProvider\Exceptions; -class MesombPayerMustHaveOnlyOneConnectedMeterException extends \Exception -{ -} +class MesombPayerMustHaveOnlyOneConnectedMeterException extends \Exception {} diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombPaymentPhoneNumberNotFoundException.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombPaymentPhoneNumberNotFoundException.php index 86cc53bd9..4e8cb327a 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombPaymentPhoneNumberNotFoundException.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombPaymentPhoneNumberNotFoundException.php @@ -2,6 +2,4 @@ namespace Inensus\MesombPaymentProvider\Exceptions; -class MesombPaymentPhoneNumberNotFoundException extends \Exception -{ -} +class MesombPaymentPhoneNumberNotFoundException extends \Exception {} diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombStatusFailedException.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombStatusFailedException.php index 40dc55a05..d16a9f826 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombStatusFailedException.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Exceptions/MesombStatusFailedException.php @@ -2,6 +2,4 @@ namespace Inensus\MesombPaymentProvider\Exceptions; -class MesombStatusFailedException extends \Exception -{ -} +class MesombStatusFailedException extends \Exception {} diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Http/Controllers/MesombPaymentProviderController.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Http/Controllers/MesombPaymentProviderController.php index 391796bfe..6c99bcff8 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Http/Controllers/MesombPaymentProviderController.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Http/Controllers/MesombPaymentProviderController.php @@ -6,10 +6,8 @@ use Illuminate\Routing\Controller; use Inensus\MesombPaymentProvider\Http\Resources\MesombTransactionProcessingResource; -class MesombPaymentProviderController extends Controller -{ - public function store() - { +class MesombPaymentProviderController extends Controller { + public function store() { $transactionProvider = resolve('MesombPaymentProvider'); $transactionProvider->saveTransaction(); // store common data diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Http/Kernel.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Http/Kernel.php index 5685569bb..3bf8a537a 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Http/Kernel.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Http/Kernel.php @@ -5,8 +5,7 @@ use Illuminate\Foundation\Http\Kernel as HttpKernel; use Inensus\MesombPaymentProvider\Http\Middleware\MesombTransactionRequest; -class Kernel extends HttpKernel -{ +class Kernel extends HttpKernel { protected $routeMiddleware = [ 'mesomb.transaction.request' => MesombTransactionRequest::class, ]; diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Http/Middleware/MesombTransactionRequest.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Http/Middleware/MesombTransactionRequest.php index d79995cff..8674613e5 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Http/Middleware/MesombTransactionRequest.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Http/Middleware/MesombTransactionRequest.php @@ -8,10 +8,8 @@ use Inensus\MesombPaymentProvider\Exceptions\MesombPaymentPhoneNumberNotFoundException; use Inensus\MesombPaymentProvider\Exceptions\MesombStatusFailedException; -class MesombTransactionRequest -{ - public function handle(Request $request, \Closure $next) - { +class MesombTransactionRequest { + public function handle(Request $request, \Closure $next) { $transactionProvider = resolve('MesombPaymentProvider'); try { $transactionProvider->validateRequest($request); diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Http/Resources/MesombTransactionProcessingResource.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Http/Resources/MesombTransactionProcessingResource.php index ad3fa435c..ccec12c06 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Http/Resources/MesombTransactionProcessingResource.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Http/Resources/MesombTransactionProcessingResource.php @@ -4,8 +4,7 @@ use Illuminate\Http\Resources\Json\JsonResource; -class MesombTransactionProcessingResource extends JsonResource -{ +class MesombTransactionProcessingResource extends JsonResource { /** * Transform the resource into an array. * @@ -13,8 +12,7 @@ class MesombTransactionProcessingResource extends JsonResource * * @return array */ - public function toArray($request) - { + public function toArray($request) { return [ 'data' => [ 'type' => 'mesomb_transaction', diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Listeners/TransactionListener.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Listeners/TransactionListener.php index d99aba693..49334f725 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Listeners/TransactionListener.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Listeners/TransactionListener.php @@ -6,10 +6,8 @@ use Illuminate\Events\Dispatcher; use Illuminate\Support\Facades\Log; -class TransactionListener -{ - public function onTransactionFailed(Transaction $transaction, $message = null): void - { +class TransactionListener { + public function onTransactionFailed(Transaction $transaction, $message = null): void { $transactionProvider = resolve('MesombPaymentProvider'); $transactionProvider->addConflict($message); if (config('app.debug')) { @@ -18,14 +16,12 @@ public function onTransactionFailed(Transaction $transaction, $message = null): $transactionProvider->sendResult(false, $transaction); } - public function onTransactionSuccess(Transaction $transaction) - { + public function onTransactionSuccess(Transaction $transaction) { $transactionProvider = resolve('MesombPaymentProvider'); $transactionProvider->sendResult(true, $transaction); } - public function subscribe(Dispatcher $events) - { + public function subscribe(Dispatcher $events) { $events->listen( 'transaction.successful', 'Inensus\MesombPaymentProvider\Listeners\TransactionListener@onTransactionSuccess' diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Models/BaseModel.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Models/BaseModel.php index 4db5bf3d2..9e2fc612c 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Models/BaseModel.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Models/BaseModel.php @@ -4,20 +4,17 @@ use Illuminate\Database\Eloquent\Model; -class BaseModel extends Model -{ +class BaseModel extends Model { protected $guarded = ['id']; public static $rules = []; - public function __construct(array $attributes = []) - { + public function __construct(array $attributes = []) { parent::__construct($attributes); $this->setConnection('shard'); } - public function resolveChildRouteBinding($childType, $value, $field) - { + public function resolveChildRouteBinding($childType, $value, $field) { // TODO: Implement resolveChildRouteBinding() method. } } diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Models/MesombTransaction.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Models/MesombTransaction.php index c7e7d74ee..57ce27b58 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Models/MesombTransaction.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Models/MesombTransaction.php @@ -9,22 +9,18 @@ use Illuminate\Database\Eloquent\Relations\MorphOne; use Illuminate\Database\Eloquent\Relations\MorphTo; -class MesombTransaction extends BaseModel implements IRawTransaction -{ +class MesombTransaction extends BaseModel implements IRawTransaction { protected $table = 'mesomb_transactions'; - public function transaction(): MorphOne - { + public function transaction(): MorphOne { return $this->morphOne(Transaction::class, 'original_transaction'); } - public function manufacturerTransaction(): MorphTo - { + public function manufacturerTransaction(): MorphTo { return $this->morphTo(); } - public function conflicts(): MorphMany - { + public function conflicts(): MorphMany { return $this->morphMany(TransactionConflicts::class, 'transaction'); } } diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Providers/EventServiceProvider.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Providers/EventServiceProvider.php index aa29178ec..615f14087 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Providers/EventServiceProvider.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Providers/EventServiceProvider.php @@ -5,8 +5,7 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; use Inensus\MesombPaymentProvider\Listeners\TransactionListener; -class EventServiceProvider extends ServiceProvider -{ +class EventServiceProvider extends ServiceProvider { protected $subscribe = [ // TransactionListener::class ]; @@ -16,8 +15,7 @@ class EventServiceProvider extends ServiceProvider * * @return void */ - public function boot() - { + public function boot() { parent::boot(); } } diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Providers/MesombServiceProvider.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Providers/MesombServiceProvider.php index 5b485cbd9..5fe50b077 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Providers/MesombServiceProvider.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Providers/MesombServiceProvider.php @@ -10,10 +10,8 @@ use Inensus\MesombPaymentProvider\Console\Commands\UpdatePackage; use Inensus\MesombPaymentProvider\Models\MesombTransaction; -class MesombServiceProvider extends ServiceProvider -{ - public function boot(Filesystem $filesystem) - { +class MesombServiceProvider extends ServiceProvider { + public function boot(Filesystem $filesystem) { $this->app->register(RouteServiceProvider::class); if ($this->app->runningInConsole()) { $this->publishConfigFiles(); @@ -27,30 +25,26 @@ public function boot(Filesystem $filesystem) ); } - public function register() - { + public function register() { $this->mergeConfigFrom(__DIR__.'/../../config/mesomb-payment-provider.php', 'mesomb-payment-provider'); $this->app->register(EventServiceProvider::class); $this->app->register(ObserverServiceProvider::class); $this->app->singleton('MesombPaymentProvider', MesombTransactionProvider::class); } - public function publishConfigFiles() - { + public function publishConfigFiles() { $this->publishes([ __DIR__.'/../../config/mesomb-payment-provider.php' => config_path('mesomb-payment-provider.php'), ]); } - public function publishMigrations($filesystem) - { + public function publishMigrations($filesystem) { $this->publishes([ __DIR__.'/../../database/migrations/create_mesomb_payment_provider_tables.php.stub' => $this->getMigrationFileName($filesystem), ], 'migrations'); } - protected function getMigrationFileName(Filesystem $filesystem): string - { + protected function getMigrationFileName(Filesystem $filesystem): string { $timestamp = date('Y_m_d_His'); return Collection::make($this->app->databasePath().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR) diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Providers/MesombTransactionProvider.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Providers/MesombTransactionProvider.php index 3b02aa06e..2a22eacb2 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Providers/MesombTransactionProvider.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Providers/MesombTransactionProvider.php @@ -17,8 +17,7 @@ use Inensus\MesombPaymentProvider\Services\MesomTransactionService; use MPM\Transaction\Provider\ITransactionProvider; -class MesombTransactionProvider implements ITransactionProvider -{ +class MesombTransactionProvider implements ITransactionProvider { private $transaction; private $mesombTransaction; @@ -41,8 +40,7 @@ public function __construct( $this->address = $address; } - public function validateRequest($request) - { + public function validateRequest($request) { $requestData = $request->all(); if ($requestData['status'] === 'FAILED') { throw new MesombStatusFailedException($requestData['status'].' Sender: '.$requestData['b_party']); @@ -53,22 +51,19 @@ public function validateRequest($request) $this->validData = array_merge($this->validData, $requestData); } - public function saveTransaction() - { + public function saveTransaction() { $this->mesombTransaction = $this->mesombTransactionService->assignIncomingDataToMesombTransaction($this->validData); $this->transaction = $this->mesombTransactionService->assignIncomingDataToTransaction($this->validData); } - public function saveCommonData(): Model - { + public function saveCommonData(): Model { return $this->mesombTransactionService->associateMesombTransactionWithTransaction( $this->mesombTransaction, $this->transaction ); } - public function sendResult(bool $requestType, Transaction $transaction) - { + public function sendResult(bool $requestType, Transaction $transaction) { $this->mesombTransaction = $transaction->originalTransaction()->first(); if ($requestType) { $this->mesombTransaction->status = 1; @@ -82,8 +77,7 @@ public function sendResult(bool $requestType, Transaction $transaction) } } - public function confirm(): void - { + public function confirm(): void { echo $xmlResponse = ''. ''. @@ -97,8 +91,7 @@ public function confirm(): void ''; } - private function checkPhoneIsExists($requestData): Model - { + private function checkPhoneIsExists($requestData): Model { $personAddresses = $this->address->newQuery() ->where('phone', $requestData['b_party']) ->orWhere('phone', '+'.$requestData['b_party'])->get(); @@ -110,8 +103,7 @@ private function checkPhoneIsExists($requestData): Model return $personAddresses->first(); } - private function checkSenderHasOnlyOneMeterRegistered($senderAddress): void - { + private function checkSenderHasOnlyOneMeterRegistered($senderAddress): void { $senderMeters = $senderAddress->newQuery()->whereHasMorph( 'owner', [Person::class] @@ -125,33 +117,27 @@ private function checkSenderHasOnlyOneMeterRegistered($senderAddress): void $this->validData['meter'] = $senderMeters->first()->meter()->first()->serial_number; } - public function init($transaction): void - { + public function init($transaction): void { // TODO: Implement init() method. } - public function addConflict(?string $message): void - { + public function addConflict(?string $message): void { // TODO: Implement addConflict() method. } - public function getTransaction(): Transaction - { + public function getTransaction(): Transaction { // TODO: Implement getTransaction() method. } - public function getMessage(): string - { + public function getMessage(): string { // TODO: Implement getMessage() method. } - public function getAmount(): int - { + public function getAmount(): int { // TODO: Implement getAmount() method. } - public function getSender(): string - { + public function getSender(): string { // TODO: Implement getSender() method. } } diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Providers/ObserverServiceProvider.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Providers/ObserverServiceProvider.php index cdbe9fcb6..05f5e7178 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Providers/ObserverServiceProvider.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Providers/ObserverServiceProvider.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; -class ObserverServiceProvider extends ServiceProvider -{ +class ObserverServiceProvider extends ServiceProvider { /** * Register any events for your application. * * @return void */ - public function boot() - { + public function boot() { parent::boot(); } } diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Providers/RouteServiceProvider.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Providers/RouteServiceProvider.php index 2835917cc..cad77292e 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Providers/RouteServiceProvider.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Providers/RouteServiceProvider.php @@ -5,22 +5,18 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Support\Facades\Route; -class RouteServiceProvider extends ServiceProvider -{ +class RouteServiceProvider extends ServiceProvider { protected $namespace = 'Inensus\MesombPaymentProvider\Http\Controllers'; - public function boot() - { + public function boot() { parent::boot(); } - public function map() - { + public function map() { $this->mapApiRoutes(); } - protected function mapApiRoutes() - { + protected function mapApiRoutes() { Route::prefix('api') ->middleware('api') ->namespace($this->namespace) diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Services/MesomTransactionService.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Services/MesomTransactionService.php index baa9227ed..36229fec3 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Services/MesomTransactionService.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Services/MesomTransactionService.php @@ -5,8 +5,7 @@ use App\Models\Transaction\Transaction; use Inensus\MesombPaymentProvider\Models\MesombTransaction; -class MesomTransactionService -{ +class MesomTransactionService { private $mesombTransaction; private $transaction; @@ -19,8 +18,7 @@ public function __construct( $this->transaction = $transaction; } - public function assignIncomingDataToMesombTransaction(array $data) - { + public function assignIncomingDataToMesombTransaction(array $data) { return $this->mesombTransaction->newQuery()->create([ 'pk' => $data['pk'], 'type' => $data['type'], @@ -33,8 +31,7 @@ public function assignIncomingDataToMesombTransaction(array $data) ]); } - public function assignIncomingDataToTransaction(array $data) - { + public function assignIncomingDataToTransaction(array $data) { return $this->transaction->newQuery()->make([ 'amount' => (int) $data['amount'], 'sender' => $data['b_party'], @@ -44,8 +41,7 @@ public function assignIncomingDataToTransaction(array $data) ]); } - public function associateMesombTransactionWithTransaction($mesombTransaction, $transaction) - { + public function associateMesombTransactionWithTransaction($mesombTransaction, $transaction) { return $mesombTransaction->transaction()->save($transaction); } } diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Tests/Feature/PaymentTests.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Tests/Feature/PaymentTests.php index 324cdef54..e8786cf24 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Tests/Feature/PaymentTests.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Tests/Feature/PaymentTests.php @@ -17,13 +17,11 @@ use Tests\CreatesApplication; use Tests\TestCase; -class PaymentTests extends TestCase -{ +class PaymentTests extends TestCase { use CreatesApplication; use RefreshDatabase; - public function testOnlySuccessesPaymentsCanBeProcessed() - { + public function testOnlySuccessesPaymentsCanBeProcessed() { $data = [ 'status' => 'FAILED', 'type' => 'Payment', @@ -41,8 +39,7 @@ public function testOnlySuccessesPaymentsCanBeProcessed() ]); } - public function testOnlyOnePhoneNumberIsValidForOneCustomer() - { + public function testOnlyOnePhoneNumberIsValidForOneCustomer() { $data = [ 'status' => 'SUCCESS', 'type' => 'Payment', @@ -61,8 +58,7 @@ public function testOnlyOnePhoneNumberIsValidForOneCustomer() ]); } - public function testOnlyOneConnectingMeterIsValidForOneNumber() - { + public function testOnlyOneConnectingMeterIsValidForOneNumber() { // create person factory(Person::class)->create(); // associate meter with a person @@ -93,8 +89,7 @@ public function testOnlyOneConnectingMeterIsValidForOneNumber() ]); } - public function testValidTransactionStartsTransactionProcessing() - { + public function testValidTransactionStartsTransactionProcessing() { Queue::fake(); $this->withoutExceptionHandling(); $this->initializeData(); @@ -135,8 +130,7 @@ public function testValidTransactionStartsTransactionProcessing() Queue::assertPushed(ProcessPayment::class); } - private function initializeData() - { + private function initializeData() { // create person factory(Person::class)->create(); // create meter-tariff diff --git a/src/backend/packages/inensus/mesomb-payment-provider/src/Tests/Unit/PaymentProcessTests.php b/src/backend/packages/inensus/mesomb-payment-provider/src/Tests/Unit/PaymentProcessTests.php index 7ffd442f2..1c95fd443 100644 --- a/src/backend/packages/inensus/mesomb-payment-provider/src/Tests/Unit/PaymentProcessTests.php +++ b/src/backend/packages/inensus/mesomb-payment-provider/src/Tests/Unit/PaymentProcessTests.php @@ -21,12 +21,10 @@ use Inensus\MesombPaymentProvider\Services\MesomTransactionService; use Tests\TestCase; -class PaymentProcessTests extends TestCase -{ +class PaymentProcessTests extends TestCase { use RefreshDatabase; - public function testProcessPaymentStartsEnergyTransactionProcessor() - { + public function testProcessPaymentStartsEnergyTransactionProcessor() { Queue::fake(); $this->initializeData(); $transaction = $this->initializeTransaction(); @@ -34,8 +32,7 @@ public function testProcessPaymentStartsEnergyTransactionProcessor() Queue::assertPushed(EnergyTransactionProcessor::class); } - public function testEnergyTransactionProcessorStartsTokenProcessor() - { + public function testEnergyTransactionProcessorStartsTokenProcessor() { Queue::fake(); $this->initializeData(); $transaction = $this->initializeTransaction(); @@ -43,8 +40,7 @@ public function testEnergyTransactionProcessorStartsTokenProcessor() Queue::assertPushed(TokenProcessor::class); } - public function testTokenProcessorChargesMeter() - { + public function testTokenProcessorChargesMeter() { Queue::fake(); $this->initializeData(); $transaction = $this->initializeTransaction(); @@ -58,8 +54,7 @@ public function testTokenProcessorChargesMeter() $this->assertEquals(1, $mesombPaymentCount); } - private function initializeTransaction() - { + private function initializeTransaction() { $validData = [ 'pk' => 'ae58a073-2b76-4774-995b-3743d6793d53', 'type' => 'PAYMENT', @@ -82,8 +77,7 @@ private function initializeTransaction() ); } - private function initializeData() - { + private function initializeData() { // create person factory(Person::class)->create(); // create meter-tariff diff --git a/src/backend/packages/inensus/micro-star-meter/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/micro-star-meter/src/Console/Commands/InstallPackage.php index 6f0e225f6..561d381c5 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Console/Commands/InstallPackage.php @@ -6,8 +6,7 @@ use Inensus\MicroStarMeter\Services\ManufacturerService; use Inensus\MicroStarMeter\Services\MicroStarCredentialService; -class InstallPackage extends Command -{ +class InstallPackage extends Command { protected $signature = 'micro-star-meter:install'; protected $description = 'Install MicroStarMeter Package'; @@ -19,16 +18,14 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { $this->info('Installing MicroStarMeter Integration Package\n'); $this->manufacturerService->register(); $this->credentialService->createCredentials(); $this->info('Package installed successfully..'); } - private function publishMigrations() - { + private function publishMigrations() { $this->info('Copying migrations\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\MicroStarMeter\Providers\MicroStarMeterServiceProvider", @@ -36,14 +33,12 @@ private function publishMigrations() ]); } - private function createDatabaseTables() - { + private function createDatabaseTables() { $this->info('Creating database tables\n'); $this->call('migrate'); } - private function publishVueFiles() - { + private function publishVueFiles() { $this->info('Copying vue files\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\MicroStarMeter\Providers\MicroStarMeterServiceProvider", @@ -51,8 +46,7 @@ private function publishVueFiles() ]); } - private function createPluginRecord() - { + private function createPluginRecord() { $this->call('plugin:add', [ 'name' => 'MicroStarMeter', 'composer_name' => 'inensus/micro-star-meter', diff --git a/src/backend/packages/inensus/micro-star-meter/src/Console/Commands/UpdatePackage.php b/src/backend/packages/inensus/micro-star-meter/src/Console/Commands/UpdatePackage.php index 0691a891e..dad2b042d 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Console/Commands/UpdatePackage.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Console/Commands/UpdatePackage.php @@ -6,8 +6,7 @@ use Illuminate\Filesystem\Filesystem; use Illuminate\Support\Facades\DB; -class UpdatePackage extends Command -{ +class UpdatePackage extends Command { protected $signature = 'micro-star-meter:update'; protected $description = 'Update MicroStarMeter Package'; @@ -18,8 +17,7 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { $this->info('MicroStar Meter Integration Updating Started\n'); $this->removeOldVersionOfPackage(); $this->installNewVersionOfPackage(); @@ -32,20 +30,17 @@ public function handle(): void $this->info('Package updated successfully..'); } - private function removeOldVersionOfPackage() - { + private function removeOldVersionOfPackage() { $this->info('Removing former version of package\n'); echo shell_exec('COMPOSER_MEMORY_LIMIT=-1 ../composer.phar remove inensus/micro-star-meter'); } - private function installNewVersionOfPackage() - { + private function installNewVersionOfPackage() { $this->info('Installing last version of package\n'); echo shell_exec('COMPOSER_MEMORY_LIMIT=-1 ../composer.phar require inensus/micro-star-meter'); } - private function deleteMigration(Filesystem $filesystem) - { + private function deleteMigration(Filesystem $filesystem) { $migrationFile = $filesystem->glob(database_path().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR .'*_create_micro_star_tables.php')[0]; $migration = DB::table('migrations') @@ -58,8 +53,7 @@ private function deleteMigration(Filesystem $filesystem) ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->delete(); } - private function publishMigrationsAgain() - { + private function publishMigrationsAgain() { $this->info('Copying migrations\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\MicroStarMeter\Providers\MicroStarMeterServiceProvider", @@ -67,14 +61,12 @@ private function publishMigrationsAgain() ]); } - private function updateDatabase() - { + private function updateDatabase() { $this->info('Updating database tables\n'); $this->call('migrate'); } - private function publishVueFilesAgain() - { + private function publishVueFilesAgain() { $this->info('Copying vue files\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\MicroStarMeter\Providers\MicroStarMeterServiceProvider", diff --git a/src/backend/packages/inensus/micro-star-meter/src/Exceptions/MicroStarApiResponseException.php b/src/backend/packages/inensus/micro-star-meter/src/Exceptions/MicroStarApiResponseException.php index 530404553..b07884022 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Exceptions/MicroStarApiResponseException.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Exceptions/MicroStarApiResponseException.php @@ -2,10 +2,8 @@ namespace Inensus\MicroStarMeter\Exceptions; -class MicroStarApiResponseException extends \Exception -{ - public function __construct(string $responseMessage) - { +class MicroStarApiResponseException extends \Exception { + public function __construct(string $responseMessage) { $errorMessage = "MicroStar Meter Api Response Error: $responseMessage"; parent::__construct($errorMessage); diff --git a/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarCertificateController.php b/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarCertificateController.php index 372a45125..72017d82a 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarCertificateController.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarCertificateController.php @@ -9,23 +9,19 @@ use Inensus\MicroStarMeter\Services\MicroStarCertificateService; use Inensus\MicroStarMeter\Services\MicroStarCredentialService; -class MicroStarCertificateController extends Controller -{ +class MicroStarCertificateController extends Controller { public function __construct( private MicroStarCertificateService $certificateService, private MicroStarCredentialService $credentialService, - ) { - } + ) {} - public function store(ImportCertificateRequest $request) - { + public function store(ImportCertificateRequest $request) { $credentials = $this->credentialService->getCredentials(); return MicroStarResource::make($this->certificateService->upload($request, $credentials)); } - public function show(Request $request) - { + public function show(Request $request) { $credentials = $this->credentialService->getCredentials(); $certificateName = $this->certificateService->getUploadedCertificate($credentials); diff --git a/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarCredentialController.php b/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarCredentialController.php index 5d6f60622..5e886294f 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarCredentialController.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarCredentialController.php @@ -7,19 +7,14 @@ use Inensus\MicroStarMeter\Http\Resources\MicroStarResource; use Inensus\MicroStarMeter\Services\MicroStarCredentialService; -class MicroStarCredentialController extends Controller -{ - public function __construct(private MicroStarCredentialService $credentialService) - { - } +class MicroStarCredentialController extends Controller { + public function __construct(private MicroStarCredentialService $credentialService) {} - public function show(): MicroStarResource - { + public function show(): MicroStarResource { return MicroStarResource::make($this->credentialService->getCredentials()); } - public function update(MicroStarCredentialRequest $request): MicroStarResource - { + public function update(MicroStarCredentialRequest $request): MicroStarResource { $credentials = $this->credentialService->updateCredentials($request->only([ 'id', 'api_url', diff --git a/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarTestController.php b/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarTestController.php index 01d044421..ce3a25363 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarTestController.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Http/Controllers/MicroStarTestController.php @@ -5,14 +5,10 @@ use Illuminate\Routing\Controller; use Inensus\MicroStarMeter\Modules\Api\ApiRequests; -class MicroStarTestController extends Controller -{ - public function __construct(private ApiRequests $apiRequests) - { - } +class MicroStarTestController extends Controller { + public function __construct(private ApiRequests $apiRequests) {} - public function show() - { + public function show() { return $this->apiRequests->testGet(); } } diff --git a/src/backend/packages/inensus/micro-star-meter/src/Http/Requests/ImportCertificateRequest.php b/src/backend/packages/inensus/micro-star-meter/src/Http/Requests/ImportCertificateRequest.php index f2c704658..d64fbe76a 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Http/Requests/ImportCertificateRequest.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Http/Requests/ImportCertificateRequest.php @@ -4,23 +4,20 @@ use Illuminate\Foundation\Http\FormRequest; -class ImportCertificateRequest extends FormRequest -{ +class ImportCertificateRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } /** * Get the validation rules that apply to the request. */ - public function rules(): array - { + public function rules(): array { return ['cert' => 'required']; } } diff --git a/src/backend/packages/inensus/micro-star-meter/src/Http/Requests/MicroStarCredentialRequest.php b/src/backend/packages/inensus/micro-star-meter/src/Http/Requests/MicroStarCredentialRequest.php index b98eec107..49534b1bb 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Http/Requests/MicroStarCredentialRequest.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Http/Requests/MicroStarCredentialRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class MicroStarCredentialRequest extends FormRequest -{ +class MicroStarCredentialRequest extends FormRequest { /** * Get the validation rules that apply to the request. * * @return array */ - public function rules() - { + public function rules() { return [ 'api_url' => ['required'], 'certificate_password' => ['required'], diff --git a/src/backend/packages/inensus/micro-star-meter/src/Http/Resources/MicroStarResource.php b/src/backend/packages/inensus/micro-star-meter/src/Http/Resources/MicroStarResource.php index 6450670aa..6d1b40326 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Http/Resources/MicroStarResource.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Http/Resources/MicroStarResource.php @@ -5,8 +5,7 @@ use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\JsonResource; -class MicroStarResource extends JsonResource -{ +class MicroStarResource extends JsonResource { /** * Transform the resource into an array. * @@ -14,8 +13,7 @@ class MicroStarResource extends JsonResource * * @return array */ - public function toArray($request) - { + public function toArray($request) { return parent::toArray($request); } } diff --git a/src/backend/packages/inensus/micro-star-meter/src/Models/MicroStarCredential.php b/src/backend/packages/inensus/micro-star-meter/src/Models/MicroStarCredential.php index 744ced8a8..26f425792 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Models/MicroStarCredential.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Models/MicroStarCredential.php @@ -4,17 +4,14 @@ use App\Models\Base\BaseModel; -class MicroStarCredential extends BaseModel -{ +class MicroStarCredential extends BaseModel { protected $table = 'micro_star_api_credentials'; - public function getApiKey() - { + public function getApiKey() { return $this->api_key; } - public function getApiUrl() - { + public function getApiUrl() { return $this->api_url; } } diff --git a/src/backend/packages/inensus/micro-star-meter/src/Models/MicroStarTransaction.php b/src/backend/packages/inensus/micro-star-meter/src/Models/MicroStarTransaction.php index 1c3b7b544..6ae180366 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Models/MicroStarTransaction.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Models/MicroStarTransaction.php @@ -12,42 +12,34 @@ use Inensus\SwiftaPaymentProvider\Models\SwiftaTransaction; use Inensus\WaveMoneyPaymentProvider\Models\WaveMoneyTransaction; -class MicroStarTransaction extends BaseModel implements ISubTransaction -{ +class MicroStarTransaction extends BaseModel implements ISubTransaction { protected $table = 'micro_star_transactions'; - public function agentTransaction() - { + public function agentTransaction() { return $this->morphOne(AgentTransaction::class, 'manufacturer_transaction'); } - public function vodacomTransaction() - { + public function vodacomTransaction() { return $this->morphOne(VodacomTransaction::class, 'manufacturer_transaction'); } - public function airtelTransaction() - { + public function airtelTransaction() { return $this->morphOne(AirtelTransaction::class, 'manufacturer_transaction'); } - public function thirdPartyTransaction() - { + public function thirdPartyTransaction() { return $this->morphOne(ThirdPartyTransaction::class, 'manufacturer_transaction'); } - public function mesombTransaction() - { + public function mesombTransaction() { return $this->morphOne(MesombTransaction::class, 'manufacturer_transaction'); } - public function swiftaTransaction() - { + public function swiftaTransaction() { return $this->morphOne(SwiftaTransaction::class, 'manufacturer_transaction'); } - public function waveMoneyTransaction() - { + public function waveMoneyTransaction() { return $this->morphOne(WaveMoneyTransaction::class, 'manufacturer_transaction'); } } diff --git a/src/backend/packages/inensus/micro-star-meter/src/Modules/Api/ApiRequests.php b/src/backend/packages/inensus/micro-star-meter/src/Modules/Api/ApiRequests.php index 9e87dfbeb..1d7404d9e 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Modules/Api/ApiRequests.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Modules/Api/ApiRequests.php @@ -9,16 +9,13 @@ use Inensus\MicroStarMeter\Models\MicroStarCredential; use Inensus\MicroStarMeter\Modules\Api\Utils\ResponseResolver; -class ApiRequests -{ +class ApiRequests { public function __construct( private Client $httpClient, private ResponseResolver $responseResolver, - ) { - } + ) {} - public function get(MicroStarCredential $credentials, array $params, string $slug) - { + public function get(MicroStarCredential $credentials, array $params, string $slug) { $url = $credentials->getApiUrl().$slug; foreach ($params as $key => $value) { $url .= $key.'='.$value.'&'; @@ -45,8 +42,7 @@ public function get(MicroStarCredential $credentials, array $params, string $slu } } - public function testGet() - { + public function testGet() { // ti1 = 1 phase 2 = 3 phase $url = 'https://ympt.microstarelectric.com'; diff --git a/src/backend/packages/inensus/micro-star-meter/src/Modules/Api/MicroStarMeterApi.php b/src/backend/packages/inensus/micro-star-meter/src/Modules/Api/MicroStarMeterApi.php index 7c70656a3..269c36c59 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Modules/Api/MicroStarMeterApi.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Modules/Api/MicroStarMeterApi.php @@ -10,19 +10,16 @@ use Inensus\MicroStarMeter\Models\MicroStarTransaction; use Inensus\MicroStarMeter\Services\MicroStarCredentialService; -class MicroStarMeterApi implements IManufacturerAPI -{ +class MicroStarMeterApi implements IManufacturerAPI { public const API_CALL_CHARGE_METER = '/getStsVendingToken?'; public function __construct( private MicroStarCredentialService $credentialService, private MicroStarTransaction $microStarTransaction, private ApiRequests $apiRequests, - ) { - } + ) {} - public function chargeDevice(TransactionDataContainer $transactionContainer): array - { + public function chargeDevice(TransactionDataContainer $transactionContainer): array { $meter = $transactionContainer->device->device; $tariff = $transactionContainer->tariff; $transactionContainer->chargedEnergy += $transactionContainer->amount / $tariff->total_price; @@ -53,8 +50,7 @@ public function chargeDevice(TransactionDataContainer $transactionContainer): ar ]; } - public function clearDevice(Device $device) - { + public function clearDevice(Device $device) { throw new ApiCallDoesNotSupportedException('This api call does not supported'); } } diff --git a/src/backend/packages/inensus/micro-star-meter/src/Modules/Api/Utils/ResponseResolver.php b/src/backend/packages/inensus/micro-star-meter/src/Modules/Api/Utils/ResponseResolver.php index b5cb9187e..9cba68bfc 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Modules/Api/Utils/ResponseResolver.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Modules/Api/Utils/ResponseResolver.php @@ -4,13 +4,11 @@ use Inensus\MicroStarMeter\Exceptions\MicroStarApiResponseException; -class ResponseResolver -{ +class ResponseResolver { /** * @throws MicroStarApiResponseException */ - public function checkResponse($result) - { + public function checkResponse($result) { if (isset($result['errorCode'])) { if ($result['errorCode'] == 1000) { return $result; @@ -24,8 +22,7 @@ public function checkResponse($result) return $result; } - public function getMessage($statusCode): string - { + public function getMessage($statusCode): string { switch ($statusCode) { case 1000: return 'Success'; diff --git a/src/backend/packages/inensus/micro-star-meter/src/Providers/EventServiceProvider.php b/src/backend/packages/inensus/micro-star-meter/src/Providers/EventServiceProvider.php index 773cd06b6..979d9d44f 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Providers/EventServiceProvider.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Providers/EventServiceProvider.php @@ -4,8 +4,7 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; -class EventServiceProvider extends ServiceProvider -{ +class EventServiceProvider extends ServiceProvider { protected $subscribe = [ ]; @@ -14,8 +13,7 @@ class EventServiceProvider extends ServiceProvider * * @return void */ - public function boot() - { + public function boot() { parent::boot(); } } diff --git a/src/backend/packages/inensus/micro-star-meter/src/Providers/MicroStarMeterServiceProvider.php b/src/backend/packages/inensus/micro-star-meter/src/Providers/MicroStarMeterServiceProvider.php index b1a9f605a..200a7b46c 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Providers/MicroStarMeterServiceProvider.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Providers/MicroStarMeterServiceProvider.php @@ -9,10 +9,8 @@ use Inensus\MicroStarMeter\Console\Commands\UpdatePackage; use Inensus\MicroStarMeter\Modules\Api\MicroStarMeterApi; -class MicroStarMeterServiceProvider extends ServiceProvider -{ - public function boot(Filesystem $filesystem) - { +class MicroStarMeterServiceProvider extends ServiceProvider { + public function boot(Filesystem $filesystem) { $this->app->register(RouteServiceProvider::class); if ($this->app->runningInConsole()) { $this->publishConfigFiles(); @@ -22,37 +20,32 @@ public function boot(Filesystem $filesystem) } } - public function register() - { + public function register() { $this->mergeConfigFrom(__DIR__.'/../../config/micro-star-meter.php', 'micro-star-meter'); $this->app->register(EventServiceProvider::class); $this->app->register(ObserverServiceProvider::class); $this->app->bind('MicroStarMeterApi', MicroStarMeterApi::class); } - public function publishConfigFiles() - { + public function publishConfigFiles() { $this->publishes([ __DIR__.'/../../config/micro-star-meter.php' => config_path('micro-star-meter.php'), ]); } - public function publishVueFiles() - { + public function publishVueFiles() { $this->publishes([ __DIR__.'/../resources/assets' => resource_path('assets/js/plugins/micro-star-meter'), ], 'vue-components'); } - public function publishMigrations($filesystem) - { + public function publishMigrations($filesystem) { $this->publishes([ __DIR__.'/../../database/migrations/create_micro_star_tables.php.stub' => $this->getMigrationFileName($filesystem), ], 'migrations'); } - protected function getMigrationFileName(Filesystem $filesystem): string - { + protected function getMigrationFileName(Filesystem $filesystem): string { $timestamp = date('Y_m_d_His'); return Collection::make($this->app->databasePath().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR) diff --git a/src/backend/packages/inensus/micro-star-meter/src/Providers/ObserverServiceProvider.php b/src/backend/packages/inensus/micro-star-meter/src/Providers/ObserverServiceProvider.php index 6586d7032..ed9d38d80 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Providers/ObserverServiceProvider.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Providers/ObserverServiceProvider.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; -class ObserverServiceProvider extends ServiceProvider -{ +class ObserverServiceProvider extends ServiceProvider { /** * Register any events for your application. * * @return void */ - public function boot() - { + public function boot() { parent::boot(); } } diff --git a/src/backend/packages/inensus/micro-star-meter/src/Providers/RouteServiceProvider.php b/src/backend/packages/inensus/micro-star-meter/src/Providers/RouteServiceProvider.php index 557fddb7c..12995aa50 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Providers/RouteServiceProvider.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Providers/RouteServiceProvider.php @@ -5,22 +5,18 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Support\Facades\Route; -class RouteServiceProvider extends ServiceProvider -{ +class RouteServiceProvider extends ServiceProvider { protected $namespace = 'Inensus\MicroStarMeter\Http\Controllers'; - public function boot() - { + public function boot() { parent::boot(); } - public function map() - { + public function map() { $this->mapApiRoutes(); } - protected function mapApiRoutes() - { + protected function mapApiRoutes() { Route::prefix('api') ->middleware('api') ->namespace($this->namespace) diff --git a/src/backend/packages/inensus/micro-star-meter/src/Services/ManufacturerService.php b/src/backend/packages/inensus/micro-star-meter/src/Services/ManufacturerService.php index 7915b77aa..cf4541959 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Services/ManufacturerService.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Services/ManufacturerService.php @@ -4,14 +4,10 @@ use App\Models\Manufacturer; -class ManufacturerService -{ - public function __construct(private Manufacturer $manufacturer) - { - } +class ManufacturerService { + public function __construct(private Manufacturer $manufacturer) {} - public function register() - { + public function register() { $api = $this->manufacturer->newQuery()->where('api_name', 'MicroStarMeterApi')->first(); if (!$api) { $this->manufacturer->newQuery()->create([ diff --git a/src/backend/packages/inensus/micro-star-meter/src/Services/MicroStarCertificateService.php b/src/backend/packages/inensus/micro-star-meter/src/Services/MicroStarCertificateService.php index f25ee9ac5..114b4bca5 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Services/MicroStarCertificateService.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Services/MicroStarCertificateService.php @@ -6,10 +6,8 @@ use Illuminate\Support\Facades\File; use Illuminate\Support\Facades\Storage; -class MicroStarCertificateService -{ - public function upload($request, $credentials) - { +class MicroStarCertificateService { + public function upload($request, $credentials) { $file = $request->file('cert'); $companyId = app()->make(UserService::class)->getCompanyId(); @@ -28,8 +26,7 @@ public function upload($request, $credentials) return $credentials; } - public function getUploadedCertificate($credentials) - { + public function getUploadedCertificate($credentials) { if (!$credentials->certificate_path || !$credentials->certificate_file_name) { return ''; } diff --git a/src/backend/packages/inensus/micro-star-meter/src/Services/MicroStarCredentialService.php b/src/backend/packages/inensus/micro-star-meter/src/Services/MicroStarCredentialService.php index 2cff47f14..85f6bf5e2 100644 --- a/src/backend/packages/inensus/micro-star-meter/src/Services/MicroStarCredentialService.php +++ b/src/backend/packages/inensus/micro-star-meter/src/Services/MicroStarCredentialService.php @@ -4,18 +4,15 @@ use Inensus\MicroStarMeter\Models\MicroStarCredential; -class MicroStarCredentialService -{ +class MicroStarCredentialService { public function __construct( private MicroStarCredential $credential, - ) { - } + ) {} /** * This function uses one time on installation of the package. */ - public function createCredentials() - { + public function createCredentials() { return $this->credential->newQuery()->firstOrCreate(['id' => 1], [ 'api_url' => null, 'certificate_password' => null, @@ -24,13 +21,11 @@ public function createCredentials() ]); } - public function getCredentials() - { + public function getCredentials() { return $this->credential->newQuery()->first(); } - public function updateCredentials($data) - { + public function updateCredentials($data) { $credential = $this->getCredentials(); $credential->update([ 'certificate_password' => $data['certificate_password'], diff --git a/src/backend/packages/inensus/spark-meter/src/Console/Commands/InstallSparkMeterPackage.php b/src/backend/packages/inensus/spark-meter/src/Console/Commands/InstallSparkMeterPackage.php index 68a533d67..d782d977c 100644 --- a/src/backend/packages/inensus/spark-meter/src/Console/Commands/InstallSparkMeterPackage.php +++ b/src/backend/packages/inensus/spark-meter/src/Console/Commands/InstallSparkMeterPackage.php @@ -15,8 +15,7 @@ use Inensus\SparkMeter\Services\SmSmsVariableDefaultValueService; use Inensus\SparkMeter\Services\SmSyncSettingService; -class InstallSparkMeterPackage extends Command -{ +class InstallSparkMeterPackage extends Command { protected $signature = 'spark-meter:install'; protected $description = 'Install the Spark Meter Integration Package'; @@ -37,8 +36,7 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { $this->info('Installing Spark Meter Integration Package\n'); $this->packageInstallationService->createDefaultSettingRecords(); $this->insertSparkMeterApi->registerSparkMeterManufacturer(); @@ -57,8 +55,7 @@ public function handle(): void } } - private function publishMigrations() - { + private function publishMigrations() { $this->info('Copying migrations\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\SparkMeter\Providers\SparkMeterServiceProvider", @@ -66,14 +63,12 @@ private function publishMigrations() ]); } - private function createDatabaseTables() - { + private function createDatabaseTables() { $this->info('Creating database tables\n'); $this->call('migrate'); } - private function publishVueFiles() - { + private function publishVueFiles() { $this->info('Copying vue files\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\SparkMeter\Providers\SparkMeterServiceProvider", @@ -82,8 +77,7 @@ private function publishVueFiles() ]); } - private function createPluginRecord() - { + private function createPluginRecord() { $this->call('plugin:add', [ 'name' => 'SparkMeter', 'composer_name' => 'inensus/spark-meter', diff --git a/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterDataSynchronizer.php b/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterDataSynchronizer.php index 1bc3bcf7d..22eedc446 100644 --- a/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterDataSynchronizer.php +++ b/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterDataSynchronizer.php @@ -20,8 +20,7 @@ use Inensus\SparkMeter\Services\TariffService; use Inensus\SparkMeter\Services\TransactionService; -class SparkMeterDataSynchronizer extends AbstractSharedCommand -{ +class SparkMeterDataSynchronizer extends AbstractSharedCommand { use ScheduledPluginCommand; public const MPM_PLUGIN_ID = 2; @@ -44,8 +43,7 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } diff --git a/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterSmsNotifier.php b/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterSmsNotifier.php index 2185401bd..ff669e33e 100644 --- a/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterSmsNotifier.php +++ b/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterSmsNotifier.php @@ -17,8 +17,7 @@ use Inensus\SparkMeter\Sms\Senders\SparkSmsConfig; use Inensus\SparkMeter\Sms\SparkSmsTypes; -class SparkMeterSmsNotifier extends AbstractSharedCommand -{ +class SparkMeterSmsNotifier extends AbstractSharedCommand { use ScheduledPluginCommand; public const MPM_PLUGIN_ID = 2; @@ -56,8 +55,7 @@ public function __construct( $this->smsService = $smsService; } - private function sendTransactionNotifySms($transactionMin, $smsNotifiedCustomers, $customers) - { + private function sendTransactionNotifySms($transactionMin, $smsNotifiedCustomers, $customers) { $this->smTransactionService->getSparkTransactions($transactionMin) ->each(function ($smTransaction) use ( $smsNotifiedCustomers, @@ -98,8 +96,7 @@ private function sendTransactionNotifySms($transactionMin, $smsNotifiedCustomers }); } - private function sendLowBalanceWarningNotifySms($customers, $smsNotifiedCustomers, $lowBalanceMin) - { + private function sendLowBalanceWarningNotifySms($customers, $smsNotifiedCustomers, $lowBalanceMin) { $customers->each(function ($customer) use ( $smsNotifiedCustomers ) { @@ -130,8 +127,7 @@ private function sendLowBalanceWarningNotifySms($customers, $smsNotifiedCustomer }); } - public function handle(): void - { + public function handle(): void { if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } diff --git a/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterTransactionStatusCheck.php b/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterTransactionStatusCheck.php index ff27950db..fb70e0d9e 100644 --- a/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterTransactionStatusCheck.php +++ b/src/backend/packages/inensus/spark-meter/src/Console/Commands/SparkMeterTransactionStatusCheck.php @@ -8,8 +8,7 @@ use Inensus\SparkMeter\Models\SmTransaction; use Inensus\SparkMeter\Services\TransactionService; -class SparkMeterTransactionStatusCheck extends AbstractSharedCommand -{ +class SparkMeterTransactionStatusCheck extends AbstractSharedCommand { use ScheduledPluginCommand; protected $signature = 'spark-meter:transactionStatusCheck'; @@ -23,8 +22,7 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { if (!$this->checkForPluginStatusIsActive(MpmPlugin::SPARK_METER)) { return; } diff --git a/src/backend/packages/inensus/spark-meter/src/Console/Commands/UpdateSparkMeterPackage.php b/src/backend/packages/inensus/spark-meter/src/Console/Commands/UpdateSparkMeterPackage.php index 654c082b8..82847a17a 100644 --- a/src/backend/packages/inensus/spark-meter/src/Console/Commands/UpdateSparkMeterPackage.php +++ b/src/backend/packages/inensus/spark-meter/src/Console/Commands/UpdateSparkMeterPackage.php @@ -17,8 +17,7 @@ use Inensus\SparkMeter\Services\SmSmsVariableDefaultValueService; use Inensus\SparkMeter\Services\SmSyncSettingService; -class UpdateSparkMeterPackage extends Command -{ +class UpdateSparkMeterPackage extends Command { protected $signature = 'spark-meter:update'; protected $description = 'Update the Spark Meter Integration Package'; @@ -43,8 +42,7 @@ public function __construct( /** * Execute the console command. */ - public function handle(): void - { + public function handle(): void { $this->info('Spark Meter Integration Updating Started\n'); $this->removeOldVersionOfPackage(); $this->installNewVersionOfPackage(); @@ -57,20 +55,17 @@ public function handle(): void $this->info('Package updated successfully..'); } - private function removeOldVersionOfPackage() - { + private function removeOldVersionOfPackage() { $this->info('Removing former version of package\n'); echo shell_exec('COMPOSER_MEMORY_LIMIT=-1 ../composer.phar remove inensus/spark-meter'); } - private function installNewVersionOfPackage() - { + private function installNewVersionOfPackage() { $this->info('Installing last version of package\n'); echo shell_exec('COMPOSER_MEMORY_LIMIT=-1 ../composer.phar require inensus/spark-meter'); } - private function deleteMigration(Filesystem $filesystem) - { + private function deleteMigration(Filesystem $filesystem) { $migrationFile = $filesystem->glob(database_path().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR.'*_create_spark_tables.php')[0]; $migration = DB::table('migrations') ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->first(); @@ -82,8 +77,7 @@ private function deleteMigration(Filesystem $filesystem) ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->delete(); } - private function publishMigrationsAgain() - { + private function publishMigrationsAgain() { $this->info('Copying migrations\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\SparkMeter\Providers\SparkMeterServiceProvider", @@ -91,14 +85,12 @@ private function publishMigrationsAgain() ]); } - private function updateDatabase() - { + private function updateDatabase() { $this->info('Updating database tables\n'); $this->call('migrate'); } - private function publishVueFilesAgain() - { + private function publishVueFilesAgain() { $this->info('Updating vue files\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\SparkMeter\Providers\SparkMeterServiceProvider", diff --git a/src/backend/packages/inensus/spark-meter/src/Exceptions/CredentialsNotFoundException.php b/src/backend/packages/inensus/spark-meter/src/Exceptions/CredentialsNotFoundException.php index 09fc5a8a1..d6c86a011 100644 --- a/src/backend/packages/inensus/spark-meter/src/Exceptions/CredentialsNotFoundException.php +++ b/src/backend/packages/inensus/spark-meter/src/Exceptions/CredentialsNotFoundException.php @@ -2,6 +2,4 @@ namespace Inensus\SparkMeter\Exceptions; -class CredentialsNotFoundException extends \Exception -{ -} +class CredentialsNotFoundException extends \Exception {} diff --git a/src/backend/packages/inensus/spark-meter/src/Exceptions/CredentialsNotUpToDateException.php b/src/backend/packages/inensus/spark-meter/src/Exceptions/CredentialsNotUpToDateException.php index 0f55d90a5..6d18e9962 100644 --- a/src/backend/packages/inensus/spark-meter/src/Exceptions/CredentialsNotUpToDateException.php +++ b/src/backend/packages/inensus/spark-meter/src/Exceptions/CredentialsNotUpToDateException.php @@ -2,6 +2,4 @@ namespace Inensus\SparkMeter\Exceptions; -class CredentialsNotUpToDateException extends \Exception -{ -} +class CredentialsNotUpToDateException extends \Exception {} diff --git a/src/backend/packages/inensus/spark-meter/src/Exceptions/CronJobException.php b/src/backend/packages/inensus/spark-meter/src/Exceptions/CronJobException.php index cd08c1991..5b0686684 100644 --- a/src/backend/packages/inensus/spark-meter/src/Exceptions/CronJobException.php +++ b/src/backend/packages/inensus/spark-meter/src/Exceptions/CronJobException.php @@ -2,6 +2,4 @@ namespace Inensus\SparkMeter\Exceptions; -class CronJobException extends \Exception -{ -} +class CronJobException extends \Exception {} diff --git a/src/backend/packages/inensus/spark-meter/src/Exceptions/NoOnlineSiteRecordException.php b/src/backend/packages/inensus/spark-meter/src/Exceptions/NoOnlineSiteRecordException.php index 8c58c8a07..485b574ee 100644 --- a/src/backend/packages/inensus/spark-meter/src/Exceptions/NoOnlineSiteRecordException.php +++ b/src/backend/packages/inensus/spark-meter/src/Exceptions/NoOnlineSiteRecordException.php @@ -2,6 +2,4 @@ namespace Inensus\SparkMeter\Exceptions; -class NoOnlineSiteRecordException extends \Exception -{ -} +class NoOnlineSiteRecordException extends \Exception {} diff --git a/src/backend/packages/inensus/spark-meter/src/Exceptions/SitesNotUpToDateException.php b/src/backend/packages/inensus/spark-meter/src/Exceptions/SitesNotUpToDateException.php index 26b5d2ea2..9c8404b5c 100644 --- a/src/backend/packages/inensus/spark-meter/src/Exceptions/SitesNotUpToDateException.php +++ b/src/backend/packages/inensus/spark-meter/src/Exceptions/SitesNotUpToDateException.php @@ -2,6 +2,4 @@ namespace Inensus\SparkMeter\Exceptions; -class SitesNotUpToDateException extends \Exception -{ -} +class SitesNotUpToDateException extends \Exception {} diff --git a/src/backend/packages/inensus/spark-meter/src/Exceptions/SparkAPIResponseException.php b/src/backend/packages/inensus/spark-meter/src/Exceptions/SparkAPIResponseException.php index cd22db5b8..595c3a4e2 100644 --- a/src/backend/packages/inensus/spark-meter/src/Exceptions/SparkAPIResponseException.php +++ b/src/backend/packages/inensus/spark-meter/src/Exceptions/SparkAPIResponseException.php @@ -2,6 +2,4 @@ namespace Inensus\SparkMeter\Exceptions; -class SparkAPIResponseException extends \Exception -{ -} +class SparkAPIResponseException extends \Exception {} diff --git a/src/backend/packages/inensus/spark-meter/src/Exceptions/WrongCredentialsException.php b/src/backend/packages/inensus/spark-meter/src/Exceptions/WrongCredentialsException.php index ad5eca5af..06dab1b37 100644 --- a/src/backend/packages/inensus/spark-meter/src/Exceptions/WrongCredentialsException.php +++ b/src/backend/packages/inensus/spark-meter/src/Exceptions/WrongCredentialsException.php @@ -2,6 +2,4 @@ namespace Inensus\SparkMeter\Exceptions; -class WrongCredentialsException extends \Exception -{ -} +class WrongCredentialsException extends \Exception {} diff --git a/src/backend/packages/inensus/spark-meter/src/Helpers/InsertSparkMeterApi.php b/src/backend/packages/inensus/spark-meter/src/Helpers/InsertSparkMeterApi.php index 99bd7fd4e..7e376a080 100644 --- a/src/backend/packages/inensus/spark-meter/src/Helpers/InsertSparkMeterApi.php +++ b/src/backend/packages/inensus/spark-meter/src/Helpers/InsertSparkMeterApi.php @@ -4,8 +4,7 @@ use App\Models\Manufacturer; -class InsertSparkMeterApi -{ +class InsertSparkMeterApi { private $manufacturer; public function __construct( @@ -14,8 +13,7 @@ public function __construct( $this->manufacturer = $manufacturer; } - public function registerSparkMeterManufacturer() - { + public function registerSparkMeterManufacturer() { $api = $this->manufacturer->newQuery()->where('api_name', 'SparkMeterApi')->first(); if (!$api) { $this->manufacturer->newQuery()->create([ diff --git a/src/backend/packages/inensus/spark-meter/src/Helpers/ResultStatusChecker.php b/src/backend/packages/inensus/spark-meter/src/Helpers/ResultStatusChecker.php index b2865decd..cf3c02392 100644 --- a/src/backend/packages/inensus/spark-meter/src/Helpers/ResultStatusChecker.php +++ b/src/backend/packages/inensus/spark-meter/src/Helpers/ResultStatusChecker.php @@ -4,10 +4,8 @@ use Inensus\SparkMeter\Exceptions\SparkAPIResponseException; -class ResultStatusChecker -{ - public function checkApiResult($result) - { +class ResultStatusChecker { + public function checkApiResult($result) { if ($result['error'] !== false && $result['error'] !== null) { throw new SparkAPIResponseException($result['error']); } diff --git a/src/backend/packages/inensus/spark-meter/src/Helpers/SmTableEncryption.php b/src/backend/packages/inensus/spark-meter/src/Helpers/SmTableEncryption.php index d9ead7b63..cf4d37896 100644 --- a/src/backend/packages/inensus/spark-meter/src/Helpers/SmTableEncryption.php +++ b/src/backend/packages/inensus/spark-meter/src/Helpers/SmTableEncryption.php @@ -2,10 +2,8 @@ namespace Inensus\SparkMeter\Helpers; -class SmTableEncryption -{ - public function makeHash($data) - { +class SmTableEncryption { + public function makeHash($data) { return md5(implode('', $data)); } } diff --git a/src/backend/packages/inensus/spark-meter/src/Http/Controllers/IBaseController.php b/src/backend/packages/inensus/spark-meter/src/Http/Controllers/IBaseController.php index 61126292d..26ae5bbea 100644 --- a/src/backend/packages/inensus/spark-meter/src/Http/Controllers/IBaseController.php +++ b/src/backend/packages/inensus/spark-meter/src/Http/Controllers/IBaseController.php @@ -2,8 +2,7 @@ namespace Inensus\SparkMeter\Http\Controllers; -interface IBaseController -{ +interface IBaseController { public function sync(); public function checkSync(); diff --git a/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmCredentialController.php b/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmCredentialController.php index 208d0ef83..03c3bff3c 100644 --- a/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmCredentialController.php +++ b/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmCredentialController.php @@ -8,22 +8,18 @@ use Inensus\SparkMeter\Http\Resources\SparkResource; use Inensus\SparkMeter\Services\CredentialService; -class SmCredentialController extends Controller -{ +class SmCredentialController extends Controller { private $credentialService; - public function __construct(CredentialService $credentialService) - { + public function __construct(CredentialService $credentialService) { $this->credentialService = $credentialService; } - public function show(): SparkResource - { + public function show(): SparkResource { return new SparkResource($this->credentialService->getCredentials()); } - public function update(SmCredentialRequest $request): SparkMeterCredentialResource - { + public function update(SmCredentialRequest $request): SparkMeterCredentialResource { $credentials = $this->credentialService->updateCredentials($request->only([ 'id', 'api_key', diff --git a/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmCustomerController.php b/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmCustomerController.php index 00641cb71..be0e0809a 100644 --- a/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmCustomerController.php +++ b/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmCustomerController.php @@ -8,8 +8,7 @@ use Inensus\SparkMeter\Models\SmCustomer; use Inensus\SparkMeter\Services\CustomerService; -class SmCustomerController implements IBaseController -{ +class SmCustomerController implements IBaseController { private $customerService; public function __construct( @@ -18,42 +17,35 @@ public function __construct( $this->customerService = $customerService; } - public function index(Request $request): SparkResource - { + public function index(Request $request): SparkResource { $customers = $this->customerService->getSmCustomers($request); return new SparkResource($customers); } - public function sync(): SparkResource - { + public function sync(): SparkResource { return new SparkResource($this->customerService->sync()); } - public function checkSync(): SparkResource - { + public function checkSync(): SparkResource { return new SparkResource($this->customerService->syncCheck()); } - public function count() - { + public function count() { return $this->customerService->getSmCustomersCount(); } - public function connection(): SparkResource - { + public function connection(): SparkResource { return new SparkResource($this->customerService->checkConnectionAvailability()); } - public function update(SmCustomer $customer, SmCustomerRequest $request): SparkResource - { + public function update(SmCustomer $customer, SmCustomerRequest $request): SparkResource { return new SparkResource($this->customerService->updateCustomerLowBalanceLimit($customer->id, $request->only([ 'low_balance_limit', ]))); } - public function search() - { + public function search() { $term = request('term'); $paginate = request('paginate') ?? 1; diff --git a/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmMeterModelController.php b/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmMeterModelController.php index f16f38d09..5de1c8404 100644 --- a/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmMeterModelController.php +++ b/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmMeterModelController.php @@ -7,8 +7,7 @@ use Inensus\SparkMeter\Http\Resources\SparkResource; use Inensus\SparkMeter\Services\MeterModelService; -class SmMeterModelController extends Controller implements IBaseController -{ +class SmMeterModelController extends Controller implements IBaseController { private $meterModelService; public function __construct( @@ -17,25 +16,21 @@ public function __construct( $this->meterModelService = $meterModelService; } - public function index(Request $request): SparkResource - { + public function index(Request $request): SparkResource { $meterModels = $this->meterModelService->getSmMeterModels($request); return new SparkResource($meterModels); } - public function sync(): SparkResource - { + public function sync(): SparkResource { return new SparkResource($this->meterModelService->sync()); } - public function checkSync(): SparkResource - { + public function checkSync(): SparkResource { return new SparkResource($this->meterModelService->syncCheck()); } - public function count() - { + public function count() { return $this->meterModelService->getSmMeterModelsCount(); } } diff --git a/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmSalesAccountController.php b/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmSalesAccountController.php index caf5e4535..84f2a3104 100644 --- a/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmSalesAccountController.php +++ b/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmSalesAccountController.php @@ -6,34 +6,28 @@ use Inensus\SparkMeter\Http\Resources\SparkResource; use Inensus\SparkMeter\Services\SmSalesAccoutService; -class SmSalesAccountController implements IBaseController -{ +class SmSalesAccountController implements IBaseController { private $smSalesAccountService; - public function __construct(SmSalesAccoutService $salesAccountService) - { + public function __construct(SmSalesAccoutService $salesAccountService) { $this->smSalesAccountService = $salesAccountService; } - public function index(Request $request): SparkResource - { + public function index(Request $request): SparkResource { $salesAccounts = $this->smSalesAccountService->getSmSalesAccounts($request); return new SparkResource($salesAccounts); } - public function sync(): SparkResource - { + public function sync(): SparkResource { return new SparkResource($this->smSalesAccountService->sync()); } - public function checkSync(): SparkResource - { + public function checkSync(): SparkResource { return new SparkResource($this->smSalesAccountService->syncCheck()); } - public function count() - { + public function count() { return $this->smSalesAccountService->getSmSalesAccountsCount(); } } diff --git a/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmSettingController.php b/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmSettingController.php index 468dad1bf..269fb73d8 100644 --- a/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmSettingController.php +++ b/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmSettingController.php @@ -6,17 +6,14 @@ use Inensus\SparkMeter\Http\Resources\SparkResource; use Inensus\SparkMeter\Services\SmSettingService; -class SmSettingController extends Controller -{ +class SmSettingController extends Controller { private $settingService; - public function __construct(SmSettingService $settingService) - { + public function __construct(SmSettingService $settingService) { $this->settingService = $settingService; } - public function index(): SparkResource - { + public function index(): SparkResource { return new SparkResource($this->settingService->getSettings()); } } diff --git a/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmSiteController.php b/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmSiteController.php index 2f23cea75..953498b3c 100644 --- a/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmSiteController.php +++ b/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmSiteController.php @@ -8,8 +8,7 @@ use Inensus\SparkMeter\Models\SmSite; use Inensus\SparkMeter\Services\SiteService; -class SmSiteController implements IBaseController -{ +class SmSiteController implements IBaseController { private $siteService; public function __construct( @@ -18,35 +17,29 @@ public function __construct( $this->siteService = $siteService; } - public function index(Request $request): SparkResource - { + public function index(Request $request): SparkResource { $customers = $this->siteService->getSmSites($request); return new SparkResource($customers); } - public function sync(): SparkResource - { + public function sync(): SparkResource { return new SparkResource($this->siteService->sync()); } - public function checkSync(): SparkResource - { + public function checkSync(): SparkResource { return new SparkResource($this->siteService->syncCheck()); } - public function count() - { + public function count() { return $this->siteService->getSmSitesCount(); } - public function location(): SparkResource - { + public function location(): SparkResource { return new SparkResource($this->siteService->checkLocationAvailability()); } - public function update(SmSite $site, SmSiteRequest $request): SparkResource - { + public function update(SmSite $site, SmSiteRequest $request): SparkResource { return new SparkResource($this->siteService->update($site->id, $request->only([ 'id', 'thundercloud_url', diff --git a/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmSmsBodyController.php b/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmSmsBodyController.php index b0138971f..a12208f9d 100644 --- a/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmSmsBodyController.php +++ b/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmSmsBodyController.php @@ -7,22 +7,18 @@ use Inensus\SparkMeter\Http\Resources\SparkResource; use Inensus\SparkMeter\Services\SmSmsBodyService; -class SmSmsBodyController extends Controller -{ +class SmSmsBodyController extends Controller { private $smsBodyService; - public function __construct(SmSmsBodyService $smsBodyService) - { + public function __construct(SmSmsBodyService $smsBodyService) { $this->smsBodyService = $smsBodyService; } - public function index(): SparkResource - { + public function index(): SparkResource { return new SparkResource($this->smsBodyService->getSmsBodies()); } - public function update(Request $request): SparkResource - { + public function update(Request $request): SparkResource { return new SparkResource($this->smsBodyService->updateSmsBodies($request->all())); } } diff --git a/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmSmsFeedbackController.php b/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmSmsFeedbackController.php index e33d72b7d..c580647fa 100644 --- a/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmSmsFeedbackController.php +++ b/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmSmsFeedbackController.php @@ -8,22 +8,18 @@ use Inensus\SparkMeter\Models\SmSmsFeedbackWord; use Inensus\SparkMeter\Services\SmSmsFeedbackWordService; -class SmSmsFeedbackController extends Controller -{ +class SmSmsFeedbackController extends Controller { private $smsFeedbackWorkService; - public function __construct(SmSmsFeedbackWordService $smsFeedbackWordService) - { + public function __construct(SmSmsFeedbackWordService $smsFeedbackWordService) { $this->smsFeedbackWorkService = $smsFeedbackWordService; } - public function index(): SparkResource - { + public function index(): SparkResource { return new SparkResource($this->smsFeedbackWorkService->getSmsFeedbackWords()); } - public function update(SmSmsFeedbackWord $smsFeedbackWord, Request $request): SparkResource - { + public function update(SmSmsFeedbackWord $smsFeedbackWord, Request $request): SparkResource { return new SparkResource($this->smsFeedbackWorkService->updateSmsFeedbackWord($smsFeedbackWord, $request->all())); } } diff --git a/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmSmsSettingController.php b/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmSmsSettingController.php index 51c9688ee..0c5ed94eb 100644 --- a/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmSmsSettingController.php +++ b/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmSmsSettingController.php @@ -6,17 +6,14 @@ use Inensus\SparkMeter\Http\Resources\SparkResource; use Inensus\SparkMeter\Services\SmSmsSettingService; -class SmSmsSettingController -{ +class SmSmsSettingController { private $smsSettingService; - public function __construct(SmSmsSettingService $smsSettingService) - { + public function __construct(SmSmsSettingService $smsSettingService) { $this->smsSettingService = $smsSettingService; } - public function update(Request $request): SparkResource - { + public function update(Request $request): SparkResource { return new SparkResource($this->smsSettingService->updateSmsSettings($request->all())); } } diff --git a/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmSmsVariableDefaultValueController.php b/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmSmsVariableDefaultValueController.php index 8400b1f65..c09faf78f 100644 --- a/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmSmsVariableDefaultValueController.php +++ b/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmSmsVariableDefaultValueController.php @@ -6,17 +6,14 @@ use Inensus\SparkMeter\Services\SmSmsVariableDefaultValueService; use Inensus\Ticket\Http\Controllers\Controller; -class SmSmsVariableDefaultValueController extends Controller -{ +class SmSmsVariableDefaultValueController extends Controller { private $smsVariableDefaultSValueService; - public function __construct(SmSmsVariableDefaultValueService $smsVariableDefaultSValueService) - { + public function __construct(SmSmsVariableDefaultValueService $smsVariableDefaultSValueService) { $this->smsVariableDefaultSValueService = $smsVariableDefaultSValueService; } - public function index(): SparkResource - { + public function index(): SparkResource { return new SparkResource($this->smsVariableDefaultSValueService->getSmsVariableDefaultValues()); } } diff --git a/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmSyncSettingController.php b/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmSyncSettingController.php index c4cf5bb0f..d3ab6dc95 100644 --- a/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmSyncSettingController.php +++ b/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmSyncSettingController.php @@ -6,17 +6,14 @@ use Inensus\SparkMeter\Http\Resources\SparkResource; use Inensus\SparkMeter\Services\SmSyncSettingService; -class SmSyncSettingController -{ +class SmSyncSettingController { private $syncSettingService; - public function __construct(SmSyncSettingService $syncSettingService) - { + public function __construct(SmSyncSettingService $syncSettingService) { $this->syncSettingService = $syncSettingService; } - public function update(Request $request): SparkResource - { + public function update(Request $request): SparkResource { return new SparkResource($this->syncSettingService->updateSyncSettings($request->all())); } } diff --git a/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmTariffController.php b/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmTariffController.php index 4c0feccd2..24c70cb15 100644 --- a/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmTariffController.php +++ b/src/backend/packages/inensus/spark-meter/src/Http/Controllers/SmTariffController.php @@ -8,27 +8,22 @@ use Inensus\SparkMeter\Http\Resources\SparkResource; use Inensus\SparkMeter\Services\TariffService; -class SmTariffController extends Controller implements IBaseController -{ +class SmTariffController extends Controller implements IBaseController { private $tariffService; - public function __construct(TariffService $tariffService) - { + public function __construct(TariffService $tariffService) { $this->tariffService = $tariffService; } - public function index(Request $request): SparkResource - { + public function index(Request $request): SparkResource { return new SparkResource($this->tariffService->getSmTariffs($request)); } - public function getInfo($tariffId): SparkResource - { + public function getInfo($tariffId): SparkResource { return new SparkResource($this->tariffService->getSparkTariffInfo($tariffId)); } - public function updateInfo(SmTariffRequest $request) - { + public function updateInfo(SmTariffRequest $request) { $tariffData = [ 'id' => $request->input('id'), 'name' => $request->input('name'), @@ -48,18 +43,15 @@ public function updateInfo(SmTariffRequest $request) return new SparkResource($this->tariffService->updateSparkTariffInfo($tariffData)); } - public function sync(): SparkResource - { + public function sync(): SparkResource { return new SparkResource($this->tariffService->sync()); } - public function checkSync(): SparkResource - { + public function checkSync(): SparkResource { return new SparkResource($this->tariffService->syncCheck()); } - public function count() - { + public function count() { return $this->tariffService->getSmTariffsCount(); } } diff --git a/src/backend/packages/inensus/spark-meter/src/Http/Requests/SmCredentialRequest.php b/src/backend/packages/inensus/spark-meter/src/Http/Requests/SmCredentialRequest.php index 0598b5100..fdcfacc64 100644 --- a/src/backend/packages/inensus/spark-meter/src/Http/Requests/SmCredentialRequest.php +++ b/src/backend/packages/inensus/spark-meter/src/Http/Requests/SmCredentialRequest.php @@ -5,15 +5,13 @@ use Illuminate\Foundation\Http\FormRequest; use Illuminate\Validation\Rule; -class SmCredentialRequest extends FormRequest -{ +class SmCredentialRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -22,8 +20,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { return [ 'api_key' => ['required', Rule::unique('shard.sm_api_credentials')->ignore($this->id)], 'api_secret' => 'required', diff --git a/src/backend/packages/inensus/spark-meter/src/Http/Requests/SmCustomerRequest.php b/src/backend/packages/inensus/spark-meter/src/Http/Requests/SmCustomerRequest.php index 6f2c82c7d..9d1659718 100644 --- a/src/backend/packages/inensus/spark-meter/src/Http/Requests/SmCustomerRequest.php +++ b/src/backend/packages/inensus/spark-meter/src/Http/Requests/SmCustomerRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class SmCustomerRequest extends FormRequest -{ +class SmCustomerRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -21,8 +19,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { return [ 'low_balance_limit' => 'required', ]; diff --git a/src/backend/packages/inensus/spark-meter/src/Http/Requests/SmSiteRequest.php b/src/backend/packages/inensus/spark-meter/src/Http/Requests/SmSiteRequest.php index e0213b98a..f3a34a765 100644 --- a/src/backend/packages/inensus/spark-meter/src/Http/Requests/SmSiteRequest.php +++ b/src/backend/packages/inensus/spark-meter/src/Http/Requests/SmSiteRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class SmSiteRequest extends FormRequest -{ +class SmSiteRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -21,8 +19,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { return [ 'thundercloud_url' => 'required', 'thundercloud_token' => 'required', diff --git a/src/backend/packages/inensus/spark-meter/src/Http/Requests/SmTariffRequest.php b/src/backend/packages/inensus/spark-meter/src/Http/Requests/SmTariffRequest.php index 834d4b92e..1af2ab250 100644 --- a/src/backend/packages/inensus/spark-meter/src/Http/Requests/SmTariffRequest.php +++ b/src/backend/packages/inensus/spark-meter/src/Http/Requests/SmTariffRequest.php @@ -6,15 +6,13 @@ use Illuminate\Validation\Rule; use Inensus\SparkMeter\Models\SmTariff; -class SmTariffRequest extends FormRequest -{ +class SmTariffRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ - public function authorize() - { + public function authorize() { return true; } @@ -23,8 +21,7 @@ public function authorize() * * @return array */ - public function rules() - { + public function rules() { $meterTariff = SmTariff::with('mpmTariff')->where('tariff_id', $this->id)->firstOrFail(); return [ diff --git a/src/backend/packages/inensus/spark-meter/src/Http/Requests/SparkMeterApiRequests.php b/src/backend/packages/inensus/spark-meter/src/Http/Requests/SparkMeterApiRequests.php index 92cf713c1..5efd9aec1 100644 --- a/src/backend/packages/inensus/spark-meter/src/Http/Requests/SparkMeterApiRequests.php +++ b/src/backend/packages/inensus/spark-meter/src/Http/Requests/SparkMeterApiRequests.php @@ -9,8 +9,7 @@ use Inensus\SparkMeter\Models\SmCredential; use Inensus\SparkMeter\Models\SmSite; -class SparkMeterApiRequests -{ +class SparkMeterApiRequests { private $client; private $resultStatusChecker; @@ -35,8 +34,7 @@ public function __construct( $this->smCredentail = $smCredential; } - public function get($url, $siteId) - { + public function get($url, $siteId) { $smSite = $this->getThunderCloudInformation($siteId); try { $request = $this->client->get( @@ -55,8 +53,7 @@ public function get($url, $siteId) return $this->resultStatusChecker->checkApiResult(json_decode((string) $request->getBody(), true)); } - public function post($url, $postParams, $siteId) - { + public function post($url, $postParams, $siteId) { $smSite = $this->getThunderCloudInformation($siteId); try { $request = $this->client->post( @@ -76,8 +73,7 @@ public function post($url, $postParams, $siteId) return $this->resultStatusChecker->checkApiResult(json_decode((string) $request->getBody(), true)); } - public function put($url, $putParams, $siteId) - { + public function put($url, $putParams, $siteId) { $smSite = $this->getThunderCloudInformation($siteId); try { $request = $this->client->put( @@ -97,8 +93,7 @@ public function put($url, $putParams, $siteId) return $this->resultStatusChecker->checkApiResult(json_decode((string) $request->getBody(), true)); } - public function getByParams($url, $params, $siteId) - { + public function getByParams($url, $params, $siteId) { try { $smSite = $this->getThunderCloudInformation($siteId); $apiUrl = $smSite->thundercloud_url.$url.'?'; @@ -125,8 +120,7 @@ public function getByParams($url, $params, $siteId) } } - public function getInfo($url, $id, $siteId) - { + public function getInfo($url, $id, $siteId) { $smSite = $this->getThunderCloudInformation($siteId); $apiUrl = $smSite->thundercloud_url.$url.$id; try { @@ -146,8 +140,7 @@ public function getInfo($url, $id, $siteId) return $this->resultStatusChecker->checkApiResult(json_decode((string) $request->getBody(), true)); } - public function getFromKoios($url) - { + public function getFromKoios($url) { $smCredential = $this->getCredentials(); try { $request = $this->client->get( @@ -167,8 +160,7 @@ public function getFromKoios($url) return $this->resultStatusChecker->checkApiResult(json_decode((string) $request->getBody(), true)); } - public function postToKoios($url, $postParams) - { + public function postToKoios($url, $postParams) { $smCredential = $this->getCredentials(); try { $request = $this->client->post( @@ -189,13 +181,11 @@ public function postToKoios($url, $postParams) return $this->resultStatusChecker->checkApiResult(json_decode((string) $request->getBody(), true)); } - private function getCredentials() - { + private function getCredentials() { return $this->smCredentail->newQuery()->first(); } - private function getThunderCloudInformation($siteId) - { + private function getThunderCloudInformation($siteId) { return $this->site->newQuery()->where('site_id', $siteId)->first(); } } diff --git a/src/backend/packages/inensus/spark-meter/src/Http/Resources/SparkMeterCredentialResource.php b/src/backend/packages/inensus/spark-meter/src/Http/Resources/SparkMeterCredentialResource.php index 891e090a1..1cc6ce741 100644 --- a/src/backend/packages/inensus/spark-meter/src/Http/Resources/SparkMeterCredentialResource.php +++ b/src/backend/packages/inensus/spark-meter/src/Http/Resources/SparkMeterCredentialResource.php @@ -6,10 +6,8 @@ use Illuminate\Http\Resources\Json\JsonResource; use Inensus\SparkMeter\Models\SmCredential; -class SparkMeterCredentialResource extends JsonResource -{ - public function __construct(SmCredential $smCredential) - { +class SparkMeterCredentialResource extends JsonResource { + public function __construct(SmCredential $smCredential) { parent::__construct($smCredential); } @@ -20,16 +18,14 @@ public function __construct(SmCredential $smCredential) * * @return Request */ - public function toArray($request) - { + public function toArray($request) { $credentials = $this->resource->toArray(); $credentials['alert'] = $this->alertType($this->resource->is_authenticated); return $credentials; } - private function alertType($authenticationStatus) - { + private function alertType($authenticationStatus) { switch ($authenticationStatus) { case true: return [ diff --git a/src/backend/packages/inensus/spark-meter/src/Http/Resources/SparkResource.php b/src/backend/packages/inensus/spark-meter/src/Http/Resources/SparkResource.php index d28e1c463..3e9f5f9b4 100644 --- a/src/backend/packages/inensus/spark-meter/src/Http/Resources/SparkResource.php +++ b/src/backend/packages/inensus/spark-meter/src/Http/Resources/SparkResource.php @@ -5,8 +5,7 @@ use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\JsonResource; -class SparkResource extends JsonResource -{ +class SparkResource extends JsonResource { /** * Transform the resource into an array. * @@ -14,8 +13,7 @@ class SparkResource extends JsonResource * * @return array */ - public function toArray($request) - { + public function toArray($request) { return parent::toArray($request); } } diff --git a/src/backend/packages/inensus/spark-meter/src/Listeners/MeterParameterListener.php b/src/backend/packages/inensus/spark-meter/src/Listeners/MeterParameterListener.php index 600d1ff7a..633dc6c1b 100644 --- a/src/backend/packages/inensus/spark-meter/src/Listeners/MeterParameterListener.php +++ b/src/backend/packages/inensus/spark-meter/src/Listeners/MeterParameterListener.php @@ -13,8 +13,7 @@ use Inensus\SparkMeter\Services\CustomerService; use Inensus\SparkMeter\Services\TariffService; -class MeterParameterListener -{ +class MeterParameterListener { private $tariffService; private $customerService; @@ -54,8 +53,7 @@ public function __construct( /** * Sets the in_use to true. */ - public function onParameterSaved(int $meter_id) - { + public function onParameterSaved(int $meter_id) { Log::debug('Meter Parameter listener Spark Meter Package', []); $meterInfo = $this->meterParameter->newQuery()->with([ 'tariff.tou', @@ -98,8 +96,7 @@ function ($q) use ($customerId) { } } - public function subscribe(Dispatcher $events) - { + public function subscribe(Dispatcher $events) { $events->listen('meterparameter.saved', 'Inensus\SparkMeter\Listeners\MeterParameterListener@onParameterSaved'); } } diff --git a/src/backend/packages/inensus/spark-meter/src/Listeners/SmsListener.php b/src/backend/packages/inensus/spark-meter/src/Listeners/SmsListener.php index 7e6b84689..862dad230 100644 --- a/src/backend/packages/inensus/spark-meter/src/Listeners/SmsListener.php +++ b/src/backend/packages/inensus/spark-meter/src/Listeners/SmsListener.php @@ -11,8 +11,7 @@ use Inensus\SparkMeter\Sms\Senders\SparkSmsConfig; use Inensus\SparkMeter\Sms\SparkSmsTypes; -class SmsListener -{ +class SmsListener { private $smsFeedbackWordService; private $customerService; @@ -33,8 +32,7 @@ public function __construct( $this->smsService = $smsService; } - public function onSmsStored($sender, $message) - { + public function onSmsStored($sender, $message) { $sparkCustomer = $this->customerService->getSparkCustomerWithPhone($sender); if (!$sparkCustomer) { return; @@ -72,8 +70,7 @@ public function onSmsStored($sender, $message) } } - public function subscribe(Dispatcher $events) - { + public function subscribe(Dispatcher $events) { $events->listen('sms.stored', 'Inensus\SparkMeter\Listeners\SmsListener@onSmsStored'); } } diff --git a/src/backend/packages/inensus/spark-meter/src/Listeners/TransactionListener.php b/src/backend/packages/inensus/spark-meter/src/Listeners/TransactionListener.php index 2bf390b7d..3141106cb 100644 --- a/src/backend/packages/inensus/spark-meter/src/Listeners/TransactionListener.php +++ b/src/backend/packages/inensus/spark-meter/src/Listeners/TransactionListener.php @@ -7,8 +7,7 @@ use Inensus\SparkMeter\Models\SmTransaction; use Inensus\SparkMeter\Services\TransactionService; -class TransactionListener -{ +class TransactionListener { private $transactionService; private $smTransaction; @@ -24,16 +23,14 @@ public function __construct( /** * Sets the in_use to true. */ - public function onTransactionSuccess(Transaction $transaction) - { + public function onTransactionSuccess(Transaction $transaction) { $smTransaction = $this->smTransaction->newQuery()->where('mpm_transaction_id', $transaction->id)->first(); if ($smTransaction) { $this->transactionService->updateTransactionStatus($smTransaction); } } - public function subscribe(Dispatcher $events) - { + public function subscribe(Dispatcher $events) { $events->listen( 'transaction.successful', 'Inensus\SparkMeter\Listeners\TransactionListener@onTransactionSuccess' diff --git a/src/backend/packages/inensus/spark-meter/src/Models/BaseModel.php b/src/backend/packages/inensus/spark-meter/src/Models/BaseModel.php index ef7cdfff0..e2372f8f2 100644 --- a/src/backend/packages/inensus/spark-meter/src/Models/BaseModel.php +++ b/src/backend/packages/inensus/spark-meter/src/Models/BaseModel.php @@ -4,20 +4,17 @@ use Illuminate\Database\Eloquent\Model; -class BaseModel extends Model -{ +class BaseModel extends Model { protected $guarded = ['id']; public static $rules = []; - public function __construct(array $attributes = []) - { + public function __construct(array $attributes = []) { parent::__construct($attributes); $this->setConnection('shard'); } - public function resolveChildRouteBinding($childType, $value, $field) - { + public function resolveChildRouteBinding($childType, $value, $field) { // TODO: Implement resolveChildRouteBinding() method. } } diff --git a/src/backend/packages/inensus/spark-meter/src/Models/SmCredential.php b/src/backend/packages/inensus/spark-meter/src/Models/SmCredential.php index a3241afe0..eb8e89e5d 100644 --- a/src/backend/packages/inensus/spark-meter/src/Models/SmCredential.php +++ b/src/backend/packages/inensus/spark-meter/src/Models/SmCredential.php @@ -2,7 +2,6 @@ namespace Inensus\SparkMeter\Models; -class SmCredential extends BaseModel -{ +class SmCredential extends BaseModel { protected $table = 'sm_api_credentials'; } diff --git a/src/backend/packages/inensus/spark-meter/src/Models/SmCustomer.php b/src/backend/packages/inensus/spark-meter/src/Models/SmCustomer.php index b7ed5c87d..62729c954 100644 --- a/src/backend/packages/inensus/spark-meter/src/Models/SmCustomer.php +++ b/src/backend/packages/inensus/spark-meter/src/Models/SmCustomer.php @@ -4,17 +4,14 @@ use App\Models\Person\Person; -class SmCustomer extends BaseModel -{ +class SmCustomer extends BaseModel { protected $table = 'sm_customers'; - public function mpmPerson() - { + public function mpmPerson() { return $this->belongsTo(Person::class, 'mpm_customer_id'); } - public function site() - { + public function site() { return $this->belongsTo(SmSite::class, 'site_id', 'site_id'); } } diff --git a/src/backend/packages/inensus/spark-meter/src/Models/SmMeterModel.php b/src/backend/packages/inensus/spark-meter/src/Models/SmMeterModel.php index fada89e03..f6ac4cc2d 100644 --- a/src/backend/packages/inensus/spark-meter/src/Models/SmMeterModel.php +++ b/src/backend/packages/inensus/spark-meter/src/Models/SmMeterModel.php @@ -4,17 +4,14 @@ use App\Models\Meter\MeterType; -class SmMeterModel extends BaseModel -{ +class SmMeterModel extends BaseModel { protected $table = 'sm_meter_models'; - public function meterType() - { + public function meterType() { return $this->belongsTo(MeterType::class, 'mpm_meter_type_id'); } - public function site() - { + public function site() { return $this->belongsTo(SmSite::class, 'site_id', 'site_id'); } } diff --git a/src/backend/packages/inensus/spark-meter/src/Models/SmOrganization.php b/src/backend/packages/inensus/spark-meter/src/Models/SmOrganization.php index 2b5b2e25d..71cfa5277 100644 --- a/src/backend/packages/inensus/spark-meter/src/Models/SmOrganization.php +++ b/src/backend/packages/inensus/spark-meter/src/Models/SmOrganization.php @@ -2,7 +2,6 @@ namespace Inensus\SparkMeter\Models; -class SmOrganization extends BaseModel -{ +class SmOrganization extends BaseModel { protected $table = 'sm_organizations'; } diff --git a/src/backend/packages/inensus/spark-meter/src/Models/SmSalesAccount.php b/src/backend/packages/inensus/spark-meter/src/Models/SmSalesAccount.php index a7794efab..d3f6f5019 100644 --- a/src/backend/packages/inensus/spark-meter/src/Models/SmSalesAccount.php +++ b/src/backend/packages/inensus/spark-meter/src/Models/SmSalesAccount.php @@ -2,12 +2,10 @@ namespace Inensus\SparkMeter\Models; -class SmSalesAccount extends BaseModel -{ +class SmSalesAccount extends BaseModel { protected $table = 'sm_sales_accounts'; - public function site() - { + public function site() { return $this->belongsTo(SmSite::class, 'site_id', 'site_id'); } } diff --git a/src/backend/packages/inensus/spark-meter/src/Models/SmSetting.php b/src/backend/packages/inensus/spark-meter/src/Models/SmSetting.php index 22b7a0c70..9d0178bc8 100644 --- a/src/backend/packages/inensus/spark-meter/src/Models/SmSetting.php +++ b/src/backend/packages/inensus/spark-meter/src/Models/SmSetting.php @@ -5,28 +5,24 @@ use App\Relations\BelongsToMorph; use Illuminate\Database\Eloquent\Relations\MorphTo; -class SmSetting extends BaseModel -{ +class SmSetting extends BaseModel { protected $table = 'sm_settings'; - public function setting(): MorphTo - { + public function setting(): MorphTo { return $this->morphTo(); } /** * A work-around for querying the polymorphic relation with whereHas. */ - public function settingSms(): BelongsToMorph - { + public function settingSms(): BelongsToMorph { return BelongsToMorph::build($this, SmSmsSetting::class, 'setting'); } /** * A work-around for querying the polymorphic relation with whereHas. */ - public function settingSync(): BelongsToMorph - { + public function settingSync(): BelongsToMorph { return BelongsToMorph::build($this, SmSyncSetting::class, 'setting'); } } diff --git a/src/backend/packages/inensus/spark-meter/src/Models/SmSite.php b/src/backend/packages/inensus/spark-meter/src/Models/SmSite.php index 81379a7e8..dc7bc43fc 100644 --- a/src/backend/packages/inensus/spark-meter/src/Models/SmSite.php +++ b/src/backend/packages/inensus/spark-meter/src/Models/SmSite.php @@ -4,12 +4,10 @@ use App\Models\MiniGrid; -class SmSite extends BaseModel -{ +class SmSite extends BaseModel { protected $table = 'sm_sites'; - public function mpmMiniGrid() - { + public function mpmMiniGrid() { return $this->belongsTo(MiniGrid::class, 'mpm_mini_grid_id'); } } diff --git a/src/backend/packages/inensus/spark-meter/src/Models/SmSmsBody.php b/src/backend/packages/inensus/spark-meter/src/Models/SmSmsBody.php index dca5e7baa..b3d4e0b9a 100644 --- a/src/backend/packages/inensus/spark-meter/src/Models/SmSmsBody.php +++ b/src/backend/packages/inensus/spark-meter/src/Models/SmSmsBody.php @@ -2,7 +2,6 @@ namespace Inensus\SparkMeter\Models; -class SmSmsBody extends BaseModel -{ +class SmSmsBody extends BaseModel { protected $table = 'sm_sms_bodies'; } diff --git a/src/backend/packages/inensus/spark-meter/src/Models/SmSmsFeedbackWord.php b/src/backend/packages/inensus/spark-meter/src/Models/SmSmsFeedbackWord.php index da438d20c..98f34eeb2 100644 --- a/src/backend/packages/inensus/spark-meter/src/Models/SmSmsFeedbackWord.php +++ b/src/backend/packages/inensus/spark-meter/src/Models/SmSmsFeedbackWord.php @@ -2,7 +2,6 @@ namespace Inensus\SparkMeter\Models; -class SmSmsFeedbackWord extends BaseModel -{ +class SmSmsFeedbackWord extends BaseModel { protected $table = 'sm_sms_feedback_words'; } diff --git a/src/backend/packages/inensus/spark-meter/src/Models/SmSmsNotifiedCustomer.php b/src/backend/packages/inensus/spark-meter/src/Models/SmSmsNotifiedCustomer.php index f91293c6a..439b4461d 100644 --- a/src/backend/packages/inensus/spark-meter/src/Models/SmSmsNotifiedCustomer.php +++ b/src/backend/packages/inensus/spark-meter/src/Models/SmSmsNotifiedCustomer.php @@ -4,12 +4,10 @@ use Illuminate\Database\Eloquent\Relations\MorphTo; -class SmSmsNotifiedCustomer extends BaseModel -{ +class SmSmsNotifiedCustomer extends BaseModel { protected $table = 'sm_sms_notified_customers'; - public function notify(): MorphTo - { + public function notify(): MorphTo { return $this->morphTo(); } } diff --git a/src/backend/packages/inensus/spark-meter/src/Models/SmSmsSetting.php b/src/backend/packages/inensus/spark-meter/src/Models/SmSmsSetting.php index a1059649b..97efbe937 100644 --- a/src/backend/packages/inensus/spark-meter/src/Models/SmSmsSetting.php +++ b/src/backend/packages/inensus/spark-meter/src/Models/SmSmsSetting.php @@ -2,12 +2,10 @@ namespace Inensus\SparkMeter\Models; -class SmSmsSetting extends BaseModel -{ +class SmSmsSetting extends BaseModel { protected $table = 'sm_sms_settings'; - public function setting() - { + public function setting() { return $this->morphOne(SmSetting::class, 'setting'); } } diff --git a/src/backend/packages/inensus/spark-meter/src/Models/SmSmsVariableDefaultValue.php b/src/backend/packages/inensus/spark-meter/src/Models/SmSmsVariableDefaultValue.php index 6858b4aa3..231bac378 100644 --- a/src/backend/packages/inensus/spark-meter/src/Models/SmSmsVariableDefaultValue.php +++ b/src/backend/packages/inensus/spark-meter/src/Models/SmSmsVariableDefaultValue.php @@ -2,7 +2,6 @@ namespace Inensus\SparkMeter\Models; -class SmSmsVariableDefaultValue extends BaseModel -{ +class SmSmsVariableDefaultValue extends BaseModel { protected $table = 'sm_sms_variable_default_values'; } diff --git a/src/backend/packages/inensus/spark-meter/src/Models/SmSyncAction.php b/src/backend/packages/inensus/spark-meter/src/Models/SmSyncAction.php index 5e8678e52..006d53159 100644 --- a/src/backend/packages/inensus/spark-meter/src/Models/SmSyncAction.php +++ b/src/backend/packages/inensus/spark-meter/src/Models/SmSyncAction.php @@ -2,12 +2,10 @@ namespace Inensus\SparkMeter\Models; -class SmSyncAction extends BaseModel -{ +class SmSyncAction extends BaseModel { protected $table = 'sm_sync_actions'; - public function synSetting() - { + public function synSetting() { return $this->belongsTo(SmSyncSetting::class, 'sync_setting_id'); } } diff --git a/src/backend/packages/inensus/spark-meter/src/Models/SmSyncSetting.php b/src/backend/packages/inensus/spark-meter/src/Models/SmSyncSetting.php index ac3a08ec4..2067eedd8 100644 --- a/src/backend/packages/inensus/spark-meter/src/Models/SmSyncSetting.php +++ b/src/backend/packages/inensus/spark-meter/src/Models/SmSyncSetting.php @@ -2,17 +2,14 @@ namespace Inensus\SparkMeter\Models; -class SmSyncSetting extends BaseModel -{ +class SmSyncSetting extends BaseModel { protected $table = 'sm_sync_settings'; - public function syncAction() - { + public function syncAction() { return $this->hasOne(SmSyncAction::class); } - public function setting() - { + public function setting() { return $this->morphOne(SmSetting::class, 'setting'); } } diff --git a/src/backend/packages/inensus/spark-meter/src/Models/SmTariff.php b/src/backend/packages/inensus/spark-meter/src/Models/SmTariff.php index 5ca299b22..9a7ad5c6b 100644 --- a/src/backend/packages/inensus/spark-meter/src/Models/SmTariff.php +++ b/src/backend/packages/inensus/spark-meter/src/Models/SmTariff.php @@ -4,17 +4,14 @@ use App\Models\Meter\MeterTariff; -class SmTariff extends BaseModel -{ +class SmTariff extends BaseModel { protected $table = 'sm_tariffs'; - public function mpmTariff() - { + public function mpmTariff() { return $this->belongsTo(MeterTariff::class, 'mpm_tariff_id'); } - public function site() - { + public function site() { return $this->belongsTo(SmSite::class, 'site_id', 'site_id'); } } diff --git a/src/backend/packages/inensus/spark-meter/src/Models/SmTransaction.php b/src/backend/packages/inensus/spark-meter/src/Models/SmTransaction.php index 345dba8ac..dc1bc5a40 100644 --- a/src/backend/packages/inensus/spark-meter/src/Models/SmTransaction.php +++ b/src/backend/packages/inensus/spark-meter/src/Models/SmTransaction.php @@ -12,52 +12,42 @@ use Inensus\SwiftaPaymentProvider\Models\SwiftaTransaction; use Inensus\WaveMoneyPaymentProvider\Models\WaveMoneyTransaction; -class SmTransaction extends BaseModel implements ISubTransaction -{ +class SmTransaction extends BaseModel implements ISubTransaction { protected $table = 'sm_transactions'; - public function mpmTransaction() - { + public function mpmTransaction() { return $this->belongsTo(Transaction::class, 'mpm_transaction_id'); } - public function site() - { + public function site() { return $this->belongsTo(SmSite::class, 'site_id', 'site_id'); } - public function agentTransaction() - { + public function agentTransaction() { return $this->morphOne(AgentTransaction::class, 'manufacturer_transaction'); } - public function vodacomTransaction() - { + public function vodacomTransaction() { return $this->morphOne(VodacomTransaction::class, 'manufacturer_transaction'); } - public function airtelTransaction() - { + public function airtelTransaction() { return $this->morphOne(AirtelTransaction::class, 'manufacturer_transaction'); } - public function thirdPartyTransaction() - { + public function thirdPartyTransaction() { return $this->morphOne(ThirdPartyTransaction::class, 'manufacturer_transaction'); } - public function mesombTransaction() - { + public function mesombTransaction() { return $this->morphOne(MesombTransaction::class, 'manufacturer_transaction'); } - public function swiftaTransaction() - { + public function swiftaTransaction() { return $this->morphOne(SwiftaTransaction::class, 'manufacturer_transaction'); } - public function waveMoneyTransaction() - { + public function waveMoneyTransaction() { return $this->morphOne(WaveMoneyTransaction::class, 'manufacturer_transaction'); } } diff --git a/src/backend/packages/inensus/spark-meter/src/Models/SyncStatus.php b/src/backend/packages/inensus/spark-meter/src/Models/SyncStatus.php index 49bbcdf55..dbdd1dd7c 100644 --- a/src/backend/packages/inensus/spark-meter/src/Models/SyncStatus.php +++ b/src/backend/packages/inensus/spark-meter/src/Models/SyncStatus.php @@ -2,8 +2,7 @@ namespace Inensus\SparkMeter\Models; -abstract class SyncStatus -{ +abstract class SyncStatus { public const SYNCED = 1; public const MODIFIED = 2; diff --git a/src/backend/packages/inensus/spark-meter/src/Observers/GeographicalInformationObserver.php b/src/backend/packages/inensus/spark-meter/src/Observers/GeographicalInformationObserver.php index e0e69db02..c717121c8 100644 --- a/src/backend/packages/inensus/spark-meter/src/Observers/GeographicalInformationObserver.php +++ b/src/backend/packages/inensus/spark-meter/src/Observers/GeographicalInformationObserver.php @@ -10,19 +10,16 @@ use Inensus\SparkMeter\Models\SmCustomer; use Inensus\SparkMeter\Services\CustomerService; -class GeographicalInformationObserver -{ +class GeographicalInformationObserver { public function __construct( private CustomerService $customerService, private SmTableEncryption $smTableEncryption, private Person $person, private SmCustomer $smCustomer, private PluginsService $pluginsService, - ) { - } + ) {} - public function updated(GeographicalInformation $geographicalInformation) - { + public function updated(GeographicalInformation $geographicalInformation) { if ($this->pluginsService->isPluginActive(MpmPlugin::SPARK_METER) && $geographicalInformation->owner_type === 'meter_parameter') { $meterParameterId = $geographicalInformation->owner_id; $customer = $this->person->newQuery()->with(['meters.tariff', 'meters.geo', 'meters.meter']) diff --git a/src/backend/packages/inensus/spark-meter/src/Observers/MeterTariffObserver.php b/src/backend/packages/inensus/spark-meter/src/Observers/MeterTariffObserver.php index 693bb9f2d..19667fc71 100644 --- a/src/backend/packages/inensus/spark-meter/src/Observers/MeterTariffObserver.php +++ b/src/backend/packages/inensus/spark-meter/src/Observers/MeterTariffObserver.php @@ -8,8 +8,7 @@ use Inensus\SparkMeter\Models\SmTariff; use Inensus\SparkMeter\Services\TariffService; -class MeterTariffObserver -{ +class MeterTariffObserver { private $tariffService; private $smTableEncryption; @@ -30,8 +29,7 @@ public function __construct( $this->accessRate = $accessRate; } - public function updated(MeterTariff $tariff) - { + public function updated(MeterTariff $tariff) { $smTariff = $this->smTariff->newQuery()->where('mpm_tariff_id', $tariff->id)->first(); if ($smTariff) { $sparkTariff = $this->tariffService->getSparkTariffInfo($smTariff->tariff_id); diff --git a/src/backend/packages/inensus/spark-meter/src/Observers/PersonObserver.php b/src/backend/packages/inensus/spark-meter/src/Observers/PersonObserver.php index 39170acb6..90fcf6040 100644 --- a/src/backend/packages/inensus/spark-meter/src/Observers/PersonObserver.php +++ b/src/backend/packages/inensus/spark-meter/src/Observers/PersonObserver.php @@ -7,8 +7,7 @@ use Inensus\SparkMeter\Models\SmCustomer; use Inensus\SparkMeter\Services\CustomerService; -class PersonObserver -{ +class PersonObserver { private $customerService; private $smTableEncryption; @@ -29,8 +28,7 @@ public function __construct( $this->smCustomer = $smCustomer; } - public function updated(Person $person) - { + public function updated(Person $person) { $smCustomer = $this->smCustomer->newQuery()->with('site') ->where('mpm_customer_id', $person->id)->first(); diff --git a/src/backend/packages/inensus/spark-meter/src/Providers/EventServiceProvider.php b/src/backend/packages/inensus/spark-meter/src/Providers/EventServiceProvider.php index 035781318..76c267275 100644 --- a/src/backend/packages/inensus/spark-meter/src/Providers/EventServiceProvider.php +++ b/src/backend/packages/inensus/spark-meter/src/Providers/EventServiceProvider.php @@ -7,8 +7,7 @@ use Inensus\SparkMeter\Listeners\SmsListener; use Inensus\SparkMeter\Listeners\TransactionListener; -class EventServiceProvider extends ServiceProvider -{ +class EventServiceProvider extends ServiceProvider { protected $subscribe = [ // MeterParameterListener::class, // TransactionListener::class, @@ -20,8 +19,7 @@ class EventServiceProvider extends ServiceProvider * * @return void */ - public function boot() - { + public function boot() { parent::boot(); } } diff --git a/src/backend/packages/inensus/spark-meter/src/Providers/ObserverServiceProvider.php b/src/backend/packages/inensus/spark-meter/src/Providers/ObserverServiceProvider.php index dadf7cac1..8acd6378f 100644 --- a/src/backend/packages/inensus/spark-meter/src/Providers/ObserverServiceProvider.php +++ b/src/backend/packages/inensus/spark-meter/src/Providers/ObserverServiceProvider.php @@ -10,15 +10,13 @@ use Inensus\SparkMeter\Observers\MeterTariffObserver; use Inensus\SparkMeter\Observers\PersonObserver; -class ObserverServiceProvider extends ServiceProvider -{ +class ObserverServiceProvider extends ServiceProvider { /** * Register any events for your application. * * @return void */ - public function boot() - { + public function boot() { parent::boot(); Person::observe(PersonObserver::class); GeographicalInformation::observe(GeographicalInformationObserver::class); diff --git a/src/backend/packages/inensus/spark-meter/src/Providers/SparkMeterRouteServiceProvider.php b/src/backend/packages/inensus/spark-meter/src/Providers/SparkMeterRouteServiceProvider.php index c406b4add..5d5aca4a7 100644 --- a/src/backend/packages/inensus/spark-meter/src/Providers/SparkMeterRouteServiceProvider.php +++ b/src/backend/packages/inensus/spark-meter/src/Providers/SparkMeterRouteServiceProvider.php @@ -5,22 +5,18 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Support\Facades\Route; -class SparkMeterRouteServiceProvider extends ServiceProvider -{ +class SparkMeterRouteServiceProvider extends ServiceProvider { protected $namespace = 'Inensus\SparkMeter\Http\Controllers'; - public function boot() - { + public function boot() { parent::boot(); } - public function map() - { + public function map() { $this->mapApiRoutes(); } - protected function mapApiRoutes() - { + protected function mapApiRoutes() { Route::prefix('api') ->middleware('api') ->namespace($this->namespace) diff --git a/src/backend/packages/inensus/spark-meter/src/Providers/SparkMeterServiceProvider.php b/src/backend/packages/inensus/spark-meter/src/Providers/SparkMeterServiceProvider.php index d3e380dfe..c1ed656cb 100644 --- a/src/backend/packages/inensus/spark-meter/src/Providers/SparkMeterServiceProvider.php +++ b/src/backend/packages/inensus/spark-meter/src/Providers/SparkMeterServiceProvider.php @@ -17,13 +17,11 @@ use Inensus\SparkMeter\Models\SmTransaction; use Inensus\SparkMeter\SparkMeterApi; -class SparkMeterServiceProvider extends ServiceProvider -{ +class SparkMeterServiceProvider extends ServiceProvider { /** * Bootstrap the application services. */ - public function boot(Filesystem $filesystem) - { + public function boot(Filesystem $filesystem) { $this->app->register(SparkMeterRouteServiceProvider::class); if ($this->app->runningInConsole()) { $this->publishConfigFiles(); @@ -53,37 +51,32 @@ public function boot(Filesystem $filesystem) ); } - public function register() - { + public function register() { $this->mergeConfigFrom(__DIR__.'/../../config/spark-meter-integration.php', 'spark'); $this->app->register(EventServiceProvider::class); $this->app->register(ObserverServiceProvider::class); $this->app->bind('SparkMeterApi', SparkMeterApi::class); } - public function publishVueFiles() - { + public function publishVueFiles() { $this->publishes([ __DIR__.'/../resources/assets' => resource_path('assets/js/plugins/spark-meter'), ], 'vue-components'); } - public function publishConfigFiles() - { + public function publishConfigFiles() { $this->publishes([ __DIR__.'/../../config/spark-meter-integration.php' => config_path('spark-meter-integration.php'), ]); } - public function publishMigrations($filesystem) - { + public function publishMigrations($filesystem) { $this->publishes([ __DIR__.'/../../database/migrations/create_spark_tables.php.stub' => $this->getMigrationFileName($filesystem), ], 'migrations'); } - protected function getMigrationFileName(Filesystem $filesystem): string - { + protected function getMigrationFileName(Filesystem $filesystem): string { $timestamp = date('Y_m_d_His'); return Collection::make($this->app->databasePath().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR) diff --git a/src/backend/packages/inensus/spark-meter/src/Services/CredentialService.php b/src/backend/packages/inensus/spark-meter/src/Services/CredentialService.php index 098382e78..89613a0d9 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/CredentialService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/CredentialService.php @@ -7,8 +7,7 @@ use Inensus\SparkMeter\Http\Requests\SparkMeterApiRequests; use Inensus\SparkMeter\Models\SmCredential; -class CredentialService -{ +class CredentialService { private $sparkMeterApiRequests; private $smCredential; @@ -29,13 +28,11 @@ public function __construct( $this->organizationService = $organizationService; } - public function getCredentials() - { + public function getCredentials() { return $this->smCredential->newQuery()->latest()->take(1)->get()->first(); } - public function createSmCredentials() - { + public function createSmCredentials() { return $this->smCredential->newQuery()->firstOrCreate(['id' => 1], [ 'api_key' => null, 'api_secret' => null, @@ -43,8 +40,7 @@ public function createSmCredentials() ]); } - public function updateCredentials($data) - { + public function updateCredentials($data) { $smCredentials = $this->smCredential->newQuery()->find($data['id']); $smCredentials->update([ 'api_key' => $data['api_key'], diff --git a/src/backend/packages/inensus/spark-meter/src/Services/CustomerService.php b/src/backend/packages/inensus/spark-meter/src/Services/CustomerService.php index 3444d59fe..cc5b2aeab 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/CustomerService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/CustomerService.php @@ -26,8 +26,7 @@ use Inensus\SparkMeter\Models\SmTariff; use Inensus\SparkMeter\Models\SyncStatus; -class CustomerService implements ISynchronizeService -{ +class CustomerService implements ISynchronizeService { private $sparkMeterApiRequests; private $rootUrl = '/customer/'; @@ -102,8 +101,7 @@ public function __construct( $this->smSmsNotifiedCustomerService = $smSmsNotifiedCustomerService; } - public function createCustomer($meterInfo, $siteId) - { + public function createCustomer($meterInfo, $siteId) { $params = [ 'meter_serial' => $meterInfo->meter->serial_number, ]; @@ -149,28 +147,24 @@ public function createCustomer($meterInfo, $siteId) } } - public function getSmCustomers($request) - { + public function getSmCustomers($request) { $perPage = $request->input('per_page') ?? 15; return $this->smCustomer->newQuery()->with(['mpmPerson', 'site.mpmMiniGrid'])->paginate($perPage); } - public function getSmCustomersCount() - { + public function getSmCustomersCount() { return count($this->smCustomer->newQuery()->get()); } - public function getSmCustomerByCustomerId($customerId) - { + public function getSmCustomerByCustomerId($customerId) { return $this->smCustomer->newQuery()->with([ 'mpmPerson.meters.meter', 'mpmPerson.addresses', ])->where('customer_id', $customerId)->first(); } - public function updateSparkCustomerInfo($customerData, $siteId) - { + public function updateSparkCustomerInfo($customerData, $siteId) { try { $customerId = $customerData['id']; $putParams = [ @@ -192,8 +186,7 @@ public function updateSparkCustomerInfo($customerData, $siteId) } } - public function createRelatedPerson($customer, $site_id) - { + public function createRelatedPerson($customer, $site_id) { try { DB::connection('shard')->beginTransaction(); $sparkCustomerMeterSerial = $customer['meters'][0]['serial']; @@ -278,8 +271,7 @@ function ($q) use ($currentTariffName) { } } - public function createPerson($data) - { + public function createPerson($data) { $person = $this->person->newQuery()->create([ 'name' => $data['name'], 'is_customer' => 1, @@ -297,8 +289,7 @@ public function createPerson($data) return $person; } - public function updateRelatedPerson($customer, $person, $site_id) - { + public function updateRelatedPerson($customer, $person, $site_id) { $sparkCustomerMeterSerial = $customer['meters'][0]['serial']; $currentTariffName = $customer['meters'][0]['current_tariff_name']; $site = $this->smSite->newQuery()->with('mpmMiniGrid')->where('site_id', $site_id)->firstOrFail(); @@ -345,8 +336,7 @@ function ($q) use ($currentTariffName) { ]); } - public function checkConnectionAvailability() - { + public function checkConnectionAvailability() { $connectionType = $this->connectionType->newQuery()->first(); $connectionGroup = $this->connectionGroup->newQuery()->first(); @@ -362,8 +352,7 @@ public function checkConnectionAvailability() return $result; } - public function hashCustomerWithMeterSerial($meterSerial, $siteId) - { + public function hashCustomerWithMeterSerial($meterSerial, $siteId) { try { $params = [ 'meter_serial' => $meterSerial, @@ -377,8 +366,7 @@ public function hashCustomerWithMeterSerial($meterSerial, $siteId) } } - public function updateCustomerLowBalanceLimit($customerId, $data) - { + public function updateCustomerLowBalanceLimit($customerId, $data) { $customer = $this->smCustomer->newQuery()->find($customerId); $customer->update([ 'low_balance_limit' => $data['low_balance_limit'], @@ -387,8 +375,7 @@ public function updateCustomerLowBalanceLimit($customerId, $data) return $customer->fresh(); } - public function searchCustomer($searchTerm, $paginate) - { + public function searchCustomer($searchTerm, $paginate) { if ($paginate === 1) { return $this->smCustomer->newQuery()->with(['mpmPerson', 'site.mpmMiniGrid']) ->WhereHas('site.mpmMiniGrid', function ($q) use ($searchTerm) { @@ -406,8 +393,7 @@ public function searchCustomer($searchTerm, $paginate) })->get(); } - public function getLowBalancedCustomers() - { + public function getLowBalancedCustomers() { return $this->smCustomer->newQuery()->with([ 'mpmPerson.addresses' => function ($q) { return $q->where('is_primary', 1); @@ -418,8 +404,7 @@ public function getLowBalancedCustomers() ->where('low_balance_limit', '>', 'credit_balance')->get(); } - public function sync() - { + public function sync() { $synSetting = $this->smSyncSettingService->getSyncSettingsByActionName('Customers'); $syncAction = $this->smSyncActionService->getSyncActionBySynSettingId($synSetting->id); try { @@ -472,8 +457,7 @@ public function sync() } } - public function syncCheck($returnData = false) - { + public function syncCheck($returnData = false) { $returnArray = ['available_site_count' => 0]; $sites = $this->smSite->newQuery()->where('is_authenticated', 1)->where('is_online', 1)->get(); foreach ($sites as $key => $site) { @@ -536,8 +520,7 @@ public function syncCheck($returnData = false) return $returnArray; } - public function modelHasher($model, ...$params): string - { + public function modelHasher($model, ...$params): string { return $this->smTableEncryption->makeHash([ trim($model['name']), $params[0], @@ -547,8 +530,7 @@ public function modelHasher($model, ...$params): string ]); } - public function getSparkCustomersWithAddress() - { + public function getSparkCustomersWithAddress() { return $this->smCustomer->newQuery()->with([ 'mpmPerson.addresses', ])->whereHas('mpmPerson.addresses', function ($q) { @@ -556,8 +538,7 @@ public function getSparkCustomersWithAddress() })->get(); } - public function syncCheckBySite($siteId) - { + public function syncCheckBySite($siteId) { try { $sparkCustomers = $this->sparkMeterApiRequests->get('/customers', $siteId); } catch (SparkAPIResponseException $e) { @@ -598,8 +579,7 @@ public function syncCheckBySite($siteId) } } - public function resetMeter($customer) - { + public function resetMeter($customer) { $rootUrl = '/customers/'.$customer->customer_id.'/reset-meter'; try { $this->sparkMeterApiRequests->post($rootUrl, null, $customer->site->site_id); @@ -609,8 +589,7 @@ public function resetMeter($customer) } } - public function getSparkCustomerWithPhone($phoneNumber) - { + public function getSparkCustomerWithPhone($phoneNumber) { $person = $this->person::with(['addresses']) ->whereHas( 'addresses', diff --git a/src/backend/packages/inensus/spark-meter/src/Services/ISynchronizeService.php b/src/backend/packages/inensus/spark-meter/src/Services/ISynchronizeService.php index 8ba77ea6a..427da8cbe 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/ISynchronizeService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/ISynchronizeService.php @@ -2,8 +2,7 @@ namespace Inensus\SparkMeter\Services; -interface ISynchronizeService -{ +interface ISynchronizeService { public function sync(); public function syncCheck(); diff --git a/src/backend/packages/inensus/spark-meter/src/Services/MeterModelService.php b/src/backend/packages/inensus/spark-meter/src/Services/MeterModelService.php index ba825c973..2f335f8bc 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/MeterModelService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/MeterModelService.php @@ -11,8 +11,7 @@ use Inensus\SparkMeter\Models\SmSite; use Inensus\SparkMeter\Models\SyncStatus; -class MeterModelService implements ISynchronizeService -{ +class MeterModelService implements ISynchronizeService { private $sparkMeterApiRequests; private $rootUrl = '/meters'; @@ -47,20 +46,17 @@ public function __construct( $this->smSyncActionService = $smSyncActionService; } - public function getSmMeterModels($request) - { + public function getSmMeterModels($request) { $perPage = $request->input('per_page') ?? 15; return $this->smMeterModel->newQuery()->with(['meterType', 'site.mpmMiniGrid'])->paginate($perPage); } - public function getSmMeterModelsCount() - { + public function getSmMeterModelsCount() { return count($this->smMeterModel->newQuery()->get()); } - public function sync() - { + public function sync() { $synSetting = $this->smSyncSettingService->getSyncSettingsByActionName('MeterModels'); $syncAction = $this->smSyncActionService->getSyncActionBySynSettingId($synSetting->id); try { @@ -115,8 +111,7 @@ public function sync() } } - public function syncCheck($returnData = false) - { + public function syncCheck($returnData = false) { $returnArray = ['available_site_count' => 0]; $sites = $this->smSite->newQuery()->where('is_authenticated', 1)->where('is_online', 1)->get(); foreach ($sites as $key => $site) { @@ -177,8 +172,7 @@ public function syncCheck($returnData = false) return $returnArray; } - public function modelHasher($model, ...$params): string - { + public function modelHasher($model, ...$params): string { return $smModelHash = $this->smTableEncryption->makeHash([ $model['name'], $model['phase_count'], @@ -187,8 +181,7 @@ public function modelHasher($model, ...$params): string ]); } - public function syncCheckBySite($siteId) - { + public function syncCheckBySite($siteId) { try { $url = $this->rootUrl.'/models'; $sparkMeterModels = $this->sparkMeterApiRequests->get($url, $siteId); @@ -228,8 +221,7 @@ public function syncCheckBySite($siteId) } } - public function createRelatedMeterModel($meterModel) - { + public function createRelatedMeterModel($meterModel) { return $this->meterType->newQuery()->create([ 'online' => 1, 'phase' => $meterModel['phase_count'], @@ -237,8 +229,7 @@ public function createRelatedMeterModel($meterModel) ]); } - public function updateRelatedMeterModel($meterModel, $relatedMeterModel) - { + public function updateRelatedMeterModel($meterModel, $relatedMeterModel) { return $meterModel['relatedMeterModel']->update([ 'phase' => $meterModel['phase_count'], 'max_current' => $meterModel['continuous_limit'], diff --git a/src/backend/packages/inensus/spark-meter/src/Services/OrganizationService.php b/src/backend/packages/inensus/spark-meter/src/Services/OrganizationService.php index 8cdaa098c..fe42a4667 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/OrganizationService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/OrganizationService.php @@ -4,8 +4,7 @@ use Inensus\SparkMeter\Models\SmOrganization; -class OrganizationService -{ +class OrganizationService { private $organization; public function __construct( @@ -14,13 +13,11 @@ public function __construct( $this->organization = $organization; } - public function getOrganizations() - { + public function getOrganizations() { return $this->organization->newQuery()->where('id', '>', 0)->get(); } - public function createOrganization($organizationData) - { + public function createOrganization($organizationData) { $organization = $this->organization->newQuery()->first(); if (!$organization) { return $this->organization->newQuery()->create([ @@ -39,8 +36,7 @@ public function createOrganization($organizationData) } } - public function deleteOrganization() - { + public function deleteOrganization() { $organization = $this->organization->newQuery()->first(); $organization->delete(); } diff --git a/src/backend/packages/inensus/spark-meter/src/Services/PackageInstallationService.php b/src/backend/packages/inensus/spark-meter/src/Services/PackageInstallationService.php index 72747c74b..fa09878b3 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/PackageInstallationService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/PackageInstallationService.php @@ -2,8 +2,7 @@ namespace Inensus\SparkMeter\Services; -class PackageInstallationService -{ +class PackageInstallationService { private $smsSettingService; private $syncSettingService; @@ -28,8 +27,7 @@ public function __construct( $this->smSmsFeedbackWordService = $smSmsFeedbackWordService; } - public function createDefaultSettingRecords() - { + public function createDefaultSettingRecords() { $this->smsBodyService->createSmsBodies(); $this->defaultValueService->createSmsVariableDefaultValues(); $this->syncSettingService->createDefaultSettings(); diff --git a/src/backend/packages/inensus/spark-meter/src/Services/SiteService.php b/src/backend/packages/inensus/spark-meter/src/Services/SiteService.php index 8914a98c3..5c2ca03c8 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/SiteService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/SiteService.php @@ -14,8 +14,7 @@ use Inensus\SparkMeter\Models\SmSite; use Inensus\SparkMeter\Models\SyncStatus; -class SiteService implements ISynchronizeService -{ +class SiteService implements ISynchronizeService { private $site; private $sparkMeterApiRequests; @@ -62,8 +61,7 @@ public function __construct( $this->smSyncActionService = $smSyncActionService; } - public function getSmSites($request) - { + public function getSmSites($request) { $perPage = $request->input('per_page') ?? 15; $sites = $this->site->newQuery()->with('mpmMiniGrid')->paginate($perPage); @@ -79,13 +77,11 @@ public function getSmSites($request) return $sites; } - public function getSmSitesCount() - { + public function getSmSitesCount() { return count($this->site->newQuery()->get()); } - public function creteRelatedMiniGrid($site) - { + public function creteRelatedMiniGrid($site) { $cluster = $this->cluster->newQuery()->latest('created_at')->first(); $miniGrid = $this->miniGrid->newQuery()->create([ 'name' => $site['name'], @@ -102,8 +98,7 @@ public function creteRelatedMiniGrid($site) return $miniGrid; } - public function updateGeographicalInformation($miniGridId) - { + public function updateGeographicalInformation($miniGridId) { $geographicalInformation = $this->geographicalInformation->newQuery()->whereHasMorph( 'owner', [MiniGrid::class], @@ -120,15 +115,13 @@ static function ($q) use ($miniGridId) { ]); } - public function updateRelatedMiniGrid($site, $miniGrid) - { + public function updateRelatedMiniGrid($site, $miniGrid) { return $miniGrid->newQuery()->update([ 'name' => $site['name'], ]); } - public function update($siteId, $data) - { + public function update($siteId, $data) { $site = $this->site->newQuery()->find($siteId); $site->update([ 'thundercloud_token' => $data['thundercloud_token'], @@ -153,18 +146,15 @@ public function update($siteId, $data) return $site->fresh(); } - public function getThunderCloudInformation($siteId) - { + public function getThunderCloudInformation($siteId) { return $this->site->newQuery()->where('site_id', $siteId)->first(); } - public function checkLocationAvailability() - { + public function checkLocationAvailability() { return $this->cluster->newQuery()->latest('created_at')->first(); } - public function sync() - { + public function sync() { $synSetting = $this->smSyncSettingService->getSyncSettingsByActionName('Sites'); $syncAction = $this->smSyncActionService->getSyncActionBySynSettingId($synSetting->id); try { @@ -208,8 +198,7 @@ public function sync() } } - public function syncCheck($returnData = false) - { + public function syncCheck($returnData = false) { $organizations = $this->organizationService->getOrganizations(); $sites = []; try { @@ -257,8 +246,7 @@ public function syncCheck($returnData = false) return $returnData ? ['data' => $sitesCollection, 'result' => true] : ['result' => true]; } - public function modelHasher($model, ...$params): string - { + public function modelHasher($model, ...$params): string { return $this->smTableEncryption->makeHash([ $model['name'], $model['display_name'], @@ -266,8 +254,7 @@ public function modelHasher($model, ...$params): string ]); } - public function syncCheckBySite($siteId) - { + public function syncCheckBySite($siteId) { // This function is not using for sites } } diff --git a/src/backend/packages/inensus/spark-meter/src/Services/SmSalesAccoutService.php b/src/backend/packages/inensus/spark-meter/src/Services/SmSalesAccoutService.php index cb8b2cc07..8b054a64f 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/SmSalesAccoutService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/SmSalesAccoutService.php @@ -10,8 +10,7 @@ use Inensus\SparkMeter\Models\SmSite; use Inensus\SparkMeter\Models\SyncStatus; -class SmSalesAccoutService implements ISynchronizeService -{ +class SmSalesAccoutService implements ISynchronizeService { private $sparkMeterApiRequests; private $rootUrl = '/sales-accounts'; @@ -42,20 +41,17 @@ public function __construct( $this->smSyncActionService = $smSyncActionService; } - public function getSmSalesAccounts($request) - { + public function getSmSalesAccounts($request) { $perPage = $request->input('per_page') ?? 15; return $this->smSalesAccount->newQuery()->with(['site.mpmMiniGrid'])->paginate($perPage); } - public function getSmSalesAccountsCount() - { + public function getSmSalesAccountsCount() { return count($this->smSalesAccount->newQuery()->get()); } - public function sync() - { + public function sync() { $synSetting = $this->smSyncSettingService->getSyncSettingsByActionName('SalesAccounts'); $syncAction = $this->smSyncActionService->getSyncActionBySynSettingId($synSetting->id); try { @@ -103,8 +99,7 @@ public function sync() } } - public function syncCheck($returnData = false) - { + public function syncCheck($returnData = false) { $returnArray = ['available_site_count' => 0]; $sites = $this->smSite->newQuery()->where('is_authenticated', 1)->where('is_online', 1)->get(); @@ -159,8 +154,7 @@ public function syncCheck($returnData = false) return $returnArray; } - public function syncCheckBySite($siteId) - { + public function syncCheckBySite($siteId) { try { $url = $this->rootUrl; $sparkMeterModels = $this->sparkMeterApiRequests->get($url, $siteId); @@ -196,8 +190,7 @@ public function syncCheckBySite($siteId) } } - public function modelHasher($model, ...$params): string - { + public function modelHasher($model, ...$params): string { return $smModelHash = $this->smTableEncryption->makeHash([ $model['account_type'], $model['active'], diff --git a/src/backend/packages/inensus/spark-meter/src/Services/SmSettingService.php b/src/backend/packages/inensus/spark-meter/src/Services/SmSettingService.php index f24536d3c..43fda9fa4 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/SmSettingService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/SmSettingService.php @@ -4,17 +4,14 @@ use Inensus\SparkMeter\Models\SmSetting; -class SmSettingService -{ +class SmSettingService { private $smSetting; - public function __construct(SmSetting $smSetting) - { + public function __construct(SmSetting $smSetting) { $this->smSetting = $smSetting; } - public function getSettings() - { + public function getSettings() { return $this->smSetting->newQuery()->with(['settingSms', 'settingSync'])->whereHasMorph('setting', '*')->get(); } } diff --git a/src/backend/packages/inensus/spark-meter/src/Services/SmSmsBodyService.php b/src/backend/packages/inensus/spark-meter/src/Services/SmSmsBodyService.php index 7e969571b..5e4af91c7 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/SmSmsBodyService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/SmSmsBodyService.php @@ -4,27 +4,22 @@ use Inensus\SparkMeter\Models\SmSmsBody; -class SmSmsBodyService -{ +class SmSmsBodyService { private $smsBody; - public function __construct(SmSmsBody $smsBody) - { + public function __construct(SmSmsBody $smsBody) { $this->smsBody = $smsBody; } - public function getSmsBodyByReference($reference) - { + public function getSmsBodyByReference($reference) { return $this->smsBody->newQuery()->where('reference', $reference)->firstOrFail(); } - public function getSmsBodies() - { + public function getSmsBodies() { return $this->smsBody->newQuery()->get(); } - public function updateSmsBodies($smsBodiesData) - { + public function updateSmsBodies($smsBodiesData) { $smsBodies = $this->smsBody->newQuery()->get(); collect($smsBodiesData)->each(function ($smsBody) use ($smsBodies) { $smsBodies->filter(function ($body) use ($smsBody) { @@ -37,13 +32,11 @@ public function updateSmsBodies($smsBodiesData) return $smsBodies; } - public function getNullBodies() - { + public function getNullBodies() { return $this->smsBody->newQuery()->whereNull('body')->get(); } - public function createSmsBodies() - { + public function createSmsBodies() { $smsBodies = [ [ 'reference' => 'SparkSmsLowBalanceHeader', diff --git a/src/backend/packages/inensus/spark-meter/src/Services/SmSmsFeedbackWordService.php b/src/backend/packages/inensus/spark-meter/src/Services/SmSmsFeedbackWordService.php index f140fc758..3f5a9eed3 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/SmSmsFeedbackWordService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/SmSmsFeedbackWordService.php @@ -4,30 +4,25 @@ use Inensus\SparkMeter\Models\SmSmsFeedbackWord; -class SmSmsFeedbackWordService -{ +class SmSmsFeedbackWordService { private $smsFeedbackWord; - public function __construct(SmSmsFeedbackWord $smsFeedbackWord) - { + public function __construct(SmSmsFeedbackWord $smsFeedbackWord) { $this->smsFeedbackWord = $smsFeedbackWord; } - public function getSmsFeedbackWords() - { + public function getSmsFeedbackWords() { return $this->smsFeedbackWord->newQuery()->get(); } - public function createSmsFeedbackWord() - { + public function createSmsFeedbackWord() { return $this->smsFeedbackWord->newQuery()->firstOrCreate(['id' => 1], [ 'meter_reset' => null, 'meter_balance' => null, ]); } - public function updateSmsFeedbackWord($smsFeedbackWord, $smsFeedbackWordData) - { + public function updateSmsFeedbackWord($smsFeedbackWord, $smsFeedbackWordData) { $smsFeedbackWord->update([ 'meter_reset' => $smsFeedbackWordData['meter_reset'], 'meter_balance' => $smsFeedbackWordData['meter_balance'], diff --git a/src/backend/packages/inensus/spark-meter/src/Services/SmSmsNotifiedCustomerService.php b/src/backend/packages/inensus/spark-meter/src/Services/SmSmsNotifiedCustomerService.php index 814e101f5..91f7e07a8 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/SmSmsNotifiedCustomerService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/SmSmsNotifiedCustomerService.php @@ -4,8 +4,7 @@ use Inensus\SparkMeter\Models\SmSmsNotifiedCustomer; -class SmSmsNotifiedCustomerService -{ +class SmSmsNotifiedCustomerService { private $smSmsNotifiedCustomer; public function __construct( @@ -14,13 +13,11 @@ public function __construct( $this->smSmsNotifiedCustomer = $smSmsNotifiedCustomer; } - public function getSmsNotifiedCustomers() - { + public function getSmsNotifiedCustomers() { return $this->smSmsNotifiedCustomer->newQuery()->get(); } - public function createTransactionSmsNotify($customerId, $transactionId) - { + public function createTransactionSmsNotify($customerId, $transactionId) { return $this->smSmsNotifiedCustomer->newQuery()->create([ 'customer_id' => $customerId, 'notify_type' => 'transaction', @@ -28,16 +25,14 @@ public function createTransactionSmsNotify($customerId, $transactionId) ]); } - public function createLowBalanceSmsNotify($customerId) - { + public function createLowBalanceSmsNotify($customerId) { return $this->smSmsNotifiedCustomer->newQuery()->create([ 'customer_id' => $customerId, 'notify_type' => 'low_balance', ]); } - public function removeLowBalancedCustomer($customer) - { + public function removeLowBalancedCustomer($customer) { if ($customer['low_balance_limit'] >= $customer['credit_balance']) { return false; } diff --git a/src/backend/packages/inensus/spark-meter/src/Services/SmSmsSettingService.php b/src/backend/packages/inensus/spark-meter/src/Services/SmSmsSettingService.php index 7d3f76f90..794d60973 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/SmSmsSettingService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/SmSmsSettingService.php @@ -5,20 +5,17 @@ use Inensus\SparkMeter\Models\SmSetting; use Inensus\SparkMeter\Models\SmSmsSetting; -class SmSmsSettingService -{ +class SmSmsSettingService { private $smsSetting; private $setting; - public function __construct(SmSmsSetting $smsSetting, SmSetting $setting) - { + public function __construct(SmSmsSetting $smsSetting, SmSetting $setting) { $this->smsSetting = $smsSetting; $this->setting = $setting; } - public function createDefaultSettings() - { + public function createDefaultSettings() { $smsTransaction = $this->smsSetting->newQuery()->where('state', 'Transactions')->first(); if (!$smsTransaction) { $smsSetting = $this->setting->newQuery()->make(); @@ -41,8 +38,7 @@ public function createDefaultSettings() } } - public function updateSmsSettings($smsSettings) - { + public function updateSmsSettings($smsSettings) { foreach ($smsSettings as $key => $setting) { $smsSetting = $this->smsSetting->newQuery()->find($setting['id']); if ($smsSetting) { @@ -56,8 +52,7 @@ public function updateSmsSettings($smsSettings) return $this->smsSetting->newQuery()->get(); } - public function getSmsSettings() - { + public function getSmsSettings() { return $this->smsSetting->newQuery()->get(); } } diff --git a/src/backend/packages/inensus/spark-meter/src/Services/SmSmsVariableDefaultValueService.php b/src/backend/packages/inensus/spark-meter/src/Services/SmSmsVariableDefaultValueService.php index 7d5d8b41d..dab2b8afd 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/SmSmsVariableDefaultValueService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/SmSmsVariableDefaultValueService.php @@ -4,22 +4,18 @@ use Inensus\SparkMeter\Models\SmSmsVariableDefaultValue; -class SmSmsVariableDefaultValueService -{ +class SmSmsVariableDefaultValueService { private $smsVariableDefaultValue; - public function __construct(SmSmsVariableDefaultValue $smsVariableDefaultValue) - { + public function __construct(SmSmsVariableDefaultValue $smsVariableDefaultValue) { $this->smsVariableDefaultValue = $smsVariableDefaultValue; } - public function getSmsVariableDefaultValues() - { + public function getSmsVariableDefaultValues() { return $this->smsVariableDefaultValue->newQuery()->get(); } - public function createSmsVariableDefaultValues() - { + public function createSmsVariableDefaultValues() { $smsVariableDefaultValues = [ [ 'variable' => 'name', diff --git a/src/backend/packages/inensus/spark-meter/src/Services/SmSyncActionService.php b/src/backend/packages/inensus/spark-meter/src/Services/SmSyncActionService.php index f2de4658a..f3dbc24b6 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/SmSyncActionService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/SmSyncActionService.php @@ -6,32 +6,26 @@ use Carbon\CarbonInterval; use Inensus\SparkMeter\Models\SmSyncAction; -class SmSyncActionService -{ +class SmSyncActionService { private $syncAction; - public function __construct(SmSyncAction $syncAction) - { + public function __construct(SmSyncAction $syncAction) { $this->syncAction = $syncAction; } - public function createSyncAction($syncAction) - { + public function createSyncAction($syncAction) { return $this->syncAction->newQuery()->create($syncAction); } - public function getSyncActionBySynSettingId($settingId) - { + public function getSyncActionBySynSettingId($settingId) { return $this->syncAction->newQuery()->where('sync_setting_id', $settingId)->first(); } - public function getActionsNeedsToSync() - { + public function getActionsNeedsToSync() { return $this->syncAction->newQuery()->where('next_sync', '<=', Carbon::now())->orderBy('next_sync')->get(); } - public function updateSyncAction($syncAction, $syncSetting, $syncResult) - { + public function updateSyncAction($syncAction, $syncSetting, $syncResult) { if (!$syncResult) { return $syncAction->update([ 'attempts' => $syncAction->attempts + 1, diff --git a/src/backend/packages/inensus/spark-meter/src/Services/SmSyncSettingService.php b/src/backend/packages/inensus/spark-meter/src/Services/SmSyncSettingService.php index 1e68cdb16..9a4bcaaa5 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/SmSyncSettingService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/SmSyncSettingService.php @@ -8,23 +8,20 @@ use Inensus\SparkMeter\Models\SmSetting; use Inensus\SparkMeter\Models\SmSyncSetting; -class SmSyncSettingService -{ +class SmSyncSettingService { private $syncSetting; private $setting; private $syncActionService; - public function __construct(SmSyncSetting $syncSetting, SmSetting $setting, SmSyncActionService $syncActionService) - { + public function __construct(SmSyncSetting $syncSetting, SmSetting $setting, SmSyncActionService $syncActionService) { $this->syncSetting = $syncSetting; $this->setting = $setting; $this->syncActionService = $syncActionService; } - public function createDefaultSettings() - { + public function createDefaultSettings() { $dayInterval = CarbonInterval::make('1day'); $fiveMinInterval = CarbonInterval::make('5minute'); @@ -138,8 +135,7 @@ public function createDefaultSettings() } } - public function updateSyncSettings($syncSettings) - { + public function updateSyncSettings($syncSettings) { foreach ($syncSettings as $setting) { $syncSetting = $this->syncSetting->newQuery()->find($setting['id']); $intervalStr = $setting['sync_in_value_num'].$setting['sync_in_value_str']; @@ -164,13 +160,11 @@ public function updateSyncSettings($syncSettings) return $this->syncSetting->newQuery()->get(); } - public function getSyncSettings() - { + public function getSyncSettings() { return $this->syncSetting->newQuery()->get(); } - public function getSyncSettingsByActionName($actionName) - { + public function getSyncSettingsByActionName($actionName) { try { return $this->syncSetting->newQuery()->where('action_name', $actionName)->firstOrFail(); } catch (ModelNotFoundException $exception) { diff --git a/src/backend/packages/inensus/spark-meter/src/Services/TariffService.php b/src/backend/packages/inensus/spark-meter/src/Services/TariffService.php index f13f02f73..3eccae474 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/TariffService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/TariffService.php @@ -14,8 +14,7 @@ use Inensus\SparkMeter\Models\SmTariff; use Inensus\SparkMeter\Models\SyncStatus; -class TariffService implements ISynchronizeService -{ +class TariffService implements ISynchronizeService { private $sparkMeterApiRequests; private $rootUrl = '/tariffs'; @@ -62,8 +61,7 @@ public function __construct( $this->smSyncActionService = $smSyncActionService; } - public function createSmTariff($tariff, $siteId) - { + public function createSmTariff($tariff, $siteId) { $touEnabled = count($tariff->tou) > 0; $maxValue = $this->smMeterModel->newQuery()->max('continuous_limit'); $tous = []; @@ -137,20 +135,17 @@ public function createSmTariff($tariff, $siteId) } } - public function getSmTariffs($request) - { + public function getSmTariffs($request) { $perPage = $request->input('per_page') ?? 15; return $this->smTariff->newQuery()->with(['mpmTariff', 'site.mpmMiniGrid'])->paginate($perPage); } - public function getSmTariffsCount() - { + public function getSmTariffsCount() { return count($this->smTariff->newQuery()->get()); } - public function createRelatedTariff($tariff) - { + public function createRelatedTariff($tariff) { $meterTariff = $this->meterTariff->newQuery()->create([ 'name' => $tariff['name'], 'price' => $tariff['flat_price'] * 100, @@ -172,8 +167,7 @@ public function createRelatedTariff($tariff) return $meterTariff; } - public function updateRelatedTariff($model, $tariff) - { + public function updateRelatedTariff($model, $tariff) { if (count($model['tous']) === count($tariff->tou)) { foreach ($model['tous'] as $key => $tou) { $tariff->tou[$key]->start = $tou['start']; @@ -216,8 +210,7 @@ public function updateRelatedTariff($model, $tariff) } } - private function setAccessRate($model, $tariffId, $planEnabled) - { + private function setAccessRate($model, $tariffId, $planEnabled) { $accessRate = $this->accessRate->newQuery()->where('tariff_id', $tariffId)->first(); $duration = array_key_exists('plan_duration', $model) ? $model['plan_duration'] : '1m'; if ($accessRate) { @@ -241,8 +234,7 @@ private function setAccessRate($model, $tariffId, $planEnabled) } } - public function getSparkTariffInfo($tariffId) - { + public function getSparkTariffInfo($tariffId) { try { $smTariff = $this->smTariff->newQuery()->with(['mpmTariff.accessRate', 'site'])->where( 'tariff_id', @@ -257,8 +249,7 @@ public function getSparkTariffInfo($tariffId) } } - public function updateSparkTariffInfo($tariffData) - { + public function updateSparkTariffInfo($tariffData) { try { $tariffId = $tariffData['id']; $smTariff = $this->smTariff->newQuery()->where('tariff_id', $tariffId)->first(); @@ -292,8 +283,7 @@ public function updateSparkTariffInfo($tariffData) } } - public function singleSync($smTariff) - { + public function singleSync($smTariff) { $tariff = $this->getSparkTariffInfo($smTariff->tariff_id); $modelHash = $this->modelHasher($tariff, null); @@ -325,8 +315,7 @@ public function singleSync($smTariff) return $relatedTariff; } - public function sync() - { + public function sync() { $synSetting = $this->smSyncSettingService->getSyncSettingsByActionName('Tariffs'); $syncAction = $this->smSyncActionService->getSyncActionBySynSettingId($synSetting->id); try { @@ -397,8 +386,7 @@ public function sync() } } - public function syncCheck($returnData = false) - { + public function syncCheck($returnData = false) { $returnArray = ['available_site_count' => 0]; $sites = $this->smSite->newQuery()->where('is_authenticated', 1)->where('is_online', 1)->get(); @@ -458,8 +446,7 @@ public function syncCheck($returnData = false) return $returnArray; } - public function modelHasher($model, ...$params): string - { + public function modelHasher($model, ...$params): string { $modelTouString = ''; foreach ($model['tous'] as $item) { $modelTouString .= $item['start'].$item['end'].floatval($item['value']); @@ -472,8 +459,7 @@ public function modelHasher($model, ...$params): string ]); } - public function syncCheckBySite($siteId) - { + public function syncCheckBySite($siteId) { try { $tariffs = $this->sparkMeterApiRequests->get($this->rootUrl, $siteId); } catch (SparkAPIResponseException $e) { diff --git a/src/backend/packages/inensus/spark-meter/src/Services/TransactionService.php b/src/backend/packages/inensus/spark-meter/src/Services/TransactionService.php index 5df1ee641..5b5b61a90 100644 --- a/src/backend/packages/inensus/spark-meter/src/Services/TransactionService.php +++ b/src/backend/packages/inensus/spark-meter/src/Services/TransactionService.php @@ -19,8 +19,7 @@ use Inensus\SparkMeter\Models\SmTariff; use Inensus\SparkMeter\Models\SmTransaction; -class TransactionService -{ +class TransactionService { private $sparkMeterApiRequests; private $sparkOrganization; @@ -91,8 +90,7 @@ public function __construct( $this->smSyncActionService = $smSyncActionService; } - public function updateTransactionStatus($smTransaction) - { + public function updateTransactionStatus($smTransaction) { try { $smTransactionResult = $this->sparkMeterApiRequests->getInfo( $this->rootUrl, @@ -152,8 +150,7 @@ public function updateTransactionStatus($smTransaction) ]); } - public function sync() - { + public function sync() { $synSetting = $this->smSyncSettingService->getSyncSettingsByActionName('Transactions'); $syncAction = $this->smSyncActionService->getSyncActionBySynSettingId($synSetting->id); $syncCheck = []; @@ -311,8 +308,7 @@ public function sync() $this->smSyncActionService->updateSyncAction($syncAction, $synSetting, true); } - public function syncCheck() - { + public function syncCheck() { $credentials = $this->sparkCredentialService->getCredentials(); $sparkSites = $this->sparkSite->newQuery()->where('is_authenticated', 1)->where('is_online', 1)->get(); @@ -347,8 +343,7 @@ public function syncCheck() }); } - private function createSparkTransaction($transaction) - { + private function createSparkTransaction($transaction) { return $this->sparkTransaction->newQuery()->create([ 'site_id' => $transaction['site'], 'customer_id' => $transaction['to']['customer']['id'], @@ -359,8 +354,7 @@ private function createSparkTransaction($transaction) ]); } - public function getSparkTransactions($transactionMin) - { + public function getSparkTransactions($transactionMin) { $transactions = $this->sparkTransaction->newQuery()->with(['thirdPartyTransaction.transaction'])->where( 'status', 'processed' @@ -371,8 +365,7 @@ public function getSparkTransactions($transactionMin) }); } - private function createThirdPartyTransaction($transaction, $sparkTransaction, $status) - { + private function createThirdPartyTransaction($transaction, $sparkTransaction, $status) { $thirdPartyTransaction = $this->thirdPartyTransaction->newQuery()->make([ 'transaction_id' => $transaction['transaction_id'], 'status' => $status, @@ -383,8 +376,7 @@ private function createThirdPartyTransaction($transaction, $sparkTransaction, $s return $thirdPartyTransaction; } - private function createTransaction($transaction, $thirdPartyTransaction, $meterParameter) - { + private function createTransaction($transaction, $thirdPartyTransaction, $meterParameter) { $transaction = $this->transaction->newQuery()->make([ 'amount' => (int) $transaction['amount'], 'sender' => $sparkCustomer->mpmPerson->addresses[0]->phone ?? '-', @@ -400,8 +392,7 @@ private function createTransaction($transaction, $thirdPartyTransaction, $meterP return $transaction; } - private function createToken($sparkTariff, $mainTransaction, $transaction, $sparkTransaction, $meterParameter) - { + private function createToken($sparkTariff, $mainTransaction, $transaction, $sparkTransaction, $meterParameter) { try { $tariff = $this->sparkTariffService->singleSync($sparkTariff); } catch (SparkAPIResponseException $exception) { @@ -423,8 +414,7 @@ private function createToken($sparkTariff, $mainTransaction, $transaction, $spar return $token; } - private function createPayment($meterParameter, $mainTransaction, $token) - { + private function createPayment($meterParameter, $mainTransaction, $token) { $owner = $meterParameter->owner; event('payment.successful', [ 'amount' => $mainTransaction->amount, diff --git a/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsBalanceFeedbackBody.php b/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsBalanceFeedbackBody.php index 44a9dc17a..af6a17a65 100644 --- a/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsBalanceFeedbackBody.php +++ b/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsBalanceFeedbackBody.php @@ -5,19 +5,16 @@ use App\Sms\BodyParsers\SmsBodyParser; use Inensus\SparkMeter\Models\SmCustomer; -class SparkSmsBalanceFeedbackBody extends SmsBodyParser -{ +class SparkSmsBalanceFeedbackBody extends SmsBodyParser { protected $variables = ['credit_balance']; protected $sparkCustomer; - public function __construct(SmCustomer $sparkCustomer) - { + public function __construct(SmCustomer $sparkCustomer) { $this->sparkCustomer = $sparkCustomer; } - protected function getVariableValue($variable) - { + protected function getVariableValue($variable) { switch ($variable) { case 'credit_balance': $variable = $this->sparkCustomer->credit_balance; diff --git a/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsBalanceFeedbackHeader.php b/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsBalanceFeedbackHeader.php index 8a53d051a..0d428afaa 100644 --- a/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsBalanceFeedbackHeader.php +++ b/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsBalanceFeedbackHeader.php @@ -5,19 +5,16 @@ use App\Sms\BodyParsers\SmsBodyParser; use Inensus\SparkMeter\Models\SmCustomer; -class SparkSmsBalanceFeedbackHeader extends SmsBodyParser -{ +class SparkSmsBalanceFeedbackHeader extends SmsBodyParser { protected $variables = ['name', 'surname']; protected $sparkCustomer; - public function __construct(SmCustomer $sparkCustomer) - { + public function __construct(SmCustomer $sparkCustomer) { $this->sparkCustomer = $sparkCustomer; } - protected function getVariableValue($variable) - { + protected function getVariableValue($variable) { switch ($variable) { case 'name': $variable = $this->sparkCustomer->mpmPerson->name; diff --git a/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsLowBalanceBody.php b/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsLowBalanceBody.php index b46cd453e..9d00e1f79 100644 --- a/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsLowBalanceBody.php +++ b/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsLowBalanceBody.php @@ -5,19 +5,16 @@ use App\Sms\BodyParsers\SmsBodyParser; use Inensus\SparkMeter\Models\SmCustomer; -class SparkSmsLowBalanceBody extends SmsBodyParser -{ +class SparkSmsLowBalanceBody extends SmsBodyParser { protected $variables = ['low_balance_limit', 'credit_balance']; protected $sparkCustomer; - public function __construct(SmCustomer $sparkCustomer) - { + public function __construct(SmCustomer $sparkCustomer) { $this->sparkCustomer = $sparkCustomer; } - protected function getVariableValue($variable) - { + protected function getVariableValue($variable) { switch ($variable) { case 'low_balance_limit': $variable = $this->sparkCustomer->low_balance_limit; diff --git a/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsLowBalanceHeader.php b/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsLowBalanceHeader.php index 525c42d45..742061be0 100644 --- a/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsLowBalanceHeader.php +++ b/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsLowBalanceHeader.php @@ -5,19 +5,16 @@ use App\Sms\BodyParsers\SmsBodyParser; use Inensus\SparkMeter\Models\SmCustomer; -class SparkSmsLowBalanceHeader extends SmsBodyParser -{ +class SparkSmsLowBalanceHeader extends SmsBodyParser { protected $variables = ['name', 'surname']; protected $sparkCustomer; - public function __construct(SmCustomer $sparkCustomer) - { + public function __construct(SmCustomer $sparkCustomer) { $this->sparkCustomer = $sparkCustomer; } - protected function getVariableValue($variable) - { + protected function getVariableValue($variable) { switch ($variable) { case 'name': $variable = $this->sparkCustomer->mpmPerson->name; diff --git a/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsMeterResetFailedFeedbackBody.php b/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsMeterResetFailedFeedbackBody.php index 5f9a92c6c..27544a302 100644 --- a/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsMeterResetFailedFeedbackBody.php +++ b/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsMeterResetFailedFeedbackBody.php @@ -4,19 +4,16 @@ use App\Sms\BodyParsers\SmsBodyParser; -class SparkSmsMeterResetFailedFeedbackBody extends SmsBodyParser -{ +class SparkSmsMeterResetFailedFeedbackBody extends SmsBodyParser { protected $variables = ['meter_serial']; protected $data; - public function __construct($data) - { + public function __construct($data) { $this->data = $data; } - protected function getVariableValue($variable) - { + protected function getVariableValue($variable) { switch ($variable) { case 'meter_serial': $variable = $this->data['meter']; diff --git a/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsMeterResetFeedbackBody.php b/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsMeterResetFeedbackBody.php index 0aafc8076..57990d9df 100644 --- a/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsMeterResetFeedbackBody.php +++ b/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsMeterResetFeedbackBody.php @@ -4,19 +4,16 @@ use App\Sms\BodyParsers\SmsBodyParser; -class SparkSmsMeterResetFeedbackBody extends SmsBodyParser -{ +class SparkSmsMeterResetFeedbackBody extends SmsBodyParser { protected $variables = ['meter_serial']; protected $meter; - public function __construct($meter) - { + public function __construct($meter) { $this->meter = $meter; } - protected function getVariableValue($variable) - { + protected function getVariableValue($variable) { switch ($variable) { case 'meter_serial': $variable = $this->meter->serial_number; diff --git a/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsMeterResetFeedbackHeader.php b/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsMeterResetFeedbackHeader.php index d683c5b7c..1bcba6201 100644 --- a/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsMeterResetFeedbackHeader.php +++ b/src/backend/packages/inensus/spark-meter/src/Sms/BodyParsers/SparkSmsMeterResetFeedbackHeader.php @@ -5,19 +5,16 @@ use App\Models\Person\Person; use App\Sms\BodyParsers\SmsBodyParser; -class SparkSmsMeterResetFeedbackHeader extends SmsBodyParser -{ +class SparkSmsMeterResetFeedbackHeader extends SmsBodyParser { protected $variables = ['name', 'surname']; protected $data; - public function __construct($data) - { + public function __construct($data) { $this->data = $data; } - protected function getVariableValue($variable) - { + protected function getVariableValue($variable) { if (!is_array($this->data)) { $person = $this->data->meterParameter->whereHasMorph('owner', [Person::class])->first()->owner()->first(); } else { diff --git a/src/backend/packages/inensus/spark-meter/src/Sms/Senders/BalanceFeedback.php b/src/backend/packages/inensus/spark-meter/src/Sms/Senders/BalanceFeedback.php index 339b44955..15e1d0ebe 100644 --- a/src/backend/packages/inensus/spark-meter/src/Sms/Senders/BalanceFeedback.php +++ b/src/backend/packages/inensus/spark-meter/src/Sms/Senders/BalanceFeedback.php @@ -4,8 +4,7 @@ use App\Sms\Senders\SmsSender; -class BalanceFeedback extends SmsSender -{ +class BalanceFeedback extends SmsSender { protected $references = [ 'header' => 'SparkSmsBalanceFeedbackHeader', 'body' => 'SparkSmsBalanceFeedbackBody', diff --git a/src/backend/packages/inensus/spark-meter/src/Sms/Senders/LowBalanceLimitNotifier.php b/src/backend/packages/inensus/spark-meter/src/Sms/Senders/LowBalanceLimitNotifier.php index d1b3b44af..4b3f1a42f 100644 --- a/src/backend/packages/inensus/spark-meter/src/Sms/Senders/LowBalanceLimitNotifier.php +++ b/src/backend/packages/inensus/spark-meter/src/Sms/Senders/LowBalanceLimitNotifier.php @@ -4,8 +4,7 @@ use App\Sms\Senders\SmsSender; -class LowBalanceLimitNotifier extends SmsSender -{ +class LowBalanceLimitNotifier extends SmsSender { protected $references = [ 'header' => 'SparkSmsLowBalanceHeader', 'body' => 'SparkSmsLowBalanceBody', diff --git a/src/backend/packages/inensus/spark-meter/src/Sms/Senders/MeterResetFeedback.php b/src/backend/packages/inensus/spark-meter/src/Sms/Senders/MeterResetFeedback.php index 1fc1c8e03..f0932375c 100644 --- a/src/backend/packages/inensus/spark-meter/src/Sms/Senders/MeterResetFeedback.php +++ b/src/backend/packages/inensus/spark-meter/src/Sms/Senders/MeterResetFeedback.php @@ -9,8 +9,7 @@ use Inensus\SparkMeter\Sms\BodyParsers\SparkSmsMeterResetFailedFeedbackBody; use Inensus\SparkMeter\Sms\BodyParsers\SparkSmsMeterResetFeedbackBody; -class MeterResetFeedback extends SmsSender -{ +class MeterResetFeedback extends SmsSender { protected $data; public $body = ''; @@ -21,8 +20,7 @@ class MeterResetFeedback extends SmsSender 'footer' => 'SparkSmsMeterResetFeedbackFooter', ]; - public function prepareBody() - { + public function prepareBody() { if (!is_array($this->data)) { try { $smsBody = $this->smsBodyService->getSmsBodyByReference('SparkSmsMeterResetFeedbackBody'); diff --git a/src/backend/packages/inensus/spark-meter/src/Sms/Senders/SparkSmsConfig.php b/src/backend/packages/inensus/spark-meter/src/Sms/Senders/SparkSmsConfig.php index 364af9af9..d4b8970f3 100644 --- a/src/backend/packages/inensus/spark-meter/src/Sms/Senders/SparkSmsConfig.php +++ b/src/backend/packages/inensus/spark-meter/src/Sms/Senders/SparkSmsConfig.php @@ -5,8 +5,7 @@ use App\Sms\Senders\SmsConfigsCore; use Inensus\SparkMeter\Sms\SparkSmsTypes; -class SparkSmsConfig extends SmsConfigsCore -{ +class SparkSmsConfig extends SmsConfigsCore { public $smsTypes = [ SparkSmsTypes::LOW_BALANCE_LIMIT_NOTIFIER => 'Inensus\SparkMeter\Sms\Senders\LowBalanceLimitNotifier', SparkSmsTypes::BALANCE_FEEDBACK => 'Inensus\SparkMeter\Sms\Senders\BalanceFeedback', diff --git a/src/backend/packages/inensus/spark-meter/src/Sms/SparkSmsTypes.php b/src/backend/packages/inensus/spark-meter/src/Sms/SparkSmsTypes.php index 46372c37a..3fc5d3d8c 100644 --- a/src/backend/packages/inensus/spark-meter/src/Sms/SparkSmsTypes.php +++ b/src/backend/packages/inensus/spark-meter/src/Sms/SparkSmsTypes.php @@ -2,8 +2,7 @@ namespace Inensus\SparkMeter\Sms; -class SparkSmsTypes -{ +class SparkSmsTypes { public const LOW_BALANCE_LIMIT_NOTIFIER = 1; public const BALANCE_FEEDBACK = 2; diff --git a/src/backend/packages/inensus/spark-meter/src/SparkMeterApi.php b/src/backend/packages/inensus/spark-meter/src/SparkMeterApi.php index 7fbc2d248..b825faa73 100644 --- a/src/backend/packages/inensus/spark-meter/src/SparkMeterApi.php +++ b/src/backend/packages/inensus/spark-meter/src/SparkMeterApi.php @@ -14,8 +14,7 @@ use Inensus\SparkMeter\Models\SmTransaction; use Inensus\SparkMeter\Services\TariffService; -class SparkMeterApi implements IManufacturerAPI -{ +class SparkMeterApi implements IManufacturerAPI { protected $api; private $rootUrl = '/transaction/'; @@ -31,8 +30,7 @@ public function __construct( $this->api = $httpClient; } - public function chargeDevice($transactionContainer): array - { + public function chargeDevice($transactionContainer): array { $meter = $transactionContainer->device->device; $tariff = $transactionContainer->tariff; $owner = $transactionContainer->device->person; @@ -132,8 +130,7 @@ public function chargeDevice($transactionContainer): array } } - public function clearDevice(Device $device) - { + public function clearDevice(Device $device) { // TODO: Implement clearDevice() method. } } diff --git a/src/backend/packages/inensus/spark-meter/src/Tests/Feature/SendSms.php b/src/backend/packages/inensus/spark-meter/src/Tests/Feature/SendSms.php index 3ec916662..21735a317 100644 --- a/src/backend/packages/inensus/spark-meter/src/Tests/Feature/SendSms.php +++ b/src/backend/packages/inensus/spark-meter/src/Tests/Feature/SendSms.php @@ -21,13 +21,11 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class SendSms extends TestCase -{ +class SendSms extends TestCase { use RefreshDatabase; /** @test */ - public function isMeterResetFeedbackSend() - { + public function isMeterResetFeedbackSend() { Queue::fake(); $this->withoutExceptionHandling(); $person = $this->initializeData()['customer']; @@ -44,8 +42,7 @@ public function isMeterResetFeedbackSend() } /** @test */ - public function isMeterBalanceFeedbackSend() - { + public function isMeterBalanceFeedbackSend() { Queue::fake(); $this->withoutExceptionHandling(); $person = $this->initializeData()['customer']; @@ -60,8 +57,7 @@ public function isMeterBalanceFeedbackSend() $this->assertEquals(2, $smsCount); } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); @@ -69,8 +65,7 @@ public function actingAs($user, $driver = null) return $this; } - private function initializeData() - { + private function initializeData() { $this->addSmsBodies(); $this->addFeedBackKeys(); factory(MainSettings::class)->create(); @@ -141,8 +136,7 @@ private function initializeData() return ['customer' => $p]; } - private function addSmsBodies() - { + private function addSmsBodies() { $bodies = [ [ 'reference' => 'SmsTransactionHeader', @@ -316,8 +310,7 @@ private function addSmsBodies() return SmsBody::query()->get(); } - private function addFeedBackKeys() - { + private function addFeedBackKeys() { SmSmsFeedbackWord::query()->create([ 'meter_reset' => 'Reset', 'meter_balance' => 'Balance', diff --git a/src/backend/packages/inensus/spark-meter/src/Tests/Unit/SmsNotifyTest.php b/src/backend/packages/inensus/spark-meter/src/Tests/Unit/SmsNotifyTest.php index 81eb04602..50c22b1a8 100644 --- a/src/backend/packages/inensus/spark-meter/src/Tests/Unit/SmsNotifyTest.php +++ b/src/backend/packages/inensus/spark-meter/src/Tests/Unit/SmsNotifyTest.php @@ -32,13 +32,11 @@ use Inensus\SparkMeter\Sms\SparkSmsTypes; use Tests\TestCase; -class SmsNotifyTest extends TestCase -{ +class SmsNotifyTest extends TestCase { use RefreshDatabase; /** @test */ - public function isLowBalanceNotifySend() - { + public function isLowBalanceNotifySend() { Queue::fake(); $this->initializeData(); $lowBalanceMin = SmSmsSetting::query()->where( @@ -91,8 +89,7 @@ public function isLowBalanceNotifySend() } /** @test */ - public function isTransactionNotifySend() - { + public function isTransactionNotifySend() { Queue::fake(); $data = $this->initializeData(); $this->initializeSparkTransaction($data['customer']); @@ -148,8 +145,7 @@ public function isTransactionNotifySend() } /** @test */ - public function isMaxAttemptNotifySend() - { + public function isMaxAttemptNotifySend() { Queue::fake(); $this->addSyncSettings(); $this->initializeAdminData(); @@ -188,8 +184,7 @@ public function isMaxAttemptNotifySend() $this->assertLessThan($oldNextSync, $newNextSync); } - private function initializeData() - { + private function initializeData() { $this->addSmsSettings(); $this->addSmsBodies(); // create person @@ -251,8 +246,7 @@ private function initializeData() return ['customer' => $p]; } - private function initializeSparkTransaction($customer) - { + private function initializeSparkTransaction($customer) { $sparkTransaction = SmTransaction::query()->create([ 'site_id' => 1, 'customer_id' => $customer->id, @@ -282,8 +276,7 @@ private function initializeSparkTransaction($customer) $transaction->save(); } - private function initializeAdminData() - { + private function initializeAdminData() { $user = factory(User::class)->create(); $address = Address::query()->make([ 'phone' => '+905494322161', @@ -294,8 +287,7 @@ private function initializeAdminData() $address->save(); } - private function addSmsSettings() - { + private function addSmsSettings() { $smsSetting = SmSetting::query()->make(); $smsTransaction = SmSmsSetting::query()->create([ @@ -319,8 +311,7 @@ private function addSmsSettings() $balanceSetting->save(); } - private function addSyncSettings() - { + private function addSyncSettings() { $minInterval = CarbonInterval::make('1minute'); $now = Carbon::now(); $siteSetting = SmSetting::query()->make(); @@ -340,8 +331,7 @@ private function addSyncSettings() SmSyncAction::query()->create($syncAction); } - private function addSmsBodies() - { + private function addSmsBodies() { $bodies = [ [ 'reference' => 'SmsTransactionHeader', diff --git a/src/backend/packages/inensus/steama-meter/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/steama-meter/src/Console/Commands/InstallPackage.php index 3d993784f..260f956f4 100644 --- a/src/backend/packages/inensus/steama-meter/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/steama-meter/src/Console/Commands/InstallPackage.php @@ -17,8 +17,7 @@ use Inensus\SteamaMeter\Services\SteamaTariffService; use Inensus\SteamaMeter\Services\SteamaUserTypeService; -class InstallPackage extends Command -{ +class InstallPackage extends Command { protected $signature = 'steama-meter:install'; protected $description = 'Install Steamaco Meter Package'; @@ -41,8 +40,7 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { $this->info('Installing Steamaco Meter Integration Package\n'); // $this->publishMigrations(); @@ -66,8 +64,7 @@ public function handle(): void } } - private function publishMigrations() - { + private function publishMigrations() { $this->info('Copying migrations\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\SteamaMeter\Providers\SteamaMeterServiceProvider", @@ -75,14 +72,12 @@ private function publishMigrations() ]); } - private function createDatabaseTables() - { + private function createDatabaseTables() { $this->info('Creating database tables\n'); $this->call('migrate'); } - private function publishVueFiles() - { + private function publishVueFiles() { $this->info('Copying vue files\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\SteamaMeter\Providers\SteamaMeterServiceProvider", @@ -91,8 +86,7 @@ private function publishVueFiles() ]); } - private function createPluginRecord() - { + private function createPluginRecord() { $this->call('plugin:add', [ 'name' => 'SteamaMeter', 'composer_name' => 'inensus/steama-meter', diff --git a/src/backend/packages/inensus/steama-meter/src/Console/Commands/ReadHourlyMeterReadings.php b/src/backend/packages/inensus/steama-meter/src/Console/Commands/ReadHourlyMeterReadings.php index 4d4d6a366..1e2f1f466 100644 --- a/src/backend/packages/inensus/steama-meter/src/Console/Commands/ReadHourlyMeterReadings.php +++ b/src/backend/packages/inensus/steama-meter/src/Console/Commands/ReadHourlyMeterReadings.php @@ -7,8 +7,7 @@ use Carbon\Carbon; use Inensus\SteamaMeter\Services\SteamaMeterReadingService; -class ReadHourlyMeterReadings extends AbstractSharedCommand -{ +class ReadHourlyMeterReadings extends AbstractSharedCommand { use ScheduledPluginCommand; public const MPM_PLUGIN_ID = 2; @@ -17,13 +16,11 @@ class ReadHourlyMeterReadings extends AbstractSharedCommand protected $description = 'Reads hourly meter readings.'; - public function __construct(private SteamaMeterReadingService $steamaMeterReadingService) - { + public function __construct(private SteamaMeterReadingService $steamaMeterReadingService) { parent::__construct(); } - public function handle(): void - { + public function handle(): void { if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } diff --git a/src/backend/packages/inensus/steama-meter/src/Console/Commands/SteamaMeterDataSynchronizer.php b/src/backend/packages/inensus/steama-meter/src/Console/Commands/SteamaMeterDataSynchronizer.php index fd1eace4e..73b143b6f 100644 --- a/src/backend/packages/inensus/steama-meter/src/Console/Commands/SteamaMeterDataSynchronizer.php +++ b/src/backend/packages/inensus/steama-meter/src/Console/Commands/SteamaMeterDataSynchronizer.php @@ -20,8 +20,7 @@ use Inensus\SteamaMeter\Services\SteamaTransactionsService; use Inensus\SteamaMeter\Services\StemaSyncActionService; -class SteamaMeterDataSynchronizer extends AbstractSharedCommand -{ +class SteamaMeterDataSynchronizer extends AbstractSharedCommand { use ScheduledPluginCommand; public const MPM_PLUGIN_ID = 2; @@ -71,8 +70,7 @@ public function __construct( $this->cluster = $cluster; } - public function handle(): void - { + public function handle(): void { if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } diff --git a/src/backend/packages/inensus/steama-meter/src/Console/Commands/SteamaSmsNotifier.php b/src/backend/packages/inensus/steama-meter/src/Console/Commands/SteamaSmsNotifier.php index e615ddf9d..d378d6c5d 100644 --- a/src/backend/packages/inensus/steama-meter/src/Console/Commands/SteamaSmsNotifier.php +++ b/src/backend/packages/inensus/steama-meter/src/Console/Commands/SteamaSmsNotifier.php @@ -17,8 +17,7 @@ use Inensus\SteamaMeter\Sms\Senders\SteamaSmsConfig; use Inensus\SteamaMeter\Sms\SteamaSmsTypes; -class SteamaSmsNotifier extends AbstractSharedCommand -{ +class SteamaSmsNotifier extends AbstractSharedCommand { use ScheduledPluginCommand; public const MPM_PLUGIN_ID = 2; @@ -56,8 +55,7 @@ public function __construct( $this->smsService = $smsService; } - private function sendTransactionNotifySms($transactionMin, $smsNotifiedCustomers, $customers) - { + private function sendTransactionNotifySms($transactionMin, $smsNotifiedCustomers, $customers) { $this->steamaTransactionService->getSteamaTransactions($transactionMin) ->each(function ($steamaTransaction) use ($smsNotifiedCustomers, $customers) { $smsNotifiedCustomers = $smsNotifiedCustomers->where( @@ -97,8 +95,7 @@ private function sendTransactionNotifySms($transactionMin, $smsNotifiedCustomers }); } - private function sendLowBalanceWarningNotifySms($customers, $smsNotifiedCustomers, $lowBalanceMin) - { + private function sendLowBalanceWarningNotifySms($customers, $smsNotifiedCustomers, $lowBalanceMin) { $customers->each(function ($customer) use ( $smsNotifiedCustomers ) { @@ -130,8 +127,7 @@ private function sendLowBalanceWarningNotifySms($customers, $smsNotifiedCustomer }); } - public function handle(): void - { + public function handle(): void { if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } diff --git a/src/backend/packages/inensus/steama-meter/src/Console/Commands/UpdatePackage.php b/src/backend/packages/inensus/steama-meter/src/Console/Commands/UpdatePackage.php index f9fa8a7d5..e2303c614 100644 --- a/src/backend/packages/inensus/steama-meter/src/Console/Commands/UpdatePackage.php +++ b/src/backend/packages/inensus/steama-meter/src/Console/Commands/UpdatePackage.php @@ -19,8 +19,7 @@ use Inensus\SteamaMeter\Services\SteamaTariffService; use Inensus\SteamaMeter\Services\SteamaUserTypeService; -class UpdatePackage extends Command -{ +class UpdatePackage extends Command { protected $signature = 'steama-meter:update'; protected $description = 'Install Steamaco Meter Package'; @@ -44,8 +43,7 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { $this->info('Steamaco Meter Integration Updating Started\n'); $this->removeOldVersionOfPackage(); @@ -59,20 +57,17 @@ public function handle(): void $this->info('Package updated successfully..'); } - private function removeOldVersionOfPackage() - { + private function removeOldVersionOfPackage() { $this->info('Removing former version of package\n'); echo shell_exec('COMPOSER_MEMORY_LIMIT=-1 ../composer.phar remove inensus/steama-meter'); } - private function installNewVersionOfPackage() - { + private function installNewVersionOfPackage() { $this->info('Installing last version of package\n'); echo shell_exec('COMPOSER_MEMORY_LIMIT=-1 ../composer.phar require inensus/steama-meter'); } - private function deleteMigration(Filesystem $filesystem) - { + private function deleteMigration(Filesystem $filesystem) { $migrationFile = $filesystem->glob(database_path().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR.'*_create_steama_tables.php')[0]; $migration = DB::table('migrations') ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->first(); @@ -84,8 +79,7 @@ private function deleteMigration(Filesystem $filesystem) ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->delete(); } - private function publishMigrationsAgain() - { + private function publishMigrationsAgain() { $this->info('Copying migrations\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\SteamaMeter\Providers\SteamaMeterServiceProvider", @@ -93,14 +87,12 @@ private function publishMigrationsAgain() ]); } - private function updateDatabase() - { + private function updateDatabase() { $this->info('Updating database tables\n'); $this->call('migrate'); } - private function publishVueFilesAgain() - { + private function publishVueFilesAgain() { $this->info('Copying vue files\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\SteamaMeter\Providers\SteamaMeterServiceProvider", diff --git a/src/backend/packages/inensus/steama-meter/src/Exceptions/CronJobException.php b/src/backend/packages/inensus/steama-meter/src/Exceptions/CronJobException.php index 4ef8e9804..b64feba19 100644 --- a/src/backend/packages/inensus/steama-meter/src/Exceptions/CronJobException.php +++ b/src/backend/packages/inensus/steama-meter/src/Exceptions/CronJobException.php @@ -2,6 +2,4 @@ namespace Inensus\SteamaMeter\Exceptions; -class CronJobException extends \Exception -{ -} +class CronJobException extends \Exception {} diff --git a/src/backend/packages/inensus/steama-meter/src/Exceptions/ModelNotFoundException.php b/src/backend/packages/inensus/steama-meter/src/Exceptions/ModelNotFoundException.php index 609220536..2a743e2f9 100644 --- a/src/backend/packages/inensus/steama-meter/src/Exceptions/ModelNotFoundException.php +++ b/src/backend/packages/inensus/steama-meter/src/Exceptions/ModelNotFoundException.php @@ -2,6 +2,4 @@ namespace Inensus\SteamaMeter\Exceptions; -class ModelNotFoundException extends \Exception -{ -} +class ModelNotFoundException extends \Exception {} diff --git a/src/backend/packages/inensus/steama-meter/src/Exceptions/SteamaApiResponseException.php b/src/backend/packages/inensus/steama-meter/src/Exceptions/SteamaApiResponseException.php index 409427086..219f7d6c7 100644 --- a/src/backend/packages/inensus/steama-meter/src/Exceptions/SteamaApiResponseException.php +++ b/src/backend/packages/inensus/steama-meter/src/Exceptions/SteamaApiResponseException.php @@ -2,6 +2,4 @@ namespace Inensus\SteamaMeter\Exceptions; -class SteamaApiResponseException extends \Exception -{ -} +class SteamaApiResponseException extends \Exception {} diff --git a/src/backend/packages/inensus/steama-meter/src/Exceptions/WrongCredentialsException.php b/src/backend/packages/inensus/steama-meter/src/Exceptions/WrongCredentialsException.php index 8d4b366a8..c77d42a6c 100644 --- a/src/backend/packages/inensus/steama-meter/src/Exceptions/WrongCredentialsException.php +++ b/src/backend/packages/inensus/steama-meter/src/Exceptions/WrongCredentialsException.php @@ -2,6 +2,4 @@ namespace Inensus\SteamaMeter\Exceptions; -class WrongCredentialsException extends \Exception -{ -} +class WrongCredentialsException extends \Exception {} diff --git a/src/backend/packages/inensus/steama-meter/src/Helpers/ApiHelpers.php b/src/backend/packages/inensus/steama-meter/src/Helpers/ApiHelpers.php index 82fdd6d3d..aa3cd417c 100644 --- a/src/backend/packages/inensus/steama-meter/src/Helpers/ApiHelpers.php +++ b/src/backend/packages/inensus/steama-meter/src/Helpers/ApiHelpers.php @@ -5,17 +5,14 @@ use App\Models\Manufacturer; use Inensus\SteamaMeter\Exceptions\SteamaApiResponseException; -class ApiHelpers -{ +class ApiHelpers { private $manufacturer; - public function __construct(Manufacturer $manufacturerModel) - { + public function __construct(Manufacturer $manufacturerModel) { $this->manufacturer = $manufacturerModel; } - public function registerSparkMeterManufacturer() - { + public function registerSparkMeterManufacturer() { $api = $this->manufacturer->newQuery()->where('api_name', 'SteamaMeterApi')->first(); if (!$api) { $this->manufacturer->newQuery()->create([ @@ -26,8 +23,7 @@ public function registerSparkMeterManufacturer() } } - public function checkApiResult($result) - { + public function checkApiResult($result) { if (array_key_exists('detail', $result)) { throw new SteamaApiResponseException($result['detail']); } @@ -38,8 +34,7 @@ public function checkApiResult($result) return $result; } - public function makeHash($data) - { + public function makeHash($data) { return md5(implode('', $data)); } } diff --git a/src/backend/packages/inensus/steama-meter/src/Http/Clients/SteamaMeterApiClient.php b/src/backend/packages/inensus/steama-meter/src/Http/Clients/SteamaMeterApiClient.php index 98524fb1f..075f68353 100644 --- a/src/backend/packages/inensus/steama-meter/src/Http/Clients/SteamaMeterApiClient.php +++ b/src/backend/packages/inensus/steama-meter/src/Http/Clients/SteamaMeterApiClient.php @@ -9,8 +9,7 @@ use Inensus\SteamaMeter\Helpers\ApiHelpers; use Inensus\SteamaMeter\Models\SteamaCredential; -class SteamaMeterApiClient -{ +class SteamaMeterApiClient { private $client; private $apiHelpers; @@ -27,8 +26,7 @@ public function __construct( $this->credential = $credentialModel; } - public function get($url) - { + public function get($url) { try { $credential = $this->getCredentials(); } catch (\Exception $e) { @@ -51,8 +49,7 @@ public function get($url) return $this->apiHelpers->checkApiResult(json_decode((string) $request->getBody(), true)); } - public function token($url, $postParams) - { + public function token($url, $postParams) { try { $credential = $this->getCredentials(); } catch (\Exception $e) { @@ -75,8 +72,7 @@ public function token($url, $postParams) return $this->apiHelpers->checkApiResult(json_decode((string) $request->getBody(), true)); } - public function post($url, $postParams) - { + public function post($url, $postParams) { try { $credential = $this->getCredentials(); } catch (ModelNotFoundException $e) { @@ -100,8 +96,7 @@ public function post($url, $postParams) return $this->apiHelpers->checkApiResult(json_decode((string) $request->getBody(), true)); } - public function put($url, $putParams) - { + public function put($url, $putParams) { try { $credential = $this->getCredentials(); } catch (\Exception $e) { @@ -126,8 +121,7 @@ public function put($url, $putParams) return $this->apiHelpers->checkApiResult(json_decode((string) $request->getBody(), true)); } - public function patch($url, $putParams) - { + public function patch($url, $putParams) { try { $credential = $this->getCredentials(); } catch (\Exception $e) { @@ -151,8 +145,7 @@ public function patch($url, $putParams) return $this->apiHelpers->checkApiResult(json_decode((string) $request->getBody(), true)); } - public function getByParams($url, $params) - { + public function getByParams($url, $params) { try { $credential = $this->getCredentials(); } catch (\Exception $e) { @@ -181,8 +174,7 @@ public function getByParams($url, $params) return json_decode((string) $request->getBody(), true); } - public function getCredentials() - { + public function getCredentials() { return $this->credential->newQuery()->firstOrFail(); } } diff --git a/src/backend/packages/inensus/steama-meter/src/Http/Controllers/IBaseController.php b/src/backend/packages/inensus/steama-meter/src/Http/Controllers/IBaseController.php index 85bc0ce15..083fcc304 100644 --- a/src/backend/packages/inensus/steama-meter/src/Http/Controllers/IBaseController.php +++ b/src/backend/packages/inensus/steama-meter/src/Http/Controllers/IBaseController.php @@ -2,8 +2,7 @@ namespace Inensus\SteamaMeter\Http\Controllers; -interface IBaseController -{ +interface IBaseController { public function sync(); public function checkSync(); diff --git a/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaAgentController.php b/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaAgentController.php index 2170c3d5e..8418909e7 100644 --- a/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaAgentController.php +++ b/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaAgentController.php @@ -7,34 +7,28 @@ use Inensus\SteamaMeter\Http\Resources\SteamaResource; use Inensus\SteamaMeter\Services\SteamaAgentService; -class SteamaAgentController extends Controller implements IBaseController -{ +class SteamaAgentController extends Controller implements IBaseController { private $agentService; - public function __construct(SteamaAgentService $agentService) - { + public function __construct(SteamaAgentService $agentService) { $this->agentService = $agentService; } - public function index(Request $request): SteamaResource - { + public function index(Request $request): SteamaResource { $customers = $this->agentService->getAgents($request); return new SteamaResource($customers); } - public function sync(): SteamaResource - { + public function sync(): SteamaResource { return new SteamaResource($this->agentService->sync()); } - public function checkSync(): SteamaResource - { + public function checkSync(): SteamaResource { return new SteamaResource($this->agentService->syncCheck()); } - public function count() - { + public function count() { return $this->agentService->getAgentsCount(); } } diff --git a/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaCredentialController.php b/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaCredentialController.php index bfdd592f0..88f2360cc 100644 --- a/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaCredentialController.php +++ b/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaCredentialController.php @@ -8,22 +8,18 @@ use Inensus\SteamaMeter\Http\Resources\SteamaResource; use Inensus\SteamaMeter\Services\SteamaCredentialService; -class SteamaCredentialController extends Controller -{ +class SteamaCredentialController extends Controller { private $credentialService; - public function __construct(SteamaCredentialService $credentialService) - { + public function __construct(SteamaCredentialService $credentialService) { $this->credentialService = $credentialService; } - public function show(): SteamaResource - { + public function show(): SteamaResource { return new SteamaResource($this->credentialService->getCredentials()); } - public function update(SteamaCredentialRequest $request): SteamaCredentialResource - { + public function update(SteamaCredentialRequest $request): SteamaCredentialResource { $credentials = $this->credentialService->updateCredentials($request->only([ 'id', 'username', diff --git a/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaCustomerController.php b/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaCustomerController.php index 0169f3645..1f4938f0a 100644 --- a/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaCustomerController.php +++ b/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaCustomerController.php @@ -9,44 +9,36 @@ use Inensus\SteamaMeter\Models\SteamaCustomer; use Inensus\SteamaMeter\Services\SteamaCustomerService; -class SteamaCustomerController extends Controller implements IBaseController -{ +class SteamaCustomerController extends Controller implements IBaseController { private $customerService; - public function __construct(SteamaCustomerService $steamaCustomerService) - { + public function __construct(SteamaCustomerService $steamaCustomerService) { $this->customerService = $steamaCustomerService; } - public function index(Request $request): SteamaResource - { + public function index(Request $request): SteamaResource { $customers = $this->customerService->getCustomers($request); return new SteamaResource($customers); } - public function get($customerId): SteamaResource - { + public function get($customerId): SteamaResource { return new SteamaResource($this->customerService->getSteamaCustomerName($customerId)); } - public function sync(): SteamaResource - { + public function sync(): SteamaResource { return new SteamaResource($this->customerService->sync()); } - public function checkSync(): SteamaResource - { + public function checkSync(): SteamaResource { return new SteamaResource($this->customerService->syncCheck()); } - public function count() - { + public function count() { return $this->customerService->getCustomersCount(); } - public function update(SteamaCustomer $stmCustomer, SteamaCustomerRequest $request): SteamaResource - { + public function update(SteamaCustomer $stmCustomer, SteamaCustomerRequest $request): SteamaResource { $customerData = [ 'id' => $stmCustomer->customer_id, 'low_balance_warning' => $request->input('low_balance_warning'), @@ -56,8 +48,7 @@ public function update(SteamaCustomer $stmCustomer, SteamaCustomerRequest $reque return new SteamaResource($this->customerService->updateSteamaCustomerInfo($stmCustomer, $customerData)); } - public function search(): SteamaResource - { + public function search(): SteamaResource { $term = request('term'); $paginate = request('paginate') ?? 1; diff --git a/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaMeterController.php b/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaMeterController.php index 6fad3b77e..9bd9a97fd 100644 --- a/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaMeterController.php +++ b/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaMeterController.php @@ -7,34 +7,28 @@ use Inensus\SteamaMeter\Http\Resources\SteamaResource; use Inensus\SteamaMeter\Services\SteamaMeterService; -class SteamaMeterController extends Controller implements IBaseController -{ +class SteamaMeterController extends Controller implements IBaseController { private $meterService; - public function __construct(SteamaMeterService $meterService) - { + public function __construct(SteamaMeterService $meterService) { $this->meterService = $meterService; } - public function index(Request $request): SteamaResource - { + public function index(Request $request): SteamaResource { $customers = $this->meterService->getMeters($request); return new SteamaResource($customers); } - public function sync(): SteamaResource - { + public function sync(): SteamaResource { return new SteamaResource($this->meterService->sync()); } - public function checkSync(): SteamaResource - { + public function checkSync(): SteamaResource { return new SteamaResource($this->meterService->syncCheck()); } - public function count() - { + public function count() { return $this->meterService->getMetersCount(); } } diff --git a/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaSettingController.php b/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaSettingController.php index 56a247c64..307b424af 100644 --- a/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaSettingController.php +++ b/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaSettingController.php @@ -6,17 +6,14 @@ use Inensus\SteamaMeter\Http\Resources\SteamaResource; use Inensus\SteamaMeter\Services\SteamaSettingService; -class SteamaSettingController extends Controller -{ +class SteamaSettingController extends Controller { private $settingService; - public function __construct(SteamaSettingService $settingService) - { + public function __construct(SteamaSettingService $settingService) { $this->settingService = $settingService; } - public function index(): SteamaResource - { + public function index(): SteamaResource { return new SteamaResource($this->settingService->getSettings()); } } diff --git a/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaSiteController.php b/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaSiteController.php index 3c28c6a8e..21712be96 100644 --- a/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaSiteController.php +++ b/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaSiteController.php @@ -7,39 +7,32 @@ use Inensus\SteamaMeter\Http\Resources\SteamaResource; use Inensus\SteamaMeter\Services\SteamaSiteService; -class SteamaSiteController extends Controller implements IBaseController -{ +class SteamaSiteController extends Controller implements IBaseController { private $siteService; - public function __construct(SteamaSiteService $siteService) - { + public function __construct(SteamaSiteService $siteService) { $this->siteService = $siteService; } - public function index(Request $request): SteamaResource - { + public function index(Request $request): SteamaResource { $sites = $this->siteService->getSites($request); return new SteamaResource($sites); } - public function sync(): SteamaResource - { + public function sync(): SteamaResource { return new SteamaResource($this->siteService->sync()); } - public function checkSync(): SteamaResource - { + public function checkSync(): SteamaResource { return new SteamaResource($this->siteService->syncCheck()); } - public function count() - { + public function count() { return $this->siteService->getSitesCount(); } - public function location(): SteamaResource - { + public function location(): SteamaResource { return new SteamaResource($this->siteService->checkLocationAvailability()); } } diff --git a/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaSmsBodyController.php b/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaSmsBodyController.php index 65fd4c2c7..1efb090c3 100644 --- a/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaSmsBodyController.php +++ b/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaSmsBodyController.php @@ -7,22 +7,18 @@ use Inensus\SteamaMeter\Http\Resources\SteamaResource; use Inensus\SteamaMeter\Services\SteamaSmsBodyService; -class SteamaSmsBodyController extends Controller -{ +class SteamaSmsBodyController extends Controller { private $smsBodyService; - public function __construct(SteamaSmsBodyService $smsBodyService) - { + public function __construct(SteamaSmsBodyService $smsBodyService) { $this->smsBodyService = $smsBodyService; } - public function index(): SteamaResource - { + public function index(): SteamaResource { return new SteamaResource($this->smsBodyService->getSmsBodies()); } - public function update(Request $request): SteamaResource - { + public function update(Request $request): SteamaResource { return new SteamaResource($this->smsBodyService->updateSmsBodies($request->all())); } } diff --git a/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaSmsFeedbackController.php b/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaSmsFeedbackController.php index f899e28b3..b1ee215dd 100644 --- a/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaSmsFeedbackController.php +++ b/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaSmsFeedbackController.php @@ -8,22 +8,18 @@ use Inensus\SteamaMeter\Models\SteamaSmsFeedbackWord; use Inensus\SteamaMeter\Services\SteamaSmsFeedbackWordService; -class SteamaSmsFeedbackController extends Controller -{ +class SteamaSmsFeedbackController extends Controller { private $smsFeedbackWorkService; - public function __construct(SteamaSmsFeedbackWordService $smsFeedbackWordService) - { + public function __construct(SteamaSmsFeedbackWordService $smsFeedbackWordService) { $this->smsFeedbackWorkService = $smsFeedbackWordService; } - public function index(): SteamaResource - { + public function index(): SteamaResource { return new SteamaResource($this->smsFeedbackWorkService->getSmsFeedbackWords()); } - public function update(SteamaSmsFeedbackWord $smsFeedbackWord, Request $request): SteamaResource - { + public function update(SteamaSmsFeedbackWord $smsFeedbackWord, Request $request): SteamaResource { return new SteamaResource($this->smsFeedbackWorkService->updateSmsFeedbackWord($smsFeedbackWord, $request->all())); } } diff --git a/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaSmsSettingController.php b/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaSmsSettingController.php index 38344aaba..680ca4e96 100644 --- a/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaSmsSettingController.php +++ b/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaSmsSettingController.php @@ -7,17 +7,14 @@ use Inensus\SteamaMeter\Http\Resources\SteamaResource; use Inensus\SteamaMeter\Services\SteamaSmsSettingService; -class SteamaSmsSettingController extends Controller -{ +class SteamaSmsSettingController extends Controller { private $smsSettingService; - public function __construct(SteamaSmsSettingService $smsSettingService) - { + public function __construct(SteamaSmsSettingService $smsSettingService) { $this->smsSettingService = $smsSettingService; } - public function update(Request $request): SteamaResource - { + public function update(Request $request): SteamaResource { return new SteamaResource($this->smsSettingService->updateSmsSettings($request->all())); } } diff --git a/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaSmsVariableDefaultValueController.php b/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaSmsVariableDefaultValueController.php index c7fa08c4c..e33415d85 100644 --- a/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaSmsVariableDefaultValueController.php +++ b/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaSmsVariableDefaultValueController.php @@ -6,17 +6,14 @@ use Inensus\SteamaMeter\Services\SteamaSmsVariableDefaultValueService; use Inensus\Ticket\Http\Controllers\Controller; -class SteamaSmsVariableDefaultValueController extends Controller -{ +class SteamaSmsVariableDefaultValueController extends Controller { private $smsVariableDefaultSValueService; - public function __construct(SteamaSmsVariableDefaultValueService $smsVariableDefaultSValueService) - { + public function __construct(SteamaSmsVariableDefaultValueService $smsVariableDefaultSValueService) { $this->smsVariableDefaultSValueService = $smsVariableDefaultSValueService; } - public function index(): SteamaResource - { + public function index(): SteamaResource { return new SteamaResource($this->smsVariableDefaultSValueService->getSmsVariableDefaultValues()); } } diff --git a/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaSyncSettingController.php b/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaSyncSettingController.php index 240c03a2c..560404b72 100644 --- a/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaSyncSettingController.php +++ b/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaSyncSettingController.php @@ -7,17 +7,14 @@ use Inensus\SteamaMeter\Http\Resources\SteamaResource; use Inensus\SteamaMeter\Services\SteamaSyncSettingService; -class SteamaSyncSettingController extends Controller -{ +class SteamaSyncSettingController extends Controller { private $syncSettingService; - public function __construct(SteamaSyncSettingService $syncSettingService) - { + public function __construct(SteamaSyncSettingService $syncSettingService) { $this->syncSettingService = $syncSettingService; } - public function update(Request $request): SteamaResource - { + public function update(Request $request): SteamaResource { return new SteamaResource($this->syncSettingService->updateSyncSettings($request->all())); } } diff --git a/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaTransactionController.php b/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaTransactionController.php index 8a2b46f69..39663a841 100644 --- a/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaTransactionController.php +++ b/src/backend/packages/inensus/steama-meter/src/Http/Controllers/SteamaTransactionController.php @@ -7,17 +7,14 @@ use Inensus\SteamaMeter\Http\Resources\SteamaResource; use Inensus\SteamaMeter\Services\SteamaTransactionsService; -class SteamaTransactionController extends Controller -{ +class SteamaTransactionController extends Controller { private $steamaTransactionsService; - public function __construct(SteamaTransactionsService $steamaTransactionsService) - { + public function __construct(SteamaTransactionsService $steamaTransactionsService) { $this->steamaTransactionsService = $steamaTransactionsService; } - public function index($customer, Request $request): SteamaResource - { + public function index($customer, Request $request): SteamaResource { return new SteamaResource($this->steamaTransactionsService->getTransactionsByCustomer($customer, $request)); } } diff --git a/src/backend/packages/inensus/steama-meter/src/Http/Requests/SteamaCredentialRequest.php b/src/backend/packages/inensus/steama-meter/src/Http/Requests/SteamaCredentialRequest.php index f904fea6f..b5398ad4c 100644 --- a/src/backend/packages/inensus/steama-meter/src/Http/Requests/SteamaCredentialRequest.php +++ b/src/backend/packages/inensus/steama-meter/src/Http/Requests/SteamaCredentialRequest.php @@ -5,15 +5,13 @@ use Illuminate\Foundation\Http\FormRequest; use Illuminate\Validation\Rule; -class SteamaCredentialRequest extends FormRequest -{ +class SteamaCredentialRequest extends FormRequest { /** * Get the validation rules that apply to the request. * * @return array */ - public function rules() - { + public function rules() { return [ 'username' => ['required', Rule::unique('shard.steama_credentials')->ignore($this->id)], 'password' => 'required', diff --git a/src/backend/packages/inensus/steama-meter/src/Http/Requests/SteamaCustomerRequest.php b/src/backend/packages/inensus/steama-meter/src/Http/Requests/SteamaCustomerRequest.php index 476be1a6c..20de3877c 100644 --- a/src/backend/packages/inensus/steama-meter/src/Http/Requests/SteamaCustomerRequest.php +++ b/src/backend/packages/inensus/steama-meter/src/Http/Requests/SteamaCustomerRequest.php @@ -5,15 +5,13 @@ use Illuminate\Foundation\Http\FormRequest; use Illuminate\Validation\Rule; -class SteamaCustomerRequest extends FormRequest -{ +class SteamaCustomerRequest extends FormRequest { /** * Get the validation rules that apply to the request. * * @return array */ - public function rules() - { + public function rules() { return [ 'id' => ['required', Rule::unique('shard.steama_customers')->ignore($this->id)], 'low_balance_warning' => 'required', diff --git a/src/backend/packages/inensus/steama-meter/src/Http/Resources/SteamaCredentialResource.php b/src/backend/packages/inensus/steama-meter/src/Http/Resources/SteamaCredentialResource.php index ad7259755..2cb74b363 100644 --- a/src/backend/packages/inensus/steama-meter/src/Http/Resources/SteamaCredentialResource.php +++ b/src/backend/packages/inensus/steama-meter/src/Http/Resources/SteamaCredentialResource.php @@ -6,10 +6,8 @@ use Illuminate\Http\Resources\Json\JsonResource; use Inensus\SteamaMeter\Models\SteamaCredential; -class SteamaCredentialResource extends JsonResource -{ - public function __construct(SteamaCredential $steamaCredential) - { +class SteamaCredentialResource extends JsonResource { + public function __construct(SteamaCredential $steamaCredential) { parent::__construct($steamaCredential); } @@ -20,16 +18,14 @@ public function __construct(SteamaCredential $steamaCredential) * * @return Request */ - public function toArray($request) - { + public function toArray($request) { $credentials = $this->resource->toArray(); $credentials['alert'] = $this->alertType($this->resource->is_authenticated); return $credentials; } - private function alertType($authenticationStatus) - { + private function alertType($authenticationStatus) { switch ($authenticationStatus) { case true: return [ diff --git a/src/backend/packages/inensus/steama-meter/src/Http/Resources/SteamaResource.php b/src/backend/packages/inensus/steama-meter/src/Http/Resources/SteamaResource.php index 84df4c453..6df8a2b5e 100644 --- a/src/backend/packages/inensus/steama-meter/src/Http/Resources/SteamaResource.php +++ b/src/backend/packages/inensus/steama-meter/src/Http/Resources/SteamaResource.php @@ -5,8 +5,7 @@ use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\JsonResource; -class SteamaResource extends JsonResource -{ +class SteamaResource extends JsonResource { /** * Transform the resource into an array. * @@ -14,8 +13,7 @@ class SteamaResource extends JsonResource * * @return array */ - public function toArray($request) - { + public function toArray($request) { return parent::toArray($request); } } diff --git a/src/backend/packages/inensus/steama-meter/src/Listeners/MeterParameterListener.php b/src/backend/packages/inensus/steama-meter/src/Listeners/MeterParameterListener.php index f97c93754..775bec09f 100644 --- a/src/backend/packages/inensus/steama-meter/src/Listeners/MeterParameterListener.php +++ b/src/backend/packages/inensus/steama-meter/src/Listeners/MeterParameterListener.php @@ -12,8 +12,7 @@ use Inensus\SteamaMeter\Services\SteamaCustomerService; use Inensus\SteamaMeter\Services\SteamaMeterService; -class MeterParameterListener -{ +class MeterParameterListener { private $apiHelpers; private $stmCustomerService; @@ -50,8 +49,7 @@ public function __construct( $this->stmMeter = $stmMeter; } - public function onParameterSaved(int $meterId) - { + public function onParameterSaved(int $meterId) { $meterInfo = $this->meterParameter->newQuery()->with(['meter.manufacturer', 'geo', 'owner.addresses' => static function ($q) { $q->where('is_primary', 1); }])->whereHas('meter', function ($q) use ($meterId) { @@ -90,8 +88,7 @@ public function onParameterSaved(int $meterId) } } - public function subscribe(Dispatcher $events) - { + public function subscribe(Dispatcher $events) { $events->listen( 'meterparameter.saved', 'Inensus\SteamaMeter\Listeners\MeterParameterListener@onParameterSaved' diff --git a/src/backend/packages/inensus/steama-meter/src/Listeners/SmsListener.php b/src/backend/packages/inensus/steama-meter/src/Listeners/SmsListener.php index 06b72534e..1e325d768 100644 --- a/src/backend/packages/inensus/steama-meter/src/Listeners/SmsListener.php +++ b/src/backend/packages/inensus/steama-meter/src/Listeners/SmsListener.php @@ -10,8 +10,7 @@ use Inensus\SteamaMeter\Sms\Senders\SteamaSmsConfig; use Inensus\SteamaMeter\Sms\SteamaSmsTypes; -class SmsListener -{ +class SmsListener { private $smsFeedbackWordService; private $customerService; @@ -32,8 +31,7 @@ public function __construct( $this->smsService = $smsService; } - public function onSmsStored($sender, $message) - { + public function onSmsStored($sender, $message) { $steamaCustomer = $this->customerService->getSteamaCustomerWithPhone($sender); if (!$steamaCustomer) { return; @@ -52,8 +50,7 @@ public function onSmsStored($sender, $message) } } - public function subscribe(Dispatcher $events) - { + public function subscribe(Dispatcher $events) { $events->listen('sms.stored', 'Inensus\SteamaMeter\Listeners\SmsListener@onSmsStored'); } } diff --git a/src/backend/packages/inensus/steama-meter/src/Models/BaseModel.php b/src/backend/packages/inensus/steama-meter/src/Models/BaseModel.php index a2eb72506..c38475951 100644 --- a/src/backend/packages/inensus/steama-meter/src/Models/BaseModel.php +++ b/src/backend/packages/inensus/steama-meter/src/Models/BaseModel.php @@ -4,20 +4,17 @@ use Illuminate\Database\Eloquent\Model; -class BaseModel extends Model -{ +class BaseModel extends Model { protected $guarded = ['id']; public static $rules = []; - public function __construct(array $attributes = []) - { + public function __construct(array $attributes = []) { parent::__construct($attributes); $this->setConnection('shard'); } - public function resolveChildRouteBinding($childType, $value, $field) - { + public function resolveChildRouteBinding($childType, $value, $field) { // TODO: Implement resolveChildRouteBinding() method. } } diff --git a/src/backend/packages/inensus/steama-meter/src/Models/SteamaAgent.php b/src/backend/packages/inensus/steama-meter/src/Models/SteamaAgent.php index be39b612c..bbcd1dff2 100644 --- a/src/backend/packages/inensus/steama-meter/src/Models/SteamaAgent.php +++ b/src/backend/packages/inensus/steama-meter/src/Models/SteamaAgent.php @@ -4,17 +4,14 @@ use App\Models\Agent; -class SteamaAgent extends BaseModel -{ +class SteamaAgent extends BaseModel { protected $table = 'steama_agents'; - public function mpmAgent() - { + public function mpmAgent() { return $this->belongsTo(Agent::class, 'mpm_agent_id'); } - public function site() - { + public function site() { return $this->belongsTo(SteamaSite::class, 'site_id', 'site_id'); } } diff --git a/src/backend/packages/inensus/steama-meter/src/Models/SteamaAssetRatesPaymentPlan.php b/src/backend/packages/inensus/steama-meter/src/Models/SteamaAssetRatesPaymentPlan.php index 52a1fba2c..42b522ba5 100644 --- a/src/backend/packages/inensus/steama-meter/src/Models/SteamaAssetRatesPaymentPlan.php +++ b/src/backend/packages/inensus/steama-meter/src/Models/SteamaAssetRatesPaymentPlan.php @@ -2,7 +2,6 @@ namespace Inensus\SteamaMeter\Models; -class SteamaAssetRatesPaymentPlan extends BaseModel -{ +class SteamaAssetRatesPaymentPlan extends BaseModel { protected $table = 'steama_asset_rates_payment_plans'; } diff --git a/src/backend/packages/inensus/steama-meter/src/Models/SteamaCredential.php b/src/backend/packages/inensus/steama-meter/src/Models/SteamaCredential.php index 91a3b7058..e96ad22d6 100644 --- a/src/backend/packages/inensus/steama-meter/src/Models/SteamaCredential.php +++ b/src/backend/packages/inensus/steama-meter/src/Models/SteamaCredential.php @@ -2,7 +2,6 @@ namespace Inensus\SteamaMeter\Models; -class SteamaCredential extends BaseModel -{ +class SteamaCredential extends BaseModel { protected $table = 'steama_credentials'; } diff --git a/src/backend/packages/inensus/steama-meter/src/Models/SteamaCustomer.php b/src/backend/packages/inensus/steama-meter/src/Models/SteamaCustomer.php index cce8ccd80..3f33073d5 100644 --- a/src/backend/packages/inensus/steama-meter/src/Models/SteamaCustomer.php +++ b/src/backend/packages/inensus/steama-meter/src/Models/SteamaCustomer.php @@ -4,32 +4,26 @@ use App\Models\Person\Person; -class SteamaCustomer extends BaseModel -{ +class SteamaCustomer extends BaseModel { protected $table = 'steama_customers'; - public function mpmPerson() - { + public function mpmPerson() { return $this->belongsTo(Person::class, 'mpm_customer_id'); } - public function site() - { + public function site() { return $this->belongsTo(SteamaSite::class, 'site_id', 'site_id'); } - public function userType() - { + public function userType() { return $this->belongsTo(SteamaUserType::class, 'user_type_id'); } - public function paymentPlans() - { + public function paymentPlans() { return $this->hasOne(SteamaCustomerBasisPaymentPlan::class); } - public function stmMeters() - { + public function stmMeters() { return $this->hasMany(SteamaMeter::class, 'customer_id', 'customer_id'); } } diff --git a/src/backend/packages/inensus/steama-meter/src/Models/SteamaCustomerBasisPaymentPlan.php b/src/backend/packages/inensus/steama-meter/src/Models/SteamaCustomerBasisPaymentPlan.php index a3a5f5bd1..8b6a73505 100644 --- a/src/backend/packages/inensus/steama-meter/src/Models/SteamaCustomerBasisPaymentPlan.php +++ b/src/backend/packages/inensus/steama-meter/src/Models/SteamaCustomerBasisPaymentPlan.php @@ -5,17 +5,14 @@ use App\Relations\BelongsToMorph; use Illuminate\Database\Eloquent\Relations\BelongsTo; -class SteamaCustomerBasisPaymentPlan extends BaseModel -{ +class SteamaCustomerBasisPaymentPlan extends BaseModel { protected $table = 'steama_customer_basis_payment_plans'; - public function customer() - { + public function customer() { return $this->belongsTo(SteamaCustomer::class, 'customer_id'); } - public function paymentPlan() - { + public function paymentPlan() { return $this->morphTo(); } @@ -24,8 +21,7 @@ public function paymentPlan() * * @return BelongsTo */ - public function paymentPlanFlatRate() - { + public function paymentPlanFlatRate() { return BelongsToMorph::build($this, SteamaFlatRatePaymentPlan::class, 'paymentPlan'); } @@ -34,8 +30,7 @@ public function paymentPlanFlatRate() * * @return BelongsTo */ - public function paymentPlanHybrid() - { + public function paymentPlanHybrid() { return BelongsToMorph::build($this, SteamaHybridPaymentPlan::class, 'paymentPlan'); } @@ -44,8 +39,7 @@ public function paymentPlanHybrid() * * @return BelongsTo */ - public function paymentPlanSubscription() - { + public function paymentPlanSubscription() { return BelongsToMorph::build($this, SteamaSubscriptionPaymentPlan::class, 'paymentPlan'); } @@ -54,8 +48,7 @@ public function paymentPlanSubscription() * * @return BelongsTo */ - public function paymentPlanMinimumTopUp() - { + public function paymentPlanMinimumTopUp() { return BelongsToMorph::build($this, SteamaMinimumTopUpRequirementsPaymentPlan::class, 'paymentPlan'); } @@ -64,8 +57,7 @@ public function paymentPlanMinimumTopUp() * * @return BelongsTo */ - public function paymentPlanAssetRates() - { + public function paymentPlanAssetRates() { return BelongsToMorph::build($this, SteamaAssetRatesPaymentPlan::class, 'paymentPlan'); } @@ -74,8 +66,7 @@ public function paymentPlanAssetRates() * * @return BelongsTo */ - public function paymentPlanPerKwh() - { + public function paymentPlanPerKwh() { return BelongsToMorph::build($this, SteamaPerKwhPaymentPlan::class, 'paymentPlan'); } @@ -84,8 +75,7 @@ public function paymentPlanPerKwh() * * @return BelongsTo */ - public function paymentPlanTariffOverride() - { + public function paymentPlanTariffOverride() { return BelongsToMorph::build($this, SteamaTariffOverridePaymentPlan::class, 'paymentPlan'); } @@ -94,8 +84,7 @@ public function paymentPlanTariffOverride() * * @return BelongsTo */ - public function paymentPlanCustomerBasisTimeOfUsage() - { + public function paymentPlanCustomerBasisTimeOfUsage() { return BelongsToMorph::build($this, SteamaCustomerBasisTimeOfUsage::class, 'paymentPlan'); } } diff --git a/src/backend/packages/inensus/steama-meter/src/Models/SteamaCustomerBasisTimeOfUsage.php b/src/backend/packages/inensus/steama-meter/src/Models/SteamaCustomerBasisTimeOfUsage.php index 9a6cd3907..7fdd53bca 100644 --- a/src/backend/packages/inensus/steama-meter/src/Models/SteamaCustomerBasisTimeOfUsage.php +++ b/src/backend/packages/inensus/steama-meter/src/Models/SteamaCustomerBasisTimeOfUsage.php @@ -2,7 +2,6 @@ namespace Inensus\SteamaMeter\Models; -class SteamaCustomerBasisTimeOfUsage extends BaseModel -{ +class SteamaCustomerBasisTimeOfUsage extends BaseModel { protected $table = 'create_steama_customer_basis_time_of_usages'; } diff --git a/src/backend/packages/inensus/steama-meter/src/Models/SteamaFlatRatePaymentPlan.php b/src/backend/packages/inensus/steama-meter/src/Models/SteamaFlatRatePaymentPlan.php index 2587082fb..cdaffcaf3 100644 --- a/src/backend/packages/inensus/steama-meter/src/Models/SteamaFlatRatePaymentPlan.php +++ b/src/backend/packages/inensus/steama-meter/src/Models/SteamaFlatRatePaymentPlan.php @@ -2,7 +2,6 @@ namespace Inensus\SteamaMeter\Models; -class SteamaFlatRatePaymentPlan extends BaseModel -{ +class SteamaFlatRatePaymentPlan extends BaseModel { protected $table = 'steama_flat_rate_payment_plans'; } diff --git a/src/backend/packages/inensus/steama-meter/src/Models/SteamaHybridPaymentPlan.php b/src/backend/packages/inensus/steama-meter/src/Models/SteamaHybridPaymentPlan.php index d1f2531d8..997b252a3 100644 --- a/src/backend/packages/inensus/steama-meter/src/Models/SteamaHybridPaymentPlan.php +++ b/src/backend/packages/inensus/steama-meter/src/Models/SteamaHybridPaymentPlan.php @@ -2,7 +2,6 @@ namespace Inensus\SteamaMeter\Models; -class SteamaHybridPaymentPlan extends BaseModel -{ +class SteamaHybridPaymentPlan extends BaseModel { protected $table = 'steama_hybrid_payment_plans'; } diff --git a/src/backend/packages/inensus/steama-meter/src/Models/SteamaMeter.php b/src/backend/packages/inensus/steama-meter/src/Models/SteamaMeter.php index 740de9872..4e5beb1a8 100644 --- a/src/backend/packages/inensus/steama-meter/src/Models/SteamaMeter.php +++ b/src/backend/packages/inensus/steama-meter/src/Models/SteamaMeter.php @@ -4,17 +4,14 @@ use App\Models\Meter\Meter; -class SteamaMeter extends BaseModel -{ +class SteamaMeter extends BaseModel { protected $table = 'steama_meters'; - public function mpmMeter() - { + public function mpmMeter() { return $this->belongsTo(Meter::class, 'mpm_meter_id'); } - public function stmCustomer() - { + public function stmCustomer() { return $this->belongsTo(SteamaCustomer::class, 'customer_id', 'customer_id'); } } diff --git a/src/backend/packages/inensus/steama-meter/src/Models/SteamaMeterType.php b/src/backend/packages/inensus/steama-meter/src/Models/SteamaMeterType.php index 3550930c5..498226b5c 100644 --- a/src/backend/packages/inensus/steama-meter/src/Models/SteamaMeterType.php +++ b/src/backend/packages/inensus/steama-meter/src/Models/SteamaMeterType.php @@ -4,12 +4,10 @@ use App\Models\Meter\MeterType; -class SteamaMeterType extends BaseModel -{ +class SteamaMeterType extends BaseModel { protected $table = 'steama_meter_types'; - public function mpmMeterType() - { + public function mpmMeterType() { return $this->belongsTo(MeterType::class, 'mpm_meter_type_id'); } } diff --git a/src/backend/packages/inensus/steama-meter/src/Models/SteamaMinimumTopUpRequirementsPaymentPlan.php b/src/backend/packages/inensus/steama-meter/src/Models/SteamaMinimumTopUpRequirementsPaymentPlan.php index 6753edf8b..2c9e73d8a 100644 --- a/src/backend/packages/inensus/steama-meter/src/Models/SteamaMinimumTopUpRequirementsPaymentPlan.php +++ b/src/backend/packages/inensus/steama-meter/src/Models/SteamaMinimumTopUpRequirementsPaymentPlan.php @@ -2,7 +2,6 @@ namespace Inensus\SteamaMeter\Models; -class SteamaMinimumTopUpRequirementsPaymentPlan extends BaseModel -{ +class SteamaMinimumTopUpRequirementsPaymentPlan extends BaseModel { protected $table = 'steama_minimum_top_up_requirements_payment_plans'; } diff --git a/src/backend/packages/inensus/steama-meter/src/Models/SteamaPerKwhPaymentPlan.php b/src/backend/packages/inensus/steama-meter/src/Models/SteamaPerKwhPaymentPlan.php index 6f5da9964..236534f08 100644 --- a/src/backend/packages/inensus/steama-meter/src/Models/SteamaPerKwhPaymentPlan.php +++ b/src/backend/packages/inensus/steama-meter/src/Models/SteamaPerKwhPaymentPlan.php @@ -2,7 +2,6 @@ namespace Inensus\SteamaMeter\Models; -class SteamaPerKwhPaymentPlan extends BaseModel -{ +class SteamaPerKwhPaymentPlan extends BaseModel { protected $table = 'steama_per_kwh_payment_plans'; } diff --git a/src/backend/packages/inensus/steama-meter/src/Models/SteamaSetting.php b/src/backend/packages/inensus/steama-meter/src/Models/SteamaSetting.php index 55402f72b..b546bfb4a 100644 --- a/src/backend/packages/inensus/steama-meter/src/Models/SteamaSetting.php +++ b/src/backend/packages/inensus/steama-meter/src/Models/SteamaSetting.php @@ -6,28 +6,24 @@ use App\Relations\BelongsToMorph; use Illuminate\Database\Eloquent\Relations\MorphTo; -class SteamaSetting extends BaseModel -{ +class SteamaSetting extends BaseModel { protected $table = 'steama_settings'; - public function setting(): MorphTo - { + public function setting(): MorphTo { return $this->morphTo(); } /** * A work-around for querying the polymorphic relation with whereHas. */ - public function settingSms(): BelongsToMorph - { + public function settingSms(): BelongsToMorph { return BelongsToMorph::build($this, SteamaSmsSetting::class, 'setting'); } /** * A work-around for querying the polymorphic relation with whereHas. */ - public function settingSync(): BelongsToMorph - { + public function settingSync(): BelongsToMorph { return BelongsToMorph::build($this, SteamaSyncSetting::class, 'setting'); } } diff --git a/src/backend/packages/inensus/steama-meter/src/Models/SteamaSite.php b/src/backend/packages/inensus/steama-meter/src/Models/SteamaSite.php index a20abfd43..79518f312 100644 --- a/src/backend/packages/inensus/steama-meter/src/Models/SteamaSite.php +++ b/src/backend/packages/inensus/steama-meter/src/Models/SteamaSite.php @@ -4,22 +4,18 @@ use App\Models\MiniGrid; -class SteamaSite extends BaseModel -{ +class SteamaSite extends BaseModel { protected $table = 'steama_sites'; - public function mpmMiniGrid() - { + public function mpmMiniGrid() { return $this->belongsTo(MiniGrid::class, 'mpm_mini_grid_id'); } - public function paymentPlans() - { + public function paymentPlans() { return $this->hasMany(SteamaSiteLevelPaymentPlan::class); } - public function agents() - { + public function agents() { return $this->hasMany(SteamaAgent::class); } } diff --git a/src/backend/packages/inensus/steama-meter/src/Models/SteamaSiteLevelPaymentPlan.php b/src/backend/packages/inensus/steama-meter/src/Models/SteamaSiteLevelPaymentPlan.php index 701c751ba..57a114ff4 100644 --- a/src/backend/packages/inensus/steama-meter/src/Models/SteamaSiteLevelPaymentPlan.php +++ b/src/backend/packages/inensus/steama-meter/src/Models/SteamaSiteLevelPaymentPlan.php @@ -2,17 +2,14 @@ namespace Inensus\SteamaMeter\Models; -class SteamaSiteLevelPaymentPlan extends BaseModel -{ +class SteamaSiteLevelPaymentPlan extends BaseModel { protected $table = 'steama_site_level_payment_plans'; - public function site() - { + public function site() { return $this->belongsTo(SteamaSite::class, 'site_id'); } - public function planType() - { + public function planType() { return $this->belongsTo(SteamaSiteLevelPaymentPlanType::class, 'payment_plan_type_id'); } } diff --git a/src/backend/packages/inensus/steama-meter/src/Models/SteamaSiteLevelPaymentPlanType.php b/src/backend/packages/inensus/steama-meter/src/Models/SteamaSiteLevelPaymentPlanType.php index 1170bca64..5e0f2e669 100644 --- a/src/backend/packages/inensus/steama-meter/src/Models/SteamaSiteLevelPaymentPlanType.php +++ b/src/backend/packages/inensus/steama-meter/src/Models/SteamaSiteLevelPaymentPlanType.php @@ -2,7 +2,6 @@ namespace Inensus\SteamaMeter\Models; -class SteamaSiteLevelPaymentPlanType extends BaseModel -{ +class SteamaSiteLevelPaymentPlanType extends BaseModel { protected $table = 'steama_site_level_payment_plan_types'; } diff --git a/src/backend/packages/inensus/steama-meter/src/Models/SteamaSmsBody.php b/src/backend/packages/inensus/steama-meter/src/Models/SteamaSmsBody.php index a14b6ef61..f75082f2c 100644 --- a/src/backend/packages/inensus/steama-meter/src/Models/SteamaSmsBody.php +++ b/src/backend/packages/inensus/steama-meter/src/Models/SteamaSmsBody.php @@ -4,7 +4,6 @@ use App\Models\Base\BaseModel; -class SteamaSmsBody extends BaseModel -{ +class SteamaSmsBody extends BaseModel { protected $table = 'steama_sms_bodies'; } diff --git a/src/backend/packages/inensus/steama-meter/src/Models/SteamaSmsFeedbackWord.php b/src/backend/packages/inensus/steama-meter/src/Models/SteamaSmsFeedbackWord.php index 86526e00a..c3e7c699d 100644 --- a/src/backend/packages/inensus/steama-meter/src/Models/SteamaSmsFeedbackWord.php +++ b/src/backend/packages/inensus/steama-meter/src/Models/SteamaSmsFeedbackWord.php @@ -4,7 +4,6 @@ use App\Models\Base\BaseModel; -class SteamaSmsFeedbackWord extends BaseModel -{ +class SteamaSmsFeedbackWord extends BaseModel { protected $table = 'steama_sms_feedback_words'; } diff --git a/src/backend/packages/inensus/steama-meter/src/Models/SteamaSmsNotifiedCustomer.php b/src/backend/packages/inensus/steama-meter/src/Models/SteamaSmsNotifiedCustomer.php index d28b16ff7..ba301bff7 100644 --- a/src/backend/packages/inensus/steama-meter/src/Models/SteamaSmsNotifiedCustomer.php +++ b/src/backend/packages/inensus/steama-meter/src/Models/SteamaSmsNotifiedCustomer.php @@ -4,12 +4,10 @@ use Illuminate\Database\Eloquent\Relations\MorphTo; -class SteamaSmsNotifiedCustomer extends BaseModel -{ +class SteamaSmsNotifiedCustomer extends BaseModel { protected $table = 'steama_sms_notified_customers'; - public function notify(): MorphTo - { + public function notify(): MorphTo { return $this->morphTo(); } } diff --git a/src/backend/packages/inensus/steama-meter/src/Models/SteamaSmsSetting.php b/src/backend/packages/inensus/steama-meter/src/Models/SteamaSmsSetting.php index 0565af1fe..d7311450e 100644 --- a/src/backend/packages/inensus/steama-meter/src/Models/SteamaSmsSetting.php +++ b/src/backend/packages/inensus/steama-meter/src/Models/SteamaSmsSetting.php @@ -4,12 +4,10 @@ use App\Models\Base\BaseModel; -class SteamaSmsSetting extends BaseModel -{ +class SteamaSmsSetting extends BaseModel { protected $table = 'steama_sms_settings'; - public function setting() - { + public function setting() { return $this->morphOne(SteamaSetting::class, 'setting'); } } diff --git a/src/backend/packages/inensus/steama-meter/src/Models/SteamaSmsVariableDefaultValue.php b/src/backend/packages/inensus/steama-meter/src/Models/SteamaSmsVariableDefaultValue.php index 47d5b438e..468eae61d 100644 --- a/src/backend/packages/inensus/steama-meter/src/Models/SteamaSmsVariableDefaultValue.php +++ b/src/backend/packages/inensus/steama-meter/src/Models/SteamaSmsVariableDefaultValue.php @@ -2,7 +2,6 @@ namespace Inensus\SteamaMeter\Models; -class SteamaSmsVariableDefaultValue extends BaseModel -{ +class SteamaSmsVariableDefaultValue extends BaseModel { protected $table = 'steama_sms_variable_default_values'; } diff --git a/src/backend/packages/inensus/steama-meter/src/Models/SteamaSubscriptionPaymentPlan.php b/src/backend/packages/inensus/steama-meter/src/Models/SteamaSubscriptionPaymentPlan.php index 39f2c6a9a..b3e8aa1b9 100644 --- a/src/backend/packages/inensus/steama-meter/src/Models/SteamaSubscriptionPaymentPlan.php +++ b/src/backend/packages/inensus/steama-meter/src/Models/SteamaSubscriptionPaymentPlan.php @@ -2,7 +2,6 @@ namespace Inensus\SteamaMeter\Models; -class SteamaSubscriptionPaymentPlan extends BaseModel -{ +class SteamaSubscriptionPaymentPlan extends BaseModel { protected $table = 'steama_subscription_payment_plans'; } diff --git a/src/backend/packages/inensus/steama-meter/src/Models/SteamaSyncAction.php b/src/backend/packages/inensus/steama-meter/src/Models/SteamaSyncAction.php index 4c379bd26..b69edeb2d 100644 --- a/src/backend/packages/inensus/steama-meter/src/Models/SteamaSyncAction.php +++ b/src/backend/packages/inensus/steama-meter/src/Models/SteamaSyncAction.php @@ -2,12 +2,10 @@ namespace Inensus\SteamaMeter\Models; -class SteamaSyncAction extends BaseModel -{ +class SteamaSyncAction extends BaseModel { protected $table = 'steama_sync_actions'; - public function synSetting() - { + public function synSetting() { return $this->belongsTo(SteamaSyncSetting::class, 'sync_setting_id'); } } diff --git a/src/backend/packages/inensus/steama-meter/src/Models/SteamaSyncSetting.php b/src/backend/packages/inensus/steama-meter/src/Models/SteamaSyncSetting.php index e15bf6af3..25c57d525 100644 --- a/src/backend/packages/inensus/steama-meter/src/Models/SteamaSyncSetting.php +++ b/src/backend/packages/inensus/steama-meter/src/Models/SteamaSyncSetting.php @@ -2,17 +2,14 @@ namespace Inensus\SteamaMeter\Models; -class SteamaSyncSetting extends BaseModel -{ +class SteamaSyncSetting extends BaseModel { protected $table = 'steama_sync_settings'; - public function syncAction() - { + public function syncAction() { return $this->hasOne(SteamaSyncAction::class); } - public function setting() - { + public function setting() { return $this->morphOne(SteamaSetting::class, 'setting'); } } diff --git a/src/backend/packages/inensus/steama-meter/src/Models/SteamaTariff.php b/src/backend/packages/inensus/steama-meter/src/Models/SteamaTariff.php index 06c5303bc..3ed6fe7a0 100644 --- a/src/backend/packages/inensus/steama-meter/src/Models/SteamaTariff.php +++ b/src/backend/packages/inensus/steama-meter/src/Models/SteamaTariff.php @@ -4,12 +4,10 @@ use App\Models\Meter\MeterTariff; -class SteamaTariff extends BaseModel -{ +class SteamaTariff extends BaseModel { protected $table = 'steama_tariffs'; - public function mpmTariff() - { + public function mpmTariff() { return $this->belongsTo(MeterTariff::class, 'mpm_tariff_id'); } } diff --git a/src/backend/packages/inensus/steama-meter/src/Models/SteamaTariffOverridePaymentPlan.php b/src/backend/packages/inensus/steama-meter/src/Models/SteamaTariffOverridePaymentPlan.php index 6d040a2d7..ec13116dc 100644 --- a/src/backend/packages/inensus/steama-meter/src/Models/SteamaTariffOverridePaymentPlan.php +++ b/src/backend/packages/inensus/steama-meter/src/Models/SteamaTariffOverridePaymentPlan.php @@ -2,7 +2,6 @@ namespace Inensus\SteamaMeter\Models; -class SteamaTariffOverridePaymentPlan extends BaseModel -{ +class SteamaTariffOverridePaymentPlan extends BaseModel { protected $table = 'steama_tariff_override_payment_plans'; } diff --git a/src/backend/packages/inensus/steama-meter/src/Models/SteamaTransaction.php b/src/backend/packages/inensus/steama-meter/src/Models/SteamaTransaction.php index fb9b5fddf..9a5281fa9 100644 --- a/src/backend/packages/inensus/steama-meter/src/Models/SteamaTransaction.php +++ b/src/backend/packages/inensus/steama-meter/src/Models/SteamaTransaction.php @@ -11,47 +11,38 @@ use Inensus\SwiftaPaymentProvider\Models\SwiftaTransaction; use Inensus\WaveMoneyPaymentProvider\Models\WaveMoneyTransaction; -class SteamaTransaction extends BaseModel implements ISubTransaction -{ +class SteamaTransaction extends BaseModel implements ISubTransaction { protected $table = 'steama_transactions'; - public function site() - { + public function site() { return $this->belongsTo(SteamaSite::class, 'site_id', 'site_id'); } - public function agentTransaction() - { + public function agentTransaction() { return $this->morphOne(AgentTransaction::class, 'manufacturer_transaction'); } - public function vodacomTransaction() - { + public function vodacomTransaction() { return $this->morphOne(VodacomTransaction::class, 'manufacturer_transaction'); } - public function airtelTransaction() - { + public function airtelTransaction() { return $this->morphOne(AirtelTransaction::class, 'manufacturer_transaction'); } - public function thirdPartyTransaction() - { + public function thirdPartyTransaction() { return $this->morphOne(ThirdPartyTransaction::class, 'manufacturer_transaction'); } - public function mesombTransaction() - { + public function mesombTransaction() { return $this->morphOne(MesombTransaction::class, 'manufacturer_transaction'); } - public function swiftaTransaction() - { + public function swiftaTransaction() { return $this->morphOne(SwiftaTransaction::class, 'manufacturer_transaction'); } - public function waveMoneyTransaction() - { + public function waveMoneyTransaction() { return $this->morphOne(WaveMoneyTransaction::class, 'manufacturer_transaction'); } } diff --git a/src/backend/packages/inensus/steama-meter/src/Models/SteamaUserType.php b/src/backend/packages/inensus/steama-meter/src/Models/SteamaUserType.php index 58b148a9a..7f2c7663e 100644 --- a/src/backend/packages/inensus/steama-meter/src/Models/SteamaUserType.php +++ b/src/backend/packages/inensus/steama-meter/src/Models/SteamaUserType.php @@ -4,12 +4,10 @@ use App\Models\ConnectionType; -class SteamaUserType extends BaseModel -{ +class SteamaUserType extends BaseModel { protected $table = 'steama_user_types'; - public function mpmConnectionType() - { + public function mpmConnectionType() { return $this->belongsTo(ConnectionType::class, 'mpm_connection_type_id'); } } diff --git a/src/backend/packages/inensus/steama-meter/src/Models/SyncStatus.php b/src/backend/packages/inensus/steama-meter/src/Models/SyncStatus.php index a0c4cffac..0f376fb20 100644 --- a/src/backend/packages/inensus/steama-meter/src/Models/SyncStatus.php +++ b/src/backend/packages/inensus/steama-meter/src/Models/SyncStatus.php @@ -2,8 +2,7 @@ namespace Inensus\SteamaMeter\Models; -abstract class SyncStatus -{ +abstract class SyncStatus { public const SYNCED = 1; public const MODIFIED = 2; diff --git a/src/backend/packages/inensus/steama-meter/src/Observers/GeographicalInformationObserver.php b/src/backend/packages/inensus/steama-meter/src/Observers/GeographicalInformationObserver.php index 824f0dec2..161f4a786 100644 --- a/src/backend/packages/inensus/steama-meter/src/Observers/GeographicalInformationObserver.php +++ b/src/backend/packages/inensus/steama-meter/src/Observers/GeographicalInformationObserver.php @@ -9,8 +9,7 @@ use Inensus\SteamaMeter\Models\SteamaMeter; use Inensus\SteamaMeter\Services\SteamaMeterService; -class GeographicalInformationObserver -{ +class GeographicalInformationObserver { private $stmMeterService; private $stmMeter; @@ -35,8 +34,7 @@ public function __construct( $this->meterParameter = $meterParameter; } - public function updated(GeographicalInformation $geographicalInformation) - { + public function updated(GeographicalInformation $geographicalInformation) { if ($geographicalInformation->owner_type === 'meter_parameter') { $meterParameter = $this->meterParameter->newQuery()->find($geographicalInformation->owner_id); $stmMeter = $this->stmMeter->newQuery()->where('mpm_meter_id', $meterParameter->meter_id)->first(); diff --git a/src/backend/packages/inensus/steama-meter/src/Observers/PersonObserver.php b/src/backend/packages/inensus/steama-meter/src/Observers/PersonObserver.php index 2e40d9cd6..2b65496ed 100644 --- a/src/backend/packages/inensus/steama-meter/src/Observers/PersonObserver.php +++ b/src/backend/packages/inensus/steama-meter/src/Observers/PersonObserver.php @@ -9,8 +9,7 @@ use Inensus\SteamaMeter\Services\SteamaCustomerService; use Inensus\SteamaMeter\Services\SteamaMeterService; -class PersonObserver -{ +class PersonObserver { private $apiHelpers; private $stmCustomerService; @@ -39,8 +38,7 @@ public function __construct( $this->steamaApi = $steamaApi; } - public function updated(Person $person) - { + public function updated(Person $person) { $stmCustomer = $this->stmCustomer->newQuery()->with('site')->where('mpm_customer_id', $person->id)->first(); if ($stmCustomer) { diff --git a/src/backend/packages/inensus/steama-meter/src/Providers/EventServiceProvider.php b/src/backend/packages/inensus/steama-meter/src/Providers/EventServiceProvider.php index 9a2381dfa..2d8b2192a 100644 --- a/src/backend/packages/inensus/steama-meter/src/Providers/EventServiceProvider.php +++ b/src/backend/packages/inensus/steama-meter/src/Providers/EventServiceProvider.php @@ -6,8 +6,7 @@ use Inensus\SteamaMeter\Listeners\MeterParameterListener; use Inensus\SteamaMeter\Listeners\SmsListener; -class EventServiceProvider extends ServiceProvider -{ +class EventServiceProvider extends ServiceProvider { protected $subscribe = [ // MeterParameterListener::class, SmsListener::class, @@ -18,8 +17,7 @@ class EventServiceProvider extends ServiceProvider * * @return void */ - public function boot() - { + public function boot() { parent::boot(); } } diff --git a/src/backend/packages/inensus/steama-meter/src/Providers/ObserverServiceProvider.php b/src/backend/packages/inensus/steama-meter/src/Providers/ObserverServiceProvider.php index 1a712485b..ad233f652 100644 --- a/src/backend/packages/inensus/steama-meter/src/Providers/ObserverServiceProvider.php +++ b/src/backend/packages/inensus/steama-meter/src/Providers/ObserverServiceProvider.php @@ -8,15 +8,13 @@ use Inensus\SteamaMeter\Observers\GeographicalInformationObserver; use Inensus\SteamaMeter\Observers\PersonObserver; -class ObserverServiceProvider extends ServiceProvider -{ +class ObserverServiceProvider extends ServiceProvider { /** * Register any events for your application. * * @return void */ - public function boot() - { + public function boot() { parent::boot(); Person::observe(PersonObserver::class); GeographicalInformation::observe(GeographicalInformationObserver::class); diff --git a/src/backend/packages/inensus/steama-meter/src/Providers/RouteServiceProvider.php b/src/backend/packages/inensus/steama-meter/src/Providers/RouteServiceProvider.php index b493105df..67094d743 100644 --- a/src/backend/packages/inensus/steama-meter/src/Providers/RouteServiceProvider.php +++ b/src/backend/packages/inensus/steama-meter/src/Providers/RouteServiceProvider.php @@ -5,22 +5,18 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Support\Facades\Route; -class RouteServiceProvider extends ServiceProvider -{ +class RouteServiceProvider extends ServiceProvider { protected $namespace = 'Inensus\SteamaMeter\Http\Controllers'; - public function boot() - { + public function boot() { parent::boot(); } - public function map() - { + public function map() { $this->mapApiRoutes(); } - protected function mapApiRoutes() - { + protected function mapApiRoutes() { Route::prefix('api') ->middleware('api') ->namespace($this->namespace) diff --git a/src/backend/packages/inensus/steama-meter/src/Providers/SteamaMeterServiceProvider.php b/src/backend/packages/inensus/steama-meter/src/Providers/SteamaMeterServiceProvider.php index eefa571a4..b4e9841dc 100644 --- a/src/backend/packages/inensus/steama-meter/src/Providers/SteamaMeterServiceProvider.php +++ b/src/backend/packages/inensus/steama-meter/src/Providers/SteamaMeterServiceProvider.php @@ -24,10 +24,8 @@ use Inensus\SteamaMeter\Models\SteamaTransaction; use Inensus\SteamaMeter\SteamaMeterApi; -class SteamaMeterServiceProvider extends ServiceProvider -{ - public function boot(Filesystem $filesystem) - { +class SteamaMeterServiceProvider extends ServiceProvider { + public function boot(Filesystem $filesystem) { $this->app->register(RouteServiceProvider::class); if ($this->app->runningInConsole()) { $this->publishConfigFiles(); @@ -65,37 +63,32 @@ public function boot(Filesystem $filesystem) ); } - public function register() - { + public function register() { $this->mergeConfigFrom(__DIR__.'/../../config/steama-meter.php', 'steama'); $this->app->register(EventServiceProvider::class); $this->app->register(ObserverServiceProvider::class); $this->app->bind('SteamaMeterApi', SteamaMeterApi::class); } - public function publishConfigFiles() - { + public function publishConfigFiles() { $this->publishes([ __DIR__.'/../../config/steama-meter.php' => config_path('steama-meter.php'), ]); } - public function publishVueFiles() - { + public function publishVueFiles() { $this->publishes([ __DIR__.'/../resources/assets' => resource_path('assets/js/plugins/steama-meter'), ], 'vue-components'); } - public function publishMigrations($filesystem) - { + public function publishMigrations($filesystem) { $this->publishes([ __DIR__.'/../../database/migrations/create_steama_tables.php.stub' => $this->getMigrationFileName($filesystem), ], 'migrations'); } - protected function getMigrationFileName(Filesystem $filesystem): string - { + protected function getMigrationFileName(Filesystem $filesystem): string { $timestamp = date('Y_m_d_His'); return Collection::make($this->app->databasePath().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR) diff --git a/src/backend/packages/inensus/steama-meter/src/Services/ISynchronizeService.php b/src/backend/packages/inensus/steama-meter/src/Services/ISynchronizeService.php index ef7233423..6492c300a 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/ISynchronizeService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/ISynchronizeService.php @@ -2,8 +2,7 @@ namespace Inensus\SteamaMeter\Services; -interface ISynchronizeService -{ +interface ISynchronizeService { public function sync(); public function syncCheck(); diff --git a/src/backend/packages/inensus/steama-meter/src/Services/PackageInstallationService.php b/src/backend/packages/inensus/steama-meter/src/Services/PackageInstallationService.php index 62cb4f3af..e63ccdd9c 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/PackageInstallationService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/PackageInstallationService.php @@ -4,8 +4,7 @@ use Inensus\SteamaMeter\Helpers\ApiHelpers; -class PackageInstallationService -{ +class PackageInstallationService { public function __construct( private SteamaAgentService $agentService, private SteamaCredentialService $credentialService, @@ -19,11 +18,9 @@ public function __construct( private SteamaSmsBodyService $smsBodyService, private SteamaSmsVariableDefaultValueService $defaultValueService, private SteamaSmsFeedbackWordService $steamaSmsFeedbackWordService, - ) { - } + ) {} - public function createDefaultSettingRecords() - { + public function createDefaultSettingRecords() { $this->smsBodyService->createSmsBodies(); $this->defaultValueService->createSmsVariableDefaultValues(); $this->syncSettingService->createDefaultSettings(); diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaAgentService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaAgentService.php index 6d3d4db44..e89962357 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaAgentService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaAgentService.php @@ -16,8 +16,7 @@ use Inensus\SteamaMeter\Models\SteamaSite; use Inensus\SteamaMeter\Models\SyncStatus; -class SteamaAgentService implements ISynchronizeService -{ +class SteamaAgentService implements ISynchronizeService { private $agentCommission; private $agent; @@ -68,23 +67,20 @@ public function __construct( $this->steamaSyncActionService = $steamaSyncActionService; } - public function getAgents($request) - { + public function getAgents($request) { $perPage = $request->input('per_page') ?? 15; return $this->stmAgent->newQuery()->with(['mpmAgent.person.addresses', 'site.mpmMiniGrid'])->paginate($perPage); } - public function getAgentsCount() - { + public function getAgentsCount() { return count($this->agent->newQuery()->get()); } /** * This function uses one time on installation of the package. */ - public function createSteamaAgentCommission() - { + public function createSteamaAgentCommission() { $agentCommission = $this->agentCommission->newQuery()->where('name', 'Steama Agent Comission')->first(); if (!$agentCommission) { $agentCommission = $this->agentCommission->newQuery()->create([ @@ -98,8 +94,7 @@ public function createSteamaAgentCommission() return $agentCommission; } - public function sync() - { + public function sync() { $synSetting = $this->steamaSyncSettingService->getSyncSettingsByActionName('Agents'); $syncAction = $this->steamaSyncActionService->getSyncActionBySynSettingId($synSetting->id); try { @@ -147,8 +142,7 @@ public function sync() } } - public function syncCheck($returnData = false) - { + public function syncCheck($returnData = false) { try { $url = $this->rootUrl.'?page=1&page_size=100'; $result = $this->steamaApi->get($url); @@ -196,8 +190,7 @@ public function syncCheck($returnData = false) return $returnData ? ['data' => $agentsCollection, 'result' => true] : ['result' => true]; } - public function createRelatedAgent($stmAgent) - { + public function createRelatedAgent($stmAgent) { $person = $this->person->newQuery()->create([ 'name' => $stmAgent['first_name'], 'surname' => $stmAgent['last_name'], @@ -233,8 +226,7 @@ public function createRelatedAgent($stmAgent) return $agent; } - public function updateRelatedAgent($stmAgent, $agent) - { + public function updateRelatedAgent($stmAgent, $agent) { $relatedPerson = $agent->person; $relatedPerson->update([ 'name' => $stmAgent['first_name'], @@ -270,8 +262,7 @@ function ($q) use ($personId) { return $agent; } - private function steamaAgentHasher($steamaAgent) - { + private function steamaAgentHasher($steamaAgent) { return $this->apiHelpers->makeHash([ $steamaAgent['first_name'], $steamaAgent['last_name'], diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaBitharvesterService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaBitharvesterService.php index 90cd3f6d6..f23729f86 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaBitharvesterService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaBitharvesterService.php @@ -4,8 +4,7 @@ use Inensus\SteamaMeter\Http\Clients\SteamaMeterApiClient; -class SteamaBitharvesterService -{ +class SteamaBitharvesterService { private $steamaApi; private $rootUrl = '/bitharvesters'; @@ -16,8 +15,7 @@ public function __construct( $this->steamaApi = $steamaApi; } - public function getBitharvester($siteId) - { + public function getBitharvester($siteId) { $result = $this->steamaApi->get($this->rootUrl); $bitHarvesters = $result['results']; diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaCredentialService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaCredentialService.php index 77fa5c876..e59f5e5b8 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaCredentialService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaCredentialService.php @@ -7,8 +7,7 @@ use Inensus\SteamaMeter\Http\Clients\SteamaMeterApiClient; use Inensus\SteamaMeter\Models\SteamaCredential; -class SteamaCredentialService -{ +class SteamaCredentialService { private $rootUrl = '/get-token/'; private $credential; @@ -26,8 +25,7 @@ public function __construct( /** * This function uses one time on installation of the package. */ - public function createCredentials() - { + public function createCredentials() { return $this->credential->newQuery()->firstOrCreate(['id' => 1], [ 'username' => null, 'password' => null, @@ -37,13 +35,11 @@ public function createCredentials() ]); } - public function getCredentials() - { + public function getCredentials() { return $this->credential->newQuery()->first(); } - public function updateCredentials($data) - { + public function updateCredentials($data) { $credential = $this->credential->newQuery()->find($data['id']); $credential->update([ diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaCustomerService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaCustomerService.php index 8c9770d6b..1becf260c 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaCustomerService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaCustomerService.php @@ -23,8 +23,7 @@ use Inensus\SteamaMeter\Models\SteamaUserType; use Inensus\SteamaMeter\Models\SyncStatus; -class SteamaCustomerService implements ISynchronizeService -{ +class SteamaCustomerService implements ISynchronizeService { private $customer; private $steamaApi; @@ -107,20 +106,17 @@ public function __construct( $this->steamaSmsNotifiedCustomerService = $steamaSmsNotifiedCustomerService; } - public function getCustomers($request) - { + public function getCustomers($request) { $perPage = $request->input('per_page') ?? 15; return $this->customer->newQuery()->with(['mpmPerson.addresses', 'site.mpmMiniGrid'])->paginate($perPage); } - public function getCustomersCount() - { + public function getCustomersCount() { return count($this->customer->newQuery()->get()); } - public function sync() - { + public function sync() { $synSetting = $this->steamaSyncSettingService->getSyncSettingsByActionName('Customers'); $syncAction = $this->steamaSyncActionService->getSyncActionBySynSettingId($synSetting->id); try { @@ -179,8 +175,7 @@ public function sync() } } - public function syncCheck($returnData = false) - { + public function syncCheck($returnData = false) { try { $url = $this->rootUrl.'?page=1&page_size=100'; $result = $this->steamaApi->get($url); @@ -227,8 +222,7 @@ public function syncCheck($returnData = false) return $returnData ? ['data' => $customersCollection, 'result' => true] : ['result' => true]; } - public function createRelatedPerson($customer) - { + public function createRelatedPerson($customer) { $personData = [ 'name' => $customer['first_name'] ? $customer['first_name'] : '', 'surname' => $customer['last_name'] ? $customer['last_name'] : '', @@ -256,8 +250,7 @@ public function createRelatedPerson($customer) return $person; } - public function updateRelatedPerson($customer, $person) - { + public function updateRelatedPerson($customer, $person) { $person->update([ 'name' => $customer['first_name'] ? $customer['first_name'] : '', 'surname' => $customer['last_name'] ? $customer['last_name'] : '', @@ -275,8 +268,7 @@ public function updateRelatedPerson($customer, $person) return $person; } - public function createSteamaCustomer($meterInfo) - { + public function createSteamaCustomer($meterInfo) { $miniGrid = $meterInfo->address->city->miniGrid; $steamaSite = $this->steamaSite->newQuery()->where('mpm_mini_grid_id', $miniGrid->id)->first(); $person = $meterInfo->owner; @@ -310,8 +302,7 @@ public function createSteamaCustomer($meterInfo) ]); } - public function syncTransactionCustomer($stmCustomerId) - { + public function syncTransactionCustomer($stmCustomerId) { $url = $this->rootUrl.'/'.strval($stmCustomerId); $customer = $this->steamaApi->get($url); try { @@ -336,8 +327,7 @@ public function syncTransactionCustomer($stmCustomerId) } } - public function updateSteamaCustomerInfo($stmCustomer, $putData) - { + public function updateSteamaCustomerInfo($stmCustomer, $putData) { try { $url = $this->rootUrl.'/'.strval($stmCustomer->customer_id); $updatedSteamaCustomer = $this->steamaApi->patch($url, $putData); @@ -352,8 +342,7 @@ public function updateSteamaCustomerInfo($stmCustomer, $putData) } } - public function searchCustomer($searchTerm, $paginate) - { + public function searchCustomer($searchTerm, $paginate) { if ($paginate === 1) { return $this->customer->newQuery()->with(['mpmPerson.addresses', 'site.mpmMiniGrid']) ->WhereHas('site.mpmMiniGrid', function ($q) use ($searchTerm) { @@ -375,8 +364,7 @@ public function searchCustomer($searchTerm, $paginate) })->get(); } - public function setStmCustomerPaymentPlan($customer) - { + public function setStmCustomerPaymentPlan($customer) { $plan = explode(',', $customer['payment_plan'])[0]; switch ($plan) { @@ -444,8 +432,7 @@ public function setStmCustomerPaymentPlan($customer) } } - public function setFlatRatePlan($customer) - { + public function setFlatRatePlan($customer) { $customerBasisPlan = $this->customerBasisPaymentPlan->newQuery()->make([ 'customer_id' => $customer['id'], ]); @@ -457,8 +444,7 @@ public function setFlatRatePlan($customer) $customerBasisPlan->save(); } - public function setPerKwhPlan($customer) - { + public function setPerKwhPlan($customer) { $customerBasisPlan = $this->customerBasisPaymentPlan->newQuery()->make([ 'customer_id' => $customer['id'], ]); @@ -469,8 +455,7 @@ public function setPerKwhPlan($customer) $customerBasisPlan->save(); } - public function setMinimumTopUpPlan($customer) - { + public function setMinimumTopUpPlan($customer) { $plan = explode(',', $customer['payment_plan']); $threshold = $plan[1]; @@ -484,8 +469,7 @@ public function setMinimumTopUpPlan($customer) $customerBasisPlan->save(); } - public function setSubscriptionPlan($customer) - { + public function setSubscriptionPlan($customer) { $plan = explode(',', $customer['payment_plan']); $fee = $plan[1]; $duration = $plan[2]; @@ -506,8 +490,7 @@ public function setSubscriptionPlan($customer) $customerBasisPlan->save(); } - public function setHybridPlan($customer) - { + public function setHybridPlan($customer) { $plan = explode(',', $customer['payment_plan']); $connectionFee = $plan[1]; $subscriptionCost = $plan[2]; @@ -526,15 +509,13 @@ public function setHybridPlan($customer) $customerBasisPlan->save(); } - public function getSteamaCustomerName($customerId) - { + public function getSteamaCustomerName($customerId) { $stmCustomer = $this->customer->newQuery()->with('mpmPerson')->where('customer_id', $customerId)->first(); return ['name' => $stmCustomer->mpmPerson->name.' '.$stmCustomer->mpmPerson->surname]; } - public function getSteamaCustomersWithAddress() - { + public function getSteamaCustomersWithAddress() { return $this->customer->newQuery()->with([ 'mpmPerson.addresses', ])->whereHas('mpmPerson.addresses', function ($q) { @@ -542,8 +523,7 @@ public function getSteamaCustomersWithAddress() }); } - private function steamaCustomerHasher($steamaCustomer) - { + private function steamaCustomerHasher($steamaCustomer) { return $this->apiHelpers->makeHash([ $steamaCustomer['user_type'], $steamaCustomer['control_type'], @@ -560,8 +540,7 @@ private function steamaCustomerHasher($steamaCustomer) ]); } - public function getSteamaCustomerWithPhone($phoneNumber) - { + public function getSteamaCustomerWithPhone($phoneNumber) { $person = $this->person::with(['addresses']) ->whereHas( 'addresses', diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaMeterReadingService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaMeterReadingService.php index 09611874f..3905cf83f 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaMeterReadingService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaMeterReadingService.php @@ -9,8 +9,7 @@ use Inensus\SteamaMeter\Http\Clients\SteamaMeterApiClient; use Inensus\SteamaMeter\Models\SteamaMeter; -class SteamaMeterReadingService -{ +class SteamaMeterReadingService { private $steamaMeter; private $steamaApi; @@ -27,8 +26,7 @@ public function __construct( $this->meterConsumtion = $meterConsumption; } - public function getMeterReadingsThroughHourlyWorkingJob() - { + public function getMeterReadingsThroughHourlyWorkingJob() { $now = Carbon::now()->toIso8601ZuluString(); $oneHourEarlier = Carbon::now()->subHours(10)->toIso8601ZuluString(); $this->steamaMeter->newQuery()->get()->each(function ($meter) use ($now, $oneHourEarlier) { diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaMeterService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaMeterService.php index 13e2d1e2c..56366320f 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaMeterService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaMeterService.php @@ -23,8 +23,7 @@ use Inensus\SteamaMeter\Models\SteamaTariff; use Inensus\SteamaMeter\Models\SyncStatus; -class SteamaMeterService implements ISynchronizeService -{ +class SteamaMeterService implements ISynchronizeService { private $rootUrl = '/meters'; public function __construct( @@ -43,11 +42,9 @@ public function __construct( private SteamaTariff $tariff, private SteamaSyncSettingService $steamaSyncSettingService, private StemaSyncActionService $steamaSyncActionService, - ) { - } + ) {} - public function getMeters($request) - { + public function getMeters($request) { $perPage = $request->input('per_page') ?? 15; return $this->stmMeter->newQuery()->with([ @@ -57,13 +54,11 @@ public function getMeters($request) ])->paginate($perPage); } - public function getMetersCount() - { + public function getMetersCount() { return count($this->stmMeter->newQuery()->get()); } - public function sync(): LengthAwarePaginator - { + public function sync(): LengthAwarePaginator { $synSetting = $this->steamaSyncSettingService->getSyncSettingsByActionName('Meters'); $syncAction = $this->steamaSyncActionService->getSyncActionBySynSettingId($synSetting->id); try { @@ -107,8 +102,7 @@ public function sync(): LengthAwarePaginator } } - public function syncCheck($returnData = false) - { + public function syncCheck($returnData = false) { try { $url = $this->rootUrl.'?page=1&page_size=100'; $result = $this->steamaApi->get($url); @@ -156,8 +150,7 @@ public function syncCheck($returnData = false) return $returnData ? ['data' => $metersCollection, 'result' => true] : ['result' => true]; } - public function createRelatedMeter($stmMeter) - { + public function createRelatedMeter($stmMeter) { try { DB::connection('shard')->beginTransaction(); $meterSerial = $stmMeter['reference']; @@ -236,8 +229,7 @@ public function createRelatedMeter($stmMeter) } } - public function updateRelatedMeter($stmMeter, $meter) - { + public function updateRelatedMeter($stmMeter, $meter) { $meterSerial = $stmMeter['reference']; $meter->serial_number = $meterSerial; $meter->meterType()->associate($this->getMeterType($stmMeter)); @@ -260,8 +252,7 @@ public function updateRelatedMeter($stmMeter, $meter) return $meter; } - public function getMeterType($stmMeter) - { + public function getMeterType($stmMeter) { $version = $stmMeter['version']; $usageSpikeThreshold = $stmMeter['usage_spike_threshold']; $stmMeterType = $this->stmMeterType->newQuery()->with('mpmMeterType')->where( @@ -294,8 +285,7 @@ public function getMeterType($stmMeter) } } - public function creteSteamaMeter($meterInfo, $stmCustomer) - { + public function creteSteamaMeter($meterInfo, $stmCustomer) { $geographicalInformation = $meterInfo->address->geo; $points = explode(',', $geographicalInformation); $postParams = [ @@ -316,8 +306,7 @@ public function creteSteamaMeter($meterInfo, $stmCustomer) ]); } - public function updateSteamaMeterInfo($stmMeter, $putParams) - { + public function updateSteamaMeterInfo($stmMeter, $putParams) { $url = '/bitharvesters/'.$stmMeter->bit_harvester_id.$this->rootUrl.'/'.$stmMeter->meter_id.'/'; $meter = $this->steamaApi->patch($url, $putParams); $stmMeterHash = $this->steamaMeterHasher($meter); @@ -328,8 +317,7 @@ public function updateSteamaMeterInfo($stmMeter, $putParams) return $stmMeter->fresh(); } - private function steamaMeterHasher($steamaMeter) - { + private function steamaMeterHasher($steamaMeter) { return $this->apiHelpers->makeHash([ $steamaMeter['reference'], $steamaMeter['version'], diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSettingService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSettingService.php index ba3669eb2..85dbc2abe 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSettingService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSettingService.php @@ -4,17 +4,14 @@ use Inensus\SteamaMeter\Models\SteamaSetting; -class SteamaSettingService -{ +class SteamaSettingService { private $steamaSetting; - public function __construct(SteamaSetting $steamaSetting) - { + public function __construct(SteamaSetting $steamaSetting) { $this->steamaSetting = $steamaSetting; } - public function getSettings() - { + public function getSettings() { return $this->steamaSetting->newQuery()->with(['settingSms', 'settingSync'])->whereHasMorph('setting', '*')->get(); } } diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSiteLevelPaymentPlanTypeService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSiteLevelPaymentPlanTypeService.php index b93ee0489..15b271ca2 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSiteLevelPaymentPlanTypeService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSiteLevelPaymentPlanTypeService.php @@ -4,20 +4,17 @@ use Inensus\SteamaMeter\Models\SteamaSiteLevelPaymentPlanType; -class SteamaSiteLevelPaymentPlanTypeService -{ +class SteamaSiteLevelPaymentPlanTypeService { private $paymentPlanType; - public function __construct(SteamaSiteLevelPaymentPlanType $paymentPlanTypeModel) - { + public function __construct(SteamaSiteLevelPaymentPlanType $paymentPlanTypeModel) { $this->paymentPlanType = $paymentPlanTypeModel; } /** * This function uses one time on installation of the package. */ - public function createPaymentPlans() - { + public function createPaymentPlans() { $paymentPlans = [ 'Credit Bundles', 'Time-of-use Pricing', diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSiteService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSiteService.php index b4453b028..83540c232 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSiteService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSiteService.php @@ -13,8 +13,7 @@ use Inensus\SteamaMeter\Models\SteamaSite; use Inensus\SteamaMeter\Models\SyncStatus; -class SteamaSiteService implements ISynchronizeService -{ +class SteamaSiteService implements ISynchronizeService { private $site; private $steamaApi; @@ -57,20 +56,17 @@ public function __construct( $this->steamaSyncActionService = $steamaSyncActionService; } - public function getSites($request) - { + public function getSites($request) { $perPage = $request->input('per_page') ?? 15; return $this->site->newQuery()->with('mpmMiniGrid.location')->paginate($perPage); } - public function getSitesCount() - { + public function getSitesCount() { return count($this->site->newQuery()->get()); } - public function sync() - { + public function sync() { $synSetting = $this->steamaSyncSettingService->getSyncSettingsByActionName('Sites'); $syncAction = $this->steamaSyncActionService->getSyncActionBySynSettingId($synSetting->id); try { @@ -109,8 +105,7 @@ public function sync() } } - public function syncCheck($returnData = false) - { + public function syncCheck($returnData = false) { try { $url = $this->rootUrl.'?page=1&page_size=100'; $result = $this->steamaApi->get($url); @@ -160,8 +155,7 @@ public function syncCheck($returnData = false) return $returnData ? ['data' => $sitesCollection, 'result' => true] : ['result' => true]; } - public function creteRelatedMiniGrid($site) - { + public function creteRelatedMiniGrid($site) { $cluster = $this->cluster->newQuery()->latest('created_at')->first(); $miniGrid = $this->miniGrid->newQuery()->create([ 'name' => $site['name'], @@ -176,8 +170,7 @@ public function creteRelatedMiniGrid($site) return $miniGrid; } - public function updateRelatedMiniGrid($site, $miniGrid) - { + public function updateRelatedMiniGrid($site, $miniGrid) { $miniGrid->update([ 'name' => $site['name'], ]); @@ -185,8 +178,7 @@ public function updateRelatedMiniGrid($site, $miniGrid) return $miniGrid->fresh(); } - public function createOrUpdateGeographicalInformation($miniGridId, $site) - { + public function createOrUpdateGeographicalInformation($miniGridId, $site) { $geographicalInformation = $this->geographicalInformation->newQuery()->whereHasMorph( 'owner', [MiniGrid::class], @@ -210,13 +202,11 @@ static function ($q) use ($miniGridId) { } } - public function checkLocationAvailability() - { + public function checkLocationAvailability() { return $this->cluster->newQuery()->latest('created_at')->first(); } - private function steamaSiteHasher($steamaSite) - { + private function steamaSiteHasher($steamaSite) { return $this->apiHelpers->makeHash([ $steamaSite['name'], $steamaSite['latitude'], diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSmsBodyService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSmsBodyService.php index acebec7e9..56d0b6584 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSmsBodyService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSmsBodyService.php @@ -4,27 +4,22 @@ use Inensus\SteamaMeter\Models\SteamaSmsBody; -class SteamaSmsBodyService -{ +class SteamaSmsBodyService { private $smsBody; - public function __construct(SteamaSmsBody $smsBody) - { + public function __construct(SteamaSmsBody $smsBody) { $this->smsBody = $smsBody; } - public function getSmsBodyByReference($reference) - { + public function getSmsBodyByReference($reference) { return $this->smsBody->newQuery()->where('reference', $reference)->firstOrFail(); } - public function getSmsBodies() - { + public function getSmsBodies() { return $this->smsBody->newQuery()->get(); } - public function updateSmsBodies($smsBodiesData) - { + public function updateSmsBodies($smsBodiesData) { $smsBodies = $this->smsBody->newQuery()->get(); collect($smsBodiesData)->each(function ($smsBody) use ($smsBodies) { $smsBodies->filter(function ($body) use ($smsBody) { @@ -37,13 +32,11 @@ public function updateSmsBodies($smsBodiesData) return $smsBodies; } - public function getNullBodies() - { + public function getNullBodies() { return $this->smsBody->newQuery()->whereNull('body')->get(); } - public function createSmsBodies() - { + public function createSmsBodies() { $smsBodies = [ [ 'reference' => 'SteamaSmsLowBalanceHeader', diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSmsFeedbackWordService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSmsFeedbackWordService.php index aea962ba9..e2d8a28e7 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSmsFeedbackWordService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSmsFeedbackWordService.php @@ -4,29 +4,24 @@ use Inensus\SteamaMeter\Models\SteamaSmsFeedbackWord; -class SteamaSmsFeedbackWordService -{ +class SteamaSmsFeedbackWordService { private $smsFeedbackWord; - public function __construct(SteamaSmsFeedbackWord $smsFeedbackWord) - { + public function __construct(SteamaSmsFeedbackWord $smsFeedbackWord) { $this->smsFeedbackWord = $smsFeedbackWord; } - public function getSmsFeedbackWords() - { + public function getSmsFeedbackWords() { return $this->smsFeedbackWord->newQuery()->get(); } - public function createSmsFeedbackWord() - { + public function createSmsFeedbackWord() { return $this->smsFeedbackWord->newQuery()->firstOrCreate(['id' => 1], [ 'meter_balance' => null, ]); } - public function updateSmsFeedbackWord($smsFeedbackWord, $smsFeedbackWordData) - { + public function updateSmsFeedbackWord($smsFeedbackWord, $smsFeedbackWordData) { $smsFeedbackWord->update([ 'meter_balance' => $smsFeedbackWordData['meter_balance'], ]); diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSmsNotifiedCustomerService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSmsNotifiedCustomerService.php index 6a7ed3367..3f6626dad 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSmsNotifiedCustomerService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSmsNotifiedCustomerService.php @@ -4,8 +4,7 @@ use Inensus\SteamaMeter\Models\SteamaSmsNotifiedCustomer; -class SteamaSmsNotifiedCustomerService -{ +class SteamaSmsNotifiedCustomerService { private $steamaSmsNotifiedCustomer; public function __construct( @@ -14,13 +13,11 @@ public function __construct( $this->steamaSmsNotifiedCustomer = $steamaSmsNotifiedCustomer; } - public function getSteamaSmsNotifiedCustomers() - { + public function getSteamaSmsNotifiedCustomers() { return $this->steamaSmsNotifiedCustomer->newQuery()->get(); } - public function createTransactionSmsNotify($customerId, $transactionId) - { + public function createTransactionSmsNotify($customerId, $transactionId) { return $this->steamaSmsNotifiedCustomer->newQuery()->create([ 'customer_id' => $customerId, 'notify_type' => 'transaction', @@ -28,16 +25,14 @@ public function createTransactionSmsNotify($customerId, $transactionId) ]); } - public function createLowBalanceSmsNotify($customerId) - { + public function createLowBalanceSmsNotify($customerId) { return $this->steamaSmsNotifiedCustomer->newQuery()->create([ 'customer_id' => $customerId, 'notify_type' => 'low_balance', ]); } - public function removeLowBalancedCustomer($customer) - { + public function removeLowBalancedCustomer($customer) { if ($customer['low_balance_warning'] >= $customer['account_balance']) { return false; } diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSmsSettingService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSmsSettingService.php index 4ea598e94..dd3dd1cc4 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSmsSettingService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSmsSettingService.php @@ -5,20 +5,17 @@ use Inensus\SteamaMeter\Models\SteamaSetting; use Inensus\SteamaMeter\Models\SteamaSmsSetting; -class SteamaSmsSettingService -{ +class SteamaSmsSettingService { private $smsSetting; private $setting; - public function __construct(SteamaSmsSetting $smsSetting, SteamaSetting $setting) - { + public function __construct(SteamaSmsSetting $smsSetting, SteamaSetting $setting) { $this->smsSetting = $smsSetting; $this->setting = $setting; } - public function createDefaultSettings() - { + public function createDefaultSettings() { $smsTransaction = $this->smsSetting->newQuery()->where('state', 'Transactions')->first(); if (!$smsTransaction) { $smsSetting = $this->setting->newQuery()->make(); @@ -41,8 +38,7 @@ public function createDefaultSettings() } } - public function updateSmsSettings($smsSettings) - { + public function updateSmsSettings($smsSettings) { foreach ($smsSettings as $key => $setting) { $smsSetting = $this->smsSetting->newQuery()->find($setting['id']); if ($smsSetting) { @@ -56,8 +52,7 @@ public function updateSmsSettings($smsSettings) return $this->smsSetting->newQuery()->get(); } - public function getSmsSettings() - { + public function getSmsSettings() { return $this->smsSetting->newQuery()->get(); } } diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSmsVariableDefaultValueService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSmsVariableDefaultValueService.php index 61eb54c76..7d591be2d 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSmsVariableDefaultValueService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSmsVariableDefaultValueService.php @@ -4,22 +4,18 @@ use Inensus\SteamaMeter\Models\SteamaSmsVariableDefaultValue; -class SteamaSmsVariableDefaultValueService -{ +class SteamaSmsVariableDefaultValueService { private $smsVariableDefaultValue; - public function __construct(SteamaSmsVariableDefaultValue $smsVariableDefaultValue) - { + public function __construct(SteamaSmsVariableDefaultValue $smsVariableDefaultValue) { $this->smsVariableDefaultValue = $smsVariableDefaultValue; } - public function getSmsVariableDefaultValues() - { + public function getSmsVariableDefaultValues() { return $this->smsVariableDefaultValue->newQuery()->get(); } - public function createSmsVariableDefaultValues() - { + public function createSmsVariableDefaultValues() { $smsVariableDefaultValues = [ [ 'variable' => 'name', diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSyncSettingService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSyncSettingService.php index ee626ffc6..3be5657a7 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaSyncSettingService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaSyncSettingService.php @@ -8,8 +8,7 @@ use Inensus\SteamaMeter\Models\SteamaSetting; use Inensus\SteamaMeter\Models\SteamaSyncSetting; -class SteamaSyncSettingService -{ +class SteamaSyncSettingService { private $syncSetting; private $setting; @@ -26,8 +25,7 @@ public function __construct( $this->syncActionService = $syncActionService; } - public function createDefaultSettings() - { + public function createDefaultSettings() { $dayInterval = CarbonInterval::make('1day'); $fiveMinInterval = CarbonInterval::make('5minute'); @@ -123,8 +121,7 @@ public function createDefaultSettings() } } - public function updateSyncSettings($syncSettings) - { + public function updateSyncSettings($syncSettings) { foreach ($syncSettings as $setting) { $syncSetting = $this->syncSetting->newQuery()->find($setting['id']); $intervalStr = $setting['sync_in_value_num'].$setting['sync_in_value_str']; @@ -149,13 +146,11 @@ public function updateSyncSettings($syncSettings) return $this->syncSetting->newQuery()->get(); } - public function getSyncSettings() - { + public function getSyncSettings() { return $this->syncSetting->newQuery()->get(); } - public function getSyncSettingsByActionName($actionName) - { + public function getSyncSettingsByActionName($actionName) { try { return $this->syncSetting->newQuery()->where('action_name', $actionName)->firstOrFail(); } catch (\Exception $exception) { diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaTariffService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaTariffService.php index e0341571f..d925dbf2d 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaTariffService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaTariffService.php @@ -5,17 +5,13 @@ use App\Models\Meter\MeterTariff; use Inensus\SteamaMeter\Models\SteamaTariff; -class SteamaTariffService -{ - public function __construct(private readonly SteamaTariff $tariff, private readonly MeterTariff $meterTariff) - { - } +class SteamaTariffService { + public function __construct(private readonly SteamaTariff $tariff, private readonly MeterTariff $meterTariff) {} /** * This function uses one time on installation of the package. */ - public function createTariff() - { + public function createTariff() { $meterTariff = $this->meterTariff->newQuery()->where('name', 'Steama External Tariff')->first(); if (!$meterTariff) { $meterTariff = $this->meterTariff->newQuery()->create([ diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaTransactionsService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaTransactionsService.php index db04efcbf..0550c83ec 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaTransactionsService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaTransactionsService.php @@ -13,8 +13,7 @@ use Inensus\SteamaMeter\Models\SteamaMeter; use Inensus\SteamaMeter\Models\SteamaTransaction; -class SteamaTransactionsService implements ISynchronizeService -{ +class SteamaTransactionsService implements ISynchronizeService { private $stemaMeterService; private $steamaCustomerService; @@ -77,8 +76,7 @@ public function __construct( $this->steamaSyncActionService = $steamaSyncActionService; } - public function sync() - { + public function sync() { $synSetting = $this->steamaSyncSettingService->getSyncSettingsByActionName('Transactions'); $syncAction = $this->steamaSyncActionService->getSyncActionBySynSettingId($synSetting->id); $syncCheck = $this->syncCheck(); @@ -146,8 +144,7 @@ public function sync() return $syncCheck['message']; } - public function syncCheck() - { + public function syncCheck() { $credentials = $this->steamaCredentialService->getCredentials(); if ($credentials) { if ($credentials->is_authenticated) { @@ -183,15 +180,13 @@ public function syncCheck() } } - public function getTransactionsByCustomer($customer, $request) - { + public function getTransactionsByCustomer($customer, $request) { $perPage = $request->input('per_page') ?? 15; return $this->steamaTransaction->newQuery()->where('customer_id', $customer)->paginate($perPage); } - public function getSteamaTransactions($transactionMin) - { + public function getSteamaTransactions($transactionMin) { return $this->steamaTransaction->newQuery()->with(['thirdPartyTransaction.transaction'])->where( 'timestamp', '>=', @@ -199,8 +194,7 @@ public function getSteamaTransactions($transactionMin) )->where('category', 'PAY')->get(); } - private function createSteamaTransaction($transaction) - { + private function createSteamaTransaction($transaction) { return $this->steamaTransaction->newQuery()->create([ 'transaction_id' => $transaction['id'], 'site_id' => $transaction['site_id'], @@ -213,8 +207,7 @@ private function createSteamaTransaction($transaction) ]); } - private function createThirdPartyTransaction($transaction, $steamaTransaction) - { + private function createThirdPartyTransaction($transaction, $steamaTransaction) { $thirdPartyTransaction = $this->thirdPartyTransaction->newQuery()->make([ 'transaction_id' => $transaction['id'], 'status' => $transaction['reversed_by_id'] !== null ? -1 : 1, @@ -227,8 +220,7 @@ private function createThirdPartyTransaction($transaction, $steamaTransaction) return $thirdPartyTransaction; } - private function createTransaction($transaction, $thirdPartyTransaction, $steamaMeter) - { + private function createTransaction($transaction, $thirdPartyTransaction, $steamaMeter) { $transaction = $this->transaction->newQuery()->make([ 'amount' => (int) $transaction['amount'], 'sender' => $transaction['customer_telephone'], @@ -243,8 +235,7 @@ private function createTransaction($transaction, $thirdPartyTransaction, $steama return $transaction; } - private function createToken($steamaMeter, $mainTransaction, $transaction) - { + private function createToken($steamaMeter, $mainTransaction, $transaction) { $stmCustomer = $steamaMeter->stmCustomer->first(); $customerEnergyPrice = $stmCustomer->energy_price; $chargedEnergy = $mainTransaction->amount / $customerEnergyPrice; @@ -266,8 +257,7 @@ private function createToken($steamaMeter, $mainTransaction, $transaction) return $token; } - private function createPayment($steamaMeter, $mainTransaction, $token) - { + private function createPayment($steamaMeter, $mainTransaction, $token) { $owner = $steamaMeter->mpmMeter->meterParameter->owner; if ($owner) { diff --git a/src/backend/packages/inensus/steama-meter/src/Services/SteamaUserTypeService.php b/src/backend/packages/inensus/steama-meter/src/Services/SteamaUserTypeService.php index 342b52736..211976f4a 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/SteamaUserTypeService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/SteamaUserTypeService.php @@ -6,8 +6,7 @@ use App\Models\SubConnectionType; use Inensus\SteamaMeter\Models\SteamaUserType; -class SteamaUserTypeService -{ +class SteamaUserTypeService { private $connectionType; private $userType; @@ -27,8 +26,7 @@ public function __construct( /** * This function uses one time on installation of the package. */ - public function createUserTypes($tariff) - { + public function createUserTypes($tariff) { $connectionTypes = [ 'NA' => 'Not Specified', 'RES' => 'Residential', diff --git a/src/backend/packages/inensus/steama-meter/src/Services/StemaSyncActionService.php b/src/backend/packages/inensus/steama-meter/src/Services/StemaSyncActionService.php index f298b6146..2a2c50422 100644 --- a/src/backend/packages/inensus/steama-meter/src/Services/StemaSyncActionService.php +++ b/src/backend/packages/inensus/steama-meter/src/Services/StemaSyncActionService.php @@ -6,32 +6,26 @@ use Carbon\CarbonInterval; use Inensus\SteamaMeter\Models\SteamaSyncAction; -class StemaSyncActionService -{ +class StemaSyncActionService { private $syncAction; - public function __construct(SteamaSyncAction $syncAction) - { + public function __construct(SteamaSyncAction $syncAction) { $this->syncAction = $syncAction; } - public function createSyncAction($syncAction) - { + public function createSyncAction($syncAction) { return $this->syncAction->newQuery()->create($syncAction); } - public function getSyncActionBySynSettingId($settingId) - { + public function getSyncActionBySynSettingId($settingId) { return $this->syncAction->newQuery()->where('sync_setting_id', $settingId)->first(); } - public function getActionsNeedsToSync() - { + public function getActionsNeedsToSync() { return $this->syncAction->newQuery()->where('next_sync', '<=', Carbon::now())->orderBy('next_sync')->get(); } - public function updateSyncAction($syncAction, $syncSetting, $syncResult) - { + public function updateSyncAction($syncAction, $syncSetting, $syncResult) { if (!$syncResult) { return $syncAction->update([ 'attempts' => $syncAction->attempts + 1, diff --git a/src/backend/packages/inensus/steama-meter/src/Sms/BodyParsers/SteamaSmsBalanceFeedbackBody.php b/src/backend/packages/inensus/steama-meter/src/Sms/BodyParsers/SteamaSmsBalanceFeedbackBody.php index e9bf50d0e..e91626dda 100644 --- a/src/backend/packages/inensus/steama-meter/src/Sms/BodyParsers/SteamaSmsBalanceFeedbackBody.php +++ b/src/backend/packages/inensus/steama-meter/src/Sms/BodyParsers/SteamaSmsBalanceFeedbackBody.php @@ -5,19 +5,16 @@ use App\Sms\BodyParsers\SmsBodyParser; use Inensus\SteamaMeter\Models\SteamaCustomer; -class SteamaSmsBalanceFeedbackBody extends SmsBodyParser -{ +class SteamaSmsBalanceFeedbackBody extends SmsBodyParser { protected $variables = ['account_balance']; protected $steamaCustomer; - public function __construct(SteamaCustomer $steamaCustomer) - { + public function __construct(SteamaCustomer $steamaCustomer) { $this->steamaCustomer = $steamaCustomer; } - protected function getVariableValue($variable) - { + protected function getVariableValue($variable) { switch ($variable) { case 'account_balance': $variable = $this->steamaCustomer->account_balance; diff --git a/src/backend/packages/inensus/steama-meter/src/Sms/BodyParsers/SteamaSmsBalanceFeedbackHeader.php b/src/backend/packages/inensus/steama-meter/src/Sms/BodyParsers/SteamaSmsBalanceFeedbackHeader.php index 46ec42a10..2f0b68fa5 100644 --- a/src/backend/packages/inensus/steama-meter/src/Sms/BodyParsers/SteamaSmsBalanceFeedbackHeader.php +++ b/src/backend/packages/inensus/steama-meter/src/Sms/BodyParsers/SteamaSmsBalanceFeedbackHeader.php @@ -5,19 +5,16 @@ use App\Sms\BodyParsers\SmsBodyParser; use Inensus\SteamaMeter\Models\SteamaCustomer; -class SteamaSmsBalanceFeedbackHeader extends SmsBodyParser -{ +class SteamaSmsBalanceFeedbackHeader extends SmsBodyParser { protected $variables = ['name', 'surname']; protected $steamaCustomer; - public function __construct(SteamaCustomer $steamaCustomer) - { + public function __construct(SteamaCustomer $steamaCustomer) { $this->steamaCustomer = $steamaCustomer; } - protected function getVariableValue($variable) - { + protected function getVariableValue($variable) { switch ($variable) { case 'name': $variable = $this->steamaCustomer->mpmPerson->name; diff --git a/src/backend/packages/inensus/steama-meter/src/Sms/BodyParsers/SteamaSmsLowBalanceBody.php b/src/backend/packages/inensus/steama-meter/src/Sms/BodyParsers/SteamaSmsLowBalanceBody.php index 7ed48ac7b..652ad972e 100644 --- a/src/backend/packages/inensus/steama-meter/src/Sms/BodyParsers/SteamaSmsLowBalanceBody.php +++ b/src/backend/packages/inensus/steama-meter/src/Sms/BodyParsers/SteamaSmsLowBalanceBody.php @@ -5,19 +5,16 @@ use App\Sms\BodyParsers\SmsBodyParser; use Inensus\SteamaMeter\Models\SteamaCustomer; -class SteamaSmsLowBalanceBody extends SmsBodyParser -{ +class SteamaSmsLowBalanceBody extends SmsBodyParser { protected $variables = ['low_balance_warning', 'account_balance']; protected $steamaCustomer; - public function __construct(SteamaCustomer $steamaCustomer) - { + public function __construct(SteamaCustomer $steamaCustomer) { $this->steamaCustomer = $steamaCustomer; } - protected function getVariableValue($variable) - { + protected function getVariableValue($variable) { switch ($variable) { case 'low_balance_warning': $variable = $this->steamaCustomer->low_balance_warning; diff --git a/src/backend/packages/inensus/steama-meter/src/Sms/BodyParsers/SteamaSmsLowBalanceHeader.php b/src/backend/packages/inensus/steama-meter/src/Sms/BodyParsers/SteamaSmsLowBalanceHeader.php index 4a0fb5d1d..22349118a 100644 --- a/src/backend/packages/inensus/steama-meter/src/Sms/BodyParsers/SteamaSmsLowBalanceHeader.php +++ b/src/backend/packages/inensus/steama-meter/src/Sms/BodyParsers/SteamaSmsLowBalanceHeader.php @@ -5,19 +5,16 @@ use App\Sms\BodyParsers\SmsBodyParser; use Inensus\SteamaMeter\Models\SteamaCustomer; -class SteamaSmsLowBalanceHeader extends SmsBodyParser -{ +class SteamaSmsLowBalanceHeader extends SmsBodyParser { protected $variables = ['name', 'surname']; protected $steamaCustomer; - public function __construct(SteamaCustomer $steamaCustomer) - { + public function __construct(SteamaCustomer $steamaCustomer) { $this->steamaCustomer = $steamaCustomer; } - protected function getVariableValue($variable) - { + protected function getVariableValue($variable) { switch ($variable) { case 'name': $variable = $this->steamaCustomer->mpmPerson->name; diff --git a/src/backend/packages/inensus/steama-meter/src/Sms/Senders/BalanceFeedback.php b/src/backend/packages/inensus/steama-meter/src/Sms/Senders/BalanceFeedback.php index 444b3120d..0b80eba09 100644 --- a/src/backend/packages/inensus/steama-meter/src/Sms/Senders/BalanceFeedback.php +++ b/src/backend/packages/inensus/steama-meter/src/Sms/Senders/BalanceFeedback.php @@ -4,8 +4,7 @@ use App\Sms\Senders\SmsSender; -class BalanceFeedback extends SmsSender -{ +class BalanceFeedback extends SmsSender { protected $references = [ 'header' => 'SteamaSmsBalanceFeedbackHeader', 'body' => 'SteamaSmsBalanceFeedbackBody', diff --git a/src/backend/packages/inensus/steama-meter/src/Sms/Senders/LowBalanceLimitNotifier.php b/src/backend/packages/inensus/steama-meter/src/Sms/Senders/LowBalanceLimitNotifier.php index 6eacaef8d..f7ad4fe1f 100644 --- a/src/backend/packages/inensus/steama-meter/src/Sms/Senders/LowBalanceLimitNotifier.php +++ b/src/backend/packages/inensus/steama-meter/src/Sms/Senders/LowBalanceLimitNotifier.php @@ -4,8 +4,7 @@ use App\Sms\Senders\SmsSender; -class LowBalanceLimitNotifier extends SmsSender -{ +class LowBalanceLimitNotifier extends SmsSender { protected $references = [ 'header' => 'SteamaSmsLowBalanceHeader', 'body' => 'SteamaSmsLowBalanceBody', diff --git a/src/backend/packages/inensus/steama-meter/src/Sms/Senders/SteamaSmsConfig.php b/src/backend/packages/inensus/steama-meter/src/Sms/Senders/SteamaSmsConfig.php index d0b402651..29f98709d 100644 --- a/src/backend/packages/inensus/steama-meter/src/Sms/Senders/SteamaSmsConfig.php +++ b/src/backend/packages/inensus/steama-meter/src/Sms/Senders/SteamaSmsConfig.php @@ -5,8 +5,7 @@ use App\Sms\Senders\SmsConfigsCore; use Inensus\SteamaMeter\Sms\SteamaSmsTypes; -class SteamaSmsConfig extends SmsConfigsCore -{ +class SteamaSmsConfig extends SmsConfigsCore { public $smsTypes = [ SteamaSmsTypes::LOW_BALANCE_LIMIT_NOTIFIER => 'Inensus\SteamaMeter\Sms\Senders\LowBalanceLimitNotifier', SteamaSmsTypes::BALANCE_FEEDBACK => 'Inensus\SteamaMeter\Sms\Senders\BalanceFeedback', diff --git a/src/backend/packages/inensus/steama-meter/src/Sms/SteamaSmsTypes.php b/src/backend/packages/inensus/steama-meter/src/Sms/SteamaSmsTypes.php index de0250024..63ff24721 100644 --- a/src/backend/packages/inensus/steama-meter/src/Sms/SteamaSmsTypes.php +++ b/src/backend/packages/inensus/steama-meter/src/Sms/SteamaSmsTypes.php @@ -2,8 +2,7 @@ namespace Inensus\SteamaMeter\Sms; -class SteamaSmsTypes -{ +class SteamaSmsTypes { public const LOW_BALANCE_LIMIT_NOTIFIER = 1; public const BALANCE_FEEDBACK = 2; diff --git a/src/backend/packages/inensus/steama-meter/src/SteamaMeterApi.php b/src/backend/packages/inensus/steama-meter/src/SteamaMeterApi.php index 0eca704df..649672abe 100644 --- a/src/backend/packages/inensus/steama-meter/src/SteamaMeterApi.php +++ b/src/backend/packages/inensus/steama-meter/src/SteamaMeterApi.php @@ -14,8 +14,7 @@ use Inensus\SteamaMeter\Services\SteamaCredentialService; use Inensus\SteamaMeter\Services\SteamaCustomerService; -class SteamaMeterApi implements IManufacturerAPI -{ +class SteamaMeterApi implements IManufacturerAPI { protected $api; public function __construct( @@ -28,8 +27,7 @@ public function __construct( $this->api = $httpClient; } - public function chargeDevice(TransactionDataContainer $transactionContainer): array - { + public function chargeDevice(TransactionDataContainer $transactionContainer): array { $owner = $transactionContainer->device->person; $stmCustomer = $this->steamaCustomer->newQuery()->with('paymentPlans')->where( @@ -107,7 +105,5 @@ public function chargeDevice(TransactionDataContainer $transactionContainer): ar } } - public function clearDevice(Device $device) - { - } + public function clearDevice(Device $device) {} } diff --git a/src/backend/packages/inensus/steama-meter/src/Tests/Feature/SendSms.php b/src/backend/packages/inensus/steama-meter/src/Tests/Feature/SendSms.php index 9ecf1d300..deade5706 100644 --- a/src/backend/packages/inensus/steama-meter/src/Tests/Feature/SendSms.php +++ b/src/backend/packages/inensus/steama-meter/src/Tests/Feature/SendSms.php @@ -18,13 +18,11 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class SendSms extends TestCase -{ +class SendSms extends TestCase { use RefreshDatabase; /** @test */ - public function isMeterBalanceFeedbackSend() - { + public function isMeterBalanceFeedbackSend() { Queue::fake(); Config::set('app.debug', false); $this->withoutExceptionHandling(); @@ -40,8 +38,7 @@ public function isMeterBalanceFeedbackSend() $this->assertEquals(2, $smsCount); } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); @@ -49,8 +46,7 @@ public function actingAs($user, $driver = null) return $this; } - private function initializeData() - { + private function initializeData() { $this->addSmsBodies(); $this->addFeedBackKeys(); factory(MainSettings::class)->create(); @@ -89,8 +85,7 @@ private function initializeData() return ['customer' => $p]; } - private function addSmsBodies() - { + private function addSmsBodies() { $bodies = [ [ 'reference' => 'SmsTransactionHeader', @@ -240,8 +235,7 @@ private function addSmsBodies() return SmsBody::query()->get(); } - private function addFeedBackKeys() - { + private function addFeedBackKeys() { SteamaSmsFeedbackWord::query()->create([ 'meter_balance' => 'Balance', ]); diff --git a/src/backend/packages/inensus/steama-meter/src/Tests/Unit/SmsNotifyTest.php b/src/backend/packages/inensus/steama-meter/src/Tests/Unit/SmsNotifyTest.php index 04413f28d..707a850bb 100644 --- a/src/backend/packages/inensus/steama-meter/src/Tests/Unit/SmsNotifyTest.php +++ b/src/backend/packages/inensus/steama-meter/src/Tests/Unit/SmsNotifyTest.php @@ -33,13 +33,11 @@ use Inensus\SteamaMeter\Sms\SteamaSmsTypes; use Tests\TestCase; -class SmsNotifyTest extends TestCase -{ +class SmsNotifyTest extends TestCase { use RefreshDatabase; /** @test */ - public function isLowBalanceNotifySend() - { + public function isLowBalanceNotifySend() { Queue::fake(); $this->initializeData(); $lowBalanceMin = SteamaSmsSetting::query()->where( @@ -91,8 +89,7 @@ public function isLowBalanceNotifySend() } /** @test */ - public function isTransactionNotifySend() - { + public function isTransactionNotifySend() { Queue::fake(); $data = $this->initializeData(); $this->initializeSteamaTransaction($data['customer'], $data['meter']); @@ -148,8 +145,7 @@ public function isTransactionNotifySend() } /** @test */ - public function isMaxAttemptNotifySend() - { + public function isMaxAttemptNotifySend() { Queue::fake(); $this->addSyncSettings(); $this->initializeAdminData(); @@ -191,8 +187,7 @@ public function isMaxAttemptNotifySend() $this->assertLessThan($oldNextSync, $newNextSync); } - private function initializeData() - { + private function initializeData() { $this->addSmsSettings(); $this->addSmsBodies(); // create person @@ -262,8 +257,7 @@ private function initializeData() return ['customer' => $p, 'meter' => $steamaMeter]; } - private function initializeSteamaTransaction($customer, $steamaMeter) - { + private function initializeSteamaTransaction($customer, $steamaMeter) { $steamaTransaction = SteamaTransaction::query()->create([ 'transaction_id' => '1111', 'site_id' => 1, @@ -295,8 +289,7 @@ private function initializeSteamaTransaction($customer, $steamaMeter) $transaction->save(); } - private function initializeAdminData() - { + private function initializeAdminData() { $user = factory(User::class)->create(); $address = Address::query()->make([ 'phone' => '+905396398161', @@ -307,8 +300,7 @@ private function initializeAdminData() $address->save(); } - private function addSmsSettings() - { + private function addSmsSettings() { $smsSetting = SteamaSetting::query()->make(); $smsTransaction = SteamaSmsSetting::query()->create([ @@ -332,8 +324,7 @@ private function addSmsSettings() $balanceSetting->save(); } - private function addSyncSettings() - { + private function addSyncSettings() { $minInterval = CarbonInterval::make('1minute'); $now = Carbon::now(); $siteSetting = SteamaSetting::query()->make(); @@ -353,8 +344,7 @@ private function addSyncSettings() SteamaSyncAction::query()->create($syncAction); } - private function addSmsBodies() - { + private function addSmsBodies() { $bodies = [ [ 'reference' => 'SmsTransactionHeader', diff --git a/src/backend/packages/inensus/stron-meter/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/stron-meter/src/Console/Commands/InstallPackage.php index 8179d344d..76ce6d5c5 100644 --- a/src/backend/packages/inensus/stron-meter/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/stron-meter/src/Console/Commands/InstallPackage.php @@ -6,8 +6,7 @@ use Inensus\StronMeter\Helpers\ApiHelpers; use Inensus\StronMeter\Services\StronCredentialService; -class InstallPackage extends Command -{ +class InstallPackage extends Command { protected $signature = 'stron-meter:install'; protected $description = 'Install StronMeter Package'; @@ -19,16 +18,14 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { $this->info('Installing Stron Meter Integration Package\n'); $this->apiHelpers->registerStronMeterManufacturer(); $this->credentialService->createCredentials(); $this->info('Package installed successfully..'); } - private function publishMigrations() - { + private function publishMigrations() { $this->info('Copying migrations\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\StronMeter\Providers\StronMeterServiceProvider", @@ -36,14 +33,12 @@ private function publishMigrations() ]); } - private function createDatabaseTables() - { + private function createDatabaseTables() { $this->info('Creating database tables\n'); $this->call('migrate'); } - private function publishVueFiles() - { + private function publishVueFiles() { $this->info('Copying vue files\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\StronMeter\Providers\StronMeterServiceProvider", @@ -51,8 +46,7 @@ private function publishVueFiles() ]); } - private function createPluginRecord() - { + private function createPluginRecord() { $this->call('plugin:add', [ 'name' => 'StronMeter', 'composer_name' => 'inensus/stron-meter', diff --git a/src/backend/packages/inensus/stron-meter/src/Console/Commands/UpdatePackage.php b/src/backend/packages/inensus/stron-meter/src/Console/Commands/UpdatePackage.php index ba3b5018c..a6fba8014 100644 --- a/src/backend/packages/inensus/stron-meter/src/Console/Commands/UpdatePackage.php +++ b/src/backend/packages/inensus/stron-meter/src/Console/Commands/UpdatePackage.php @@ -7,8 +7,7 @@ use Illuminate\Support\Facades\DB; use Inensus\StronMeter\Services\StronCredentialService; -class UpdatePackage extends Command -{ +class UpdatePackage extends Command { protected $signature = 'stron-meter:update'; protected $description = 'Update StronMeter Package'; @@ -20,8 +19,7 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { $this->info('Stron Meter Integration Updating Started\n'); $this->removeOldVersionOfPackage(); $this->installNewVersionOfPackage(); @@ -33,20 +31,17 @@ public function handle(): void $this->info('Package updated successfully..'); } - private function removeOldVersionOfPackage() - { + private function removeOldVersionOfPackage() { $this->info('Removing former version of package\n'); echo shell_exec('COMPOSER_MEMORY_LIMIT=-1 ../composer.phar remove inensus/stron-meter'); } - private function installNewVersionOfPackage() - { + private function installNewVersionOfPackage() { $this->info('Installing last version of package\n'); echo shell_exec('COMPOSER_MEMORY_LIMIT=-1 ../composer.phar require inensus/stron-meter'); } - private function deleteMigration(Filesystem $filesystem) - { + private function deleteMigration(Filesystem $filesystem) { $migrationFile = $filesystem->glob(database_path().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR.'*_create_calin_smart_tables.php')[0]; $migration = DB::table('migrations') ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->first(); @@ -58,8 +53,7 @@ private function deleteMigration(Filesystem $filesystem) ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->delete(); } - private function publishMigrationsAgain() - { + private function publishMigrationsAgain() { $this->info('Copying migrations\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\StronMeter\Providers\StronMeterServiceProvider", @@ -67,14 +61,12 @@ private function publishMigrationsAgain() ]); } - private function updateDatabase() - { + private function updateDatabase() { $this->info('Updating database tables\n'); $this->call('migrate'); } - private function publishVueFilesAgain() - { + private function publishVueFilesAgain() { $this->info('Copying vue files\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\StronMeter\Providers\StronMeterServiceProvider", diff --git a/src/backend/packages/inensus/stron-meter/src/Exceptions/StronApiResponseException.php b/src/backend/packages/inensus/stron-meter/src/Exceptions/StronApiResponseException.php index 22007d2aa..37808a756 100644 --- a/src/backend/packages/inensus/stron-meter/src/Exceptions/StronApiResponseException.php +++ b/src/backend/packages/inensus/stron-meter/src/Exceptions/StronApiResponseException.php @@ -2,6 +2,4 @@ namespace Inensus\StronMeter\Exceptions; -class StronApiResponseException extends \Exception -{ -} +class StronApiResponseException extends \Exception {} diff --git a/src/backend/packages/inensus/stron-meter/src/Helpers/ApiHelpers.php b/src/backend/packages/inensus/stron-meter/src/Helpers/ApiHelpers.php index 8592ca5db..bd897dfeb 100644 --- a/src/backend/packages/inensus/stron-meter/src/Helpers/ApiHelpers.php +++ b/src/backend/packages/inensus/stron-meter/src/Helpers/ApiHelpers.php @@ -5,17 +5,14 @@ use App\Models\Manufacturer; use Inensus\StronMeter\Exceptions\StronApiResponseException; -class ApiHelpers -{ +class ApiHelpers { private $manufacturer; - public function __construct(Manufacturer $manufacturerModel) - { + public function __construct(Manufacturer $manufacturerModel) { $this->manufacturer = $manufacturerModel; } - public function registerStronMeterManufacturer() - { + public function registerStronMeterManufacturer() { $api = $this->manufacturer->newQuery()->where('api_name', 'StronMeterApi')->first(); if (!$api) { $this->manufacturer->newQuery()->create([ @@ -26,8 +23,7 @@ public function registerStronMeterManufacturer() } } - public function checkApiResult($result) - { + public function checkApiResult($result) { if (is_array($result) && array_key_exists('Message', $result)) { throw new StronApiResponseException($result['Message']); } @@ -38,8 +34,7 @@ public function checkApiResult($result) return $result; } - public function makeHash($data) - { + public function makeHash($data) { return md5(implode($data, '')); } } diff --git a/src/backend/packages/inensus/stron-meter/src/Http/Controllers/StronCredentialController.php b/src/backend/packages/inensus/stron-meter/src/Http/Controllers/StronCredentialController.php index b72f89755..8d37a256c 100644 --- a/src/backend/packages/inensus/stron-meter/src/Http/Controllers/StronCredentialController.php +++ b/src/backend/packages/inensus/stron-meter/src/Http/Controllers/StronCredentialController.php @@ -8,22 +8,18 @@ use Inensus\StronMeter\Http\Resources\StronResource; use Inensus\StronMeter\Services\StronCredentialService; -class StronCredentialController extends Controller -{ +class StronCredentialController extends Controller { private $credentialService; - public function __construct(StronCredentialService $credentialService) - { + public function __construct(StronCredentialService $credentialService) { $this->credentialService = $credentialService; } - public function show(): StronResource - { + public function show(): StronResource { return new StronResource($this->credentialService->getCredentials()); } - public function update(StronCredentialRequest $request): StronCredentialResource - { + public function update(StronCredentialRequest $request): StronCredentialResource { $credentials = $this->credentialService->updateCredentials($request->only([ 'username', 'password', diff --git a/src/backend/packages/inensus/stron-meter/src/Http/Requests/StronCredentialRequest.php b/src/backend/packages/inensus/stron-meter/src/Http/Requests/StronCredentialRequest.php index acff5fdc3..99c9786d0 100644 --- a/src/backend/packages/inensus/stron-meter/src/Http/Requests/StronCredentialRequest.php +++ b/src/backend/packages/inensus/stron-meter/src/Http/Requests/StronCredentialRequest.php @@ -5,15 +5,13 @@ use Illuminate\Foundation\Http\FormRequest; use Illuminate\Validation\Rule; -class StronCredentialRequest extends FormRequest -{ +class StronCredentialRequest extends FormRequest { /** * Get the validation rules that apply to the request. * * @return array */ - public function rules() - { + public function rules() { return [ 'company_name' => ['required', Rule::unique('shard.stron_api_credentials')->ignore($this->id)], 'username' => ['required', Rule::unique('shard.stron_api_credentials')->ignore($this->id)], diff --git a/src/backend/packages/inensus/stron-meter/src/Http/Requests/StronMeterApiRequests.php b/src/backend/packages/inensus/stron-meter/src/Http/Requests/StronMeterApiRequests.php index 6257f62b6..1e96767f4 100644 --- a/src/backend/packages/inensus/stron-meter/src/Http/Requests/StronMeterApiRequests.php +++ b/src/backend/packages/inensus/stron-meter/src/Http/Requests/StronMeterApiRequests.php @@ -7,8 +7,7 @@ use Inensus\StronMeter\Helpers\ApiHelpers; use Inensus\StronMeter\Models\StronCredential; -class StronMeterApiRequests -{ +class StronMeterApiRequests { private $client; private $apiHelpers; @@ -25,8 +24,7 @@ public function __construct( $this->credential = $credentialModel; } - public function token($url, $postParams) - { + public function token($url, $postParams) { try { $credential = $this->getCredentials(); } catch (ModelNotFoundException $e) { @@ -45,8 +43,7 @@ public function token($url, $postParams) return $this->apiHelpers->checkApiResult(json_decode((string) $request->getBody(), true)); } - public function getCredentials() - { + public function getCredentials() { return $this->credential->newQuery()->firstOrFail(); } } diff --git a/src/backend/packages/inensus/stron-meter/src/Http/Resources/StronCredentialResource.php b/src/backend/packages/inensus/stron-meter/src/Http/Resources/StronCredentialResource.php index 9dcee0599..697033608 100644 --- a/src/backend/packages/inensus/stron-meter/src/Http/Resources/StronCredentialResource.php +++ b/src/backend/packages/inensus/stron-meter/src/Http/Resources/StronCredentialResource.php @@ -6,10 +6,8 @@ use Illuminate\Http\Resources\Json\JsonResource; use Inensus\StronMeter\Models\StronCredential; -class StronCredentialResource extends JsonResource -{ - public function __construct(StronCredential $stronCredential) - { +class StronCredentialResource extends JsonResource { + public function __construct(StronCredential $stronCredential) { parent::__construct($stronCredential); } @@ -20,16 +18,14 @@ public function __construct(StronCredential $stronCredential) * * @return Request */ - public function toArray($request) - { + public function toArray($request) { $credentials = $this->resource->toArray(); $credentials['alert'] = $this->alertType($this->resource->is_authenticated); return $credentials; } - private function alertType($authenticationStatus) - { + private function alertType($authenticationStatus) { switch ($authenticationStatus) { case true: return [ diff --git a/src/backend/packages/inensus/stron-meter/src/Http/Resources/StronResource.php b/src/backend/packages/inensus/stron-meter/src/Http/Resources/StronResource.php index ccacc4bc8..35b077bfa 100644 --- a/src/backend/packages/inensus/stron-meter/src/Http/Resources/StronResource.php +++ b/src/backend/packages/inensus/stron-meter/src/Http/Resources/StronResource.php @@ -5,8 +5,7 @@ use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\JsonResource; -class StronResource extends JsonResource -{ +class StronResource extends JsonResource { /** * Transform the resource into an array. * @@ -14,8 +13,7 @@ class StronResource extends JsonResource * * @return array */ - public function toArray($request) - { + public function toArray($request) { return parent::toArray($request); } } diff --git a/src/backend/packages/inensus/stron-meter/src/Models/StronCredential.php b/src/backend/packages/inensus/stron-meter/src/Models/StronCredential.php index 244ecdce5..b04093471 100644 --- a/src/backend/packages/inensus/stron-meter/src/Models/StronCredential.php +++ b/src/backend/packages/inensus/stron-meter/src/Models/StronCredential.php @@ -4,7 +4,6 @@ use App\Models\Base\BaseModel; -class StronCredential extends BaseModel -{ +class StronCredential extends BaseModel { protected $table = 'stron_api_credentials'; } diff --git a/src/backend/packages/inensus/stron-meter/src/Models/StronTransaction.php b/src/backend/packages/inensus/stron-meter/src/Models/StronTransaction.php index 06691f172..e6a455a7c 100644 --- a/src/backend/packages/inensus/stron-meter/src/Models/StronTransaction.php +++ b/src/backend/packages/inensus/stron-meter/src/Models/StronTransaction.php @@ -12,42 +12,34 @@ use Inensus\SwiftaPaymentProvider\Models\SwiftaTransaction; use Inensus\WaveMoneyPaymentProvider\Models\WaveMoneyTransaction; -class StronTransaction extends BaseModel implements ISubTransaction -{ +class StronTransaction extends BaseModel implements ISubTransaction { protected $table = 'stron_transactions'; - public function agentTransaction() - { + public function agentTransaction() { return $this->morphOne(AgentTransaction::class, 'manufacturer_transaction'); } - public function vodacomTransaction() - { + public function vodacomTransaction() { return $this->morphOne(VodacomTransaction::class, 'manufacturer_transaction'); } - public function airtelTransaction() - { + public function airtelTransaction() { return $this->morphOne(AirtelTransaction::class, 'manufacturer_transaction'); } - public function thirdPartyTransaction() - { + public function thirdPartyTransaction() { return $this->morphOne(ThirdPartyTransaction::class, 'manufacturer_transaction'); } - public function mesombTransaction() - { + public function mesombTransaction() { return $this->morphOne(MesombTransaction::class, 'manufacturer_transaction'); } - public function swiftaTransaction() - { + public function swiftaTransaction() { return $this->morphOne(SwiftaTransaction::class, 'manufacturer_transaction'); } - public function waveMoneyTransaction() - { + public function waveMoneyTransaction() { return $this->morphOne(WaveMoneyTransaction::class, 'manufacturer_transaction'); } } diff --git a/src/backend/packages/inensus/stron-meter/src/Providers/EventServiceProvider.php b/src/backend/packages/inensus/stron-meter/src/Providers/EventServiceProvider.php index eaa7770a7..611d0a567 100644 --- a/src/backend/packages/inensus/stron-meter/src/Providers/EventServiceProvider.php +++ b/src/backend/packages/inensus/stron-meter/src/Providers/EventServiceProvider.php @@ -4,8 +4,7 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; -class EventServiceProvider extends ServiceProvider -{ +class EventServiceProvider extends ServiceProvider { protected $subscribe = [ ]; @@ -14,8 +13,7 @@ class EventServiceProvider extends ServiceProvider * * @return void */ - public function boot() - { + public function boot() { parent::boot(); } } diff --git a/src/backend/packages/inensus/stron-meter/src/Providers/ObserverServiceProvider.php b/src/backend/packages/inensus/stron-meter/src/Providers/ObserverServiceProvider.php index 4761a484a..37d0a9a8a 100644 --- a/src/backend/packages/inensus/stron-meter/src/Providers/ObserverServiceProvider.php +++ b/src/backend/packages/inensus/stron-meter/src/Providers/ObserverServiceProvider.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; -class ObserverServiceProvider extends ServiceProvider -{ +class ObserverServiceProvider extends ServiceProvider { /** * Register any events for your application. * * @return void */ - public function boot() - { + public function boot() { parent::boot(); } } diff --git a/src/backend/packages/inensus/stron-meter/src/Providers/RouteServiceProvider.php b/src/backend/packages/inensus/stron-meter/src/Providers/RouteServiceProvider.php index 868883c40..937a51e23 100644 --- a/src/backend/packages/inensus/stron-meter/src/Providers/RouteServiceProvider.php +++ b/src/backend/packages/inensus/stron-meter/src/Providers/RouteServiceProvider.php @@ -5,22 +5,18 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Support\Facades\Route; -class RouteServiceProvider extends ServiceProvider -{ +class RouteServiceProvider extends ServiceProvider { protected $namespace = 'Inensus\StronMeter\Http\Controllers'; - public function boot() - { + public function boot() { parent::boot(); } - public function map() - { + public function map() { $this->mapApiRoutes(); } - protected function mapApiRoutes() - { + protected function mapApiRoutes() { Route::prefix('api') ->middleware('api') ->namespace($this->namespace) diff --git a/src/backend/packages/inensus/stron-meter/src/Providers/StronMeterServiceProvider.php b/src/backend/packages/inensus/stron-meter/src/Providers/StronMeterServiceProvider.php index 2b278f384..d332a78a5 100644 --- a/src/backend/packages/inensus/stron-meter/src/Providers/StronMeterServiceProvider.php +++ b/src/backend/packages/inensus/stron-meter/src/Providers/StronMeterServiceProvider.php @@ -9,10 +9,8 @@ use Inensus\StronMeter\Console\Commands\UpdatePackage; use Inensus\StronMeter\StronMeterApi; -class StronMeterServiceProvider extends ServiceProvider -{ - public function boot(Filesystem $filesystem) - { +class StronMeterServiceProvider extends ServiceProvider { + public function boot(Filesystem $filesystem) { $this->app->register(RouteServiceProvider::class); if ($this->app->runningInConsole()) { $this->publishConfigFiles(); @@ -22,37 +20,32 @@ public function boot(Filesystem $filesystem) } } - public function register() - { + public function register() { $this->mergeConfigFrom(__DIR__.'/../../config/stron-meter.php', 'stron-meter'); $this->app->register(EventServiceProvider::class); $this->app->register(ObserverServiceProvider::class); $this->app->bind('StronMeterApi', StronMeterApi::class); } - public function publishConfigFiles() - { + public function publishConfigFiles() { $this->publishes([ __DIR__.'/../../config/stron-meter.php' => config_path('stron-meter.php'), ]); } - public function publishVueFiles() - { + public function publishVueFiles() { $this->publishes([ __DIR__.'/../resources/assets' => resource_path('assets/js/plugins/stron-meter'), ], 'vue-components'); } - public function publishMigrations($filesystem) - { + public function publishMigrations($filesystem) { $this->publishes([ __DIR__.'/../../database/migrations/create_stron_tables.php.stub' => $this->getMigrationFileName($filesystem), ], 'migrations'); } - protected function getMigrationFileName(Filesystem $filesystem): string - { + protected function getMigrationFileName(Filesystem $filesystem): string { $timestamp = date('Y_m_d_His'); return Collection::make($this->app->databasePath().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR) diff --git a/src/backend/packages/inensus/stron-meter/src/Services/StronCredentialService.php b/src/backend/packages/inensus/stron-meter/src/Services/StronCredentialService.php index 8868225ed..e8e157080 100644 --- a/src/backend/packages/inensus/stron-meter/src/Services/StronCredentialService.php +++ b/src/backend/packages/inensus/stron-meter/src/Services/StronCredentialService.php @@ -7,8 +7,7 @@ use Inensus\StronMeter\Http\Requests\StronMeterApiRequests; use Inensus\StronMeter\Models\StronCredential; -class StronCredentialService -{ +class StronCredentialService { private $rootUrl = '/login/'; private $credential; @@ -26,8 +25,7 @@ public function __construct( /** * This function uses one time on installation of the package. */ - public function createCredentials() - { + public function createCredentials() { return $this->credential->newQuery()->firstOrCreate(['id' => 1], [ 'username' => null, 'password' => null, @@ -37,13 +35,11 @@ public function createCredentials() ]); } - public function getCredentials() - { + public function getCredentials() { return $this->credential->newQuery()->first(); } - public function updateCredentials($data) - { + public function updateCredentials($data) { $credential = $this->credential->newQuery()->firstOrFail(); $credential->update([ diff --git a/src/backend/packages/inensus/stron-meter/src/StronMeterApi.php b/src/backend/packages/inensus/stron-meter/src/StronMeterApi.php index 4616a9a17..0023a682a 100644 --- a/src/backend/packages/inensus/stron-meter/src/StronMeterApi.php +++ b/src/backend/packages/inensus/stron-meter/src/StronMeterApi.php @@ -13,8 +13,7 @@ use Inensus\StronMeter\Models\StronCredential; use Inensus\StronMeter\Models\StronTransaction; -class StronMeterApi implements IManufacturerAPI -{ +class StronMeterApi implements IManufacturerAPI { protected $api; private $rootUrl = '/vending/'; @@ -28,8 +27,7 @@ public function __construct( $this->api = $httpClient; } - public function chargeDevice(TransactionDataContainer $transactionContainer): array - { + public function chargeDevice(TransactionDataContainer $transactionContainer): array { $meter = $transactionContainer->device->device; $tariff = $transactionContainer->tariff; $owner = $transactionContainer->device->person; @@ -94,8 +92,7 @@ public function chargeDevice(TransactionDataContainer $transactionContainer): ar ]; } - public function clearDevice(Device $device) - { + public function clearDevice(Device $device) { // TODO: Implement clearDevice() method. } } diff --git a/src/backend/packages/inensus/stron-meter/src/Tests/Unit/TokenGenerationTest.php b/src/backend/packages/inensus/stron-meter/src/Tests/Unit/TokenGenerationTest.php index 01cfad53c..1bf522649 100644 --- a/src/backend/packages/inensus/stron-meter/src/Tests/Unit/TokenGenerationTest.php +++ b/src/backend/packages/inensus/stron-meter/src/Tests/Unit/TokenGenerationTest.php @@ -19,13 +19,11 @@ use Inensus\StronMeter\Models\StronCredential; use Tests\TestCase; -class TokenGenerationTest extends TestCase -{ +class TokenGenerationTest extends TestCase { use RefreshDatabase; /** @test */ - public function isTokenGenerated() - { + public function isTokenGenerated() { Queue::fake(); Config::set('app.debug', false); $transaction = $this->initializeData(); @@ -38,8 +36,7 @@ public function isTokenGenerated() Queue::assertPushed(TokenProcessor::class); } - private function initializeData() - { + private function initializeData() { // create person factory(MainSettings::class)->create(); diff --git a/src/backend/packages/inensus/sun-king-shs/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/sun-king-shs/src/Console/Commands/InstallPackage.php index 1042209f8..63dfffc71 100644 --- a/src/backend/packages/inensus/sun-king-shs/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/sun-king-shs/src/Console/Commands/InstallPackage.php @@ -6,8 +6,7 @@ use Inensus\SunKingSHS\Services\ManufacturerService; use Inensus\SunKingSHS\Services\SunKingCredentialService; -class InstallPackage extends Command -{ +class InstallPackage extends Command { protected $signature = 'sun-king-shs:install'; protected $description = 'Install SunKingSHS Package'; @@ -19,8 +18,7 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { $this->info('Installing SunKingSHS Integration Package\n'); $this->manufacturerService->register(); @@ -28,8 +26,7 @@ public function handle(): void $this->info('Package installed successfully..'); } - private function publishMigrations() - { + private function publishMigrations() { $this->info('Copying migrations\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\SunKingSHS\Providers\SunKingSHSServiceProvider", @@ -37,14 +34,12 @@ private function publishMigrations() ]); } - private function createDatabaseTables() - { + private function createDatabaseTables() { $this->info('Creating database tables\n'); $this->call('migrate'); } - private function publishVueFiles() - { + private function publishVueFiles() { $this->info('Copying vue files\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\SunKingSHS\Providers\SunKingSHSServiceProvider", @@ -52,8 +47,7 @@ private function publishVueFiles() ]); } - private function createPluginRecord() - { + private function createPluginRecord() { $this->call('plugin:add', [ 'name' => 'SunKingSHS', 'composer_name' => 'inensus/sun-king-shs', diff --git a/src/backend/packages/inensus/sun-king-shs/src/Exceptions/SunKingApiResponseException.php b/src/backend/packages/inensus/sun-king-shs/src/Exceptions/SunKingApiResponseException.php index 0f3fe33ea..4d19c4130 100644 --- a/src/backend/packages/inensus/sun-king-shs/src/Exceptions/SunKingApiResponseException.php +++ b/src/backend/packages/inensus/sun-king-shs/src/Exceptions/SunKingApiResponseException.php @@ -2,10 +2,8 @@ namespace Inensus\SunKingSHS\Exceptions; -class SunKingApiResponseException extends \Exception -{ - public function __construct($message) - { +class SunKingApiResponseException extends \Exception { + public function __construct($message) { parent::__construct($message); } } diff --git a/src/backend/packages/inensus/sun-king-shs/src/Http/Controllers/SunKingCredentialController.php b/src/backend/packages/inensus/sun-king-shs/src/Http/Controllers/SunKingCredentialController.php index 8dea71db2..f3b66187d 100644 --- a/src/backend/packages/inensus/sun-king-shs/src/Http/Controllers/SunKingCredentialController.php +++ b/src/backend/packages/inensus/sun-king-shs/src/Http/Controllers/SunKingCredentialController.php @@ -7,19 +7,14 @@ use Inensus\SunKingSHS\Http\Resources\SunKingResource; use Inensus\SunKingSHS\Services\SunKingCredentialService; -class SunKingCredentialController extends Controller -{ - public function __construct(private SunKingCredentialService $credentialService) - { - } +class SunKingCredentialController extends Controller { + public function __construct(private SunKingCredentialService $credentialService) {} - public function show(): SunKingResource - { + public function show(): SunKingResource { return SunKingResource::make($this->credentialService->getCredentials()); } - public function update(SunKingCredentialRequest $request): SunKingResource - { + public function update(SunKingCredentialRequest $request): SunKingResource { $credentials = $this->credentialService->getCredentials(); $updateData = $request->only([ 'client_id', diff --git a/src/backend/packages/inensus/sun-king-shs/src/Http/Requests/SunKingCredentialRequest.php b/src/backend/packages/inensus/sun-king-shs/src/Http/Requests/SunKingCredentialRequest.php index d155f844f..e117d0092 100644 --- a/src/backend/packages/inensus/sun-king-shs/src/Http/Requests/SunKingCredentialRequest.php +++ b/src/backend/packages/inensus/sun-king-shs/src/Http/Requests/SunKingCredentialRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class SunKingCredentialRequest extends FormRequest -{ +class SunKingCredentialRequest extends FormRequest { /** * Get the validation rules that apply to the request. * * @return array */ - public function rules() - { + public function rules() { return [ 'client_id' => ['required'], 'client_secret' => ['required'], diff --git a/src/backend/packages/inensus/sun-king-shs/src/Http/Resources/SunKingResource.php b/src/backend/packages/inensus/sun-king-shs/src/Http/Resources/SunKingResource.php index e7a541476..d78c5f3dc 100644 --- a/src/backend/packages/inensus/sun-king-shs/src/Http/Resources/SunKingResource.php +++ b/src/backend/packages/inensus/sun-king-shs/src/Http/Resources/SunKingResource.php @@ -5,8 +5,7 @@ use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\JsonResource; -class SunKingResource extends JsonResource -{ +class SunKingResource extends JsonResource { /** * Transform the resource into an array. * @@ -14,8 +13,7 @@ class SunKingResource extends JsonResource * * @return array */ - public function toArray($request) - { + public function toArray($request) { return parent::toArray($request); } } diff --git a/src/backend/packages/inensus/sun-king-shs/src/Models/SunKingCredential.php b/src/backend/packages/inensus/sun-king-shs/src/Models/SunKingCredential.php index bcda551a3..379f01b75 100644 --- a/src/backend/packages/inensus/sun-king-shs/src/Models/SunKingCredential.php +++ b/src/backend/packages/inensus/sun-king-shs/src/Models/SunKingCredential.php @@ -4,37 +4,30 @@ use App\Models\Base\BaseModel; -class SunKingCredential extends BaseModel -{ +class SunKingCredential extends BaseModel { protected $table = 'sun_king_api_credentials'; - public function getClientSecret() - { + public function getClientSecret() { return $this->client_secret; } - public function getClientId() - { + public function getClientId() { return $this->client_id; } - public function getApiUrl() - { + public function getApiUrl() { return $this->api_url; } - public function getAuthUrl() - { + public function getAuthUrl() { return $this->auth_url; } - public function getAccessToken() - { + public function getAccessToken() { return $this->access_token; } - public function getExpirationTime() - { + public function getExpirationTime() { return $this->token_expires_in; } } diff --git a/src/backend/packages/inensus/sun-king-shs/src/Models/SunKingTransaction.php b/src/backend/packages/inensus/sun-king-shs/src/Models/SunKingTransaction.php index 9451bb065..7ba7cba3c 100644 --- a/src/backend/packages/inensus/sun-king-shs/src/Models/SunKingTransaction.php +++ b/src/backend/packages/inensus/sun-king-shs/src/Models/SunKingTransaction.php @@ -4,7 +4,6 @@ use App\Models\Base\BaseModel; -class SunKingTransaction extends BaseModel -{ +class SunKingTransaction extends BaseModel { protected $table = 'sun_king_transactions'; } diff --git a/src/backend/packages/inensus/sun-king-shs/src/Modules/Api/ApiRequests.php b/src/backend/packages/inensus/sun-king-shs/src/Modules/Api/ApiRequests.php index 905cb022c..0ace3b98e 100644 --- a/src/backend/packages/inensus/sun-king-shs/src/Modules/Api/ApiRequests.php +++ b/src/backend/packages/inensus/sun-king-shs/src/Modules/Api/ApiRequests.php @@ -8,15 +8,12 @@ use Inensus\SunKingSHS\Exceptions\SunKingApiResponseException; use Inensus\SunKingSHS\Models\SunKingCredential; -class ApiRequests -{ +class ApiRequests { public function __construct( private Client $httpClient, - ) { - } + ) {} - public function authentication($credential): array - { + public function authentication($credential): array { try { $response = $this->httpClient->post($credential->getAuthUrl(), [ @@ -44,8 +41,7 @@ public function authentication($credential): array } } - public function get(SunKingCredential $credentials, array $params, string $slug) - { + public function get(SunKingCredential $credentials, array $params, string $slug) { $url = $credentials->getApiUrl().$slug; foreach ($params as $key => $value) { $url .= $key.'='.$value.'&'; @@ -70,8 +66,7 @@ public function get(SunKingCredential $credentials, array $params, string $slug) } } - public function post(SunKingCredential $credentials, array $params, string $slug) - { + public function post(SunKingCredential $credentials, array $params, string $slug) { $url = $credentials->getApiUrl().$slug; try { $request = $this->httpClient->post( diff --git a/src/backend/packages/inensus/sun-king-shs/src/Modules/Api/SunKingSHSApi.php b/src/backend/packages/inensus/sun-king-shs/src/Modules/Api/SunKingSHSApi.php index 9ffeae752..94128cfe9 100644 --- a/src/backend/packages/inensus/sun-king-shs/src/Modules/Api/SunKingSHSApi.php +++ b/src/backend/packages/inensus/sun-king-shs/src/Modules/Api/SunKingSHSApi.php @@ -11,8 +11,7 @@ use Inensus\SunKingSHS\Models\SunKingTransaction; use Inensus\SunKingSHS\Services\SunKingCredentialService; -class SunKingSHSApi implements IManufacturerAPI -{ +class SunKingSHSApi implements IManufacturerAPI { public const API_CALL_TOKEN_GENERATION = '/token'; public const COMMAND_ADD_CREDIT = 'add_credit'; @@ -21,11 +20,9 @@ public function __construct( private SunKingCredentialService $credentialService, private SunKingTransaction $sunKingTransaction, private ApiRequests $apiRequests, - ) { - } + ) {} - public function chargeDevice(TransactionDataContainer $transactionContainer): array - { + public function chargeDevice(TransactionDataContainer $transactionContainer): array { $dayDifferenceBetweenTwoInstallments = $transactionContainer->dayDifferenceBetweenTwoInstallments; $minimumPurchaseAmount = $transactionContainer->installmentCost; $minimumPurchaseAmountPerDay = ($minimumPurchaseAmount / $dayDifferenceBetweenTwoInstallments); // This is for 1 day of energy @@ -81,8 +78,7 @@ public function chargeDevice(TransactionDataContainer $transactionContainer): ar ]; } - public function clearDevice(Device $device) - { + public function clearDevice(Device $device) { throw new ApiCallDoesNotSupportedException('This api call does not supported'); } } diff --git a/src/backend/packages/inensus/sun-king-shs/src/Providers/EventServiceProvider.php b/src/backend/packages/inensus/sun-king-shs/src/Providers/EventServiceProvider.php index daecbfabe..9c31e8b10 100644 --- a/src/backend/packages/inensus/sun-king-shs/src/Providers/EventServiceProvider.php +++ b/src/backend/packages/inensus/sun-king-shs/src/Providers/EventServiceProvider.php @@ -4,8 +4,7 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; -class EventServiceProvider extends ServiceProvider -{ +class EventServiceProvider extends ServiceProvider { protected $subscribe = [ ]; @@ -14,8 +13,7 @@ class EventServiceProvider extends ServiceProvider * * @return void */ - public function boot() - { + public function boot() { parent::boot(); } } diff --git a/src/backend/packages/inensus/sun-king-shs/src/Providers/ObserverServiceProvider.php b/src/backend/packages/inensus/sun-king-shs/src/Providers/ObserverServiceProvider.php index 54f1bde61..c1845156d 100644 --- a/src/backend/packages/inensus/sun-king-shs/src/Providers/ObserverServiceProvider.php +++ b/src/backend/packages/inensus/sun-king-shs/src/Providers/ObserverServiceProvider.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; -class ObserverServiceProvider extends ServiceProvider -{ +class ObserverServiceProvider extends ServiceProvider { /** * Register any events for your application. * * @return void */ - public function boot() - { + public function boot() { parent::boot(); } } diff --git a/src/backend/packages/inensus/sun-king-shs/src/Providers/RouteServiceProvider.php b/src/backend/packages/inensus/sun-king-shs/src/Providers/RouteServiceProvider.php index 6ca04edc8..202232d59 100644 --- a/src/backend/packages/inensus/sun-king-shs/src/Providers/RouteServiceProvider.php +++ b/src/backend/packages/inensus/sun-king-shs/src/Providers/RouteServiceProvider.php @@ -5,22 +5,18 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Support\Facades\Route; -class RouteServiceProvider extends ServiceProvider -{ +class RouteServiceProvider extends ServiceProvider { protected $namespace = 'Inensus\SunKingSHS\Http\Controllers'; - public function boot() - { + public function boot() { parent::boot(); } - public function map() - { + public function map() { $this->mapApiRoutes(); } - protected function mapApiRoutes() - { + protected function mapApiRoutes() { Route::prefix('api') ->middleware('api') ->namespace($this->namespace) diff --git a/src/backend/packages/inensus/sun-king-shs/src/Providers/SunKingSHSServiceProvider.php b/src/backend/packages/inensus/sun-king-shs/src/Providers/SunKingSHSServiceProvider.php index ac5313e48..7fe6ee7c0 100644 --- a/src/backend/packages/inensus/sun-king-shs/src/Providers/SunKingSHSServiceProvider.php +++ b/src/backend/packages/inensus/sun-king-shs/src/Providers/SunKingSHSServiceProvider.php @@ -8,10 +8,8 @@ use Inensus\SunKingSHS\Console\Commands\InstallPackage; use Inensus\SunKingSHS\Modules\Api\SunKingSHSApi; -class SunKingSHSServiceProvider extends ServiceProvider -{ - public function boot(Filesystem $filesystem) - { +class SunKingSHSServiceProvider extends ServiceProvider { + public function boot(Filesystem $filesystem) { $this->app->register(RouteServiceProvider::class); if ($this->app->runningInConsole()) { $this->publishConfigFiles(); @@ -21,37 +19,32 @@ public function boot(Filesystem $filesystem) } } - public function register() - { + public function register() { $this->mergeConfigFrom(__DIR__.'/../../config/sun-king-shs.php', 'sun-king-shs'); $this->app->register(EventServiceProvider::class); $this->app->register(ObserverServiceProvider::class); $this->app->bind('SunKingSHSApi', SunKingSHSApi::class); } - public function publishConfigFiles() - { + public function publishConfigFiles() { $this->publishes([ __DIR__.'/../../config/sun-king-shs.php' => config_path('sun-king-shs.php'), ]); } - public function publishVueFiles() - { + public function publishVueFiles() { $this->publishes([ __DIR__.'/../resources/assets' => resource_path('assets/js/plugins/sun-king-shs'), ], 'vue-components'); } - public function publishMigrations($filesystem) - { + public function publishMigrations($filesystem) { $this->publishes([ __DIR__.'/../../database/migrations/create_sun_king_tables.php.stub' => $this->getMigrationFileName($filesystem), ], 'migrations'); } - protected function getMigrationFileName(Filesystem $filesystem): string - { + protected function getMigrationFileName(Filesystem $filesystem): string { $timestamp = date('Y_m_d_His'); return Collection::make($this->app->databasePath().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR) diff --git a/src/backend/packages/inensus/sun-king-shs/src/Services/ManufacturerService.php b/src/backend/packages/inensus/sun-king-shs/src/Services/ManufacturerService.php index 0948e4470..e0cd03f8a 100644 --- a/src/backend/packages/inensus/sun-king-shs/src/Services/ManufacturerService.php +++ b/src/backend/packages/inensus/sun-king-shs/src/Services/ManufacturerService.php @@ -4,14 +4,10 @@ use App\Models\Manufacturer; -class ManufacturerService -{ - public function __construct(private Manufacturer $manufacturer) - { - } +class ManufacturerService { + public function __construct(private Manufacturer $manufacturer) {} - public function register() - { + public function register() { $api = $this->manufacturer->newQuery()->where('api_name', 'SunKingSHSApi')->first(); if (!$api) { $this->manufacturer->newQuery()->create([ diff --git a/src/backend/packages/inensus/sun-king-shs/src/Services/SunKingCredentialService.php b/src/backend/packages/inensus/sun-king-shs/src/Services/SunKingCredentialService.php index bc416a9b6..57e3be728 100644 --- a/src/backend/packages/inensus/sun-king-shs/src/Services/SunKingCredentialService.php +++ b/src/backend/packages/inensus/sun-king-shs/src/Services/SunKingCredentialService.php @@ -4,43 +4,36 @@ use Inensus\SunKingSHS\Models\SunKingCredential; -class SunKingCredentialService -{ +class SunKingCredentialService { public function __construct( private SunKingCredential $credential, - ) { - } + ) {} /** * This function uses one time on installation of the package. */ - public function createCredentials() - { + public function createCredentials() { return $this->credential->newQuery()->firstOrCreate(['id' => 1], [ 'client_id' => null, 'client_secret' => null, ]); } - public function getCredentials() - { + public function getCredentials() { return $this->credential->newQuery()->first(); } - public function updateCredentials($credentials, $updateData) - { + public function updateCredentials($credentials, $updateData) { $credentials->update($updateData); return $credentials->fresh(); } - public function getById($id) - { + public function getById($id) { return $this->credential->newQuery()->findOrFail($id); } - public function isAccessTokenValid($credential) - { + public function isAccessTokenValid($credential) { $accessToken = $credential->getAccessToken(); if ($accessToken == null) { diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/InstallPackage.php index 599cae7df..bdb469d8d 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/InstallPackage.php @@ -12,8 +12,7 @@ use Inensus\SwiftaPaymentProvider\Models\SwiftaAuthentication; use Tymon\JWTAuth\Facades\JWTAuth; -class InstallPackage extends Command -{ +class InstallPackage extends Command { protected $signature = 'swifta-payment-provider:install'; protected $description = 'Install SwiftaPaymentProvider Package'; @@ -28,16 +27,14 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { $this->info('Installing SwiftaPaymentProvider Integration Package\n'); $token = $this->generateAuthenticationToken(); $this->warn("Authentication token for swifta payments generated. token =>\n {$token}"); $this->info('Package installed successfully..'); } - private function publishConfigurations() - { + private function publishConfigurations() { $this->info('Copying configurations\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\SwiftaPaymentProvider\Providers\SwiftaServiceProvider", @@ -45,8 +42,7 @@ private function publishConfigurations() ]); } - private function publishMigrations() - { + private function publishMigrations() { $this->info('Copying migrations\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\SwiftaPaymentProvider\Providers\SwiftaServiceProvider", @@ -54,14 +50,12 @@ private function publishMigrations() ]); } - private function createDatabaseTables() - { + private function createDatabaseTables() { $this->info('Creating database tables\n'); $this->call('migrate'); } - private function createPluginRecord() - { + private function createPluginRecord() { $this->call('plugin:add', [ 'name' => 'SwiftaPaymentProvider', 'composer_name' => 'inensus/swifta-payment-provider', @@ -69,8 +63,7 @@ private function createPluginRecord() ]); } - private function generateAuthenticationToken() - { + private function generateAuthenticationToken() { $password = $this->generateRandomNumber(); $companyId = app()->make(UserService::class)->getCompanyId(); $company = $this->companyService->getById($companyId); @@ -99,8 +92,7 @@ private function generateAuthenticationToken() return $token; } - private function generateRandomNumber(): string - { + private function generateRandomNumber(): string { $length = random_int(1, 10); $number = ''; for ($i = 0; $i < $length; ++$i) { diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/TransactionStatusChecker.php b/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/TransactionStatusChecker.php index ea8f82ec2..33bd9686d 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/TransactionStatusChecker.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/TransactionStatusChecker.php @@ -7,8 +7,7 @@ use Carbon\Carbon; use Inensus\SwiftaPaymentProvider\Services\SwiftaTransactionService; -class TransactionStatusChecker extends AbstractSharedCommand -{ +class TransactionStatusChecker extends AbstractSharedCommand { use ScheduledPluginCommand; public const MPM_PLUGIN_ID = 7; @@ -17,13 +16,11 @@ class TransactionStatusChecker extends AbstractSharedCommand protected $description = 'Update the Swifta Transaction status if still REQUESTED at 00:00'; - public function __construct(private SwiftaTransactionService $swiftaTransactionService) - { + public function __construct(private SwiftaTransactionService $swiftaTransactionService) { parent::__construct(); } - public function handle(): void - { + public function handle(): void { if (!$this->checkForPluginStatusIsActive(self::MPM_PLUGIN_ID)) { return; } diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/UpdatePackage.php b/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/UpdatePackage.php index 665bb0496..e47857980 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/UpdatePackage.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Console/Commands/UpdatePackage.php @@ -10,8 +10,7 @@ use Inensus\SwiftaPaymentProvider\Models\SwiftaAuthentication; use Tymon\JWTAuth\Facades\JWTAuth; -class UpdatePackage extends Command -{ +class UpdatePackage extends Command { protected $signature = 'swifta-payment-provider:update'; protected $description = 'Update the Swifta Payment Provider Integration Package'; @@ -27,8 +26,7 @@ public function __construct( /** * Execute the console command. */ - public function handle(): void - { + public function handle(): void { $this->info('Swifta Payment Provider Integration Updating Started\n'); $this->removeOldVersionOfPackage(); $this->installNewVersionOfPackage(); @@ -41,8 +39,7 @@ public function handle(): void $this->info('Package updated successfully..'); } - private function publishConfigurations() - { + private function publishConfigurations() { $this->info('Copying configurations\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\SwiftaPaymentProvider\Providers\SwiftaServiceProvider", @@ -50,20 +47,17 @@ private function publishConfigurations() ]); } - private function removeOldVersionOfPackage() - { + private function removeOldVersionOfPackage() { $this->info('Removing former version of package\n'); echo shell_exec('COMPOSER_MEMORY_LIMIT=-1 ../composer.phar remove inensus/swifta-payment-provider'); } - private function installNewVersionOfPackage() - { + private function installNewVersionOfPackage() { $this->info('Installing last version of package\n'); echo shell_exec('COMPOSER_MEMORY_LIMIT=-1 ../composer.phar require inensus/swifta-payment-provider'); } - private function deleteMigration(Filesystem $filesystem) - { + private function deleteMigration(Filesystem $filesystem) { $migrationFile = $filesystem->glob(database_path().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR.'*_create_swifta_payment_provider_tables.php')[0]; $migration = DB::table('migrations') ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->first(); @@ -74,8 +68,7 @@ private function deleteMigration(Filesystem $filesystem) ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->delete(); } - private function publishMigrationsAgain() - { + private function publishMigrationsAgain() { $this->info('Copying migrations\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\SwiftaPaymentProvider\Providers\SwiftaServiceProvider", @@ -83,14 +76,12 @@ private function publishMigrationsAgain() ]); } - private function updateDatabase() - { + private function updateDatabase() { $this->info('Updating database tables\n'); $this->call('migrate'); } - private function generateAuthenticationTokenAgain() - { + private function generateAuthenticationTokenAgain() { $password = $this->generateRandomNumber(); $user = $this->user->newQuery()->firstOrCreate([ 'email' => 'swifta-user', @@ -112,8 +103,7 @@ private function generateAuthenticationTokenAgain() return $token; } - private function generateRandomNumber(): string - { + private function generateRandomNumber(): string { $length = random_int(1, 10); $number = ''; for ($i = 0; $i < $length; ++$i) { diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/CipherNotValidException.php b/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/CipherNotValidException.php index 954e9fd40..9e0bbbcd3 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/CipherNotValidException.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/CipherNotValidException.php @@ -2,6 +2,4 @@ namespace Inensus\SwiftaPaymentProvider\Exceptions; -class CipherNotValidException extends \Exception -{ -} +class CipherNotValidException extends \Exception {} diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/CustomerAddressNotFoundException.php b/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/CustomerAddressNotFoundException.php index 8c548c73f..36e415f33 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/CustomerAddressNotFoundException.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/CustomerAddressNotFoundException.php @@ -2,6 +2,4 @@ namespace Inensus\SwiftaPaymentProvider\Exceptions; -class CustomerAddressNotFoundException extends \Exception -{ -} +class CustomerAddressNotFoundException extends \Exception {} diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/SwiftaValidationFailedException.php b/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/SwiftaValidationFailedException.php index 1220242ac..ae16b3fb1 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/SwiftaValidationFailedException.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/SwiftaValidationFailedException.php @@ -2,6 +2,4 @@ namespace Inensus\SwiftaPaymentProvider\Exceptions; -class SwiftaValidationFailedException extends \Exception -{ -} +class SwiftaValidationFailedException extends \Exception {} diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/TransactionAmountDifferentException.php b/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/TransactionAmountDifferentException.php index 1b958300b..5ac2ad6a1 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/TransactionAmountDifferentException.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/TransactionAmountDifferentException.php @@ -2,6 +2,4 @@ namespace Inensus\SwiftaPaymentProvider\Exceptions; -class TransactionAmountDifferentException extends \Exception -{ -} +class TransactionAmountDifferentException extends \Exception {} diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/TransactionNotExistsException.php b/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/TransactionNotExistsException.php index 5be8a2415..6f45bda5f 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/TransactionNotExistsException.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Exceptions/TransactionNotExistsException.php @@ -2,6 +2,4 @@ namespace Inensus\SwiftaPaymentProvider\Exceptions; -class TransactionNotExistsException extends \Exception -{ -} +class TransactionNotExistsException extends \Exception {} diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Http/Controllers/SwiftaAuthenticationController.php b/src/backend/packages/inensus/swifta-payment-provider/src/Http/Controllers/SwiftaAuthenticationController.php index 99fee28a5..51aaed0be 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Http/Controllers/SwiftaAuthenticationController.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Http/Controllers/SwiftaAuthenticationController.php @@ -6,14 +6,10 @@ use Illuminate\Routing\Controller; use Inensus\SwiftaPaymentProvider\Services\SwiftaAuthenticationService; -class SwiftaAuthenticationController extends Controller -{ - public function __construct(private SwiftaAuthenticationService $swiftaAuthenticationService) - { - } +class SwiftaAuthenticationController extends Controller { + public function __construct(private SwiftaAuthenticationService $swiftaAuthenticationService) {} - public function show(): ApiResource - { + public function show(): ApiResource { return ApiResource::make($this->swiftaAuthenticationService->getSwiftaAuthentication()); } } diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Http/Controllers/SwiftaPaymentProviderController.php b/src/backend/packages/inensus/swifta-payment-provider/src/Http/Controllers/SwiftaPaymentProviderController.php index 300d77513..18d4b2f09 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Http/Controllers/SwiftaPaymentProviderController.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Http/Controllers/SwiftaPaymentProviderController.php @@ -9,14 +9,10 @@ use Inensus\SwiftaPaymentProvider\Models\SwiftaTransaction; use Inensus\SwiftaPaymentProvider\Services\SwiftaTransactionService; -class SwiftaPaymentProviderController extends Controller -{ - public function __construct(private SwiftaTransactionService $swiftaTransactionService) - { - } +class SwiftaPaymentProviderController extends Controller { + public function __construct(private SwiftaTransactionService $swiftaTransactionService) {} - public function validation(SwiftaValidationRequest $request) - { + public function validation(SwiftaValidationRequest $request) { $transactionId = $request->get('transactionId'); $customerName = $request->get('customerName'); $data = collect([ @@ -31,8 +27,7 @@ public function validation(SwiftaValidationRequest $request) return new Response($data, 200); } - public function transaction(SwiftaTransactionRequest $request) - { + public function transaction(SwiftaTransactionRequest $request) { $transaction = $request->get('transaction'); $reference = $request->get('reference'); $swiftaTransaction = $transaction->originalTransaction()->first(); diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Http/Kernel.php b/src/backend/packages/inensus/swifta-payment-provider/src/Http/Kernel.php index 45544c4fd..a7d75d8e8 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Http/Kernel.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Http/Kernel.php @@ -7,8 +7,7 @@ use Inensus\SwiftaPaymentProvider\Http\Middleware\SwiftaTransactionCallbackMiddleware; use Inensus\SwiftaPaymentProvider\Http\Middleware\SwiftaTransactionMiddleware; -class Kernel extends HttpKernel -{ +class Kernel extends HttpKernel { protected $routeMiddleware = [ 'swifta.transaction' => SwiftaTransactionCallbackMiddleware::class, 'swifta.validation' => SwiftaMiddleware::class, diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Http/Middleware/SwiftaMiddleware.php b/src/backend/packages/inensus/swifta-payment-provider/src/Http/Middleware/SwiftaMiddleware.php index 0e56bf9c0..df7b97af1 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Http/Middleware/SwiftaMiddleware.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Http/Middleware/SwiftaMiddleware.php @@ -6,10 +6,8 @@ use Illuminate\Http\Response; use Illuminate\Support\Facades\Log; -class SwiftaMiddleware -{ - public function handle(Request $request, \Closure $next) - { +class SwiftaMiddleware { + public function handle(Request $request, \Closure $next) { if (auth()->payload()->get('usr') !== 'swifta-token') { $data = collect([ 'success' => 0, @@ -32,8 +30,7 @@ public function handle(Request $request, \Closure $next) return $next($request); } - private function checkCipherIsValid(Request $request) - { + private function checkCipherIsValid(Request $request) { $hash = md5('Inensus'.$request->input('timestamp').$request->input('amount').'Swifta'); if ($request->input('cipher') != $hash) { Log::warning('Swifta Transaction Validation Failed', [ diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Http/Middleware/SwiftaTransactionCallbackMiddleware.php b/src/backend/packages/inensus/swifta-payment-provider/src/Http/Middleware/SwiftaTransactionCallbackMiddleware.php index ad9af1208..bf7940805 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Http/Middleware/SwiftaTransactionCallbackMiddleware.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Http/Middleware/SwiftaTransactionCallbackMiddleware.php @@ -7,14 +7,10 @@ use Illuminate\Http\Response; use Inensus\SwiftaPaymentProvider\Services\SwiftaTransactionService; -class SwiftaTransactionCallbackMiddleware -{ - public function __construct(private SwiftaTransactionService $swiftaTransactionService) - { - } +class SwiftaTransactionCallbackMiddleware { + public function __construct(private SwiftaTransactionService $swiftaTransactionService) {} - public function handle(Request $request, \Closure $next) - { + public function handle(Request $request, \Closure $next) { try { $transactionId = $request->input('transaction_id'); $amount = $request->input('amount'); diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Http/Middleware/SwiftaTransactionMiddleware.php b/src/backend/packages/inensus/swifta-payment-provider/src/Http/Middleware/SwiftaTransactionMiddleware.php index 89cca332a..2a7cd4e9e 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Http/Middleware/SwiftaTransactionMiddleware.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Http/Middleware/SwiftaTransactionMiddleware.php @@ -5,10 +5,8 @@ use Illuminate\Http\Request; use Illuminate\Http\Response; -class SwiftaTransactionMiddleware -{ - public function handle(Request $request, \Closure $next) - { +class SwiftaTransactionMiddleware { + public function handle(Request $request, \Closure $next) { $transactionProvider = resolve('SwiftaPaymentProvider'); try { diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Http/Requests/SwiftaTransactionRequest.php b/src/backend/packages/inensus/swifta-payment-provider/src/Http/Requests/SwiftaTransactionRequest.php index 34c913032..9564d8321 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Http/Requests/SwiftaTransactionRequest.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Http/Requests/SwiftaTransactionRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class SwiftaTransactionRequest extends FormRequest -{ +class SwiftaTransactionRequest extends FormRequest { /** * Get the validation rules that apply to the request. * * @return array */ - public function rules() - { + public function rules() { return [ 'transaction_id' => 'required', 'transaction_reference' => 'required', diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Http/Requests/SwiftaValidationRequest.php b/src/backend/packages/inensus/swifta-payment-provider/src/Http/Requests/SwiftaValidationRequest.php index 793699635..49d8841a0 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Http/Requests/SwiftaValidationRequest.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Http/Requests/SwiftaValidationRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class SwiftaValidationRequest extends FormRequest -{ +class SwiftaValidationRequest extends FormRequest { /** * Get the validation rules that apply to the request. * * @return array */ - public function rules() - { + public function rules() { return [ 'meter_number' => 'required', 'amount' => 'required', diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Listeners/TransactionListener.php b/src/backend/packages/inensus/swifta-payment-provider/src/Listeners/TransactionListener.php index ca1fa1790..7b0354ec5 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Listeners/TransactionListener.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Listeners/TransactionListener.php @@ -6,10 +6,8 @@ use Illuminate\Events\Dispatcher; use Illuminate\Support\Facades\Log; -class TransactionListener -{ - public function onTransactionFailed(Transaction $transaction, $message = null): void - { +class TransactionListener { + public function onTransactionFailed(Transaction $transaction, $message = null): void { $transactionProvider = resolve('SwiftaPaymentProvider'); $transactionProvider->conflict($message, $transaction); if (config('app.debug')) { @@ -18,14 +16,12 @@ public function onTransactionFailed(Transaction $transaction, $message = null): $transactionProvider->sendResult(false, $transaction); } - public function onTransactionSuccess(Transaction $transaction) - { + public function onTransactionSuccess(Transaction $transaction) { $transactionProvider = resolve('SwiftaPaymentProvider'); $transactionProvider->sendResult(true, $transaction); } - public function subscribe(Dispatcher $events) - { + public function subscribe(Dispatcher $events) { $events->listen( 'transaction.successful', 'Inensus\SwiftaPaymentProvider\Listeners\TransactionListener@onTransactionSuccess' diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Models/SwiftaAuthentication.php b/src/backend/packages/inensus/swifta-payment-provider/src/Models/SwiftaAuthentication.php index 90fe117e3..7db6aa89a 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Models/SwiftaAuthentication.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Models/SwiftaAuthentication.php @@ -4,7 +4,6 @@ use App\Models\Base\BaseModel; -class SwiftaAuthentication extends BaseModel -{ +class SwiftaAuthentication extends BaseModel { protected $table = 'swifta_authentication'; } diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Models/SwiftaTransaction.php b/src/backend/packages/inensus/swifta-payment-provider/src/Models/SwiftaTransaction.php index 4ef0a210f..9e05ad820 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Models/SwiftaTransaction.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Models/SwiftaTransaction.php @@ -11,8 +11,7 @@ use Illuminate\Database\Eloquent\Relations\MorphTo; use MPM\Transaction\FullySupportedTransactionInterface; -class SwiftaTransaction extends BaseModel implements FullySupportedTransactionInterface, IRawTransaction -{ +class SwiftaTransaction extends BaseModel implements FullySupportedTransactionInterface, IRawTransaction { public const RELATION_NAME = 'swifta_transaction'; public const STATUS_SUCCESS = 1; @@ -25,28 +24,23 @@ class SwiftaTransaction extends BaseModel implements FullySupportedTransactionIn protected $table = 'swifta_transactions'; - public function getAmount(): int - { + public function getAmount(): int { return $this->amount; } - public function transaction(): MorphOne - { + public function transaction(): MorphOne { return $this->morphOne(Transaction::class, 'original_transaction'); } - public function manufacturerTransaction(): MorphTo - { + public function manufacturerTransaction(): MorphTo { return $this->morphTo(); } - public function conflicts(): MorphMany - { + public function conflicts(): MorphMany { return $this->morphMany(TransactionConflicts::class, 'transaction'); } - public static function getTransactionName(): string - { + public static function getTransactionName(): string { return self::RELATION_NAME; } } diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Providers/EventServiceProvider.php b/src/backend/packages/inensus/swifta-payment-provider/src/Providers/EventServiceProvider.php index 327ad4bda..190b752c1 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Providers/EventServiceProvider.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Providers/EventServiceProvider.php @@ -5,8 +5,7 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; use Inensus\SwiftaPaymentProvider\Listeners\TransactionListener; -class EventServiceProvider extends ServiceProvider -{ +class EventServiceProvider extends ServiceProvider { // commended out because it is not used for cloud protected $subscribe = [ // TransactionListener::class @@ -17,8 +16,7 @@ class EventServiceProvider extends ServiceProvider * * @return void */ - public function boot() - { + public function boot() { parent::boot(); } } diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Providers/ObserverServiceProvider.php b/src/backend/packages/inensus/swifta-payment-provider/src/Providers/ObserverServiceProvider.php index c5907ab88..4c39c9f1f 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Providers/ObserverServiceProvider.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Providers/ObserverServiceProvider.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; -class ObserverServiceProvider extends ServiceProvider -{ +class ObserverServiceProvider extends ServiceProvider { /** * Register any events for your application. * * @return void */ - public function boot() - { + public function boot() { parent::boot(); } } diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Providers/RouteServiceProvider.php b/src/backend/packages/inensus/swifta-payment-provider/src/Providers/RouteServiceProvider.php index f51124905..2a70f18ed 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Providers/RouteServiceProvider.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Providers/RouteServiceProvider.php @@ -5,22 +5,18 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Support\Facades\Route; -class RouteServiceProvider extends ServiceProvider -{ +class RouteServiceProvider extends ServiceProvider { protected $namespace = 'Inensus\SwiftaPaymentProvider\Http\Controllers'; - public function boot() - { + public function boot() { parent::boot(); } - public function map() - { + public function map() { $this->mapApiRoutes(); } - protected function mapApiRoutes() - { + protected function mapApiRoutes() { Route::prefix('api') ->middleware('api') ->namespace($this->namespace) diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Providers/SwiftaServiceProvider.php b/src/backend/packages/inensus/swifta-payment-provider/src/Providers/SwiftaServiceProvider.php index b547cc5ac..c87b6b703 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Providers/SwiftaServiceProvider.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Providers/SwiftaServiceProvider.php @@ -12,10 +12,8 @@ use Inensus\SwiftaPaymentProvider\Console\Commands\UpdatePackage; use Inensus\SwiftaPaymentProvider\Models\SwiftaTransaction; -class SwiftaServiceProvider extends ServiceProvider -{ - public function boot(Filesystem $filesystem) - { +class SwiftaServiceProvider extends ServiceProvider { + public function boot(Filesystem $filesystem) { $this->app->register(RouteServiceProvider::class); if ($this->app->runningInConsole()) { $this->publishConfigFiles(); @@ -31,30 +29,26 @@ public function boot(Filesystem $filesystem) ->appendOutputTo(storage_path('logs/cron.log')); } - public function register() - { + public function register() { $this->mergeConfigFrom(__DIR__.'/../../config/swifta-payment-provider.php', 'swifta-payment-provider'); $this->app->register(EventServiceProvider::class); $this->app->register(ObserverServiceProvider::class); $this->app->bind('SwiftaPaymentProvider', SwiftaTransactionProvider::class); } - public function publishConfigFiles() - { + public function publishConfigFiles() { $this->publishes([ __DIR__.'/../../config/swifta-payment-provider.php' => config_path('swifta-payment-provider.php'), ], 'configurations'); } - public function publishMigrations($filesystem) - { + public function publishMigrations($filesystem) { $this->publishes([ __DIR__.'/../../database/migrations/create_swifta_payment_provider_tables.php.stub' => $this->getMigrationFileName($filesystem), ], 'migrations'); } - protected function getMigrationFileName(Filesystem $filesystem): string - { + protected function getMigrationFileName(Filesystem $filesystem): string { $timestamp = date('Y_m_d_His'); return Collection::make($this->app->databasePath().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR) diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Providers/SwiftaTransactionProvider.php b/src/backend/packages/inensus/swifta-payment-provider/src/Providers/SwiftaTransactionProvider.php index e1e58b33c..bb312770f 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Providers/SwiftaTransactionProvider.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Providers/SwiftaTransactionProvider.php @@ -13,8 +13,7 @@ use Inensus\SwiftaPaymentProvider\Services\SwiftaTransactionService; use MPM\Transaction\Provider\ITransactionProvider; -class SwiftaTransactionProvider implements ITransactionProvider -{ +class SwiftaTransactionProvider implements ITransactionProvider { private $validData = []; public function __construct( @@ -22,11 +21,9 @@ public function __construct( private Transaction $transaction, private SwiftaTransactionService $swiftaTransactionService, private TransactionConflicts $transactionConflicts, - ) { - } + ) {} - public function validateRequest($request) - { + public function validateRequest($request) { $meterSerial = $request->input('meter_number'); $amount = $request->input('amount'); @@ -43,13 +40,11 @@ public function validateRequest($request) $this->setValidData($swiftaTransactionData); } - public function saveTransaction() - { + public function saveTransaction() { $this->swiftaTransactionService->saveTransaction(); } - public function sendResult(bool $requestType, Transaction $transaction) - { + public function sendResult(bool $requestType, Transaction $transaction) { $swiftaTransaction = $transaction->originalTransaction()->first(); if ($requestType) { $updateData = [ @@ -63,8 +58,7 @@ public function sendResult(bool $requestType, Transaction $transaction) } } - public function addConflict(?string $message): void - { + public function addConflict(?string $message): void { $conflict = $this->transactionConflicts->newQuery()->make([ 'state' => $message, ]); @@ -72,49 +66,40 @@ public function addConflict(?string $message): void $conflict->save(); } - public function getTransaction(): Transaction - { + public function getTransaction(): Transaction { return $this->transaction; } - public function setValidData($swiftaTransactionData) - { + public function setValidData($swiftaTransactionData) { $this->validData = $swiftaTransactionData; } - public function getSubTransaction() - { + public function getSubTransaction() { return $this->swiftaTransactionService->getSwiftaTransaction(); } - public function init($transaction): void - { + public function init($transaction): void { $this->swiftaTransaction = $transaction; $this->transaction = $transaction->transaction()->first(); } - public function confirm(): void - { + public function confirm(): void { // TODO: Implement getMessage() method. } - public function getMessage(): string - { + public function getMessage(): string { // TODO: Implement getMessage() method. } - public function getAmount(): int - { + public function getAmount(): int { return $this->getTransaction()->amount; } - public function getSender(): string - { + public function getSender(): string { return $this->getTransaction()->message; } - public function saveCommonData(): Model - { + public function saveCommonData(): Model { // TODO: Implement getSender() method. } } diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Services/SwiftaAuthenticationService.php b/src/backend/packages/inensus/swifta-payment-provider/src/Services/SwiftaAuthenticationService.php index ced42711f..42d2fc212 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Services/SwiftaAuthenticationService.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Services/SwiftaAuthenticationService.php @@ -4,14 +4,10 @@ use Inensus\SwiftaPaymentProvider\Models\SwiftaAuthentication; -class SwiftaAuthenticationService -{ - public function __construct(private SwiftaAuthentication $swiftaAuthentication) - { - } +class SwiftaAuthenticationService { + public function __construct(private SwiftaAuthentication $swiftaAuthentication) {} - public function getSwiftaAuthentication() - { + public function getSwiftaAuthentication() { return $this->swiftaAuthentication->firstOrFail(); } } diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Services/SwiftaTransactionService.php b/src/backend/packages/inensus/swifta-payment-provider/src/Services/SwiftaTransactionService.php index 85970670c..87dfd941b 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Services/SwiftaTransactionService.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Services/SwiftaTransactionService.php @@ -18,8 +18,7 @@ /** * @implements IBaseService */ -class SwiftaTransactionService extends AbstractPaymentAggregatorTransactionService implements IBaseService -{ +class SwiftaTransactionService extends AbstractPaymentAggregatorTransactionService implements IBaseService { public function __construct( private Meter $meter, private Address $address, @@ -36,8 +35,7 @@ public function __construct( ); } - public function initializeTransactionData($data): array - { + public function initializeTransactionData($data): array { return [ 'amount' => $data['amount'], 'cipher' => $data['cipher'], @@ -46,8 +44,7 @@ public function initializeTransactionData($data): array ]; } - public function setRequestedTransactionsStatusFailed() - { + public function setRequestedTransactionsStatusFailed() { $this->swiftaTransaction->newQuery()->where('status', SwiftaTransaction::STATUS_REQUESTED)->get()->each(function ($transaction) { $transaction->update([ 'status' => SwiftaTransaction::STATUS_FAILED, @@ -61,13 +58,11 @@ public function setRequestedTransactionsStatusFailed() }); } - public function getSwiftaTransaction() - { + public function getSwiftaTransaction() { return $this->getPaymentAggregatorTransaction(); } - public function getTransactionById($transactionId) - { + public function getTransactionById($transactionId) { try { return $this->transaction->newQuery()->findOrFail($transactionId); } catch (ModelNotFoundException $exception) { @@ -75,38 +70,32 @@ public function getTransactionById($transactionId) } } - public function checkAmountIsSame($amount, $transaction) - { + public function checkAmountIsSame($amount, $transaction) { if ($amount != (int) $transaction->amount) { throw new \Exception('amount validation field.'); } } - public function getById(?int $id): SwiftaTransaction - { + public function getById(?int $id): SwiftaTransaction { return $this->swiftaTransaction->newQuery()->find($id); } - public function update($swiftaTransaction, $swiftaTransactionData): SwiftaTransaction - { + public function update($swiftaTransaction, $swiftaTransactionData): SwiftaTransaction { $swiftaTransaction->update($swiftaTransactionData); $swiftaTransaction->fresh(); return $swiftaTransaction; } - public function create(array $swiftaTransactionData): SwiftaTransaction - { + public function create(array $swiftaTransactionData): SwiftaTransaction { return $this->swiftaTransaction->newQuery()->create($swiftaTransactionData); } - public function delete($swiftaTransaction): ?bool - { + public function delete($swiftaTransaction): ?bool { return $swiftaTransaction->delete(); } - public function getAll(?int $limit = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null): Collection|LengthAwarePaginator { $query = $this->swiftaTransaction->newQuery(); if ($limit) { diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Tests/Feature/TransactionTests.php b/src/backend/packages/inensus/swifta-payment-provider/src/Tests/Feature/TransactionTests.php index 09bfb0bb4..08d212c57 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Tests/Feature/TransactionTests.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Tests/Feature/TransactionTests.php @@ -19,12 +19,10 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class TransactionTests extends TestCase -{ +class TransactionTests extends TestCase { use RefreshDatabase; - public function testWithNonExistingTransaction() - { + public function testWithNonExistingTransaction() { $data = [ 'transaction_id' => -1, 'transaction_reference' => 'ref', @@ -44,8 +42,7 @@ public function testWithNonExistingTransaction() ]); } - public function testWithDifferentTransactionAmountFromValidatedTransaction() - { + public function testWithDifferentTransactionAmountFromValidatedTransaction() { $this->initializeData(); $user = User::query()->create([ 'name' => 'test', @@ -74,8 +71,7 @@ public function testWithDifferentTransactionAmountFromValidatedTransaction() ]); } - public function testWithValidTransaction() - { + public function testWithValidTransaction() { Queue::fake(); $this->initializeData(); $user = User::query()->create([ @@ -115,8 +111,7 @@ public function testWithValidTransaction() ]); } - private function initializeData() - { + private function initializeData() { // create person factory(Person::class)->create(); // create meter-tariff @@ -167,8 +162,7 @@ private function initializeData() $address->save(); } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $customClaims = ['usr' => 'swifta-token', 'exp' => Carbon::now()->addYears(1)->timestamp]; $token = JWTAuth::customClaims($customClaims)->fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Tests/Feature/ValidationTests.php b/src/backend/packages/inensus/swifta-payment-provider/src/Tests/Feature/ValidationTests.php index a9f213bd6..e20abd044 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Tests/Feature/ValidationTests.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Tests/Feature/ValidationTests.php @@ -18,12 +18,10 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class ValidationTests extends TestCase -{ +class ValidationTests extends TestCase { use RefreshDatabase; - public function testOnlyAuthenticatedSwiftaUserSendsTransaction() - { + public function testOnlyAuthenticatedSwiftaUserSendsTransaction() { $data = [ 'meter_number' => '478881899', 'amount' => 1000, @@ -42,8 +40,7 @@ public function testOnlyAuthenticatedSwiftaUserSendsTransaction() ]); } - public function testWithoutInvalidCipher() - { + public function testWithoutInvalidCipher() { $data = [ 'meter_number' => '478881899', 'amount' => 1000, @@ -62,8 +59,7 @@ public function testWithoutInvalidCipher() ]); } - public function testWithoutNonExistingMeterNumber() - { + public function testWithoutNonExistingMeterNumber() { $this->initializeData(); $data = [ 'meter_number' => '4700005610', @@ -84,8 +80,7 @@ public function testWithoutNonExistingMeterNumber() ]); } - public function testWithNonSenderAddress() - { + public function testWithNonSenderAddress() { $this->initializeData(); Address::query()->first()->delete(); $data = [ @@ -108,8 +103,7 @@ public function testWithNonSenderAddress() ]); } - public function testWithInvalidTransactionAmount() - { + public function testWithInvalidTransactionAmount() { $this->initializeData(); AccessRate::query()->where('id', 1)->update([ 'tariff_id' => 1, @@ -140,8 +134,7 @@ public function testWithInvalidTransactionAmount() ]); } - public function testWithValidTransactionAmount() - { + public function testWithValidTransactionAmount() { $this->initializeData(); $data = [ 'meter_number' => '4700005646', @@ -169,8 +162,7 @@ public function testWithValidTransactionAmount() ]); } - private function initializeData() - { + private function initializeData() { // create person factory(Person::class)->create(); // create meter-tariff @@ -221,8 +213,7 @@ private function initializeData() $address->save(); } - public function actingAsWrong($user, $driver = null) - { + public function actingAsWrong($user, $driver = null) { $customClaims = ['usr' => 'swifta-token-wrong', 'exp' => Carbon::now()->addYears(1)->timestamp]; $token = JWTAuth::customClaims($customClaims)->fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); @@ -231,8 +222,7 @@ public function actingAsWrong($user, $driver = null) return $this; } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $customClaims = ['usr' => 'swifta-token', 'exp' => Carbon::now()->addYears(1)->timestamp]; $token = JWTAuth::customClaims($customClaims)->fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); diff --git a/src/backend/packages/inensus/swifta-payment-provider/src/Tests/Unit/PaymentProcessTests.php b/src/backend/packages/inensus/swifta-payment-provider/src/Tests/Unit/PaymentProcessTests.php index 944ad1744..8371c7516 100644 --- a/src/backend/packages/inensus/swifta-payment-provider/src/Tests/Unit/PaymentProcessTests.php +++ b/src/backend/packages/inensus/swifta-payment-provider/src/Tests/Unit/PaymentProcessTests.php @@ -20,12 +20,10 @@ use Illuminate\Support\Facades\Queue; use Tests\TestCase; -class PaymentProcessTests extends TestCase -{ +class PaymentProcessTests extends TestCase { use RefreshDatabase; - public function testProcessPaymentStartsEnergyTransactionProcessor() - { + public function testProcessPaymentStartsEnergyTransactionProcessor() { Queue::fake(); $this->initializeData(); $transaction = $this->initializeTransaction(); @@ -33,8 +31,7 @@ public function testProcessPaymentStartsEnergyTransactionProcessor() Queue::assertPushed(EnergyTransactionProcessor::class); } - public function testEnergyTransactionProcessorStartsTokenProcessor() - { + public function testEnergyTransactionProcessorStartsTokenProcessor() { Queue::fake(); $this->initializeData(); $transaction = $this->initializeTransaction(); @@ -42,8 +39,7 @@ public function testEnergyTransactionProcessorStartsTokenProcessor() Queue::assertPushed(TokenProcessor::class); } - public function testTokenProcessorChargesMeter() - { + public function testTokenProcessorChargesMeter() { Queue::fake(); $this->initializeData(); $transaction = $this->initializeTransaction(); @@ -57,8 +53,7 @@ public function testTokenProcessorChargesMeter() $this->assertEquals(1, $mesombPaymentCount); } - private function initializeTransaction() - { + private function initializeTransaction() { $validData = [ 'pk' => 'ae58a073-2b76-4774-995b-3743d6793d53', 'type' => 'PAYMENT', @@ -81,8 +76,7 @@ private function initializeTransaction() ); } - private function initializeData() - { + private function initializeData() { // create person factory(Person::class)->create(); // create meter-tariff diff --git a/src/backend/packages/inensus/ticket/src/Exceptions/ApiUserNotFound.php b/src/backend/packages/inensus/ticket/src/Exceptions/ApiUserNotFound.php index 081ae012e..28f351359 100644 --- a/src/backend/packages/inensus/ticket/src/Exceptions/ApiUserNotFound.php +++ b/src/backend/packages/inensus/ticket/src/Exceptions/ApiUserNotFound.php @@ -2,6 +2,4 @@ namespace Inensus\Ticket\Exceptions; -class ApiUserNotFound extends \Exception -{ -} +class ApiUserNotFound extends \Exception {} diff --git a/src/backend/packages/inensus/ticket/src/Exceptions/TicketOwnerNotFoundException.php b/src/backend/packages/inensus/ticket/src/Exceptions/TicketOwnerNotFoundException.php index 0cb518af5..c6ff994c0 100644 --- a/src/backend/packages/inensus/ticket/src/Exceptions/TicketOwnerNotFoundException.php +++ b/src/backend/packages/inensus/ticket/src/Exceptions/TicketOwnerNotFoundException.php @@ -2,6 +2,4 @@ namespace Inensus\Ticket\Exceptions; -class TicketOwnerNotFoundException extends \Exception -{ -} +class TicketOwnerNotFoundException extends \Exception {} diff --git a/src/backend/packages/inensus/ticket/src/Factories/TicketCategoryFactory.php b/src/backend/packages/inensus/ticket/src/Factories/TicketCategoryFactory.php index f0b4625a8..89ff52ab6 100644 --- a/src/backend/packages/inensus/ticket/src/Factories/TicketCategoryFactory.php +++ b/src/backend/packages/inensus/ticket/src/Factories/TicketCategoryFactory.php @@ -5,8 +5,7 @@ use Illuminate\Database\Eloquent\Factories\Factory; use Inensus\Ticket\Models\TicketCategory; -class TicketCategoryFactory extends Factory -{ +class TicketCategoryFactory extends Factory { protected $model = TicketCategory::class; /** @@ -14,8 +13,7 @@ class TicketCategoryFactory extends Factory * * @return array */ - public function definition() - { + public function definition() { return [ 'label_name' => $this->faker->word, 'label_color' => $this->faker->colorName, diff --git a/src/backend/packages/inensus/ticket/src/Http/Controllers/Controller.php b/src/backend/packages/inensus/ticket/src/Http/Controllers/Controller.php index 9c572c7df..577736f13 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Controllers/Controller.php +++ b/src/backend/packages/inensus/ticket/src/Http/Controllers/Controller.php @@ -7,8 +7,7 @@ use Illuminate\Foundation\Validation\ValidatesRequests; use Illuminate\Routing\Controller as BaseController; -class Controller extends BaseController -{ +class Controller extends BaseController { use AuthorizesRequests; use DispatchesJobs; use ValidatesRequests; diff --git a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketAgentController.php b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketAgentController.php index 52003b9f8..e5d4242a9 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketAgentController.php +++ b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketAgentController.php @@ -6,14 +6,10 @@ use Inensus\Ticket\Http\Resources\TicketResource; use Inensus\Ticket\Services\TicketService; -class TicketAgentController extends Controller -{ - public function __construct(private TicketService $ticketService) - { - } +class TicketAgentController extends Controller { + public function __construct(private TicketService $ticketService) {} - public function index($agentId, Request $request): TicketResource - { + public function index($agentId, Request $request): TicketResource { $limit = 5; $status = null; diff --git a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCategoryController.php b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCategoryController.php index 44e9c6f1d..a3af249bf 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCategoryController.php +++ b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCategoryController.php @@ -7,25 +7,20 @@ use Inensus\Ticket\Http\Resources\TicketResource; use Inensus\Ticket\Services\TicketCategoryService; -class TicketCategoryController extends Controller -{ - public function __construct(private TicketCategoryService $ticketCategoryService) - { - } +class TicketCategoryController extends Controller { + public function __construct(private TicketCategoryService $ticketCategoryService) {} /** * A list of all stored labels/categories. */ - public function index(Request $request): TicketResource - { + public function index(Request $request): TicketResource { $limit = $request->input('per_page'); $outsource = $request->get('outsource'); return TicketResource::make($this->ticketCategoryService->getAll($limit, $outsource)); } - public function store(TicketCategoryRequest $request): TicketResource - { + public function store(TicketCategoryRequest $request): TicketResource { $ticketCategoryData = [ 'label_name' => $request->input('labelName'), 'label_color' => $request->input('labelColor'), diff --git a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCommentController.php b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCommentController.php index f144a1a1b..319c32c5c 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCommentController.php +++ b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCommentController.php @@ -8,14 +8,10 @@ use Inensus\Ticket\Services\TicketCommentService; use Inensus\Ticket\Services\TicketUserService; -class TicketCommentController extends Controller -{ - public function __construct(private TicketCommentService $ticketCommentService, private TicketUserService $ticketUserService) - { - } +class TicketCommentController extends Controller { + public function __construct(private TicketCommentService $ticketCommentService, private TicketUserService $ticketUserService) {} - public function store(Request $request) - { + public function store(Request $request) { /** @var User $user */ $user = Auth::user(); $ticketId = (int) $request->input('cardId'); diff --git a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketController.php b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketController.php index de5d0e833..0840d9678 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketController.php +++ b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketController.php @@ -6,16 +6,12 @@ use Inensus\Ticket\Http\Resources\TicketResource; use Inensus\Ticket\Services\TicketService; -class TicketController extends Controller -{ +class TicketController extends Controller { public const FOR_APP = false; - public function __construct(private TicketService $ticketService) - { - } + public function __construct(private TicketService $ticketService) {} - public function index(Request $request): TicketResource - { + public function index(Request $request): TicketResource { $assignedId = $request->input('person') ?? null; $categoryId = $request->input('category') ?? null; $status = $request->input('status') ?? null; @@ -33,16 +29,14 @@ public function index(Request $request): TicketResource )); } - public function show(int $id): TicketResource - { + public function show(int $id): TicketResource { $ticket = $this->ticketService->getById($id); return TicketResource::make(collect($ticket)); } // TODO: change this on UI side with query parameter $ticketId - public function destroy(int $ticketId, Request $request) - { + public function destroy(int $ticketId, Request $request) { $closed = $this->ticketService->close($ticketId); return TicketResource::make(['data' => $closed]); diff --git a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCustomerController.php b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCustomerController.php index 48eec9212..e922d403d 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCustomerController.php +++ b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketCustomerController.php @@ -14,8 +14,7 @@ use Inensus\Ticket\Services\TicketOutSourceService; use Inensus\Ticket\Services\TicketService; -class TicketCustomerController extends Controller -{ +class TicketCustomerController extends Controller { public function __construct( private TicketService $ticketService, private UserTicketService $userTicketService, @@ -25,11 +24,9 @@ public function __construct( private TicketOutSourceService $ticketOutSourceService, private MaintenanceUserService $maintenanceUserService, private MaintenanceUserTicketService $maintenanceUserTicketService, - ) { - } + ) {} - public function store(UserTicketCreateRequest $request): TicketResource - { + public function store(UserTicketCreateRequest $request): TicketResource { $ticketData = $request->getMappedArray(); $user = auth('api')->user(); $ticket = $this->ticketService->make($ticketData); @@ -62,8 +59,7 @@ public function store(UserTicketCreateRequest $request): TicketResource return TicketResource::make($ticket); } - public function index($customerId, Request $request) - { + public function index($customerId, Request $request) { $limit = 5; $agentId = null; $status = null; diff --git a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketExportController.php b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketExportController.php index 3736287c9..d616609f6 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketExportController.php +++ b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketExportController.php @@ -8,19 +8,16 @@ use Inensus\Ticket\Services\TicketService; use Symfony\Component\HttpFoundation\BinaryFileResponse; -class TicketExportController -{ +class TicketExportController { public function __construct( private TicketOutsourceReportService $ticketOutsourceReportService, private TicketService $ticketService, - ) { - } + ) {} /** * A list of stored book keeping data. */ - public function index(Request $request): TicketResource - { + public function index(Request $request): TicketResource { $limit = $request->input('per_page'); return TicketResource::make($this->ticketOutsourceReportService->getAll($limit)); @@ -31,8 +28,7 @@ public function index(Request $request): TicketResource * * @throws \PhpOffice\PhpSpreadsheet\Exception */ - public function outsource(Request $request): TicketResource - { + public function outsource(Request $request): TicketResource { $startDate = $request->input('startDate'); $endDate = $request->input('endDate'); $tickets = $this->ticketService->getForOutsourceReport($startDate, $endDate); @@ -45,8 +41,7 @@ public function outsource(Request $request): TicketResource return TicketResource::make($this->ticketOutsourceReportService->create($ticketOutsourceReportData)); } - public function download($id): BinaryFileResponse - { + public function download($id): BinaryFileResponse { return response()->download($this->ticketOutsourceReportService->getById($id)); } } diff --git a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketUserController.php b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketUserController.php index bd23a2f21..682a6965a 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketUserController.php +++ b/src/backend/packages/inensus/ticket/src/Http/Controllers/TicketUserController.php @@ -9,24 +9,20 @@ use Inensus\Ticket\Http\Resources\TicketResource; use Inensus\Ticket\Services\TicketUserService; -class TicketUserController extends Controller -{ +class TicketUserController extends Controller { public function __construct( private TicketUserService $ticketUserService, private UserService $userService, - ) { - } + ) {} - public function index(Request $request): TicketResource - { + public function index(Request $request): TicketResource { $limit = $request->input('per_page'); $outSource = $request->input('outsource'); return TicketResource::make($this->ticketUserService->getAll($limit, $outSource)); } - public function storeExternal(TicketingUserExternalRequest $request) - { + public function storeExternal(TicketingUserExternalRequest $request) { $ticketUserData = [ 'user_name' => $request->getUserName(), 'phone' => $request->getPhone(), @@ -37,8 +33,7 @@ public function storeExternal(TicketingUserExternalRequest $request) $this->ticketUserService->create($ticketUserData); } - public function store(TicketingUserRequest $request): TicketResource - { + public function store(TicketingUserRequest $request): TicketResource { $user = $this->userService->get($request->getUserId()); $ticketUserData = [ diff --git a/src/backend/packages/inensus/ticket/src/Http/Controllers/WatcherController.php b/src/backend/packages/inensus/ticket/src/Http/Controllers/WatcherController.php index 47818725c..7a68ad27c 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Controllers/WatcherController.php +++ b/src/backend/packages/inensus/ticket/src/Http/Controllers/WatcherController.php @@ -13,8 +13,7 @@ * The reason to storing the actions, is to make a timeline. * Class WatcherController. */ -class WatcherController -{ +class WatcherController { // TODO: fix for Saas. /** @@ -30,13 +29,11 @@ class WatcherController /** * WatcherController constructor. */ - public function __construct(Ticket $ticket) - { + public function __construct(Ticket $ticket) { $this->ticket = $ticket; } - public function store(): void - { + public function store(): void { // convert the json string $content = json_decode(request()->getContent(), true); if ($content === null) { // request body is not a valid json string. @@ -62,8 +59,7 @@ public function store(): void * * @param string $type the request type */ - private function filterRequest($type): bool - { + private function filterRequest($type): bool { return \in_array($type, self::INTERESTING_ACTIONS, false); } @@ -73,13 +69,11 @@ private function filterRequest($type): bool * * @throws ModelNotFoundException */ - private function ticketMatcher(string $ticketId): Ticket - { + private function ticketMatcher(string $ticketId): Ticket { return $this->ticket->where('ticket_id', $ticketId)->firstOrFail(); } - private function fetchAndStore($type, $action): void - { + private function fetchAndStore($type, $action): void { $text = ''; // initialize text $ticketId = $action['data']['card']['id']; // the affected card. $actionType = null; diff --git a/src/backend/packages/inensus/ticket/src/Http/Requests/TicketCategoryRequest.php b/src/backend/packages/inensus/ticket/src/Http/Requests/TicketCategoryRequest.php index 99a9b5ff2..936bc2155 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Requests/TicketCategoryRequest.php +++ b/src/backend/packages/inensus/ticket/src/Http/Requests/TicketCategoryRequest.php @@ -4,10 +4,8 @@ use Illuminate\Foundation\Http\FormRequest; -class TicketCategoryRequest extends FormRequest -{ - public function rules(): array - { +class TicketCategoryRequest extends FormRequest { + public function rules(): array { return [ 'labelName' => 'required', 'labelColor' => 'sometimes|in:yellow,purple,blue,red,green,orange,black,sky,pink,lime,nocolor', diff --git a/src/backend/packages/inensus/ticket/src/Http/Requests/TicketingUserExternalRequest.php b/src/backend/packages/inensus/ticket/src/Http/Requests/TicketingUserExternalRequest.php index a3577727e..4d69785cd 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Requests/TicketingUserExternalRequest.php +++ b/src/backend/packages/inensus/ticket/src/Http/Requests/TicketingUserExternalRequest.php @@ -4,26 +4,22 @@ use Illuminate\Foundation\Http\FormRequest; -class TicketingUserExternalRequest extends FormRequest -{ +class TicketingUserExternalRequest extends FormRequest { /** * Describes the rules which should be fulfilled by the request. */ - public function rules(): array - { + public function rules(): array { return [ 'username' => 'required', 'phone' => 'required', ]; } - public function getUserName(): string - { + public function getUserName(): string { return $this->input('username'); } - public function getPhone(): string - { + public function getPhone(): string { return (int) $this->input('phone'); } } diff --git a/src/backend/packages/inensus/ticket/src/Http/Requests/TicketingUserRequest.php b/src/backend/packages/inensus/ticket/src/Http/Requests/TicketingUserRequest.php index 3c7cebe31..586e53eec 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Requests/TicketingUserRequest.php +++ b/src/backend/packages/inensus/ticket/src/Http/Requests/TicketingUserRequest.php @@ -4,20 +4,17 @@ use Illuminate\Foundation\Http\FormRequest; -class TicketingUserRequest extends FormRequest -{ +class TicketingUserRequest extends FormRequest { /** * Describes the rules which should be fulfilled by the request. */ - public function rules(): array - { + public function rules(): array { return [ 'user_id' => 'required|numeric', ]; } - public function getUserId(): int - { + public function getUserId(): int { return (int) $this->input('user_id'); } } diff --git a/src/backend/packages/inensus/ticket/src/Http/Requests/UserTicketCreateRequest.php b/src/backend/packages/inensus/ticket/src/Http/Requests/UserTicketCreateRequest.php index aaa819478..585797d7e 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Requests/UserTicketCreateRequest.php +++ b/src/backend/packages/inensus/ticket/src/Http/Requests/UserTicketCreateRequest.php @@ -5,30 +5,24 @@ use Illuminate\Foundation\Http\FormRequest; use Ramsey\Uuid\Uuid; -class UserTicketCreateRequest extends FormRequest -{ - public function rules(): array - { +class UserTicketCreateRequest extends FormRequest { + public function rules(): array { return []; } - public function getTitle(): string - { + public function getTitle(): string { return $this->input('title'); } - public function getOwnerId(): ?int - { + public function getOwnerId(): ?int { return $this->input('owner_id'); } - public function getOutsourcing(): bool - { + public function getOutsourcing(): bool { return $this->input('outsourcing'); } - public function getMappedArray(): array - { + public function getMappedArray(): array { return [ 'ticket_id' => Uuid::uuid4(), 'title' => $this->getTitle(), @@ -39,23 +33,19 @@ public function getMappedArray(): array ]; } - public function getLabel(): int - { + public function getLabel(): int { return $this->input('label'); } - private function getAssignedPerson(): ?int - { + private function getAssignedPerson(): ?int { return $this->input('assignedPerson'); } - private function getDescription(): string - { + private function getDescription(): string { return $this->input('description'); } - private function getDueDate(): ?string - { + private function getDueDate(): ?string { return $this->input('dueDate'); } } diff --git a/src/backend/packages/inensus/ticket/src/Http/Resources/TicketResource.php b/src/backend/packages/inensus/ticket/src/Http/Resources/TicketResource.php index 024d08f73..892137753 100644 --- a/src/backend/packages/inensus/ticket/src/Http/Resources/TicketResource.php +++ b/src/backend/packages/inensus/ticket/src/Http/Resources/TicketResource.php @@ -5,8 +5,7 @@ use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\JsonResource; -class TicketResource extends JsonResource -{ +class TicketResource extends JsonResource { /** * Transform the resource into an array. * @@ -14,8 +13,7 @@ class TicketResource extends JsonResource * * @return array */ - public function toArray($request) - { + public function toArray($request) { return parent::toArray($request); } } diff --git a/src/backend/packages/inensus/ticket/src/Interfaces/ITicketProvider.php b/src/backend/packages/inensus/ticket/src/Interfaces/ITicketProvider.php index faf7f0a7e..d52500f7c 100644 --- a/src/backend/packages/inensus/ticket/src/Interfaces/ITicketProvider.php +++ b/src/backend/packages/inensus/ticket/src/Interfaces/ITicketProvider.php @@ -2,8 +2,7 @@ namespace Inensus\Ticket\Interfaces; -interface ITicketProvider -{ +interface ITicketProvider { // initializes the ticketing system public function initialize(); diff --git a/src/backend/packages/inensus/ticket/src/Jobs/OutputJob.php b/src/backend/packages/inensus/ticket/src/Jobs/OutputJob.php index cde2c6a3e..366ffc1a1 100644 --- a/src/backend/packages/inensus/ticket/src/Jobs/OutputJob.php +++ b/src/backend/packages/inensus/ticket/src/Jobs/OutputJob.php @@ -9,8 +9,7 @@ use Illuminate\Queue\SerializesModels; use Illuminate\Support\Facades\Log; -class OutputJob implements ShouldQueue -{ +class OutputJob implements ShouldQueue { use Dispatchable; use InteractsWithQueue; use Queueable; @@ -26,14 +25,12 @@ class OutputJob implements ShouldQueue */ protected $queue_name; - public function __construct(string $queue_name, int $val) - { + public function __construct(string $queue_name, int $val) { $this->queue_name = $queue_name; $this->val = $val; } - public function handle(): void - { + public function handle(): void { Log::critical('redis', ['abc' => 'def', 'Val' => $this->val, 'queue' => $this->queue_name]); } } diff --git a/src/backend/packages/inensus/ticket/src/Models/BaseModel.php b/src/backend/packages/inensus/ticket/src/Models/BaseModel.php index 3097d4d06..c49f487c9 100644 --- a/src/backend/packages/inensus/ticket/src/Models/BaseModel.php +++ b/src/backend/packages/inensus/ticket/src/Models/BaseModel.php @@ -2,6 +2,4 @@ namespace Inensus\Ticket\Models; -class BaseModel extends \App\Models\Base\BaseModel -{ -} +class BaseModel extends \App\Models\Base\BaseModel {} diff --git a/src/backend/packages/inensus/ticket/src/Models/Ticket.php b/src/backend/packages/inensus/ticket/src/Models/Ticket.php index 470206ac1..6b5bdc359 100644 --- a/src/backend/packages/inensus/ticket/src/Models/Ticket.php +++ b/src/backend/packages/inensus/ticket/src/Models/Ticket.php @@ -8,8 +8,7 @@ use Illuminate\Database\Eloquent\Relations\MorphTo; use Illuminate\Support\Facades\DB; -class Ticket extends BaseModel -{ +class Ticket extends BaseModel { protected $table = 'tickets'; public const STATUS = [ @@ -18,53 +17,44 @@ class Ticket extends BaseModel 'waiting' => 2, ]; - public function card() - { + public function card() { return $this->belongsTo(TicketCard::class); } - public function category(): BelongsTo - { + public function category(): BelongsTo { return $this->belongsTo(TicketCategory::class, 'category_id'); } - public function owner(): MorphTo - { + public function owner(): MorphTo { return $this->morphTo(); } - public function outsource(): HasOne - { + public function outsource(): HasOne { return $this->hasOne(TicketOutsource::class); } - public function assignedTo(): BelongsTo - { + public function assignedTo(): BelongsTo { return $this->belongsTo(TicketUser::class, 'assigned_id'); } - public function ticketsOpenedInPeriod($startDate, $endDate) - { + public function ticketsOpenedInPeriod($startDate, $endDate) { return $this->select(DB::raw('COUNT(id) as amount, YEARWEEK(created_at,3) as period')) ->whereBetween('created_at', [$startDate, $endDate]) ->groupBy(DB::raw('YEARWEEK(created_at,3)')); } - public function ticketsClosedInPeriod($startDate, $endDate) - { + public function ticketsClosedInPeriod($startDate, $endDate) { return $this->select(DB::raw('COUNT(id) as amount, YEARWEEK(updated_at,3) as period,avg(timestampdiff(SECOND, created_at, updated_at)) as avgdiff')) ->where('status', 1) ->whereBetween('updated_at', [$startDate, $endDate]) ->groupBy(DB::raw('YEARWEEK(updated_at,3)')); } - public function creator() - { + public function creator() { return $this->morphTo('creator'); } - public function ticketsOpenedWithCategories($miniGridId): bool|array - { + public function ticketsOpenedWithCategories($miniGridId): bool|array { $sql = 'SELECT ticket_categories.label_name, count(tickets.id) as new_tickets, YEARWEEK(tickets.created_at,3) as period FROM `tickets` '. 'LEFT join ticket_categories on tickets.category_id = ticket_categories.id '. 'left join addresses on addresses.owner_id = tickets.owner_id '. @@ -79,8 +69,7 @@ public function ticketsOpenedWithCategories($miniGridId): bool|array return $sth->fetchAll(\PDO::FETCH_ASSOC); } - public function ticketsClosedWithCategories($miniGridId): bool|array - { + public function ticketsClosedWithCategories($miniGridId): bool|array { $sql = 'SELECT ticket_categories.label_name, count(tickets.id) as closed_tickets, YEARWEEK(tickets.updated_at,3) as period FROM `tickets` '. 'LEFT join ticket_categories on tickets.category_id = ticket_categories.id '. 'left join addresses on addresses.owner_id = tickets.owner_id '. @@ -95,8 +84,7 @@ public function ticketsClosedWithCategories($miniGridId): bool|array return $sth->fetchAll(\PDO::FETCH_ASSOC); } - public function comments(): HasMany - { + public function comments(): HasMany { return $this->hasMany(TicketComment::class, 'ticket_id', 'id'); } } diff --git a/src/backend/packages/inensus/ticket/src/Models/TicketCategory.php b/src/backend/packages/inensus/ticket/src/Models/TicketCategory.php index eec1aaf5d..2f3b81a89 100644 --- a/src/backend/packages/inensus/ticket/src/Models/TicketCategory.php +++ b/src/backend/packages/inensus/ticket/src/Models/TicketCategory.php @@ -5,13 +5,11 @@ use Illuminate\Database\Eloquent\Factories\Factory; use Inensus\Ticket\Factories\TicketCategoryFactory; -class TicketCategory extends BaseModel -{ +class TicketCategory extends BaseModel { /** * Create a new factory instance for the model. */ - protected static function newFactory(): Factory - { + protected static function newFactory(): Factory { return TicketCategoryFactory::new(); } diff --git a/src/backend/packages/inensus/ticket/src/Models/TicketComment.php b/src/backend/packages/inensus/ticket/src/Models/TicketComment.php index 70bfdd5f1..597817733 100644 --- a/src/backend/packages/inensus/ticket/src/Models/TicketComment.php +++ b/src/backend/packages/inensus/ticket/src/Models/TicketComment.php @@ -4,17 +4,14 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; -class TicketComment extends BaseModel -{ +class TicketComment extends BaseModel { protected $table = 'ticket_comments'; - public function ticket(): BelongsTo - { + public function ticket(): BelongsTo { return $this->belongsTo(Ticket::class, 'ticket_id', 'id'); } - public function ticketUser(): BelongsTo - { + public function ticketUser(): BelongsTo { return $this->belongsTo(TicketUser::class, 'ticket_user_id', 'id'); } } diff --git a/src/backend/packages/inensus/ticket/src/Models/TicketOutsource.php b/src/backend/packages/inensus/ticket/src/Models/TicketOutsource.php index e6ffd9fe8..0b2dd1c59 100644 --- a/src/backend/packages/inensus/ticket/src/Models/TicketOutsource.php +++ b/src/backend/packages/inensus/ticket/src/Models/TicketOutsource.php @@ -2,12 +2,10 @@ namespace Inensus\Ticket\Models; -class TicketOutsource extends BaseModel -{ +class TicketOutsource extends BaseModel { protected $table = 'ticket_outsources'; - public function ticket() - { + public function ticket() { return $this->belongsTo(Ticket::class); } } diff --git a/src/backend/packages/inensus/ticket/src/Models/TicketOutsourceReport.php b/src/backend/packages/inensus/ticket/src/Models/TicketOutsourceReport.php index 18f04c596..bdb122b80 100644 --- a/src/backend/packages/inensus/ticket/src/Models/TicketOutsourceReport.php +++ b/src/backend/packages/inensus/ticket/src/Models/TicketOutsourceReport.php @@ -9,7 +9,6 @@ * @property string $date * @property string $path */ -class TicketOutsourceReport extends BaseModel -{ +class TicketOutsourceReport extends BaseModel { protected $table = 'ticket_outsource_reports'; } diff --git a/src/backend/packages/inensus/ticket/src/Models/TicketUser.php b/src/backend/packages/inensus/ticket/src/Models/TicketUser.php index 01e1f4dd1..d406cb1d4 100644 --- a/src/backend/packages/inensus/ticket/src/Models/TicketUser.php +++ b/src/backend/packages/inensus/ticket/src/Models/TicketUser.php @@ -10,16 +10,14 @@ * @property int $out_source * @property int $id */ -class TicketUser extends BaseModel -{ +class TicketUser extends BaseModel { public const TABLE_NAME = 'ticket_users'; public const COL_USER_ID = 'user_id'; protected $table = self::TABLE_NAME; - public function getId(): int - { + public function getId(): int { return $this->id; } } diff --git a/src/backend/packages/inensus/ticket/src/Providers/TicketRootServiceProvider.php b/src/backend/packages/inensus/ticket/src/Providers/TicketRootServiceProvider.php index ba15e182e..ddacb811c 100644 --- a/src/backend/packages/inensus/ticket/src/Providers/TicketRootServiceProvider.php +++ b/src/backend/packages/inensus/ticket/src/Providers/TicketRootServiceProvider.php @@ -5,22 +5,18 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Support\Facades\Route; -class TicketRootServiceProvider extends ServiceProvider -{ +class TicketRootServiceProvider extends ServiceProvider { protected $namespace = 'Inensus\Ticket\Http\Controllers'; - public function boot() - { + public function boot() { parent::boot(); } - public function map() - { + public function map() { $this->mapApiRoutes(); } - protected function mapApiRoutes() - { + protected function mapApiRoutes() { Route::prefix('tickets') ->namespace($this->namespace) ->group(__DIR__.'/../routes/web.php'); diff --git a/src/backend/packages/inensus/ticket/src/Providers/TicketServiceProvider.php b/src/backend/packages/inensus/ticket/src/Providers/TicketServiceProvider.php index f2fbd7e73..622a4105b 100644 --- a/src/backend/packages/inensus/ticket/src/Providers/TicketServiceProvider.php +++ b/src/backend/packages/inensus/ticket/src/Providers/TicketServiceProvider.php @@ -4,10 +4,8 @@ use Illuminate\Support\ServiceProvider; -class TicketServiceProvider extends ServiceProvider -{ - public function boot() - { +class TicketServiceProvider extends ServiceProvider { + public function boot() { $this->app->register(TicketRootServiceProvider::class); if ($this->app->runningInConsole()) { $this->publishConfigFiles(); @@ -15,23 +13,20 @@ public function boot() } } - public function register() - { + public function register() { $this->mergeConfigFrom( __DIR__.'/../../config/tickets.php', 'tickets' ); } - public function publishConfigFiles() - { + public function publishConfigFiles() { $this->publishes([ __DIR__.'/../../config/tickets.php' => config_path('tickets.php'), ], 'config'); } - public function publishMigrations() - { + public function publishMigrations() { if (!class_exists('CreateTicketingTables')) { $timestamp = date('Y_m_d_His', time()); diff --git a/src/backend/packages/inensus/ticket/src/Services/TicketCategoryService.php b/src/backend/packages/inensus/ticket/src/Services/TicketCategoryService.php index 11278724c..23f1a8342 100644 --- a/src/backend/packages/inensus/ticket/src/Services/TicketCategoryService.php +++ b/src/backend/packages/inensus/ticket/src/Services/TicketCategoryService.php @@ -10,35 +10,28 @@ /** * @implements IBaseService */ -class TicketCategoryService implements IBaseService -{ +class TicketCategoryService implements IBaseService { public function __construct( private TicketCategory $ticketCategory, - ) { - } + ) {} - public function getById(int $categoryId): TicketCategory - { + public function getById(int $categoryId): TicketCategory { return $this->ticketCategory->newQuery()->find($categoryId); } - public function create(array $ticketCategoryData): TicketCategory - { + public function create(array $ticketCategoryData): TicketCategory { return $this->ticketCategory->newQuery()->create($ticketCategoryData); } - public function update($model, array $data): TicketCategory - { + public function update($model, array $data): TicketCategory { throw new \Exception('Method update() not yet implemented.'); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } - public function getAll(?int $limit = null, ?bool $outsource = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null, ?bool $outsource = null): Collection|LengthAwarePaginator { $ticketCategories = $this->ticketCategory->newQuery(); if ($outsource) { diff --git a/src/backend/packages/inensus/ticket/src/Services/TicketCommentService.php b/src/backend/packages/inensus/ticket/src/Services/TicketCommentService.php index c657b3d02..1dbdd966b 100644 --- a/src/backend/packages/inensus/ticket/src/Services/TicketCommentService.php +++ b/src/backend/packages/inensus/ticket/src/Services/TicketCommentService.php @@ -5,17 +5,14 @@ use App\Models\Person\Person; use Inensus\Ticket\Models\TicketComment; -class TicketCommentService -{ +class TicketCommentService { public function __construct( private Person $person, private TicketComment $ticketComment, private TicketUserService $ticketUserService, - ) { - } + ) {} - public function createComment(int $ticketId, string $comment, int $ticketUserId): TicketComment - { + public function createComment(int $ticketId, string $comment, int $ticketUserId): TicketComment { $commentData = [ 'comment' => $comment, 'ticket_id' => $ticketId, @@ -29,8 +26,7 @@ public function createComment(int $ticketId, string $comment, int $ticketUserId) } // store a comment if the sender is an maintenance guy and responds with sms to an open ticket. - public function storeComment($sender, $message) - { + public function storeComment($sender, $message) { $person = $this->person::with([ 'addresses', 'tickets' => static function ($q) { diff --git a/src/backend/packages/inensus/ticket/src/Services/TicketOutSourceService.php b/src/backend/packages/inensus/ticket/src/Services/TicketOutSourceService.php index e70bcb414..be9024f64 100644 --- a/src/backend/packages/inensus/ticket/src/Services/TicketOutSourceService.php +++ b/src/backend/packages/inensus/ticket/src/Services/TicketOutSourceService.php @@ -9,35 +9,28 @@ /** * @implements IBaseService */ -class TicketOutSourceService implements IBaseService -{ +class TicketOutSourceService implements IBaseService { public function __construct( private TicketOutsource $ticketOutsource, - ) { - } + ) {} - public function getById(int $ticketOutsourceId): TicketOutsource - { + public function getById(int $ticketOutsourceId): TicketOutsource { return $this->ticketOutsource->newQuery()->find($ticketOutsourceId); } - public function create(array $ticketOutsourceData): TicketOutsource - { + public function create(array $ticketOutsourceData): TicketOutsource { return $this->ticketOutsource->newQuery()->create($ticketOutsourceData); } - public function update($model, array $data): TicketOutsource - { + public function update($model, array $data): TicketOutsource { throw new \Exception('Method update() not yet implemented.'); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } - public function getAll(?int $limit = null): Collection - { + public function getAll(?int $limit = null): Collection { throw new \Exception('Method getAll() not yet implemented.'); } } diff --git a/src/backend/packages/inensus/ticket/src/Services/TicketOutsourceReportService.php b/src/backend/packages/inensus/ticket/src/Services/TicketOutsourceReportService.php index 276e0bed0..1cf302203 100644 --- a/src/backend/packages/inensus/ticket/src/Services/TicketOutsourceReportService.php +++ b/src/backend/packages/inensus/ticket/src/Services/TicketOutsourceReportService.php @@ -13,16 +13,13 @@ /** * @implements IBaseService */ -class TicketOutsourceReportService implements IBaseService -{ +class TicketOutsourceReportService implements IBaseService { public function __construct( private TicketOutsourceReport $ticketOutsourceReport, private Spreadsheet $spreadsheet, - ) { - } + ) {} - public function getAll(?int $limit = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null): Collection|LengthAwarePaginator { if ($limit) { return $this->ticketOutsourceReport->newQuery()->paginate($limit); } @@ -30,8 +27,7 @@ public function getAll(?int $limit = null): Collection|LengthAwarePaginator return $this->ticketOutsourceReport->newQuery()->get(); } - public function createExcelSheet($startDate, $endDate, $tickets) - { + public function createExcelSheet($startDate, $endDate, $tickets) { $fileName = 'Outsourcing-'.$startDate.'-'.$endDate.'.xlsx'; $sheet = $this->spreadsheet->getActiveSheet(); @@ -63,23 +59,19 @@ public function createExcelSheet($startDate, $endDate, $tickets) return $fileName; } - public function create(array $ticketOutsourceReportData): TicketOutsourceReport - { + public function create(array $ticketOutsourceReportData): TicketOutsourceReport { return $this->ticketOutsourceReport->newQuery()->create($ticketOutsourceReportData); } - public function getById(int $outsourceReportId): TicketOutsourceReport - { + public function getById(int $outsourceReportId): TicketOutsourceReport { return $this->ticketOutsourceReport->newQuery()->find($outsourceReportId); } - public function update($model, array $data): TicketOutsourceReport - { + public function update($model, array $data): TicketOutsourceReport { throw new \Exception('Method update() not yet implemented.'); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } } diff --git a/src/backend/packages/inensus/ticket/src/Services/TicketService.php b/src/backend/packages/inensus/ticket/src/Services/TicketService.php index 9bba24c0f..29e03f970 100644 --- a/src/backend/packages/inensus/ticket/src/Services/TicketService.php +++ b/src/backend/packages/inensus/ticket/src/Services/TicketService.php @@ -10,12 +10,10 @@ /** * @implements IAssociative */ -class TicketService implements IAssociative -{ +class TicketService implements IAssociative { public function __construct( private Ticket $ticket, - ) { - } + ) {} public function create( string $title, @@ -41,8 +39,7 @@ public function create( return $ticket; } - public function close($ticketId): Ticket - { + public function close($ticketId): Ticket { $ticket = $this->getById($ticketId); $ticketData = ['status' => 1]; $this->update($ticket, $ticketData); @@ -50,8 +47,7 @@ public function close($ticketId): Ticket return $ticket->fresh(); } - public function getBatch($tickets) - { + public function getBatch($tickets) { foreach ($tickets as $index => $ticket) { $tickets[$index]['comments'] = $ticket->comments()->with('ticketUser')->get(); } @@ -59,13 +55,11 @@ public function getBatch($tickets) return $tickets; } - public function getById($ticketId) - { + public function getById($ticketId) { return $this->ticket->newQuery()->with(['category', 'owner'])->where('id', $ticketId)->first(); } - public function update($ticket, $ticketData) - { + public function update($ticket, $ticketData) { $ticket->update($ticketData); $ticket->fresh(); @@ -120,18 +114,15 @@ static function ($q) use ($agentId) { return $tickets; } - public function make(array $ticketData): Ticket - { + public function make(array $ticketData): Ticket { return $this->ticket->newQuery()->make($ticketData); } - public function save($ticket): bool - { + public function save($ticket): bool { return $ticket->save(); } - public function getForOutsourceReport($startDate, $endDate) - { + public function getForOutsourceReport($startDate, $endDate) { return $this->ticket->newQuery()->with(['outsource', 'assignedTo', 'category']) ->whereHas('category', static function ($q) { $q->where('out_source', 1); @@ -143,8 +134,7 @@ public function getForOutsourceReport($startDate, $endDate) ->get(); } - public function getForAgent($agentId, $customerId = null) - { + public function getForAgent($agentId, $customerId = null) { $query = $this->ticket->newQuery()->with(['category', 'owner', 'assignedTo', 'comments.ticketUser']); if ($agentId) { diff --git a/src/backend/packages/inensus/ticket/src/Services/TicketUserService.php b/src/backend/packages/inensus/ticket/src/Services/TicketUserService.php index 14f6c8153..41556151e 100644 --- a/src/backend/packages/inensus/ticket/src/Services/TicketUserService.php +++ b/src/backend/packages/inensus/ticket/src/Services/TicketUserService.php @@ -11,16 +11,13 @@ /** * @implements IBaseService */ -class TicketUserService implements IBaseService -{ +class TicketUserService implements IBaseService { public function __construct( private TicketUser $ticketUser, private User $user, - ) { - } + ) {} - public function getAll(?int $limit = null, ?bool $outsource = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null, ?bool $outsource = null): Collection|LengthAwarePaginator { $ticketUsers = $this->user::with('relationTicketUser'); if ($outsource) { @@ -34,28 +31,23 @@ public function getAll(?int $limit = null, ?bool $outsource = null): Collection| return $ticketUsers->get(); } - public function getById(int $externId): TicketUser - { + public function getById(int $externId): TicketUser { return $this->ticketUser->newQuery()->where('extern_id', $externId)->first(); } - public function create($ticketUserData): TicketUser - { + public function create($ticketUserData): TicketUser { return $this->ticketUser->newQuery()->create($ticketUserData); } - public function update($model, array $data): TicketUser - { + public function update($model, array $data): TicketUser { throw new \Exception('Method update() not yet implemented.'); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } - public function findByPhone(string $phone): TicketUser - { + public function findByPhone(string $phone): TicketUser { /** @var TicketUser $result */ $result = $this->ticketUser->newQuery()->where('phone', '=', $phone) ->firstOrFail(); @@ -63,8 +55,7 @@ public function findByPhone(string $phone): TicketUser return $result; } - public function findOrCreateByUser(User $user): TicketUser - { + public function findOrCreateByUser(User $user): TicketUser { try { /** @var TicketUser $result */ $result = $this->ticketUser->newQuery()->where('user_id', '=', $user->getId()) diff --git a/src/backend/packages/inensus/viber-messaging/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/viber-messaging/src/Console/Commands/InstallPackage.php index d1263bc34..5f45e8641 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/viber-messaging/src/Console/Commands/InstallPackage.php @@ -5,8 +5,7 @@ use Illuminate\Console\Command; use Inensus\ViberMessaging\Services\ViberCredentialService; -class InstallPackage extends Command -{ +class InstallPackage extends Command { protected $signature = 'viber-messaging:install'; protected $description = 'Install ViberMessaging Package'; @@ -17,15 +16,13 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { $this->info('Installing ViberMessaging Integration Package\n'); $this->credentialService->createCredentials(); $this->info('Package installed successfully..'); } - private function publishMigrations() - { + private function publishMigrations() { $this->info('Copying migrations\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\ViberMessaging\Providers\ViberMessagingServiceProvider", @@ -33,14 +30,12 @@ private function publishMigrations() ]); } - private function createDatabaseTables() - { + private function createDatabaseTables() { $this->info('Creating database tables\n'); $this->call('migrate'); } - private function publishVueFiles() - { + private function publishVueFiles() { $this->info('Copying vue files\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\ViberMessaging\Providers\ViberMessagingServiceProvider", @@ -48,8 +43,7 @@ private function publishVueFiles() ]); } - private function createPluginRecord() - { + private function createPluginRecord() { $this->call('plugin:add', [ 'name' => 'ViberMessaging', 'composer_name' => 'inensus/viber-messaging', diff --git a/src/backend/packages/inensus/viber-messaging/src/Console/Commands/UpdatePackage.php b/src/backend/packages/inensus/viber-messaging/src/Console/Commands/UpdatePackage.php index ae98722be..c3c6e30d0 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Console/Commands/UpdatePackage.php +++ b/src/backend/packages/inensus/viber-messaging/src/Console/Commands/UpdatePackage.php @@ -7,8 +7,7 @@ use Illuminate\Support\Facades\DB; use Inensus\ViberMessaging\Services\ViberCredentialService; -class UpdatePackage extends Command -{ +class UpdatePackage extends Command { protected $signature = 'viber-messaging:update'; protected $description = 'Update ViberMessaging Package'; @@ -20,8 +19,7 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { $this->info('Viber Messaging Integration Updating Started\n'); $this->removeOldVersionOfPackage(); $this->installNewVersionOfPackage(); @@ -34,20 +32,17 @@ public function handle(): void $this->info('Package updated successfully..'); } - private function removeOldVersionOfPackage() - { + private function removeOldVersionOfPackage() { $this->info('Removing former version of package\n'); echo shell_exec('COMPOSER_MEMORY_LIMIT=-1 ../composer.phar remove inensus/viber-messaging'); } - private function installNewVersionOfPackage() - { + private function installNewVersionOfPackage() { $this->info('Installing last version of package\n'); echo shell_exec('COMPOSER_MEMORY_LIMIT=-1 ../composer.phar require inensus/viber-messaging'); } - private function deleteMigration(Filesystem $filesystem) - { + private function deleteMigration(Filesystem $filesystem) { $migrationFile = $filesystem->glob(database_path().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR. '*_create_viber_tables.php')[0]; $migration = DB::table('migrations') @@ -60,8 +55,7 @@ private function deleteMigration(Filesystem $filesystem) ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->delete(); } - private function publishMigrationsAgain() - { + private function publishMigrationsAgain() { $this->info('Copying migrations\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\ViberMessaging\Providers\ViberMessagingServiceProvider", @@ -69,14 +63,12 @@ private function publishMigrationsAgain() ]); } - private function updateDatabase() - { + private function updateDatabase() { $this->info('Updating database tables\n'); $this->call('migrate'); } - private function publishVueFilesAgain() - { + private function publishVueFilesAgain() { $this->info('Copying vue files\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\ViberMessaging\Providers\ViberMessagingServiceProvider", diff --git a/src/backend/packages/inensus/viber-messaging/src/Exceptions/MessageNotSentException.php b/src/backend/packages/inensus/viber-messaging/src/Exceptions/MessageNotSentException.php index 774de2d69..6b51cfa7c 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Exceptions/MessageNotSentException.php +++ b/src/backend/packages/inensus/viber-messaging/src/Exceptions/MessageNotSentException.php @@ -2,6 +2,4 @@ namespace Inensus\ViberMessaging\Exceptions; -class MessageNotSentException extends \Exception -{ -} +class MessageNotSentException extends \Exception {} diff --git a/src/backend/packages/inensus/viber-messaging/src/Exceptions/WebhookNotCreatedException.php b/src/backend/packages/inensus/viber-messaging/src/Exceptions/WebhookNotCreatedException.php index 4837bd754..4522049ec 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Exceptions/WebhookNotCreatedException.php +++ b/src/backend/packages/inensus/viber-messaging/src/Exceptions/WebhookNotCreatedException.php @@ -2,6 +2,4 @@ namespace Inensus\ViberMessaging\Exceptions; -class WebhookNotCreatedException extends \Exception -{ -} +class WebhookNotCreatedException extends \Exception {} diff --git a/src/backend/packages/inensus/viber-messaging/src/Http/Controllers/ViberCredentialController.php b/src/backend/packages/inensus/viber-messaging/src/Http/Controllers/ViberCredentialController.php index 0dcde78ae..fdd76d6f4 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Http/Controllers/ViberCredentialController.php +++ b/src/backend/packages/inensus/viber-messaging/src/Http/Controllers/ViberCredentialController.php @@ -9,21 +9,17 @@ use Inensus\ViberMessaging\Services\ViberCredentialService; use MPM\DatabaseProxy\DatabaseProxyManagerService; -class ViberCredentialController extends Controller -{ +class ViberCredentialController extends Controller { public function __construct( private ViberCredentialService $credentialService, private DatabaseProxyManagerService $databaseProxyManagerService, - ) { - } + ) {} - public function show(): ViberResource - { + public function show(): ViberResource { return ViberResource::make($this->credentialService->getCredentials()); } - public function update(ViberCredentialRequest $request): ViberResource - { + public function update(ViberCredentialRequest $request): ViberResource { $databaseProxy = $this->databaseProxyManagerService->findByEmail(auth('api')->user()->email); $companyId = $databaseProxy->getCompanyId(); $apiToken = $request->input('api_token'); diff --git a/src/backend/packages/inensus/viber-messaging/src/Http/Controllers/WebhookController.php b/src/backend/packages/inensus/viber-messaging/src/Http/Controllers/WebhookController.php index 5b951162e..f4d5e1dd7 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Http/Controllers/WebhookController.php +++ b/src/backend/packages/inensus/viber-messaging/src/Http/Controllers/WebhookController.php @@ -15,8 +15,7 @@ use Viber\Api\Sender; use Viber\Bot; -class WebhookController extends Controller -{ +class WebhookController extends Controller { private $bot; private $botSender; @@ -33,8 +32,7 @@ public function __construct( ]); } - public function index(string $slug) - { + public function index(string $slug) { Log::info('Webhook called'); $credential = $this->credentialService->getCredentials(); @@ -129,33 +127,27 @@ public function index(string $slug) return response()->json(['success' => 'success'], 200); } - private function setWrongFormatMessage(): string - { + private function setWrongFormatMessage(): string { return 'Please enter your meter serial number after register+'; } - private function setMeterNotFoundMessage(): string - { + private function setMeterNotFoundMessage(): string { return "We couldn't find your meter. Please check your meter serial number and try again."; } - private function setSuccessMessage(): string - { + private function setSuccessMessage(): string { return 'You have successfully registered with MicroPowerManager.'; } - private function setAlreadyRegisteredMessage($meterSerialNumber) - { + private function setAlreadyRegisteredMessage($meterSerialNumber) { return "$meterSerialNumber has already registered with MicroPowerManager."; } - private function setNoTransactionMessage($meterSerial) - { + private function setNoTransactionMessage($meterSerial) { return "No transaction found for meter serial: $meterSerial"; } - private function answerToCustomer($bot, $botSender, $event, $message) - { + private function answerToCustomer($bot, $botSender, $event, $message) { $bot->getClient()->sendMessage( (new \Viber\Api\Message\Text()) ->setSender($botSender) diff --git a/src/backend/packages/inensus/viber-messaging/src/Http/Requests/ViberCredentialRequest.php b/src/backend/packages/inensus/viber-messaging/src/Http/Requests/ViberCredentialRequest.php index 692612974..52bec1443 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Http/Requests/ViberCredentialRequest.php +++ b/src/backend/packages/inensus/viber-messaging/src/Http/Requests/ViberCredentialRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class ViberCredentialRequest extends FormRequest -{ +class ViberCredentialRequest extends FormRequest { /** * Get the validation rules that apply to the request. * * @return array */ - public function rules() - { + public function rules() { return [ 'api_token' => ['required'], ]; diff --git a/src/backend/packages/inensus/viber-messaging/src/Http/Resources/ViberResource.php b/src/backend/packages/inensus/viber-messaging/src/Http/Resources/ViberResource.php index 1f204d92d..418fa2837 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Http/Resources/ViberResource.php +++ b/src/backend/packages/inensus/viber-messaging/src/Http/Resources/ViberResource.php @@ -5,8 +5,7 @@ use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\JsonResource; -class ViberResource extends JsonResource -{ +class ViberResource extends JsonResource { /** * Transform the resource into an array. * @@ -14,8 +13,7 @@ class ViberResource extends JsonResource * * @return array */ - public function toArray($request) - { + public function toArray($request) { return parent::toArray($request); } } diff --git a/src/backend/packages/inensus/viber-messaging/src/Models/ViberContact.php b/src/backend/packages/inensus/viber-messaging/src/Models/ViberContact.php index 770545573..3b6a6216d 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Models/ViberContact.php +++ b/src/backend/packages/inensus/viber-messaging/src/Models/ViberContact.php @@ -5,12 +5,10 @@ use App\Models\Base\BaseModel; use App\Models\Person\Person; -class ViberContact extends BaseModel -{ +class ViberContact extends BaseModel { protected $table = 'viber_contacts'; - public function mpmPerson() - { + public function mpmPerson() { return $this->belongsTo(Person::class, 'person_id'); } } diff --git a/src/backend/packages/inensus/viber-messaging/src/Models/ViberCredential.php b/src/backend/packages/inensus/viber-messaging/src/Models/ViberCredential.php index d83325e34..87988359e 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Models/ViberCredential.php +++ b/src/backend/packages/inensus/viber-messaging/src/Models/ViberCredential.php @@ -4,7 +4,6 @@ use App\Models\Base\BaseModel; -class ViberCredential extends BaseModel -{ +class ViberCredential extends BaseModel { protected $table = 'viber_credentials'; } diff --git a/src/backend/packages/inensus/viber-messaging/src/Models/ViberMessage.php b/src/backend/packages/inensus/viber-messaging/src/Models/ViberMessage.php index 1b57ee3a4..028e72bb0 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Models/ViberMessage.php +++ b/src/backend/packages/inensus/viber-messaging/src/Models/ViberMessage.php @@ -4,7 +4,6 @@ use App\Models\Base\BaseModel; -class ViberMessage extends BaseModel -{ +class ViberMessage extends BaseModel { protected $table = 'viber_messages'; } diff --git a/src/backend/packages/inensus/viber-messaging/src/Providers/EventServiceProvider.php b/src/backend/packages/inensus/viber-messaging/src/Providers/EventServiceProvider.php index 74a9ea6b4..47b952a1e 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Providers/EventServiceProvider.php +++ b/src/backend/packages/inensus/viber-messaging/src/Providers/EventServiceProvider.php @@ -4,8 +4,7 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; -class EventServiceProvider extends ServiceProvider -{ +class EventServiceProvider extends ServiceProvider { protected $subscribe = [ ]; @@ -14,8 +13,7 @@ class EventServiceProvider extends ServiceProvider * * @return void */ - public function boot() - { + public function boot() { parent::boot(); } } diff --git a/src/backend/packages/inensus/viber-messaging/src/Providers/ObserverServiceProvider.php b/src/backend/packages/inensus/viber-messaging/src/Providers/ObserverServiceProvider.php index 58fd63bb4..cd002637b 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Providers/ObserverServiceProvider.php +++ b/src/backend/packages/inensus/viber-messaging/src/Providers/ObserverServiceProvider.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; -class ObserverServiceProvider extends ServiceProvider -{ +class ObserverServiceProvider extends ServiceProvider { /** * Register any events for your application. * * @return void */ - public function boot() - { + public function boot() { parent::boot(); } } diff --git a/src/backend/packages/inensus/viber-messaging/src/Providers/RouteServiceProvider.php b/src/backend/packages/inensus/viber-messaging/src/Providers/RouteServiceProvider.php index 5a0db19a9..33fa3a133 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Providers/RouteServiceProvider.php +++ b/src/backend/packages/inensus/viber-messaging/src/Providers/RouteServiceProvider.php @@ -5,22 +5,18 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Support\Facades\Route; -class RouteServiceProvider extends ServiceProvider -{ +class RouteServiceProvider extends ServiceProvider { protected $namespace = 'Inensus\ViberMessaging\Http\Controllers'; - public function boot() - { + public function boot() { parent::boot(); } - public function map() - { + public function map() { $this->mapApiRoutes(); } - protected function mapApiRoutes() - { + protected function mapApiRoutes() { Route::prefix('api') ->middleware('api') ->namespace($this->namespace) diff --git a/src/backend/packages/inensus/viber-messaging/src/Providers/ViberMessagingServiceProvider.php b/src/backend/packages/inensus/viber-messaging/src/Providers/ViberMessagingServiceProvider.php index 592815c49..24e5bd653 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Providers/ViberMessagingServiceProvider.php +++ b/src/backend/packages/inensus/viber-messaging/src/Providers/ViberMessagingServiceProvider.php @@ -9,10 +9,8 @@ use Inensus\ViberMessaging\Console\Commands\UpdatePackage; use Inensus\ViberMessaging\ViberGateway; -class ViberMessagingServiceProvider extends ServiceProvider -{ - public function boot(Filesystem $filesystem) - { +class ViberMessagingServiceProvider extends ServiceProvider { + public function boot(Filesystem $filesystem) { $this->app->register(RouteServiceProvider::class); if ($this->app->runningInConsole()) { $this->publishConfigFiles(); @@ -22,23 +20,20 @@ public function boot(Filesystem $filesystem) } } - public function register() - { + public function register() { $this->mergeConfigFrom(__DIR__.'/../../config/viber-messaging.php', 'viber-messaging'); $this->app->register(EventServiceProvider::class); $this->app->register(ObserverServiceProvider::class); $this->app->bind('ViberGateway', ViberGateway::class); } - public function publishConfigFiles() - { + public function publishConfigFiles() { $this->publishes([ __DIR__.'/../../config/viber-messaging.php' => config_path('viber-messaging.php'), ]); } - public function publishVueFiles() - { + public function publishVueFiles() { $this->publishes([ __DIR__.'/../resources/assets' => resource_path( 'assets/js/plugins/viber-messaging' @@ -46,15 +41,13 @@ public function publishVueFiles() ], 'vue-components'); } - public function publishMigrations($filesystem) - { + public function publishMigrations($filesystem) { $this->publishes([ __DIR__.'/../../database/migrations/create_viber_tables.php.stub' => $this->getMigrationFileName($filesystem), ], 'migrations'); } - protected function getMigrationFileName(Filesystem $filesystem): string - { + protected function getMigrationFileName(Filesystem $filesystem): string { $timestamp = date('Y_m_d_His'); return Collection::make($this->app->databasePath().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR) diff --git a/src/backend/packages/inensus/viber-messaging/src/Services/AccountService.php b/src/backend/packages/inensus/viber-messaging/src/Services/AccountService.php index fcf72f944..f2b73c8eb 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Services/AccountService.php +++ b/src/backend/packages/inensus/viber-messaging/src/Services/AccountService.php @@ -5,10 +5,8 @@ use Illuminate\Support\Facades\Log; use Viber\Client; -class AccountService -{ - public function getAccountInfo($credential) - { +class AccountService { + public function getAccountInfo($credential) { $apiKey = $credential->api_token; try { diff --git a/src/backend/packages/inensus/viber-messaging/src/Services/ViberContactService.php b/src/backend/packages/inensus/viber-messaging/src/Services/ViberContactService.php index bbeb6998c..96a798686 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Services/ViberContactService.php +++ b/src/backend/packages/inensus/viber-messaging/src/Services/ViberContactService.php @@ -10,48 +10,39 @@ /** * @implements IBaseService */ -class ViberContactService implements IBaseService -{ +class ViberContactService implements IBaseService { public function __construct( private ViberContact $viberContact, private Person $person, - ) { - } + ) {} - public function createContact($personId, $viberId) - { + public function createContact($personId, $viberId) { return $this->viberContact->newQuery()->firstOrCreate(['person_id' => $personId], [ 'viber_id' => $viberId, ]); } - public function getById(int $id): ViberContact - { + public function getById(int $id): ViberContact { return $this->viberContact->newQuery()->find($id); } - public function create(array $data): ViberContact - { + public function create(array $data): ViberContact { return $this->viberContact->newQuery()->create($data); } - public function update($model, array $data): ViberContact - { + public function update($model, array $data): ViberContact { throw new \Exception('Method update() not yet implemented.'); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } - public function getAll(?int $limit = null): Collection - { + public function getAll(?int $limit = null): Collection { throw new \Exception('Method getAll() not yet implemented.'); } - public function getByReceiverPhoneNumber($receiver) - { + public function getByReceiverPhoneNumber($receiver) { return $this->viberContact->newQuery() ->whereHas('mpmPerson', function ($q) use ($receiver) { $q->whereHas('addresses', static function ($q) use ($receiver) { @@ -60,13 +51,11 @@ public function getByReceiverPhoneNumber($receiver) })->first(); } - public function getByRegisteredMeterSerialNumber($meterSerialNumber) - { + public function getByRegisteredMeterSerialNumber($meterSerialNumber) { return $this->viberContact->newQuery()->where('registered_meter_serial_number', $meterSerialNumber)->first(); } - public function getByViberId($viberId) - { + public function getByViberId($viberId) { return $this->viberContact->newQuery()->where('viber_id', $viberId)->first(); } } diff --git a/src/backend/packages/inensus/viber-messaging/src/Services/ViberCredentialService.php b/src/backend/packages/inensus/viber-messaging/src/Services/ViberCredentialService.php index f4995c7fa..c3c52a3bd 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Services/ViberCredentialService.php +++ b/src/backend/packages/inensus/viber-messaging/src/Services/ViberCredentialService.php @@ -4,20 +4,17 @@ use Inensus\ViberMessaging\Models\ViberCredential; -class ViberCredentialService -{ +class ViberCredentialService { public function __construct( private ViberCredential $credential, private WebhookService $webhookService, private AccountService $accountService, - ) { - } + ) {} /** * This function uses one time on installation of the package. */ - public function createCredentials() - { + public function createCredentials() { return $this->credential->newQuery()->firstOrCreate(['id' => 1], [ 'api_token' => null, 'webhook_url' => null, @@ -26,16 +23,14 @@ public function createCredentials() ]); } - public function getCredentials() - { + public function getCredentials() { return $this->credential->newQuery()->first(); } /** * @throws \Inensus\ViberMessaging\Exceptions\WebhookNotCreatedException */ - public function updateCredentials($data) - { + public function updateCredentials($data) { $credential = $this->credential->newQuery()->find($data['id']); $credential->update([ diff --git a/src/backend/packages/inensus/viber-messaging/src/Services/ViberMessageService.php b/src/backend/packages/inensus/viber-messaging/src/Services/ViberMessageService.php index c480c60c9..a3cd64958 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Services/ViberMessageService.php +++ b/src/backend/packages/inensus/viber-messaging/src/Services/ViberMessageService.php @@ -9,35 +9,28 @@ /** * @implements IBaseService */ -class ViberMessageService implements IBaseService -{ +class ViberMessageService implements IBaseService { public function __construct( private ViberMessage $viberMessage, - ) { - } + ) {} - public function getById(int $id): ViberMessage - { + public function getById(int $id): ViberMessage { throw new \Exception('Method getById() not yet implemented.'); } - public function create(array $data): ViberMessage - { + public function create(array $data): ViberMessage { return $this->viberMessage->newQuery()->create($data); } - public function update($model, array $data): ViberMessage - { + public function update($model, array $data): ViberMessage { throw new \Exception('Method update() not yet implemented.'); } - public function delete($model): ?bool - { + public function delete($model): ?bool { throw new \Exception('Method delete() not yet implemented.'); } - public function getAll(?int $limit = null): Collection - { + public function getAll(?int $limit = null): Collection { throw new \Exception('Method getAll() not yet implemented.'); } } diff --git a/src/backend/packages/inensus/viber-messaging/src/Services/WebhookService.php b/src/backend/packages/inensus/viber-messaging/src/Services/WebhookService.php index d01be3993..73d739cb0 100644 --- a/src/backend/packages/inensus/viber-messaging/src/Services/WebhookService.php +++ b/src/backend/packages/inensus/viber-messaging/src/Services/WebhookService.php @@ -6,10 +6,8 @@ use Inensus\ViberMessaging\Exceptions\WebhookNotCreatedException; use Viber\Client; -class WebhookService -{ - public function createWebHook($credential) - { +class WebhookService { + public function createWebHook($credential) { $apiKey = $credential->api_token; $webhookUrl = $credential->webhook_url; diff --git a/src/backend/packages/inensus/viber-messaging/src/ViberGateway.php b/src/backend/packages/inensus/viber-messaging/src/ViberGateway.php index 3d39bb5ed..c81a83aba 100644 --- a/src/backend/packages/inensus/viber-messaging/src/ViberGateway.php +++ b/src/backend/packages/inensus/viber-messaging/src/ViberGateway.php @@ -10,8 +10,7 @@ use Viber\Api\Sender; use Viber\Bot; -class ViberGateway -{ +class ViberGateway { private $bot; private $botSender; diff --git a/src/backend/packages/inensus/wave-money-payment-provider/database/migrations/create_wave_money_payment_provider_tables.php b/src/backend/packages/inensus/wave-money-payment-provider/database/migrations/create_wave_money_payment_provider_tables.php index 8cc6bc9e2..89132c6ef 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/database/migrations/create_wave_money_payment_provider_tables.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/database/migrations/create_wave_money_payment_provider_tables.php @@ -4,10 +4,8 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class CreateWaveMoneyPaymentProviderTables extends Migration -{ - public function up() - { +class CreateWaveMoneyPaymentProviderTables extends Migration { + public function up() { if (!Schema::hasTable('wave_money_transactions')) { Schema::create('wave_money_transactions', static function (Blueprint $table) { $table->increments('id'); @@ -37,8 +35,7 @@ public function up() } } - public function down() - { + public function down() { Schema::dropIfExists('wave_money_transactions'); Schema::dropIfExists('wave_money_credentials'); } diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Console/Commands/InstallPackage.php index 160b7cf0a..d6e4dabcd 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Console/Commands/InstallPackage.php @@ -5,8 +5,7 @@ use Illuminate\Console\Command; use Inensus\WaveMoneyPaymentProvider\Services\WaveMoneyCredentialService; -class InstallPackage extends Command -{ +class InstallPackage extends Command { protected $signature = 'wave-money-payment-provider:install'; protected $description = 'Install WaveMoneyPaymentProvider Package'; @@ -17,15 +16,13 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { $this->info('Installing WaveMoneyPaymentProvider Integration Package\n'); $this->credentialService->createCredentials(); $this->info('Package installed successfully..'); } - private function publishMigrations() - { + private function publishMigrations() { $this->info('Copying migrations\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\WaveMoneyPaymentProvider\Providers\WaveMoneyPaymentProviderServiceProvider", @@ -33,14 +30,12 @@ private function publishMigrations() ]); } - private function createDatabaseTables() - { + private function createDatabaseTables() { $this->info('Creating database tables\n'); $this->call('migrate'); } - private function publishVueFiles() - { + private function publishVueFiles() { $this->info('Copying vue files\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\WaveMoneyPaymentProvider\Providers\WaveMoneyPaymentProviderServiceProvider", @@ -48,8 +43,7 @@ private function publishVueFiles() ]); } - private function createPluginRecord() - { + private function createPluginRecord() { $this->call('plugin:add', [ 'name' => 'ViberMessaging', 'composer_name' => 'inensus/wave-money-payment-provider', diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Console/Commands/UpdatePackage.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Console/Commands/UpdatePackage.php index 1d2fd6199..ca8bd9b21 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Console/Commands/UpdatePackage.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Console/Commands/UpdatePackage.php @@ -7,8 +7,7 @@ use Illuminate\Support\Facades\DB; use Inensus\WaveMoneyPaymentProvider\Services\WaveMoneyCredentialService; -class UpdatePackage extends Command -{ +class UpdatePackage extends Command { protected $signature = 'wave-money-payment-provider:update'; protected $description = 'Update WaveMoney Package'; @@ -20,8 +19,7 @@ public function __construct( parent::__construct(); } - public function handle(): void - { + public function handle(): void { $this->info('WaveMoney Integration Updating Started\n'); // $this->removeOldVersionOfPackage(); // $this->installNewVersionOfPackage(); @@ -34,20 +32,17 @@ public function handle(): void $this->info('Package updated successfully..'); } - private function removeOldVersionOfPackage() - { + private function removeOldVersionOfPackage() { $this->info('Removing former version of package\n'); echo shell_exec('COMPOSER_MEMORY_LIMIT=-1 ../composer.phar remove inensus/wave-money-payment-provider'); } - private function installNewVersionOfPackage() - { + private function installNewVersionOfPackage() { $this->info('Installing last version of package\n'); echo shell_exec('COMPOSER_MEMORY_LIMIT=-1 ../composer.phar require inensus/wave-money-payment-provider'); } - private function deleteMigration(Filesystem $filesystem) - { + private function deleteMigration(Filesystem $filesystem) { $migrationFile = $filesystem->glob(database_path().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR. '*_create_wave_money_payment_provider_tables.php')[0]; $migration = DB::table('migrations') @@ -60,8 +55,7 @@ private function deleteMigration(Filesystem $filesystem) ->where('migration', substr(explode('/migrations/', $migrationFile)[1], 0, -4))->delete(); } - private function publishMigrationsAgain() - { + private function publishMigrationsAgain() { $this->info('Copying migrations\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\WaveMoneyPaymentProvider\Providers\WaveMoneyPaymentProviderServiceProvider", @@ -69,14 +63,12 @@ private function publishMigrationsAgain() ]); } - private function updateDatabase() - { + private function updateDatabase() { $this->info('Updating database tables\n'); $this->call('migrate'); } - private function publishVueFilesAgain() - { + private function publishVueFilesAgain() { $this->info('Copying vue files\n'); $this->call('vendor:publish', [ '--provider' => "Inensus\WaveMoneyPaymentProvider\Providers\WaveMoneyPaymentProviderServiceProvider", diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Controllers/WaveMoneyController.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Controllers/WaveMoneyController.php index 3add2dc85..6960e3096 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Controllers/WaveMoneyController.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Controllers/WaveMoneyController.php @@ -11,23 +11,19 @@ use Inensus\WaveMoneyPaymentProvider\Modules\Api\WaveMoneyApiService; use Inensus\WaveMoneyPaymentProvider\Modules\Transaction\WaveMoneyTransactionService; -class WaveMoneyController extends Controller -{ +class WaveMoneyController extends Controller { public function __construct( private WaveMoneyTransactionService $transactionService, private WaveMoneyApiService $apiService, - ) { - } + ) {} - public function startTransaction(TransactionInitializeRequest $request): WaveMoneyResource - { + public function startTransaction(TransactionInitializeRequest $request): WaveMoneyResource { $transaction = $request->get('waveMoneyTransaction'); return WaveMoneyResource::make($this->apiService->requestPayment($transaction)); } - public function transactionCallBack(Request $request) - { + public function transactionCallBack(Request $request) { $transaction = $request->get('waveMoneyTransaction'); $status = $request->get('status'); diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Controllers/WaveMoneyCredentialController.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Controllers/WaveMoneyCredentialController.php index a0fa27144..3fbc67098 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Controllers/WaveMoneyCredentialController.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Controllers/WaveMoneyCredentialController.php @@ -10,22 +10,18 @@ use Inensus\WaveMoneyPaymentProvider\Services\WaveMoneyCredentialService; use MPM\DatabaseProxy\DatabaseProxyManagerService; -class WaveMoneyCredentialController extends Controller -{ +class WaveMoneyCredentialController extends Controller { public function __construct( private WaveMoneyCredentialService $credentialService, private DatabaseProxyManagerService $databaseProxyManagerService, private CompanyService $companyService, - ) { - } + ) {} - public function show(): WaveMoneyResource - { + public function show(): WaveMoneyResource { return WaveMoneyResource::make($this->credentialService->getCredentials()); } - public function update(WaveMoneyCredentialRequest $request): WaveMoneyResource - { + public function update(WaveMoneyCredentialRequest $request): WaveMoneyResource { $databaseProxy = $this->databaseProxyManagerService->findByEmail(auth('api')->user()->email); $companyId = $databaseProxy->getCompanyId(); $company = $this->companyService->getById($companyId); diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Middleware/WaveMoneyTransactionCallbackMiddleware.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Middleware/WaveMoneyTransactionCallbackMiddleware.php index 1a500b31f..d15f46e1a 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Middleware/WaveMoneyTransactionCallbackMiddleware.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Middleware/WaveMoneyTransactionCallbackMiddleware.php @@ -11,14 +11,10 @@ use Inensus\WaveMoneyPaymentProvider\Modules\Api\Data\TransactionCallbackData; use Inensus\WaveMoneyPaymentProvider\Modules\Transaction\WaveMoneyTransactionService; -class WaveMoneyTransactionCallbackMiddleware -{ - public function __construct(private WaveMoneyTransactionService $transactionService) - { - } +class WaveMoneyTransactionCallbackMiddleware { + public function __construct(private WaveMoneyTransactionService $transactionService) {} - public function handle(Request $request, \Closure $next) - { + public function handle(Request $request, \Closure $next) { $mapper = new TransactionCallbackRequestMapper(); $callbackData = $mapper->getMappedObject($request); try { diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Middleware/WaveMoneyTransactionMiddleware.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Middleware/WaveMoneyTransactionMiddleware.php index c943a3a23..58c6a580e 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Middleware/WaveMoneyTransactionMiddleware.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Middleware/WaveMoneyTransactionMiddleware.php @@ -5,10 +5,8 @@ use Illuminate\Http\Request; use Illuminate\Http\Response; -class WaveMoneyTransactionMiddleware -{ - public function handle(Request $request, \Closure $next) - { +class WaveMoneyTransactionMiddleware { + public function handle(Request $request, \Closure $next) { $transactionProvider = resolve('WaveMoneyPaymentProvider'); try { diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Requests/TransactionCallbackRequestMapper.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Requests/TransactionCallbackRequestMapper.php index 799201462..f49c9c639 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Requests/TransactionCallbackRequestMapper.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Requests/TransactionCallbackRequestMapper.php @@ -7,8 +7,7 @@ use Illuminate\Http\Request; use Inensus\WaveMoneyPaymentProvider\Modules\Api\Data\TransactionCallbackData; -class TransactionCallbackRequestMapper -{ +class TransactionCallbackRequestMapper { private const BODY_PARAM_STATUS = 'status'; private const BODY_PARAM_MERCHANT_ID = 'merchantId'; @@ -49,8 +48,7 @@ class TransactionCallbackRequestMapper private const BODY_PARAM_ADDITIONAL_FIELD_5 = 'additionalField5'; - public function getMappedObject(Request $request): TransactionCallbackData - { + public function getMappedObject(Request $request): TransactionCallbackData { return new TransactionCallbackData( $request->input(self::BODY_PARAM_STATUS), $request->input(self::BODY_PARAM_MERCHANT_ID), diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Requests/TransactionInitializeRequest.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Requests/TransactionInitializeRequest.php index 822aac7f1..d6bf757e6 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Requests/TransactionInitializeRequest.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Requests/TransactionInitializeRequest.php @@ -6,14 +6,12 @@ use Illuminate\Foundation\Http\FormRequest; -class TransactionInitializeRequest extends FormRequest -{ +class TransactionInitializeRequest extends FormRequest { private const BODY_PARAM_METER_SERIAL = 'meterSerial'; private const BODY_PARAM_AMOUNT = 'amount'; - public function rules(): array - { + public function rules(): array { return [ self::BODY_PARAM_METER_SERIAL => 'required', self::BODY_PARAM_AMOUNT => 'required|numeric', diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Requests/WaveMoneyCredentialRequest.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Requests/WaveMoneyCredentialRequest.php index 3ec4a544e..1c27e94f2 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Requests/WaveMoneyCredentialRequest.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Requests/WaveMoneyCredentialRequest.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Http\FormRequest; -class WaveMoneyCredentialRequest extends FormRequest -{ +class WaveMoneyCredentialRequest extends FormRequest { /** * Get the validation rules that apply to the request. * * @return array */ - public function rules() - { + public function rules() { return [ 'merchant_id' => ['required'], 'secret_key' => ['required'], diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Resources/WaveMoneyResource.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Resources/WaveMoneyResource.php index c66114fea..8d7e80964 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Resources/WaveMoneyResource.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Http/Resources/WaveMoneyResource.php @@ -5,8 +5,7 @@ use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\JsonResource; -class WaveMoneyResource extends JsonResource -{ +class WaveMoneyResource extends JsonResource { /** * Transform the resource into an array. * @@ -14,8 +13,7 @@ class WaveMoneyResource extends JsonResource * * @return array */ - public function toArray($request) - { + public function toArray($request) { return parent::toArray($request); } } diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Models/WaveMoneyCredential.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Models/WaveMoneyCredential.php index 87bf61186..0adff2123 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Models/WaveMoneyCredential.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Models/WaveMoneyCredential.php @@ -12,37 +12,30 @@ * @property string result_url * @property string merchant_name */ -class WaveMoneyCredential extends BaseModel -{ +class WaveMoneyCredential extends BaseModel { protected $table = 'wave_money_credentials'; - public function getMerchantId(): string - { + public function getMerchantId(): string { return $this->merchant_id; } - public function getSecretKey(): string - { + public function getSecretKey(): string { return $this->secret_key; } - public function getMerchantName(): string - { + public function getMerchantName(): string { return $this->merchant_name; } - public function getCallbackUrl(): string - { + public function getCallbackUrl(): string { return $this->callback_url; } - public function getPaymentUrl(): string - { + public function getPaymentUrl(): string { return $this->payment_url; } - public function getResultUrl(): string - { + public function getResultUrl(): string { return $this->result_url; } } diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Models/WaveMoneyTransaction.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Models/WaveMoneyTransaction.php index 6f743a15c..52692ccb9 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Models/WaveMoneyTransaction.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Models/WaveMoneyTransaction.php @@ -19,8 +19,7 @@ * @property int customer_id * @property string|null meter_serial */ -class WaveMoneyTransaction extends BaseModel implements FullySupportedTransactionInterface, IRawTransaction -{ +class WaveMoneyTransaction extends BaseModel implements FullySupportedTransactionInterface, IRawTransaction { public const RELATION_NAME = 'wave_money_transaction'; public const STATUS_REQUESTED = 0; @@ -35,83 +34,67 @@ class WaveMoneyTransaction extends BaseModel implements FullySupportedTransactio protected $table = 'wave_money_transactions'; - public function getAmount(): int - { + public function getAmount(): int { return $this->amount; } - public function getCurrency(): string - { + public function getCurrency(): string { return $this->currency; } - public function getOrderId(): string - { + public function getOrderId(): string { return $this->order_id; } - public function getReferenceId(): string - { + public function getReferenceId(): string { return $this->reference_id; } - public function getId(): int - { + public function getId(): int { return $this->id; } - public function setStatus(int $status) - { + public function setStatus(int $status) { $this->status = $status; } - public function setExternalTransactionId(string $transactionId) - { + public function setExternalTransactionId(string $transactionId) { $this->external_transaction_id = $transactionId; } - public function setOrderId(string $orderId) - { + public function setOrderId(string $orderId) { $this->order_id = $orderId; } - public function setReferenceId(string $referenceId) - { + public function setReferenceId(string $referenceId) { $this->reference_id = $referenceId; } - public function setCustomerId(int $customerId) - { + public function setCustomerId(int $customerId) { $this->customer_id = $customerId; } - public function setMeterSerial(string $meterSerialNumber) - { + public function setMeterSerial(string $meterSerialNumber) { $this->meter_serial = $meterSerialNumber; } - public function setAmount(float $amount) - { + public function setAmount(float $amount) { $this->amount = $amount; } - public function transaction() - { + public function transaction() { return $this->morphOne(Transaction::class, 'original_transaction'); } - public function manufacturerTransaction() - { + public function manufacturerTransaction() { return $this->morphTo(); } - public function conflicts() - { + public function conflicts() { return $this->morphMany(TransactionConflicts::class, 'transaction'); } - public static function getTransactionName(): string - { + public static function getTransactionName(): string { return self::RELATION_NAME; } } diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/AbstractApi.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/AbstractApi.php index b59f46d74..c3af36207 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/AbstractApi.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/AbstractApi.php @@ -8,14 +8,10 @@ use Inensus\WaveMoneyPaymentProvider\Modules\Api\Exceptions\ApiRequestFailedException; use Inensus\WaveMoneyPaymentProvider\Modules\Api\Resources\AbstractApiResource; -abstract class AbstractApi -{ - public function __construct(private Client $client) - { - } +abstract class AbstractApi { + public function __construct(private Client $client) {} - public function doRequest(AbstractApiResource $resource): AbstractApiResource - { + public function doRequest(AbstractApiResource $resource): AbstractApiResource { if ($resource->getRequestMethod() === RequestMethod::POST) { $response = $this->client->post($resource->getPaymentUri(), [ 'form_params' => $resource->getBodyData(), diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Data/TransactionCallbackData.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Data/TransactionCallbackData.php index 19cba1eea..8745274d4 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Data/TransactionCallbackData.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Data/TransactionCallbackData.php @@ -4,8 +4,7 @@ namespace Inensus\WaveMoneyPaymentProvider\Modules\Api\Data; -class TransactionCallbackData -{ +class TransactionCallbackData { public const STATUS_PAYMENT_CONFIRMED = 'PAYMENT_CONFIRMED'; public const STATUS_BILL_COLLECTION_FAILED = 'BILL_COLLECTION_FAILED'; @@ -41,86 +40,69 @@ public function __construct( private ?string $additional3, private ?string $additional4, private ?string $additional5, - ) { - } + ) {} - public function getStatus(): string - { + public function getStatus(): string { return $this->status; } - public function getMerchantId(): string - { + public function getMerchantId(): string { return $this->merchantId; } - public function getOrderId(): string - { + public function getOrderId(): string { return $this->orderId; } - public function getMerchantReferenceId(): string - { + public function getMerchantReferenceId(): string { return $this->merchantReferenceId; } - public function getFrontendResultUrl(): string - { + public function getFrontendResultUrl(): string { return $this->frontendResultUrl; } - public function getBackEndResultUrl(): string - { + public function getBackEndResultUrl(): string { return $this->backEndResultUrl; } - public function getInitiatorMsisdn(): ?string - { + public function getInitiatorMsisdn(): ?string { return $this->initiatorMsisdn; } - public function getAmount(): float - { + public function getAmount(): float { return $this->amount; } - public function getTimeToLiveSeconds(): int - { + public function getTimeToLiveSeconds(): int { return $this->timeToLiveSeconds; } - public function getPaymentDescription(): string - { + public function getPaymentDescription(): string { return $this->paymentDescription; } - public function getCurrency(): string - { + public function getCurrency(): string { return $this->currency; } - public function getHash(): string - { + public function getHash(): string { return $this->hash; } - public function getTransactionId(): ?string - { + public function getTransactionId(): ?string { return $this->transactionId; } - public function getPaymentRequestId(): string|int - { + public function getPaymentRequestId(): string|int { return $this->paymentRequestId; } - public function getRequestTime(): string - { + public function getRequestTime(): string { return $this->requestTime; } - public function getAdditionalFields(): array - { + public function getAdditionalFields(): array { return [ 'add1' => $this->additional1, 'add2' => $this->additional2, @@ -130,8 +112,7 @@ public function getAdditionalFields(): array ]; } - public function mapTransactionStatus(string $status): int - { + public function mapTransactionStatus(string $status): int { if ($status === self::STATUS_PAYMENT_CONFIRMED) { return self::STATUS_SUCCESS; } diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Exceptions/ApiRequestFailedException.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Exceptions/ApiRequestFailedException.php index 48a164114..3add4e54d 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Exceptions/ApiRequestFailedException.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Exceptions/ApiRequestFailedException.php @@ -4,10 +4,8 @@ namespace Inensus\WaveMoneyPaymentProvider\Modules\Api\Exceptions; -class ApiRequestFailedException extends \Exception -{ - public function __construct(int $statusCode, string $uri, string $body) - { +class ApiRequestFailedException extends \Exception { + public function __construct(int $statusCode, string $uri, string $body) { $message = ['statusCode' => $statusCode, 'uri' => $uri, 'body' => $body]; parent::__construct(json_encode($message)); diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/RequestMethod.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/RequestMethod.php index f8f07cbd7..c74772da8 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/RequestMethod.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/RequestMethod.php @@ -2,8 +2,7 @@ namespace Inensus\WaveMoneyPaymentProvider\Modules\Api; -class RequestMethod -{ +class RequestMethod { public const POST = 'post'; public const GET = 'get'; diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Resources/AbstractApiResource.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Resources/AbstractApiResource.php index 8953d5dd1..f18f6f218 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Resources/AbstractApiResource.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Resources/AbstractApiResource.php @@ -4,8 +4,7 @@ namespace Inensus\WaveMoneyPaymentProvider\Modules\Api\Resources; -abstract class AbstractApiResource -{ +abstract class AbstractApiResource { protected string $body; protected const REQUEST_TIME_TO_LIVE_IN_SECS = 120; @@ -20,38 +19,31 @@ abstract public function getBackendCallback(): string; abstract public function getFrontendCallback(): string; - public function getUri(): string - { + public function getUri(): string { return config('wave-money-payment-provider.api_uri'); } - public function getPaymentUri(): string - { + public function getPaymentUri(): string { return config('wave-money-payment-provider.api_uri').'/payment'; } - public function getHeaders(): array - { + public function getHeaders(): array { return ['Accept' => 'application/json']; } - public function setBody(string $body): void - { + public function setBody(string $body): void { $this->body = $body; } - public function getBody(): string - { + public function getBody(): string { return $this->body; } - public function getBodyAsArray(): array - { + public function getBodyAsArray(): array { return json_decode($this->body, true); } - public function getAuthenticateUri(): string - { + public function getAuthenticateUri(): string { return config('wave-money-payment-provider.api_uri').'/authenticate?transaction_id='; } } diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Resources/StartTransactionResource.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Resources/StartTransactionResource.php index 91bba4230..fb7b5cbbe 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Resources/StartTransactionResource.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/Resources/StartTransactionResource.php @@ -6,8 +6,7 @@ use Inensus\WaveMoneyPaymentProvider\Models\WaveMoneyTransaction; use Inensus\WaveMoneyPaymentProvider\Modules\Api\RequestMethod; -class StartTransactionResource extends AbstractApiResource -{ +class StartTransactionResource extends AbstractApiResource { public const RESPONSE_SUCCESS = 'success'; public const RESPONSE_KEY_MESSAGE = 'transaction_id'; @@ -17,16 +16,13 @@ class StartTransactionResource extends AbstractApiResource public function __construct( private WaveMoneyCredential $waveMoneyCredential, private WaveMoneyTransaction $waveMoneyTransaction, - ) { - } + ) {} - public function getRequestMethod(): string - { + public function getRequestMethod(): string { return RequestMethod::POST; } - public function getBodyData(): array - { + public function getBodyData(): array { return [ 'merchant_id' => $this->waveMoneyCredential->getMerchantId(), 'order_id' => $this->waveMoneyTransaction->getOrderId(), @@ -45,13 +41,11 @@ public function getBodyData(): array ]; } - public function getQueryParams(): array - { + public function getQueryParams(): array { return []; } - private function generatePayloadHash(): string - { + private function generatePayloadHash(): string { return hash_hmac('sha256', implode('', [ self::REQUEST_TIME_TO_LIVE_IN_SECS, $this->waveMoneyCredential->getMerchantId(), @@ -62,18 +56,15 @@ private function generatePayloadHash(): string ]), $this->waveMoneyCredential->getSecretKey()); } - public function getBackendCallback(): string - { + public function getBackendCallback(): string { return $this->waveMoneyCredential->getCallbackUrl(); } - public function getFrontendCallback(): string - { + public function getFrontendCallback(): string { return $this->waveMoneyCredential->getResultUrl(); } - public function getMerchantName(): string - { + public function getMerchantName(): string { return $this->waveMoneyCredential->getMerchantName(); } } diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/WaveMoneyApi.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/WaveMoneyApi.php index 37694efca..7e9d95d30 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/WaveMoneyApi.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/WaveMoneyApi.php @@ -2,6 +2,4 @@ namespace Inensus\WaveMoneyPaymentProvider\Modules\Api; -class WaveMoneyApi extends AbstractApi -{ -} +class WaveMoneyApi extends AbstractApi {} diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/WaveMoneyApiService.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/WaveMoneyApiService.php index 68db1b9e7..b870f112a 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/WaveMoneyApiService.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Api/WaveMoneyApiService.php @@ -8,16 +8,13 @@ use Inensus\WaveMoneyPaymentProvider\Modules\Api\Resources\StartTransactionResource; use Inensus\WaveMoneyPaymentProvider\Services\WaveMoneyCredentialService; -class WaveMoneyApiService -{ +class WaveMoneyApiService { public function __construct( private WaveMoneyApi $api, private WaveMoneyCredentialService $credentialService, - ) { - } + ) {} - public function requestPayment(WaveMoneyTransaction $transaction): array - { + public function requestPayment(WaveMoneyTransaction $transaction): array { $credential = $this->credentialService->getCredentials(); $transactionResource = new StartTransactionResource($credential, $transaction); try { diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Transaction/WaveMoneyTransactionService.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Transaction/WaveMoneyTransactionService.php index 344f56378..68072b78c 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Transaction/WaveMoneyTransactionService.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Modules/Transaction/WaveMoneyTransactionService.php @@ -19,8 +19,7 @@ /** * @implements IBaseService */ -class WaveMoneyTransactionService extends AbstractPaymentAggregatorTransactionService implements IBaseService -{ +class WaveMoneyTransactionService extends AbstractPaymentAggregatorTransactionService implements IBaseService { private Meter $meter; private Address $address; @@ -53,8 +52,7 @@ public function __construct( ); } - public function initializeTransactionData(): array - { + public function initializeTransactionData(): array { $orderId = Uuid::uuid4()->toString(); // need to store somewhere $referenceId = Uuid::uuid4()->toString(); // need to store somewhere @@ -69,49 +67,41 @@ public function initializeTransactionData(): array ]; } - public function getByOrderId(string $orderId) - { + public function getByOrderId(string $orderId) { return $this->waveMoneyTransaction->newQuery()->where('order_id', '=', $orderId) ->firstOrFail(); } - public function getByExternalTransactionId(string $externalTransactionId) - { + public function getByExternalTransactionId(string $externalTransactionId) { return $this->waveMoneyTransaction->newQuery()->where('external_transaction_id', '=', $externalTransactionId) ->firstOrFail(); } - public function getByStatus($status) - { + public function getByStatus($status) { return $this->waveMoneyTransaction->newQuery()->where('status', '=', $status) ->get(); } - public function getById(int $id): WaveComTransaction - { + public function getById(int $id): WaveComTransaction { return $this->waveMoneyTransaction->newQuery()->find($id); } - public function update($waveMoneyTransaction, array $waveMoneyTransactionData): WaveMoneyTransaction - { + public function update($waveMoneyTransaction, array $waveMoneyTransactionData): WaveMoneyTransaction { $waveMoneyTransaction->update($waveMoneyTransactionData); $waveMoneyTransaction->fresh(); return $waveMoneyTransaction; } - public function create($waveMoneyTransactionData): WaveMoneyTransaction - { + public function create($waveMoneyTransactionData): WaveMoneyTransaction { return $this->waveMoneyTransaction->newQuery()->create($waveMoneyTransactionData); } - public function delete($waveMoneyTransaction): ?bool - { + public function delete($waveMoneyTransaction): ?bool { return $waveMoneyTransaction->delete(); } - public function getAll(?int $limit = null): Collection|LengthAwarePaginator - { + public function getAll(?int $limit = null): Collection|LengthAwarePaginator { $query = $this->waveMoneyTransaction->newQuery(); if ($limit) { @@ -121,8 +111,7 @@ public function getAll(?int $limit = null): Collection|LengthAwarePaginator return $this->waveMoneyTransaction->newQuery()->get(); } - public function getWaveMoneyTransaction() - { + public function getWaveMoneyTransaction() { return $this->getPaymentAggregatorTransaction(); } } diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/EventServiceProvider.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/EventServiceProvider.php index eca534b79..ef211c007 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/EventServiceProvider.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/EventServiceProvider.php @@ -4,8 +4,7 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; -class EventServiceProvider extends ServiceProvider -{ +class EventServiceProvider extends ServiceProvider { protected $subscribe = [ ]; @@ -14,8 +13,7 @@ class EventServiceProvider extends ServiceProvider * * @return void */ - public function boot() - { + public function boot() { parent::boot(); } } diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/ObserverServiceProvider.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/ObserverServiceProvider.php index 71affce49..020f8fee5 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/ObserverServiceProvider.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/ObserverServiceProvider.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; -class ObserverServiceProvider extends ServiceProvider -{ +class ObserverServiceProvider extends ServiceProvider { /** * Register any events for your application. * * @return void */ - public function boot() - { + public function boot() { parent::boot(); } } diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/RouteServiceProvider.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/RouteServiceProvider.php index 71162d81d..3fc062622 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/RouteServiceProvider.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/RouteServiceProvider.php @@ -5,22 +5,18 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Support\Facades\Route; -class RouteServiceProvider extends ServiceProvider -{ +class RouteServiceProvider extends ServiceProvider { protected $namespace = 'Inensus\WaveMoneyPaymentProvider\Http\Controllers'; - public function boot() - { + public function boot() { parent::boot(); } - public function map() - { + public function map() { $this->mapApiRoutes(); } - protected function mapApiRoutes() - { + protected function mapApiRoutes() { Route::prefix('api') ->middleware('api') ->namespace($this->namespace) diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/WaveMoneyPaymentProviderServiceProvider.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/WaveMoneyPaymentProviderServiceProvider.php index a55c88605..094930c65 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/WaveMoneyPaymentProviderServiceProvider.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/WaveMoneyPaymentProviderServiceProvider.php @@ -10,10 +10,8 @@ use Inensus\WaveMoneyPaymentProvider\Console\Commands\UpdatePackage; use Inensus\WaveMoneyPaymentProvider\Models\WaveMoneyTransaction; -class WaveMoneyPaymentProviderServiceProvider extends ServiceProvider -{ - public function boot(Filesystem $filesystem) - { +class WaveMoneyPaymentProviderServiceProvider extends ServiceProvider { + public function boot(Filesystem $filesystem) { $this->app->register(RouteServiceProvider::class); if ($this->app->runningInConsole()) { $this->publishConfigFiles(); @@ -28,8 +26,7 @@ public function boot(Filesystem $filesystem) ); } - public function register() - { + public function register() { $this->mergeConfigFrom( __DIR__.'/../../config/wave-money-payment-provider.php', 'wave-money-payment-provider' @@ -39,16 +36,14 @@ public function register() $this->app->singleton('WaveMoneyPaymentProvider', WaveMoneyTransactionProvider::class); } - public function publishConfigFiles() - { + public function publishConfigFiles() { $this->publishes([ __DIR__. '/../../config/wave-money-payment-provider-integration.php' => config_path('wave-money-payment-provider.php'), ]); } - public function publishVueFiles() - { + public function publishVueFiles() { $this->publishes([ __DIR__.'/../resources/assets' => resource_path( 'assets/js/plugins/wave-money-payment-provider' @@ -56,15 +51,13 @@ public function publishVueFiles() ], 'vue-components'); } - public function publishMigrations($filesystem) - { + public function publishMigrations($filesystem) { $this->publishes([ __DIR__.'/../../database/migrations/create_viber_tables.php.stub' => $this->getMigrationFileName($filesystem), ], 'migrations'); } - protected function getMigrationFileName(Filesystem $filesystem): string - { + protected function getMigrationFileName(Filesystem $filesystem): string { $timestamp = date('Y_m_d_His'); return Collection::make($this->app->databasePath().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR) diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/WaveMoneyTransactionProvider.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/WaveMoneyTransactionProvider.php index cccac46c3..a4d8ad72d 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/WaveMoneyTransactionProvider.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Providers/WaveMoneyTransactionProvider.php @@ -13,8 +13,7 @@ use Inensus\WaveMoneyPaymentProvider\Modules\Transaction\WaveMoneyTransactionService; use MPM\Transaction\Provider\ITransactionProvider; -class WaveMoneyTransactionProvider implements ITransactionProvider -{ +class WaveMoneyTransactionProvider implements ITransactionProvider { private $validData = []; public function __construct( @@ -22,11 +21,9 @@ public function __construct( private Transaction $transaction, private WaveMoneyTransactionService $waveMoneyTransactionService, private TransactionConflicts $transactionConflicts, - ) { - } + ) {} - public function validateRequest($request) - { + public function validateRequest($request) { $meterSerial = $request->input('meterSerial'); $amount = $request->input('amount'); @@ -43,13 +40,11 @@ public function validateRequest($request) $this->setValidData($waveMoneyTransactionData); } - public function saveTransaction() - { + public function saveTransaction() { $this->waveMoneyTransactionService->saveTransaction(); } - public function sendResult(bool $requestType, Transaction $transaction) - { + public function sendResult(bool $requestType, Transaction $transaction) { if ($requestType) { $waveMoneyTransaction = $transaction->originalTransaction()->first(); $updateData = [ @@ -69,39 +64,32 @@ public function sendResult(bool $requestType, Transaction $transaction) } } - public function confirm(): void - { + public function confirm(): void { // TODO: Implement confirm() method. } - public function getMessage(): string - { + public function getMessage(): string { // TODO: Implement getMessage() method. } - public function getAmount(): int - { + public function getAmount(): int { return $this->getTransaction()->amount; } - public function getSender(): string - { + public function getSender(): string { return $this->getTransaction()->message; } - public function saveCommonData(): Model - { + public function saveCommonData(): Model { // TODO: Implement saveCommonData() method. } - public function init($transaction): void - { + public function init($transaction): void { $this->waveMoneytransaction = $transaction; $this->transaction = $transaction->transaction()->first(); } - public function addConflict(?string $message): void - { + public function addConflict(?string $message): void { $conflict = $this->transactionConflicts->newQuery()->make([ 'state' => $message, ]); @@ -109,23 +97,19 @@ public function addConflict(?string $message): void $conflict->save(); } - public function getTransaction(): Transaction - { + public function getTransaction(): Transaction { return $this->transaction; } - public function setValidData($waveMoneyTransactionData) - { + public function setValidData($waveMoneyTransactionData) { $this->validData = $waveMoneyTransactionData; } - public function getValidData() - { + public function getValidData() { return $this->validData; } - public function getSubTransaction() - { + public function getSubTransaction() { return $this->waveMoneyTransactionService->getWaveMoneyTransaction(); } } diff --git a/src/backend/packages/inensus/wave-money-payment-provider/src/Services/WaveMoneyCredentialService.php b/src/backend/packages/inensus/wave-money-payment-provider/src/Services/WaveMoneyCredentialService.php index be608a888..f70a2ca67 100644 --- a/src/backend/packages/inensus/wave-money-payment-provider/src/Services/WaveMoneyCredentialService.php +++ b/src/backend/packages/inensus/wave-money-payment-provider/src/Services/WaveMoneyCredentialService.php @@ -4,18 +4,15 @@ use Inensus\WaveMoneyPaymentProvider\Models\WaveMoneyCredential; -class WaveMoneyCredentialService -{ +class WaveMoneyCredentialService { public function __construct( private WaveMoneyCredential $credential, - ) { - } + ) {} /** * This function uses one time on installation of the package. */ - public function createCredentials() - { + public function createCredentials() { return $this->credential->newQuery()->firstOrCreate(['id' => 1], [ 'merchant_id' => null, 'secret_key' => null, @@ -26,13 +23,11 @@ public function createCredentials() ]); } - public function getCredentials() - { + public function getCredentials() { return $this->credential->newQuery()->first(); } - public function updateCredentials($data) - { + public function updateCredentials($data) { $credential = $this->credential->newQuery()->find($data['id']); $credential->update([ diff --git a/src/backend/packages/inensus/wavecom-payment-provider/src/Console/Commands/InstallPackage.php b/src/backend/packages/inensus/wavecom-payment-provider/src/Console/Commands/InstallPackage.php index 0cd6ce25a..d97f200e4 100644 --- a/src/backend/packages/inensus/wavecom-payment-provider/src/Console/Commands/InstallPackage.php +++ b/src/backend/packages/inensus/wavecom-payment-provider/src/Console/Commands/InstallPackage.php @@ -4,14 +4,12 @@ use Illuminate\Console\Command; -class InstallPackage extends Command -{ +class InstallPackage extends Command { protected $signature = 'wavecom-payment-provider:install'; protected $description = 'Install wavecom-money-payment-provider Package'; - public function handle(): void - { + public function handle(): void { $this->info('Installing WavecomPaymentProvider Integration Package\n'); $this->info('Package installed successfully..'); } diff --git a/src/backend/packages/inensus/wavecom-payment-provider/src/Http/Controllers/WaveComTransactionController.php b/src/backend/packages/inensus/wavecom-payment-provider/src/Http/Controllers/WaveComTransactionController.php index 72eb7e2a5..44a945444 100644 --- a/src/backend/packages/inensus/wavecom-payment-provider/src/Http/Controllers/WaveComTransactionController.php +++ b/src/backend/packages/inensus/wavecom-payment-provider/src/Http/Controllers/WaveComTransactionController.php @@ -9,14 +9,10 @@ use Inensus\WavecomPaymentProvider\Http\Requests\UploadTransactionRequest; use Inensus\WavecomPaymentProvider\Services\TransactionService; -class WaveComTransactionController extends Controller -{ - public function __construct(private TransactionService $transactionService) - { - } +class WaveComTransactionController extends Controller { + public function __construct(private TransactionService $transactionService) {} - public function uploadTransaction(UploadTransactionRequest $request): ApiResource - { + public function uploadTransaction(UploadTransactionRequest $request): ApiResource { $file = $request->getFile(); $result = $this->transactionService->createTransactionsFromFile($file); diff --git a/src/backend/packages/inensus/wavecom-payment-provider/src/Http/Requests/UploadTransactionRequest.php b/src/backend/packages/inensus/wavecom-payment-provider/src/Http/Requests/UploadTransactionRequest.php index 0cd00faea..624a13772 100644 --- a/src/backend/packages/inensus/wavecom-payment-provider/src/Http/Requests/UploadTransactionRequest.php +++ b/src/backend/packages/inensus/wavecom-payment-provider/src/Http/Requests/UploadTransactionRequest.php @@ -6,17 +6,14 @@ use Illuminate\Foundation\Http\FormRequest; -class UploadTransactionRequest extends FormRequest -{ +class UploadTransactionRequest extends FormRequest { public const TRANSACTION_FILE = 'transaction_file'; - public function getFile(): \Illuminate\Http\UploadedFile - { + public function getFile(): \Illuminate\Http\UploadedFile { return $this->file(self::TRANSACTION_FILE); } - public function rules() - { + public function rules() { return [self::TRANSACTION_FILE => 'required|mimes:csv,txt']; } } diff --git a/src/backend/packages/inensus/wavecom-payment-provider/src/Models/WaveComTransaction.php b/src/backend/packages/inensus/wavecom-payment-provider/src/Models/WaveComTransaction.php index 34ecadbe2..90de110a0 100644 --- a/src/backend/packages/inensus/wavecom-payment-provider/src/Models/WaveComTransaction.php +++ b/src/backend/packages/inensus/wavecom-payment-provider/src/Models/WaveComTransaction.php @@ -20,8 +20,7 @@ * @property string $message * @property int $amount */ -class WaveComTransaction extends BaseModel implements FullySupportedTransactionInterface, IRawTransaction -{ +class WaveComTransaction extends BaseModel implements FullySupportedTransactionInterface, IRawTransaction { protected $table = 'wavecom_transactions'; public const RELATION_NAME = 'wavecom_transaction'; @@ -30,84 +29,68 @@ class WaveComTransaction extends BaseModel implements FullySupportedTransactionI public const STATUS_CANCELLED = -1; - public function getTransactionId(): string - { + public function getTransactionId(): string { return $this->transaction_id; } - public function getSender(): string - { + public function getSender(): string { return $this->sender; } - public function getMessage(): string - { + public function getMessage(): string { return $this->message; } - public function getAmount(): int - { + public function getAmount(): int { return $this->amount; } - public function setTransactionId(string $transactionId): void - { + public function setTransactionId(string $transactionId): void { $this->transaction_id = $transactionId; } - public function setSender(string $sender): void - { + public function setSender(string $sender): void { $this->sender = $sender; } - public function setMessage(string $message): void - { + public function setMessage(string $message): void { $this->message = $message; } - public function setAmount(int $amount): void - { + public function setAmount(int $amount): void { $this->amount = $amount; } - public function transaction(): MorphOne - { + public function transaction(): MorphOne { return $this->morphOne(Transaction::class, 'original_transaction'); } - public function manufacturerTransaction(): MorphTo - { + public function manufacturerTransaction(): MorphTo { return $this->morphTo(); } - public function conflicts(): MorphMany - { + public function conflicts(): MorphMany { return $this->morphMany(TransactionConflicts::class, 'transaction'); } - public function getManufacturerTransferType(): ?string - { + public function getManufacturerTransferType(): ?string { // TODO add type API/IMPORT return 'WaveCom'; } - public function getDescription(): ?string - { + public function getDescription(): ?string { return $this->getMessage(); } - public function setStatus(int $status) - { + public function setStatus(int $status) { $this->status = $status; } - public static function getTransactionName(): string - { + public static function getTransactionName(): string { return self::RELATION_NAME; } - public function getId(): int - { + public function getId(): int { return $this->id; } } diff --git a/src/backend/packages/inensus/wavecom-payment-provider/src/Providers/EventServiceProvider.php b/src/backend/packages/inensus/wavecom-payment-provider/src/Providers/EventServiceProvider.php index ecef44930..71b662f3c 100644 --- a/src/backend/packages/inensus/wavecom-payment-provider/src/Providers/EventServiceProvider.php +++ b/src/backend/packages/inensus/wavecom-payment-provider/src/Providers/EventServiceProvider.php @@ -4,8 +4,7 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; -class EventServiceProvider extends ServiceProvider -{ +class EventServiceProvider extends ServiceProvider { protected $subscribe = [ ]; @@ -14,8 +13,7 @@ class EventServiceProvider extends ServiceProvider * * @return void */ - public function boot() - { + public function boot() { parent::boot(); } } diff --git a/src/backend/packages/inensus/wavecom-payment-provider/src/Providers/ObserverServiceProvider.php b/src/backend/packages/inensus/wavecom-payment-provider/src/Providers/ObserverServiceProvider.php index 884016722..846c3686b 100644 --- a/src/backend/packages/inensus/wavecom-payment-provider/src/Providers/ObserverServiceProvider.php +++ b/src/backend/packages/inensus/wavecom-payment-provider/src/Providers/ObserverServiceProvider.php @@ -4,15 +4,13 @@ use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; -class ObserverServiceProvider extends ServiceProvider -{ +class ObserverServiceProvider extends ServiceProvider { /** * Register any events for your application. * * @return void */ - public function boot() - { + public function boot() { parent::boot(); } } diff --git a/src/backend/packages/inensus/wavecom-payment-provider/src/Providers/RouteServiceProvider.php b/src/backend/packages/inensus/wavecom-payment-provider/src/Providers/RouteServiceProvider.php index fde7d974f..7476e97d5 100644 --- a/src/backend/packages/inensus/wavecom-payment-provider/src/Providers/RouteServiceProvider.php +++ b/src/backend/packages/inensus/wavecom-payment-provider/src/Providers/RouteServiceProvider.php @@ -5,22 +5,18 @@ use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Support\Facades\Route; -class RouteServiceProvider extends ServiceProvider -{ +class RouteServiceProvider extends ServiceProvider { protected $namespace = 'Inensus\WavecomPaymentProvider\Http\Controllers'; - public function boot() - { + public function boot() { parent::boot(); } - public function map() - { + public function map() { $this->mapApiRoutes(); } - protected function mapApiRoutes() - { + protected function mapApiRoutes() { Route::prefix('api') ->middleware('api') ->namespace($this->namespace) diff --git a/src/backend/packages/inensus/wavecom-payment-provider/src/Providers/WaveComTransactionProvider.php b/src/backend/packages/inensus/wavecom-payment-provider/src/Providers/WaveComTransactionProvider.php index d23449afa..61951f360 100644 --- a/src/backend/packages/inensus/wavecom-payment-provider/src/Providers/WaveComTransactionProvider.php +++ b/src/backend/packages/inensus/wavecom-payment-provider/src/Providers/WaveComTransactionProvider.php @@ -15,8 +15,7 @@ use Inensus\WavecomPaymentProvider\Services\TransactionService; use MPM\Transaction\Provider\ITransactionProvider; -class WaveComTransactionProvider implements ITransactionProvider -{ +class WaveComTransactionProvider implements ITransactionProvider { private Transaction $transaction; public function __construct( @@ -24,16 +23,13 @@ public function __construct( private SmsService $smsService, private TransactionConflicts $transactionConflicts, private WaveComTransaction $waveComTransaction, - ) { - } + ) {} - public function saveTransaction() - { + public function saveTransaction() { $this->transactionService->saveTransaction(); } - public function sendResult(bool $requestType, Transaction $transaction) - { + public function sendResult(bool $requestType, Transaction $transaction) { /** @var WaveComTransaction $waveComTransaction */ $waveComTransaction = $transaction->originalTransaction()->first(); $this->transactionService->setStatus($waveComTransaction, $requestType); @@ -46,44 +42,36 @@ public function sendResult(bool $requestType, Transaction $transaction) } } - public function validateRequest($request) - { + public function validateRequest($request) { // no need as the transaction initialized by uploading a separate file } - public function confirm(): void - { + public function confirm(): void { // TODO: Implement confirm() method. } - public function getMessage(): string - { + public function getMessage(): string { return $this->getTransaction()->getMessage(); } - public function getAmount(): int - { + public function getAmount(): int { return $this->getTransaction()->getAmount(); } - public function getSender(): string - { + public function getSender(): string { return $this->getTransaction()->getSender(); } - public function saveCommonData(): Model - { + public function saveCommonData(): Model { // TODO: Implement saveCommonData() method. } - public function init($transaction): void - { + public function init($transaction): void { $this->waveComTransaction = $transaction; $this->transaction = $transaction->transaction()->first(); } - public function addConflict(?string $message): void - { + public function addConflict(?string $message): void { $conflict = $this->transactionConflicts->newQuery()->make([ 'state' => $message, ]); @@ -91,8 +79,7 @@ public function addConflict(?string $message): void $conflict->save(); } - public function getTransaction(): Transaction - { + public function getTransaction(): Transaction { return $this->transaction; } } diff --git a/src/backend/packages/inensus/wavecom-payment-provider/src/Providers/WavecomPaymentProviderServiceProvider.php b/src/backend/packages/inensus/wavecom-payment-provider/src/Providers/WavecomPaymentProviderServiceProvider.php index 1f954e168..9dc1c1287 100644 --- a/src/backend/packages/inensus/wavecom-payment-provider/src/Providers/WavecomPaymentProviderServiceProvider.php +++ b/src/backend/packages/inensus/wavecom-payment-provider/src/Providers/WavecomPaymentProviderServiceProvider.php @@ -9,10 +9,8 @@ use Inensus\WavecomPaymentProvider\Console\Commands\InstallPackage; use Inensus\WavecomPaymentProvider\Models\WaveComTransaction; -class WavecomPaymentProviderServiceProvider extends ServiceProvider -{ - public function boot(Filesystem $filesystem) - { +class WavecomPaymentProviderServiceProvider extends ServiceProvider { + public function boot(Filesystem $filesystem) { $this->app->register(RouteServiceProvider::class); if ($this->app->runningInConsole()) { $this->publishConfigFiles(); @@ -28,16 +26,14 @@ public function boot(Filesystem $filesystem) ); } - public function register() - { + public function register() { $this->mergeConfigFrom(__DIR__.'/../../config/wavecom-payment-provider.php', 'wavecom-payment-provider'); $this->app->register(EventServiceProvider::class); $this->app->register(ObserverServiceProvider::class); $this->app->bind('WaveComPaymentProvider', WaveComTransactionProvider::class); } - public function publishConfigFiles() - { + public function publishConfigFiles() { $this->publishes( [ __DIR__.'/../../config/wavecom-payment-provider.php' => config_path( @@ -47,8 +43,7 @@ public function publishConfigFiles() ); } - public function publishVueFiles() - { + public function publishVueFiles() { $this->publishes( [ __DIR__.'/../resources/assets' => resource_path( @@ -59,15 +54,13 @@ public function publishVueFiles() ); } - public function publishMigrations($filesystem) - { + public function publishMigrations($filesystem) { $this->publishes([ __DIR__.'/../../database/migrations/create_wavecom_tables.php.stub' => $this->getMigrationFileName($filesystem), ], 'migrations'); } - protected function getMigrationFileName(Filesystem $filesystem): string - { + protected function getMigrationFileName(Filesystem $filesystem): string { $timestamp = date('Y_m_d_His'); return Collection::make($this->app->databasePath().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR) diff --git a/src/backend/packages/inensus/wavecom-payment-provider/src/Services/TransactionService.php b/src/backend/packages/inensus/wavecom-payment-provider/src/Services/TransactionService.php index 3253f4111..dcc7a9844 100644 --- a/src/backend/packages/inensus/wavecom-payment-provider/src/Services/TransactionService.php +++ b/src/backend/packages/inensus/wavecom-payment-provider/src/Services/TransactionService.php @@ -15,14 +15,10 @@ use Inensus\WavecomPaymentProvider\Models\WaveComTransaction; use ParseCsv\Csv; -class TransactionService extends AbstractPaymentAggregatorTransactionService -{ - public function __construct(private Csv $csv) - { - } +class TransactionService extends AbstractPaymentAggregatorTransactionService { + public function __construct(private Csv $csv) {} - public function createTransactionsFromFile(UploadedFile $file): array - { + public function createTransactionsFromFile(UploadedFile $file): array { $this->csv->auto($file); $skippedTransactions = []; @@ -68,15 +64,13 @@ public function createTransactionsFromFile(UploadedFile $file): array return $skippedTransactions; } - public function setStatus(WaveComTransaction $transaction, bool $status): void - { + public function setStatus(WaveComTransaction $transaction, bool $status): void { $mappedStatus = $status ? WaveComTransaction::STATUS_SUCCESS : WaveComTransaction::STATUS_CANCELLED; $transaction->setStatus($mappedStatus); $transaction->save(); } - private function validateTransaction(array $transaction) - { + private function validateTransaction(array $transaction) { $rules = [ 'transaction_id' => 'required', 'sender' => 'required', diff --git a/src/backend/pint.json b/src/backend/pint.json deleted file mode 100644 index 644c00b7a..000000000 --- a/src/backend/pint.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "preset": "psr12", - "rules": { - "no_superfluous_phpdoc_tags": false, - "yoda_style": false, - "no_unused_imports": false - }, - "exclude": ["bootstrap/cache"] -} diff --git a/src/backend/tests/CreatesApplication.php b/src/backend/tests/CreatesApplication.php index 18f982511..e7f4c9006 100644 --- a/src/backend/tests/CreatesApplication.php +++ b/src/backend/tests/CreatesApplication.php @@ -5,15 +5,13 @@ use Illuminate\Contracts\Console\Kernel; use Illuminate\Foundation\Application; -trait CreatesApplication -{ +trait CreatesApplication { /** * Creates the application. * * @return Application */ - public function createApplication() - { + public function createApplication() { $app = require __DIR__.'/../bootstrap/app.php'; $app->make(Kernel::class)->bootstrap(); diff --git a/src/backend/tests/Feature/AddressTest.php b/src/backend/tests/Feature/AddressTest.php index f7a8a6d3d..9cb80dadd 100644 --- a/src/backend/tests/Feature/AddressTest.php +++ b/src/backend/tests/Feature/AddressTest.php @@ -13,13 +13,11 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class AddressTest extends TestCase -{ +class AddressTest extends TestCase { use RefreshMultipleDatabases; use WithFaker; - public function testUserDefinesAnAddressToCustomerForOwnCompany() - { + public function testUserDefinesAnAddressToCustomerForOwnCompany() { $user = UserFactory::new()->create(); $person = PersonFactory::new()->create(); $city = CityFactory::new()->create(); @@ -42,8 +40,7 @@ public function testUserDefinesAnAddressToCustomerForOwnCompany() $this->assertEquals(1, $person->addresses()->first()->is_primary); } - public function testUserUpdatesAndAddressOfCustomerForOwnCompany() - { + public function testUserUpdatesAndAddressOfCustomerForOwnCompany() { $user = UserFactory::new()->create(); $person = PersonFactory::new()->create(); $city = CityFactory::new()->create(); @@ -69,8 +66,7 @@ public function testUserUpdatesAndAddressOfCustomerForOwnCompany() $this->assertEquals(0, $person->addresses()->first()->is_primary); } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); diff --git a/src/backend/tests/Feature/AgentAppTest.php b/src/backend/tests/Feature/AgentAppTest.php index 7611e9012..0742d1c39 100644 --- a/src/backend/tests/Feature/AgentAppTest.php +++ b/src/backend/tests/Feature/AgentAppTest.php @@ -7,12 +7,10 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class AgentAppTest extends TestCase -{ +class AgentAppTest extends TestCase { use CreateEnvironments; - public function testAgentLogsIn() - { + public function testAgentLogsIn() { $this->createTestData(); $this->createAgent(); $agent = $this->agent; @@ -27,8 +25,7 @@ public function testAgentLogsIn() $this->assertNotNull($response->json('access_token')); } - public function testAgentGetsOwnData() - { + public function testAgentGetsOwnData() { $this->createTestData(); $this->createAgentCommission(); $this->createAgent(); @@ -40,8 +37,7 @@ public function testAgentGetsOwnData() $this->assertEquals($agent->name, $response['name']); } - public function testAgentLogsOut() - { + public function testAgentLogsOut() { $this->createTestData(); $this->createAgent(); $agent = $this->agent; @@ -50,8 +46,7 @@ public function testAgentLogsOut() $this->assertEquals($response->json('message'), 'Successfully logged out'); } - public function testAgentRefreshesAuthToken() - { + public function testAgentRefreshesAuthToken() { $this->createTestData(); $this->createAgent(); $agent = $this->agent; @@ -59,8 +54,7 @@ public function testAgentRefreshesAuthToken() $response->assertStatus(200); } - public function testAgentSetsFirebaseToken() - { + public function testAgentSetsFirebaseToken() { $this->createTestData(); $this->createAgentCommission(); $this->createAgent(); @@ -73,8 +67,7 @@ public function testAgentSetsFirebaseToken() $this->assertEquals($response['data']['fire_base_token'], $postData['fire_base_token']); } - public function testAgentGetsBalance() - { + public function testAgentGetsBalance() { $this->createTestData(); $this->createAgentCommission(); $this->createAgent(); @@ -84,8 +77,7 @@ public function testAgentGetsBalance() $this->assertEquals($agent->balance, $response->getContent()); } - public function testAgentGetsCustomers() - { + public function testAgentGetsCustomers() { $this->createTestData(); $this->createCluster(); $this->createMiniGrid(); @@ -102,8 +94,7 @@ public function testAgentGetsCustomers() $this->assertEquals(count($response['data']), $personCount); } - public function testAgentSearchesInCustomers() - { + public function testAgentSearchesInCustomers() { $this->createTestData(); $this->createCluster(); $this->createMiniGrid(); @@ -122,8 +113,7 @@ public function testAgentSearchesInCustomers() $this->assertEquals($response['data'][0]['name'], $person->name); } - public function testAgentGetsCustomersPaymentFlow() - { + public function testAgentGetsCustomersPaymentFlow() { $this->createTestData(); $this->createCluster(); $this->createMiniGrid(); @@ -146,8 +136,7 @@ public function testAgentGetsCustomersPaymentFlow() $this->assertNotNull($response->getContent()); } - public function testAgentGetsCustomerPaymentFlowByCustomerId() - { + public function testAgentGetsCustomerPaymentFlowByCustomerId() { $this->createTestData(); $this->createCluster(); $this->createMiniGrid(); @@ -172,8 +161,7 @@ public function testAgentGetsCustomerPaymentFlowByCustomerId() $this->assertNotNull($response->getContent()); } - public function testAgentGetsCustomersTransactions() - { + public function testAgentGetsCustomersTransactions() { $this->createTestData(); $this->createCluster(); $this->createMiniGrid(); @@ -196,8 +184,7 @@ public function testAgentGetsCustomersTransactions() $this->assertEquals(count($response['data']), $agentTransactionCount); } - public function testAgentGetsCustomerTransactionsByCustomerId() - { + public function testAgentGetsCustomerTransactionsByCustomerId() { $this->createTestData(); $this->createCluster(); $this->createMiniGrid(); @@ -220,8 +207,7 @@ public function testAgentGetsCustomerTransactionsByCustomerId() $this->assertEquals(count($response['data']), $agentTransactionCount); } - public function testAgentGetsSoldAppliances() - { + public function testAgentGetsSoldAppliances() { $this->createTestData(); $this->createAgentCommission(); $this->createAgent(); @@ -233,8 +219,7 @@ public function testAgentGetsSoldAppliances() $this->assertEquals(count($response['data']), 1); } - public function testAgentGetsCustomerSoldAppliancesByCustomerId() - { + public function testAgentGetsCustomerSoldAppliancesByCustomerId() { $this->createTestData(); $this->createAgentCommission(); $this->createAgent(); @@ -246,8 +231,7 @@ public function testAgentGetsCustomerSoldAppliancesByCustomerId() $this->assertEquals(count($response['data']), 1); } - public function testAgentSalesAppliances() - { + public function testAgentSalesAppliances() { $this->createTestData(); $this->createAgentCommission(); $this->createAgent(); @@ -265,8 +249,7 @@ public function testAgentSalesAppliances() $response->assertStatus(201); } - public function testAgentGetsAssignedAppliances() - { + public function testAgentGetsAssignedAppliances() { $this->createTestData(); $this->createAgentCommission(); $this->createAgent(); @@ -278,8 +261,7 @@ public function testAgentGetsAssignedAppliances() $this->assertEquals(count($response['data']), $assignedApplianceCount); } - public function testAgentGetsApplicationDashboardBoxes() - { + public function testAgentGetsApplicationDashboardBoxes() { $this->createTestData(); $this->createCluster(); $this->createMiniGrid(); @@ -306,8 +288,7 @@ public function testAgentGetsApplicationDashboardBoxes() $this->assertEquals(array_key_exists('since', $response['data']), true); } - public function testAgentGetsApplicationDashboardGraphValues() - { + public function testAgentGetsApplicationDashboardGraphValues() { $this->createTestData(); $this->createCluster(); $this->createMiniGrid(); @@ -329,8 +310,7 @@ public function testAgentGetsApplicationDashboardGraphValues() $response->assertStatus(200); } - public function testAgentGetsApplicationDashboardWeeklyRevenues() - { + public function testAgentGetsApplicationDashboardWeeklyRevenues() { $this->createTestData(); $this->createCluster(); $this->createMiniGrid(); @@ -352,8 +332,7 @@ public function testAgentGetsApplicationDashboardWeeklyRevenues() $response->assertStatus(200); } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); diff --git a/src/backend/tests/Feature/AgentAppTicketsTest.php b/src/backend/tests/Feature/AgentAppTicketsTest.php index 3731acf6d..84fb5522f 100644 --- a/src/backend/tests/Feature/AgentAppTicketsTest.php +++ b/src/backend/tests/Feature/AgentAppTicketsTest.php @@ -5,12 +5,10 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class AgentAppTicketsTest extends TestCase -{ +class AgentAppTicketsTest extends TestCase { use CreateEnvironments; - public function testAgentGetsTicketList() - { + public function testAgentGetsTicketList() { $this->createTestData(); $this->createAgentCommission(); $this->createAgent(); @@ -25,8 +23,7 @@ public function testAgentGetsTicketList() $this->assertEquals($ticketCount, count($response['data']['data'])); } - public function testAgentGetsTicketById() - { + public function testAgentGetsTicketById() { $this->createTestData(); $this->createAgentCommission(); $this->createAgent(); @@ -43,8 +40,7 @@ public function testAgentGetsTicketById() $this->assertEquals($this->agent->id, $response['data']['creator_id']); } - public function testAgentGetsTicketCustomerId() - { + public function testAgentGetsTicketCustomerId() { $this->createTestData(); $this->createAgentCommission(); $this->createAgent(); @@ -63,8 +59,7 @@ public function testAgentGetsTicketCustomerId() $this->assertEquals($this->agent->id, $response['data']['data'][0]['creator_id']); } - public function testAgentCreatesATicket() - { + public function testAgentCreatesATicket() { $this->createTestData(); $this->createAgentCommission(); $this->createAgent(); @@ -89,8 +84,7 @@ public function testAgentCreatesATicket() $this->assertEquals('agent', $response['data'][0]['creator_type']); } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); diff --git a/src/backend/tests/Feature/AgentAssignedApplianceWebTest.php b/src/backend/tests/Feature/AgentAssignedApplianceWebTest.php index 9a9992ec3..7cf185c2f 100644 --- a/src/backend/tests/Feature/AgentAssignedApplianceWebTest.php +++ b/src/backend/tests/Feature/AgentAssignedApplianceWebTest.php @@ -5,12 +5,10 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class AgentAssignedApplianceWebTest extends TestCase -{ +class AgentAssignedApplianceWebTest extends TestCase { use CreateEnvironments; - public function testUserGetsAgentsAssignedApplianceList() - { + public function testUserGetsAgentsAssignedApplianceList() { $this->createTestData(); $agentCount = 1; $this->createAgent($agentCount); @@ -21,8 +19,7 @@ public function testUserGetsAgentsAssignedApplianceList() $this->assertEquals(count($response['data']), $applianceCount); } - public function testUserAssignsAnAssignedApplianceToAgent() - { + public function testUserAssignsAnAssignedApplianceToAgent() { $this->createTestData(); $agentCount = 1; $this->createAgent($agentCount); @@ -42,8 +39,7 @@ public function testUserAssignsAnAssignedApplianceToAgent() $this->assertEquals($response['data']['cost'], $postData['cost']); } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); diff --git a/src/backend/tests/Feature/AgentBalanceHistoryWebTest.php b/src/backend/tests/Feature/AgentBalanceHistoryWebTest.php index a28cd1a87..acfef26f3 100644 --- a/src/backend/tests/Feature/AgentBalanceHistoryWebTest.php +++ b/src/backend/tests/Feature/AgentBalanceHistoryWebTest.php @@ -5,12 +5,10 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class AgentBalanceHistoryWebTest extends TestCase -{ +class AgentBalanceHistoryWebTest extends TestCase { use CreateEnvironments; - public function testUserGetsAgentsBalanceHistories() - { + public function testUserGetsAgentsBalanceHistories() { $this->createTestData(); $this->createAgentCommission(); $this->createAgent(); @@ -22,8 +20,7 @@ public function testUserGetsAgentsBalanceHistories() $this->assertEquals(count($response['data']), $agentBalanceHistoryCount); } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); diff --git a/src/backend/tests/Feature/AgentChargeTest.php b/src/backend/tests/Feature/AgentChargeTest.php index 215946de4..7b0bef05e 100644 --- a/src/backend/tests/Feature/AgentChargeTest.php +++ b/src/backend/tests/Feature/AgentChargeTest.php @@ -6,12 +6,10 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class AgentChargeTest extends TestCase -{ +class AgentChargeTest extends TestCase { use CreateEnvironments; - public function testUserCreatesNewBalanceForAgent() - { + public function testUserCreatesNewBalanceForAgent() { $this->createTestData(); $this->createAgentCommission(); $this->createAgent(); @@ -26,8 +24,7 @@ public function testUserCreatesNewBalanceForAgent() $this->assertEquals($agent->balance, $agentBalance + $postData['amount']); } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); diff --git a/src/backend/tests/Feature/AgentCommissionTest.php b/src/backend/tests/Feature/AgentCommissionTest.php index 3a406b84f..46e884cb1 100644 --- a/src/backend/tests/Feature/AgentCommissionTest.php +++ b/src/backend/tests/Feature/AgentCommissionTest.php @@ -6,12 +6,10 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class AgentCommissionTest extends TestCase -{ +class AgentCommissionTest extends TestCase { use CreateEnvironments; - public function testUserGetsAgentCommissionList() - { + public function testUserGetsAgentCommissionList() { $this->createTestData(); $agentCommissionCount = 5; $this->createAgentCommission($agentCommissionCount); @@ -20,8 +18,7 @@ public function testUserGetsAgentCommissionList() $this->assertEquals(count($response['data']), $agentCommissionCount); } - public function testUserCreatesAgentCommission() - { + public function testUserCreatesAgentCommission() { $this->createTestData(); $this->createCluster(); $this->createMiniGrid(); @@ -39,8 +36,7 @@ public function testUserCreatesAgentCommission() $this->assertEquals($lastCreatedAgentCommission->name, $response['data']['name']); } - public function testUserCanUpdateAnAgentCommission() - { + public function testUserCanUpdateAnAgentCommission() { $this->createTestData(); $this->createAgentCommission(); $putData = [ @@ -61,8 +57,7 @@ public function testUserCanUpdateAnAgentCommission() $this->assertEquals($putData['risk_balance'], $response['data']['risk_balance']); } - public function testUserCanDeleteAnAgent() - { + public function testUserCanDeleteAnAgent() { $this->createTestData(); $this->createAgentCommission(); $response = $this->actingAs($this->user)->delete(sprintf('/api/agents/commissions/%s', $this->agentCommissions[0]->id)); @@ -70,8 +65,7 @@ public function testUserCanDeleteAnAgent() $this->assertEquals(0, $agentsCount); } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); diff --git a/src/backend/tests/Feature/AgentReceiptTest.php b/src/backend/tests/Feature/AgentReceiptTest.php index 20fe57b04..7ec6af32d 100644 --- a/src/backend/tests/Feature/AgentReceiptTest.php +++ b/src/backend/tests/Feature/AgentReceiptTest.php @@ -6,12 +6,10 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class AgentReceiptTest extends TestCase -{ +class AgentReceiptTest extends TestCase { use CreateEnvironments; - public function testUserGetsAgentsReceipts() - { + public function testUserGetsAgentsReceipts() { $this->createTestData(); $this->createAgentCommission(); $this->createAgent(); @@ -26,8 +24,7 @@ public function testUserGetsAgentsReceipts() $this->assertEquals($response['data'][0]['agent']['balance'], $agentBalance); } - public function testUserGetsAllReceipts() - { + public function testUserGetsAllReceipts() { $this->createTestData(); $this->createAgentCommission(); $this->createAgent(); @@ -38,8 +35,7 @@ public function testUserGetsAllReceipts() $this->assertEquals(count($response['data']), 1); } - public function testUserCreatesNewReceipt() - { + public function testUserCreatesNewReceipt() { $this->createTestData(); $this->createAgentCommission(); $this->createAgent(); @@ -54,8 +50,7 @@ public function testUserCreatesNewReceipt() $this->assertEquals($response['data']['amount'], $postData['amount']); } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); diff --git a/src/backend/tests/Feature/AgentSoldApplianceWebTest.php b/src/backend/tests/Feature/AgentSoldApplianceWebTest.php index 4a3a6ba0d..01ffa9e76 100644 --- a/src/backend/tests/Feature/AgentSoldApplianceWebTest.php +++ b/src/backend/tests/Feature/AgentSoldApplianceWebTest.php @@ -5,12 +5,10 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class AgentSoldApplianceWebTest extends TestCase -{ +class AgentSoldApplianceWebTest extends TestCase { use CreateEnvironments; - public function testUserGetsAgentsSoldApplianceList() - { + public function testUserGetsAgentsSoldApplianceList() { $this->createTestData(); $this->createAgent(); $this->createAssignedAppliances(); @@ -21,8 +19,7 @@ public function testUserGetsAgentsSoldApplianceList() $this->assertEquals(count($response['data']), 1); } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); diff --git a/src/backend/tests/Feature/AgentTest.php b/src/backend/tests/Feature/AgentTest.php index 9ceebe514..98f556782 100644 --- a/src/backend/tests/Feature/AgentTest.php +++ b/src/backend/tests/Feature/AgentTest.php @@ -7,12 +7,10 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class AgentTest extends TestCase -{ +class AgentTest extends TestCase { use CreateEnvironments; - public function testUserGetsAgentList() - { + public function testUserGetsAgentList() { $this->createTestData(); $agentCount = 4; $this->createAgent(4); @@ -21,8 +19,7 @@ public function testUserGetsAgentList() $this->assertEquals(count($response['data']), $agentCount); } - public function testUserGetsAgentById() - { + public function testUserGetsAgentById() { $this->createTestData(); $agentCount = 4; $this->createAgent(4); @@ -31,8 +28,7 @@ public function testUserGetsAgentById() $this->assertEquals($response['data']['id'], $this->agents[0]->id); } - public function testUserCreatesNewAgent() - { + public function testUserCreatesNewAgent() { $this->createTestData(); $this->createCluster(); $this->createMiniGrid(); @@ -59,8 +55,7 @@ public function testUserCreatesNewAgent() $this->assertEquals($personAddress->phone, $postData['phone']); } - public function testUserCanUpdateAnAgent() - { + public function testUserCanUpdateAnAgent() { $this->createTestData(); $this->createCluster(); $this->createMiniGrid(); @@ -85,8 +80,7 @@ public function testUserCanUpdateAnAgent() $this->assertEquals($putData['gender'], $response['data']['person']['sex']); } - public function testUserCanResetsAgentsPassword() - { + public function testUserCanResetsAgentsPassword() { $this->createTestData(); $this->createCluster(); $this->createMiniGrid(); @@ -102,8 +96,7 @@ public function testUserCanResetsAgentsPassword() $response->assertStatus(200); } - public function testUserCanSearchAnAgentByName() - { + public function testUserCanSearchAnAgentByName() { $this->createTestData(); $this->createCluster(); $this->createMiniGrid(); @@ -116,8 +109,7 @@ public function testUserCanSearchAnAgentByName() $this->assertEquals($responseData['name'], $this->agents[0]->name); } - public function testUserCanDeleteAnAgent() - { + public function testUserCanDeleteAnAgent() { $this->createTestData(); $this->createCluster(); $this->createMiniGrid(); @@ -129,8 +121,7 @@ public function testUserCanDeleteAnAgent() $this->assertEquals(0, $agentsCount); } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); diff --git a/src/backend/tests/Feature/AgentTransactionWebTest.php b/src/backend/tests/Feature/AgentTransactionWebTest.php index 5fe24ea9a..29c1d883c 100644 --- a/src/backend/tests/Feature/AgentTransactionWebTest.php +++ b/src/backend/tests/Feature/AgentTransactionWebTest.php @@ -5,12 +5,10 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class AgentTransactionWebTest extends TestCase -{ +class AgentTransactionWebTest extends TestCase { use CreateEnvironments; - public function testUserGetsAgentsTransactions() - { + public function testUserGetsAgentsTransactions() { $this->createTestData(); $this->createAgentCommission(); $this->createAgent(); @@ -24,8 +22,7 @@ public function testUserGetsAgentsTransactions() $this->assertEquals($response['data'][0]['amount'], $amount); } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); diff --git a/src/backend/tests/Feature/CalinApiTest.php b/src/backend/tests/Feature/CalinApiTest.php index 7340ae89d..658459c12 100644 --- a/src/backend/tests/Feature/CalinApiTest.php +++ b/src/backend/tests/Feature/CalinApiTest.php @@ -15,8 +15,7 @@ use Illuminate\Support\Facades\Bus; use Tests\TestCase; -class CalinApiTest extends TestCase -{ +class CalinApiTest extends TestCase { use RefreshDatabase; use WithFaker; @@ -25,8 +24,7 @@ class CalinApiTest extends TestCase * for security reasons we can not provide a meter to perfom the test * This test passed on 28.06.2020 with a valid meter. */ - public function testGenerateTokenForAValidMeter(): void - { + public function testGenerateTokenForAValidMeter(): void { Bus::fake(); $this->withoutExceptionHandling(); diff --git a/src/backend/tests/Feature/CityTest.php b/src/backend/tests/Feature/CityTest.php index aea40f479..bc378dfa4 100644 --- a/src/backend/tests/Feature/CityTest.php +++ b/src/backend/tests/Feature/CityTest.php @@ -15,8 +15,7 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class CityTest extends TestCase -{ +class CityTest extends TestCase { use RefreshMultipleDatabases; use WithFaker; @@ -34,8 +33,7 @@ class CityTest extends TestCase private $cityIds = []; - public function testUserGetsCities() - { + public function testUserGetsCities() { $clusterCount = 1; $miniGridCount = 1; $cityCount = 5; @@ -45,8 +43,7 @@ public function testUserGetsCities() $this->assertEquals(count($response['data']), count($this->cityIds)); } - public function testUserGetsCityById() - { + public function testUserGetsCityById() { $clusterCount = 1; $miniGridCount = 1; $cityCount = 1; @@ -56,8 +53,7 @@ public function testUserGetsCityById() $this->assertEquals($response['data']['id'], $this->cityIds[0]); } - public function testUserCreatesNewCity() - { + public function testUserCreatesNewCity() { $clusterCount = 1; $miniGridCount = 1; $cityCount = 1; @@ -72,8 +68,7 @@ public function testUserCreatesNewCity() $this->assertEquals($response['data']['name'], $cityData['name']); } - public function testUserUpdatesACity() - { + public function testUserUpdatesACity() { $clusterCount = 2; $miniGridCount = 2; $cityCount = 1; @@ -89,8 +84,7 @@ public function testUserUpdatesACity() $this->assertEquals($response['data']['name'], $cityData['name']); } - protected function createTestData($clusterCount = 1, $miniGridCount = 1, $cityCount = 1) - { + protected function createTestData($clusterCount = 1, $miniGridCount = 1, $cityCount = 1) { $this->user = UserFactory::new()->create(); $this->company = CompanyFactory::new()->create(); $this->companyDatabase = CompanyDatabaseFactory::new()->create(); @@ -131,8 +125,7 @@ protected function createTestData($clusterCount = 1, $miniGridCount = 1, $cityCo } } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); @@ -140,8 +133,7 @@ public function actingAs($user, $driver = null) return $this; } - protected function generateUniqueNumber(): int - { + protected function generateUniqueNumber(): int { return $this->faker->unique()->randomNumber() + $this->faker->unique()->randomNumber() + $this->faker->unique()->randomNumber(); } diff --git a/src/backend/tests/Feature/ClusterDashboardCacheTest.php b/src/backend/tests/Feature/ClusterDashboardCacheTest.php index 878f1fa0e..3698a6cee 100644 --- a/src/backend/tests/Feature/ClusterDashboardCacheTest.php +++ b/src/backend/tests/Feature/ClusterDashboardCacheTest.php @@ -28,8 +28,7 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class ClusterDashboardCacheTest extends TestCase -{ +class ClusterDashboardCacheTest extends TestCase { use RefreshMultipleDatabases; use WithFaker; @@ -59,8 +58,7 @@ class ClusterDashboardCacheTest extends TestCase private $clusterIds = []; - public function testUserUpdatesClusterDataInCache() - { + public function testUserUpdatesClusterDataInCache() { $clusterCount = 1; $meterCount = 2; $transactionCount = 3; @@ -70,8 +68,7 @@ public function testUserUpdatesClusterDataInCache() $this->assertEquals(count(Cache::get('ClustersList')), count($this->clusterIds)); } - public function testUserGetsClusterDataFromCacheById() - { + public function testUserGetsClusterDataFromCacheById() { $clusterCount = 2; $meterCount = 2; $transactionCount = 3; @@ -81,8 +78,7 @@ public function testUserGetsClusterDataFromCacheById() $this->assertEquals($response['data']['id'], $this->clusterIds[0]); } - protected function createTestData($clusterCount = 1, $meterCount = 1, $transactionCount = 1) - { + protected function createTestData($clusterCount = 1, $meterCount = 1, $transactionCount = 1) { $this->user = UserFactory::new()->create(); $this->city = CityFactory::new()->create(); $this->company = CompanyFactory::new()->create(); @@ -200,8 +196,7 @@ protected function createTestData($clusterCount = 1, $meterCount = 1, $transacti } } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); @@ -209,8 +204,7 @@ public function actingAs($user, $driver = null) return $this; } - protected function generateUniqueNumber(): int - { + protected function generateUniqueNumber(): int { return $this->faker->unique()->randomNumber() + $this->faker->unique()->randomNumber() + $this->faker->unique()->randomNumber(); } diff --git a/src/backend/tests/Feature/ClusterRevenueTest.php b/src/backend/tests/Feature/ClusterRevenueTest.php index 514bd7e99..2bc023729 100644 --- a/src/backend/tests/Feature/ClusterRevenueTest.php +++ b/src/backend/tests/Feature/ClusterRevenueTest.php @@ -28,8 +28,7 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class ClusterRevenueTest extends TestCase -{ +class ClusterRevenueTest extends TestCase { use RefreshMultipleDatabases; use WithFaker; @@ -59,8 +58,7 @@ class ClusterRevenueTest extends TestCase private $clusterIds = []; - public function testUserGetsClustersRevenueMonthly() - { + public function testUserGetsClustersRevenueMonthly() { $clusterCount = 2; $meterCount = 3; $transactionCount = 4; @@ -73,8 +71,7 @@ public function testUserGetsClustersRevenueMonthly() $this->assertEquals($totalRevenue, $this->getTotalTransactionAmount()); } - public function testUserGetsClustersRevenueWeekly() - { + public function testUserGetsClustersRevenueWeekly() { $clusterCount = 1; $meterCount = 5; $transactionCount = 2; @@ -87,8 +84,7 @@ public function testUserGetsClustersRevenueWeekly() $this->assertEquals($totalRevenue, $this->getTotalTransactionAmount()); } - public function testUserGetsRevenueInConnectionTypesAnalysisForCluster() - { + public function testUserGetsRevenueInConnectionTypesAnalysisForCluster() { $clusterCount = 1; $meterCount = 2; $transactionCount = 1; @@ -100,8 +96,7 @@ public function testUserGetsRevenueInConnectionTypesAnalysisForCluster() $response->assertStatus(200); } - public function testUserGetsMiniGridRevenueMonthlyForCluster() - { + public function testUserGetsMiniGridRevenueMonthlyForCluster() { $clusterCount = 1; $meterCount = 1; $transactionCount = 1; @@ -117,8 +112,7 @@ public function testUserGetsMiniGridRevenueMonthlyForCluster() $this->assertEquals($totalRevenue, $this->getTotalTransactionAmount()); } - public function testUserGetsMiniGridRevenueWeeklyForCluster() - { + public function testUserGetsMiniGridRevenueWeeklyForCluster() { $clusterCount = 1; $meterCount = 1; $transactionCount = 1; @@ -134,8 +128,7 @@ public function testUserGetsMiniGridRevenueWeeklyForCluster() $this->assertEquals($totalRevenue, $this->getTotalTransactionAmount()); } - protected function getTotalTransactionAmount() - { + protected function getTotalTransactionAmount() { $clusterIds = $this->clusterIds; return Transaction::query() @@ -168,8 +161,7 @@ static function ($q) { )->get()->pluck('amount')->sum(); } - protected function createTestData($clusterCount = 1, $meterCount = 1, $transactionCount = 1) - { + protected function createTestData($clusterCount = 1, $meterCount = 1, $transactionCount = 1) { $this->user = UserFactory::new()->create(); $this->city = CityFactory::new()->create(); $this->company = CompanyFactory::new()->create(); @@ -292,8 +284,7 @@ protected function createTestData($clusterCount = 1, $meterCount = 1, $transacti } } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); @@ -301,8 +292,7 @@ public function actingAs($user, $driver = null) return $this; } - protected function generateUniqueNumber(): int - { + protected function generateUniqueNumber(): int { return $this->faker->unique()->randomNumber() + $this->faker->unique()->randomNumber() + $this->faker->unique()->randomNumber() + $this->faker->unique()->randomNumber() + $this->faker->unique()->randomNumber(); } diff --git a/src/backend/tests/Feature/ClusterTest.php b/src/backend/tests/Feature/ClusterTest.php index 2d6fe8826..aa4944231 100644 --- a/src/backend/tests/Feature/ClusterTest.php +++ b/src/backend/tests/Feature/ClusterTest.php @@ -28,8 +28,7 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class ClusterTest extends TestCase -{ +class ClusterTest extends TestCase { use RefreshMultipleDatabases; use WithFaker; @@ -59,8 +58,7 @@ class ClusterTest extends TestCase private $clusterIds = []; - public function testUserGetsClusterListForDashboard() - { + public function testUserGetsClusterListForDashboard() { $clusterCount = 1; $meterCount = 2; $transactionCount = 3; @@ -72,8 +70,7 @@ public function testUserGetsClusterListForDashboard() $this->assertEquals($response['data'][0]['clusterData']['meterCount'], $meterCount); } - public function testUserGetsClusterByIdForDashboard() - { + public function testUserGetsClusterByIdForDashboard() { $this->createTestData(); $response = $this->actingAs($this->user)->get(sprintf('/api/clusters/%s', $this->clusterIds[0])); $response->assertStatus(200); @@ -81,15 +78,13 @@ public function testUserGetsClusterByIdForDashboard() $this->assertEquals($response['data']['meterCount'], 1); } - public function testUserGetsClusterGeoDataById() - { + public function testUserGetsClusterGeoDataById() { $this->createTestData(); $response = $this->actingAs($this->user)->get(sprintf('/api/clusters/%s/geo', $this->clusterIds[0])); $response->assertStatus(200); } - public function testUserAddsNewCluster() - { + public function testUserAddsNewCluster() { $this->createTestData(); $clusterData = [ 'name' => 'test cluster', @@ -102,8 +97,7 @@ public function testUserAddsNewCluster() $this->assertEquals(Cluster::query()->count(), count($this->clusterIds) + 1); } - protected function createTestData($clusterCount = 1, $meterCount = 1, $transactionCount = 1) - { + protected function createTestData($clusterCount = 1, $meterCount = 1, $transactionCount = 1) { $this->user = UserFactory::new()->create(); $this->city = CityFactory::new()->create(); $this->company = CompanyFactory::new()->create(); @@ -223,8 +217,7 @@ protected function createTestData($clusterCount = 1, $meterCount = 1, $transacti } } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); @@ -232,8 +225,7 @@ public function actingAs($user, $driver = null) return $this; } - protected function generateUniqueNumber(): int - { + protected function generateUniqueNumber(): int { return $this->faker->unique()->randomNumber() + $this->faker->unique()->randomNumber() + $this->faker->unique()->randomNumber(); } diff --git a/src/backend/tests/Feature/ConnectionGroupTest.php b/src/backend/tests/Feature/ConnectionGroupTest.php index 9784e1d2c..5d1c58fb9 100644 --- a/src/backend/tests/Feature/ConnectionGroupTest.php +++ b/src/backend/tests/Feature/ConnectionGroupTest.php @@ -11,8 +11,7 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class ConnectionGroupTest extends TestCase -{ +class ConnectionGroupTest extends TestCase { use RefreshMultipleDatabases; use WithFaker; @@ -26,8 +25,7 @@ class ConnectionGroupTest extends TestCase private $connectonGroupIds = []; - public function testUserGetsConnectionGroupList() - { + public function testUserGetsConnectionGroupList() { $connectionGroupCount = 5; $this->createTestData($connectionGroupCount); $response = $this->actingAs($this->user)->get('/api/connection-groups'); @@ -35,8 +33,7 @@ public function testUserGetsConnectionGroupList() $this->assertEquals(count($response['data']), count($this->connectonGroupIds)); } - public function testUserGetsConnectionGroupById() - { + public function testUserGetsConnectionGroupById() { $connectionGroupCount = 5; $this->createTestData($connectionGroupCount); $response = $this->actingAs($this->user)->get(sprintf('/api/connection-groups/%s', $this->connectonGroupIds[0])); @@ -44,8 +41,7 @@ public function testUserGetsConnectionGroupById() $this->assertEquals($response['data']['id'], $this->connectonGroupIds[0]); } - public function testUserCreatesNewConnectionGroup() - { + public function testUserCreatesNewConnectionGroup() { $connectionGroupCount = 0; $this->createTestData($connectionGroupCount); $connectionGroupData = ['name' => 'Test Connection Group']; @@ -54,8 +50,7 @@ public function testUserCreatesNewConnectionGroup() $this->assertEquals($response['data']['name'], $connectionGroupData['name']); } - public function testUserUpdatesAConnectionGroup() - { + public function testUserUpdatesAConnectionGroup() { $connectionGroupCount = 1; $this->createTestData($connectionGroupCount); $connectionGroupData = ['name' => 'Updated Connection Group']; @@ -67,8 +62,7 @@ public function testUserUpdatesAConnectionGroup() $this->assertEquals($response['data']['name'], $connectionGroupData['name']); } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); @@ -76,8 +70,7 @@ public function actingAs($user, $driver = null) return $this; } - protected function createTestData($connectionGroupCount = 1) - { + protected function createTestData($connectionGroupCount = 1) { $this->user = UserFactory::new()->create(); $this->company = CompanyFactory::new()->create(); $this->companyDatabase = CompanyDatabaseFactory::new()->create(); diff --git a/src/backend/tests/Feature/ConnectionTypeTest.php b/src/backend/tests/Feature/ConnectionTypeTest.php index bb4b2fab8..647843e66 100644 --- a/src/backend/tests/Feature/ConnectionTypeTest.php +++ b/src/backend/tests/Feature/ConnectionTypeTest.php @@ -11,8 +11,7 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class ConnectionTypeTest extends TestCase -{ +class ConnectionTypeTest extends TestCase { use RefreshMultipleDatabases; use WithFaker; @@ -26,8 +25,7 @@ class ConnectionTypeTest extends TestCase private $connectonTypeIds = []; - public function testUserGetsConnectionTypeList() - { + public function testUserGetsConnectionTypeList() { $connectionTypeCount = 5; $this->createTestData($connectionTypeCount); $response = $this->actingAs($this->user)->get('/api/connection-types'); @@ -35,8 +33,7 @@ public function testUserGetsConnectionTypeList() $this->assertEquals(count($response['data']), count($this->connectonTypeIds)); } - public function testUserGetsConnectionTypeById() - { + public function testUserGetsConnectionTypeById() { $connectionTypeCount = 5; $this->createTestData($connectionTypeCount); $response = $this->actingAs($this->user)->get(sprintf('/api/connection-types/%s', $this->connectonTypeIds[0])); @@ -44,8 +41,7 @@ public function testUserGetsConnectionTypeById() $this->assertEquals($response['data']['id'], $this->connectonTypeIds[0]); } - public function testUserCreatesNewConnectionType() - { + public function testUserCreatesNewConnectionType() { $connectionTypeCount = 0; $this->createTestData($connectionTypeCount); $connectionTypeData = ['name' => 'Test Connection Type']; @@ -54,8 +50,7 @@ public function testUserCreatesNewConnectionType() $this->assertEquals($response['data']['name'], $connectionTypeData['name']); } - public function testUserUpdatesAConnectionType() - { + public function testUserUpdatesAConnectionType() { $connectionTypeCount = 1; $this->createTestData($connectionTypeCount); $connectionTypeData = ['name' => 'Updated Connection Type']; @@ -67,8 +62,7 @@ public function testUserUpdatesAConnectionType() $this->assertEquals($response['data']['name'], $connectionTypeData['name']); } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); @@ -76,8 +70,7 @@ public function actingAs($user, $driver = null) return $this; } - protected function createTestData($connectionTypeCount = 1) - { + protected function createTestData($connectionTypeCount = 1) { $this->user = UserFactory::new()->create(); $this->company = CompanyFactory::new()->create(); $this->companyDatabase = CompanyDatabaseFactory::new()->create(); diff --git a/src/backend/tests/Feature/CreateEnvironments.php b/src/backend/tests/Feature/CreateEnvironments.php index 43d8b9e46..33f380694 100644 --- a/src/backend/tests/Feature/CreateEnvironments.php +++ b/src/backend/tests/Feature/CreateEnvironments.php @@ -44,8 +44,7 @@ use Inensus\Ticket\Services\TicketUserService; use Tests\RefreshMultipleDatabases; -trait CreateEnvironments -{ +trait CreateEnvironments { use RefreshMultipleDatabases; use WithFaker; @@ -177,15 +176,13 @@ trait CreateEnvironments private $tickets = []; - protected function createTestData() - { + protected function createTestData() { $this->user = UserFactory::new()->create(); $this->company = CompanyFactory::new()->create(); $this->companyDatabase = CompanyDatabaseFactory::new()->create(); } - protected function createCluster($clusterCount = 1) - { + protected function createCluster($clusterCount = 1) { while ($clusterCount > 0) { $cluster = ClusterFactory::new()->create([ 'name' => $this->faker->unique()->companySuffix, @@ -200,8 +197,7 @@ protected function createCluster($clusterCount = 1) } } - protected function createMiniGrid($miniGridCount = 1) - { + protected function createMiniGrid($miniGridCount = 1) { while ($miniGridCount > 0) { $miniGrid = MiniGridFactory::new()->create([ 'cluster_id' => $this->getRandomIdFromList($this->clusters), @@ -216,8 +212,7 @@ protected function createMiniGrid($miniGridCount = 1) } } - protected function createCity($cityCount = 1) - { + protected function createCity($cityCount = 1) { while ($cityCount > 0) { $city = CityFactory::new()->create([ 'name' => $this->faker->unique()->citySuffix, @@ -234,8 +229,7 @@ protected function createCity($cityCount = 1) } } - protected function getMeter(): mixed - { + protected function getMeter(): mixed { $this->createTestData(); $meter = MeterFactory::new()->create([ 'meter_type_id' => $this->meterType->id, @@ -256,8 +250,7 @@ protected function getMeter(): mixed return $meter; } - protected function createMeterWithGeo(): void - { + protected function createMeterWithGeo(): void { $this->createTestData(); $meterCunt = 2; while ($meterCunt > 0) { @@ -296,8 +289,7 @@ protected function createMeterWithGeo(): void } } - protected function createMeterWithTransaction() - { + protected function createMeterWithTransaction() { $meter = $this->getMeter(); $this->transaction = TransactionFactory::new()->create([ 'id' => 1, @@ -326,8 +318,7 @@ protected function createMeterWithTransaction() return $meter; } - protected function createMetersWithDifferentMeterTypes($meterCountPerMeterType = 1): void - { + protected function createMetersWithDifferentMeterTypes($meterCountPerMeterType = 1): void { $meterTypeCount = count($this->meterTypes); while ($meterTypeCount > 0) { @@ -353,8 +344,7 @@ protected function createMetersWithDifferentMeterTypes($meterCountPerMeterType = } } - protected function createMeterManufacturer($manufacturerCount = 1): void - { + protected function createMeterManufacturer($manufacturerCount = 1): void { while ($manufacturerCount > 0) { $manufacturer = ManufacturerFactory::new()->create(); $address = Address::query()->make([ @@ -375,8 +365,7 @@ protected function createMeterManufacturer($manufacturerCount = 1): void } } - protected function createMeterTariff($meterTariffCount = 1, $withTimeOfUsage = false): void - { + protected function createMeterTariff($meterTariffCount = 1, $withTimeOfUsage = false): void { while ($meterTariffCount > 0) { $meterTariff = MeterTariffFactory::new()->create(); $this->meterTariffs[] = $meterTariff; @@ -397,8 +386,7 @@ protected function createMeterTariff($meterTariffCount = 1, $withTimeOfUsage = f } } - protected function createConnectionType($connectionTypeCount = 1, $subConnectionTypeCount = 1): void - { + protected function createConnectionType($connectionTypeCount = 1, $subConnectionTypeCount = 1): void { while ($connectionTypeCount > 0) { $connectionType = ConnectionTypeFactory::new()->create(); $this->connectonTypes[] = $connectionType; @@ -423,8 +411,7 @@ protected function createConnectionType($connectionTypeCount = 1, $subConnection } } - protected function createConnectionGroup($connectionGroupCount = 1): void - { + protected function createConnectionGroup($connectionGroupCount = 1): void { while ($connectionGroupCount > 0) { $connectionGroup = ConnectionGroupFactory::new()->create(); $this->connectionGroups[] = $connectionGroup; @@ -435,8 +422,7 @@ protected function createConnectionGroup($connectionGroupCount = 1): void } } - protected function createMeterType($meterTypeCount = 1): void - { + protected function createMeterType($meterTypeCount = 1): void { while ($meterTypeCount > 0) { $meterType = MeterTypeFactory::new()->create(); $this->meterTypes[] = $meterType; @@ -449,8 +435,7 @@ protected function createMeterType($meterTypeCount = 1): void } } - protected function createMeter($meterCount = 1): void - { + protected function createMeter($meterCount = 1): void { while ($meterCount > 0) { $meter = MeterFactory::new()->create([ 'meter_type_id' => $this->meterType->id, @@ -487,8 +472,7 @@ protected function createMeter($meterCount = 1): void } } - protected function createTarget($targetCount = 1): void - { + protected function createTarget($targetCount = 1): void { while ($targetCount > 0) { $target = TargetFactory::new()->create(); $this->targets[] = $target; @@ -499,8 +483,7 @@ protected function createTarget($targetCount = 1): void } } - protected function createSubTarget($subTargetCount = 1): void - { + protected function createSubTarget($subTargetCount = 1): void { while ($subTargetCount > 0) { $subTarget = SubTargetFactory::new()->create([ 'target_id' => $this->getRandomIdFromList($this->targets), @@ -514,8 +497,7 @@ protected function createSubTarget($subTargetCount = 1): void } } - protected function createPerson($personCount = 1, $isCustomer = 1) - { + protected function createPerson($personCount = 1, $isCustomer = 1) { while ($personCount > 0) { $person = PersonFactory::new()->create(['is_customer' => $isCustomer]); $this->people[] = $person; @@ -537,8 +519,7 @@ protected function createPerson($personCount = 1, $isCustomer = 1) } } - protected function createAgent($agentCount = 1) - { + protected function createAgent($agentCount = 1) { $this->createPerson($agentCount, 0); foreach ($this->people as $person) { @@ -556,8 +537,7 @@ protected function createAgent($agentCount = 1) } } - protected function createAgentCommission($agentCommissionCount = 1) - { + protected function createAgentCommission($agentCommissionCount = 1) { while ($agentCommissionCount > 0) { $agentCommission = AgentCommissionFactory::new()->create(); $this->agentCommissions[] = $agentCommission; @@ -569,8 +549,7 @@ protected function createAgentCommission($agentCommissionCount = 1) } } - protected function createAssetType($assetTypeCount = 1) - { + protected function createAssetType($assetTypeCount = 1) { while ($assetTypeCount > 0) { $assetType = AssetTypeFactory::new()->create(); $this->assetTypes[] = $assetType; @@ -582,8 +561,7 @@ protected function createAssetType($assetTypeCount = 1) } } - protected function createAssignedAppliances($applianceCount = 1) - { + protected function createAssignedAppliances($applianceCount = 1) { $this->createAssetType($applianceCount); while ($applianceCount > 0) { $assignedAppliance = AgentAssignedApplianceFactory::new()->create([ @@ -601,8 +579,7 @@ protected function createAssignedAppliances($applianceCount = 1) } } - protected function createAgentSoldAppliance($soldApplianceCount = 1) - { + protected function createAgentSoldAppliance($soldApplianceCount = 1) { while ($soldApplianceCount > 0) { $assignedApplianceId = $this->getRandomIdFromList($this->assignedAppliances); $assignedAppliance = collect($this->assignedAppliances)->where('id', $assignedApplianceId)->first(); @@ -631,8 +608,7 @@ protected function createAgentSoldAppliance($soldApplianceCount = 1) } } - protected function createAgentReceipt($agentReceiptCount = 1, $amount = 50) - { + protected function createAgentReceipt($agentReceiptCount = 1, $amount = 50) { while ($agentReceiptCount > 0) { $agentReceipt = AgentReceiptFactory::new()->create([ 'user_id' => 1, @@ -649,8 +625,7 @@ protected function createAgentReceipt($agentReceiptCount = 1, $amount = 50) } } - protected function createAgentBalanceHistory($agentBalanceHistoryCount = 1) - { + protected function createAgentBalanceHistory($agentBalanceHistoryCount = 1) { while ($agentBalanceHistoryCount > 0) { $agentBalanceHistory = AgentBalanceHistoryFactory::new()->create([ 'agent_id' => $this->getRandomIdFromList($this->agents), @@ -670,8 +645,7 @@ protected function createAgentBalanceHistory($agentBalanceHistoryCount = 1) } } - protected function createAgentTransaction($agentTransactionCount = 1, $amount = 100, $agentId = null) - { + protected function createAgentTransaction($agentTransactionCount = 1, $amount = 100, $agentId = null) { while ($agentTransactionCount > 0) { $meter = $this->getMeter(); @@ -750,8 +724,7 @@ protected function createAgentTransaction($agentTransactionCount = 1, $amount = } } - protected function createPaymentHistory($paymentHistoryCount = 1, $amount = 100, $agentId = null) - { + protected function createPaymentHistory($paymentHistoryCount = 1, $amount = 100, $agentId = null) { while ($paymentHistoryCount > 0) { $paymentHistory = PaymentHistoryFactory::new()->make([ 'id' => 1, @@ -792,8 +765,7 @@ protected function createPaymentHistory($paymentHistoryCount = 1, $amount = 100, } } - protected function createTicketCategory($ticketCategoryCount = 1) - { + protected function createTicketCategory($ticketCategoryCount = 1) { while ($ticketCategoryCount > 0) { $ticketCategory = TicketCategoryFactory::new()->create(); $this->ticketCategories[] = $ticketCategory; @@ -805,8 +777,7 @@ protected function createTicketCategory($ticketCategoryCount = 1) } } - protected function createTicket($ticketCount = 1, $status = 0, $customerId = null, $agentId = null) - { + protected function createTicket($ticketCount = 1, $status = 0, $customerId = null, $agentId = null) { while ($ticketCount > 0) { $trelloParams = [ 'idList' => $this->ticketCard->card_id, @@ -838,24 +809,20 @@ protected function createTicket($ticketCount = 1, $status = 0, $customerId = nul } } - protected function createTicketBoard() - { + protected function createTicketBoard() { $this->ticketBoard = TicketBoardFactory::new()->create(); } - protected function createTicketCard() - { + protected function createTicketCard() { $this->ticketCard = TicketCardFactory::new()->create(); } - protected function createTicketOutsourceReport($ticketOutSourceReportCount = 1) - { + protected function createTicketOutsourceReport($ticketOutSourceReportCount = 1) { while ($ticketOutSourceReportCount > 0) { } } - protected function createTicketUser($ticketUserCount = 1, $tag = 'inensusinensus') - { + protected function createTicketUser($ticketUserCount = 1, $tag = 'inensusinensus') { $ticketUserService = app()->make(TicketUserService::class); $externalUser = $ticketUserService->getByTag($tag); @@ -875,8 +842,7 @@ protected function createTicketUser($ticketUserCount = 1, $tag = 'inensusinensus } } - private function getRandomIdFromList(array $list, $startIndex = 1, $endIndex = null): int - { + private function getRandomIdFromList(array $list, $startIndex = 1, $endIndex = null): int { $ids = collect($list)->pluck('id')->toArray(); if ($endIndex === null) { diff --git a/src/backend/tests/Feature/EnergyTransactionProcessorTest.php b/src/backend/tests/Feature/EnergyTransactionProcessorTest.php index 3ca435eec..8622de553 100644 --- a/src/backend/tests/Feature/EnergyTransactionProcessorTest.php +++ b/src/backend/tests/Feature/EnergyTransactionProcessorTest.php @@ -21,13 +21,11 @@ use Illuminate\Support\Facades\Queue; use Tests\TestCase; -class EnergyTransactionProcessorTest extends TestCase -{ +class EnergyTransactionProcessorTest extends TestCase { use RefreshDatabase; use WithFaker; - public function testWithValidData() - { + public function testWithValidData() { Queue::fake(); PersonFactory::new()->create(); MeterTariffFactory::new()->create(); diff --git a/src/backend/tests/Feature/ManufacturerTest.php b/src/backend/tests/Feature/ManufacturerTest.php index 602ffdbe6..7f4c826b8 100644 --- a/src/backend/tests/Feature/ManufacturerTest.php +++ b/src/backend/tests/Feature/ManufacturerTest.php @@ -5,12 +5,10 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class ManufacturerTest extends TestCase -{ +class ManufacturerTest extends TestCase { use CreateEnvironments; - public function testUserGetsManufacturerList() - { + public function testUserGetsManufacturerList() { $this->createTestData(); $manufacturerCount = 4; $this->createMeterManufacturer($manufacturerCount); @@ -19,8 +17,7 @@ public function testUserGetsManufacturerList() $this->assertEquals(count($response['data']), count($this->manufacturers)); } - public function testUserGetsManufacturerById() - { + public function testUserGetsManufacturerById() { $this->createTestData(); $this->createMeterManufacturer(); $response = $this->actingAs($this->user)->get(sprintf('/api/manufacturers/%s', $this->manufacturers[0]->id)); @@ -28,8 +25,7 @@ public function testUserGetsManufacturerById() $this->assertEquals($response['data']['id'], $this->manufacturers[0]->id); } - public function testUserCreatesNewManufacturer() - { + public function testUserCreatesNewManufacturer() { $this->createTestData(); $this->createCity(); $manufacturerData = [ @@ -45,8 +41,7 @@ public function testUserCreatesNewManufacturer() $this->assertEquals($response['data']['name'], $manufacturerData['name']); } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); diff --git a/src/backend/tests/Feature/MeterParameterTest.php b/src/backend/tests/Feature/MeterParameterTest.php index a31b9530e..8f79eaa84 100644 --- a/src/backend/tests/Feature/MeterParameterTest.php +++ b/src/backend/tests/Feature/MeterParameterTest.php @@ -20,13 +20,11 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class MeterParameterTest extends TestCase -{ +class MeterParameterTest extends TestCase { use RefreshMultipleDatabases; use WithFaker; - public function testUserAssignsAMeterParameterToAMeter() - { + public function testUserAssignsAMeterParameterToAMeter() { $this->withExceptionHandling(); $user = UserFactory::new()->create(); $city = CityFactory::new()->create(); @@ -62,8 +60,7 @@ public function testUserAssignsAMeterParameterToAMeter() $this->assertEquals($geographicalInformation->points, $meterParameterData['geo_points']); } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); diff --git a/src/backend/tests/Feature/MeterTariffTest.php b/src/backend/tests/Feature/MeterTariffTest.php index 3844fe18b..4f73fc280 100644 --- a/src/backend/tests/Feature/MeterTariffTest.php +++ b/src/backend/tests/Feature/MeterTariffTest.php @@ -11,12 +11,10 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class MeterTariffTest extends TestCase -{ +class MeterTariffTest extends TestCase { use CreateEnvironments; - public function testUserGetsMeterTariffList() - { + public function testUserGetsMeterTariffList() { $this->createTestData(); $meterTariffCount = 5; $this->createMeterTariff($meterTariffCount); @@ -25,8 +23,7 @@ public function testUserGetsMeterTariffList() $this->assertEquals(count($response['data']), count($this->meterTariffs)); } - public function testUserGetsMeterTariffById() - { + public function testUserGetsMeterTariffById() { $this->createTestData(); $this->createMeterTariff(); $response = $this->actingAs($this->user)->get(sprintf('/api/tariffs/%s', $this->meterTariffs[0]->id)); @@ -34,8 +31,7 @@ public function testUserGetsMeterTariffById() $this->assertEquals($response['data']['id'], $this->meterTariffs[0]->id); } - public function testUserUpdatesAMeterTariff() - { + public function testUserUpdatesAMeterTariff() { Queue::fake(); $this->createTestData(); $this->createMeterTariff(); @@ -80,8 +76,7 @@ public function testUserUpdatesAMeterTariff() $this->assertEquals($this->meterTariffs[0]->id, AccessRate::query()->first()->tariff_id); } - public function testUserCreatesBasicTariff(): void - { + public function testUserCreatesBasicTariff(): void { $this->createTestData(); $tariffData = [ 'name' => 'Tariff', @@ -95,8 +90,7 @@ public function testUserCreatesBasicTariff(): void $this->assertEquals(10000, MeterTariff::first()->total_price); } - public function testUserCreatesTariffWithPriceComponents(): void - { + public function testUserCreatesTariffWithPriceComponents(): void { Queue::fake(); $this->createTestData(); $tariffData = [ @@ -116,8 +110,7 @@ public function testUserCreatesTariffWithPriceComponents(): void $this->assertCount(1, MeterTariff::all()); } - public function testUserCreatesTariffWithSocialInputs(): void - { + public function testUserCreatesTariffWithSocialInputs(): void { $this->createTestData(); $tariffData = [ 'name' => 'Tariff', @@ -137,8 +130,7 @@ public function testUserCreatesTariffWithSocialInputs(): void $this->assertEquals(MeterTariff::query()->first()->id, SocialTariff::query()->first()->tariff_id); } - public function testUserCreatesTariffWithTimeOfUsages(): void - { + public function testUserCreatesTariffWithTimeOfUsages(): void { $this->createTestData(); $tariffData = [ 'name' => 'Test Tariff', @@ -166,8 +158,7 @@ public function testUserCreatesTariffWithTimeOfUsages(): void $this->assertEquals(MeterTariff::query()->first()->id, TimeOfUsage::query()->first()->tariff_id); } - public function testUserCreatesTariffWithAccessRate(): void - { + public function testUserCreatesTariffWithAccessRate(): void { $this->createTestData(); $tariffData = [ 'name' => 'Test Tariff', @@ -185,8 +176,7 @@ public function testUserCreatesTariffWithAccessRate(): void $this->assertEquals(MeterTariff::query()->first()->id, AccessRate::query()->first()->tariff_id); } - public function testUserGetsMeterListForATariff(): void - { + public function testUserGetsMeterListForATariff(): void { $this->createTestData(); $this->createMeterManufacturer(); $this->createMeterType(); @@ -205,8 +195,7 @@ public function testUserGetsMeterListForATariff(): void $this->assertEquals($response['data']['count'], $meterCount); } - public function testComponentPriceChangesTotalPrice(): void - { + public function testComponentPriceChangesTotalPrice(): void { $this->createTestData(); $this->createMeterTariff(); $tariff = $this->meterTariff; @@ -224,8 +213,7 @@ public function testComponentPriceChangesTotalPrice(): void $this->assertEquals($tariffPrice + 200000, $updatedTariff->total_price); } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); diff --git a/src/backend/tests/Feature/MeterTest.php b/src/backend/tests/Feature/MeterTest.php index 7fb73bb1d..556141ef2 100644 --- a/src/backend/tests/Feature/MeterTest.php +++ b/src/backend/tests/Feature/MeterTest.php @@ -26,8 +26,7 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class MeterTest extends TestCase -{ +class MeterTest extends TestCase { use RefreshMultipleDatabases; use WithFaker; @@ -55,8 +54,7 @@ class MeterTest extends TestCase private $transaction; - public function testUserGetsMeterList() - { + public function testUserGetsMeterList() { $this->createTestData(); $meterCunt = 5; while ($meterCunt > 0) { @@ -82,8 +80,7 @@ public function testUserGetsMeterList() $this->assertEquals(5, count($response['data'])); } - public function testUserCreatesAMeter() - { + public function testUserCreatesAMeter() { $this->createTestData(); $meterData = [ 'serial_number' => '123456789', @@ -97,24 +94,21 @@ public function testUserCreatesAMeter() $this->assertEquals($meter->serial_number, $meterData['serial_number']); } - public function testUserGetsMeterBySerialNumber() - { + public function testUserGetsMeterBySerialNumber() { $meter = $this->getMeter(); $response = $this->actingAs($this->user)->get(sprintf('/api/meters/%s', $meter->serial_number)); $response->assertStatus(200); $this->assertEquals($meter->serial_number, $response['data']['serial_number']); } - public function testUserSearchesMetersBySerialNumber() - { + public function testUserSearchesMetersBySerialNumber() { $meter = $this->getMeter(); $response = $this->actingAs($this->user)->get(sprintf('/api/meters/search?term=%s', $meter->serial_number)); $response->assertStatus(200); $this->assertEquals($response['data'][0]['id'], $meter->id); } - public function testUserSearchesMeterByTariffName() - { + public function testUserSearchesMeterByTariffName() { $meter = $this->getMeter(); $response = $this->actingAs($this->user)->get(sprintf( '/api/meters/search?term=%s', @@ -124,8 +118,7 @@ public function testUserSearchesMeterByTariffName() $this->assertEquals($response['data'][0]['id'], $meter->id); } - public function testUserUpdatesMetersGeolocation() - { + public function testUserUpdatesMetersGeolocation() { $this->createMeterWithGeo(); $meterData = [ ['lat' => '444', 'lng' => '555', 'id' => 1], @@ -135,8 +128,7 @@ public function testUserUpdatesMetersGeolocation() $response->assertStatus(200); } - public function testUserGetsPersonMeters() - { + public function testUserGetsPersonMeters() { $meter = $this->getMeter(); $response = $this->actingAs($this->user)->get(sprintf( '/api/people/%s/meters', @@ -147,8 +139,7 @@ public function testUserGetsPersonMeters() $this->assertEquals(count($response['data']['meters']), $metersCount); } - public function testUserGetsPersonMetersGeographicalInformation() - { + public function testUserGetsPersonMetersGeographicalInformation() { $this->createMeterWithGeo(); $response = $this->actingAs($this->user)->get(sprintf( '/api/people/%s/meters/geo', @@ -157,8 +148,7 @@ public function testUserGetsPersonMetersGeographicalInformation() $response->assertStatus(200); } - public function testUserGetsMetersTransactions() - { + public function testUserGetsMetersTransactions() { $meter = $this->createMeterWithTransaction(); $response = $this->actingAs($this->user)->get(sprintf( '/api/meters/%s/transactions', @@ -169,8 +159,7 @@ public function testUserGetsMetersTransactions() $this->assertEquals($response['data'][0]['id'], $this->transaction->id); } - public function testUserGetsMeterRevenueBySerialNumber() - { + public function testUserGetsMeterRevenueBySerialNumber() { $meter = $this->createMeterWithTransaction(); $response = $this->actingAs($this->user)->get(sprintf( '/api/meters/%s/revenue', @@ -180,8 +169,7 @@ public function testUserGetsMeterRevenueBySerialNumber() $this->assertEquals($response['data']['revenue'], $this->transaction->amount); } - public function testUserGetsMeterConsumptions() - { + public function testUserGetsMeterConsumptions() { $meter = $this->createMeterWithTransaction(); $consumption = MeterConsumptionFactory::new()->create(); $response = $this->actingAs($this->user)->get(sprintf( @@ -195,15 +183,13 @@ public function testUserGetsMeterConsumptions() $this->assertEquals($response['data'][0]['meter_id'], $meter->id); } - public function testUserDeletesAMeter() - { + public function testUserDeletesAMeter() { $meter = $this->getMeter(); $response = $this->actingAs($this->user)->delete(sprintf('/api/meters/%s', $meter->id)); $response->assertStatus(204); } - protected function createTestData() - { + protected function createTestData() { $this->user = UserFactory::new()->create(); $this->city = CityFactory::new()->create(); $this->company = CompanyFactory::new()->create(); @@ -216,8 +202,7 @@ protected function createTestData() $this->person = PersonFactory::new()->create(); } - protected function getMeter(): mixed - { + protected function getMeter(): mixed { $this->createTestData(); $meter = MeterFactory::new()->create([ 'meter_type_id' => $this->meterType->id, @@ -238,8 +223,7 @@ protected function getMeter(): mixed return $meter; } - protected function createMeterWithGeo(): void - { + protected function createMeterWithGeo(): void { $this->createTestData(); $meterCunt = 2; while ($meterCunt > 0) { @@ -278,8 +262,7 @@ protected function createMeterWithGeo(): void } } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); @@ -287,8 +270,7 @@ public function actingAs($user, $driver = null) return $this; } - protected function createMeterWithTransaction() - { + protected function createMeterWithTransaction() { $meter = $this->getMeter(); $this->transaction = TransactionFactory::new()->create([ 'id' => 1, diff --git a/src/backend/tests/Feature/MeterTypeTest.php b/src/backend/tests/Feature/MeterTypeTest.php index 6444a5519..7667c9836 100644 --- a/src/backend/tests/Feature/MeterTypeTest.php +++ b/src/backend/tests/Feature/MeterTypeTest.php @@ -5,12 +5,10 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class MeterTypeTest extends TestCase -{ +class MeterTypeTest extends TestCase { use CreateEnvironments; - public function testUserGetsMeterTypeList() - { + public function testUserGetsMeterTypeList() { $connectionTypeCount = 1; $subConnectionTypeCount = 1; $meterTypeCount = 5; @@ -24,8 +22,7 @@ public function testUserGetsMeterTypeList() $this->assertEquals(count($response['data']), count($this->meterTypes)); } - public function testUserGetsMeterTypeById() - { + public function testUserGetsMeterTypeById() { $connectionTypeCount = 1; $subConnectionTypeCount = 1; $meterTypeCount = 5; @@ -40,8 +37,7 @@ public function testUserGetsMeterTypeById() $this->assertEquals($response['data']['phase'], $this->meterTypes[0]->phase); } - public function testUserCreatesNewMeterType() - { + public function testUserCreatesNewMeterType() { $connectionTypeCount = 0; $subConnectionTypeCount = 0; $meterTypeCount = 0; @@ -61,8 +57,7 @@ public function testUserCreatesNewMeterType() $this->assertEquals($response['data']['phase'], $meterTypeData['phase']); } - public function testUserUpdatesAMeterType() - { + public function testUserUpdatesAMeterType() { $meterTypeCount = 1; $meterTariffCount = 1; $this->createTestData(); @@ -81,8 +76,7 @@ public function testUserUpdatesAMeterType() $this->assertEquals($response['data']['phase'], $meterTypeData['phase']); } - public function testUserGetsMeterTypesWithMeterRelationByMeterTypeId() - { + public function testUserGetsMeterTypesWithMeterRelationByMeterTypeId() { $connectionTypeCount = 2; $this->createTestData(); $this->createMeterTariff(); @@ -100,8 +94,7 @@ public function testUserGetsMeterTypesWithMeterRelationByMeterTypeId() $this->assertEquals(count($response['data']['meters']), 1); } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); diff --git a/src/backend/tests/Feature/MiniGridRevenueTest.php b/src/backend/tests/Feature/MiniGridRevenueTest.php index 92959e5d1..047332e72 100644 --- a/src/backend/tests/Feature/MiniGridRevenueTest.php +++ b/src/backend/tests/Feature/MiniGridRevenueTest.php @@ -29,8 +29,7 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class MiniGridRevenueTest extends TestCase -{ +class MiniGridRevenueTest extends TestCase { use RefreshMultipleDatabases; use WithFaker; @@ -64,8 +63,7 @@ class MiniGridRevenueTest extends TestCase private $soldEnergy; - public function testUserGetsSoldEnergyOfAMiniGridWithDefaultPeriod() - { + public function testUserGetsSoldEnergyOfAMiniGridWithDefaultPeriod() { $clusterCount = 1; $meterCount = 2; $transactionCount = 1; @@ -77,8 +75,7 @@ public function testUserGetsSoldEnergyOfAMiniGridWithDefaultPeriod() $this->assertEquals($soldEnergy, round($this->soldEnergy, 3)); } - public function testUserGetsSoldEnergyOfAMiniGridWithPeriod() - { + public function testUserGetsSoldEnergyOfAMiniGridWithPeriod() { $clusterCount = 1; $meterCount = 2; $transactionCount = 1; @@ -94,8 +91,7 @@ public function testUserGetsSoldEnergyOfAMiniGridWithPeriod() $this->assertEquals($soldEnergy, round($this->soldEnergy, 3)); } - public function testUserGetsTransactionRevenuesOfAMiniGridWithDefaultPeriod() - { + public function testUserGetsTransactionRevenuesOfAMiniGridWithDefaultPeriod() { $this->withExceptionHandling(); $clusterCount = 1; $meterCount = 2; @@ -108,8 +104,7 @@ public function testUserGetsTransactionRevenuesOfAMiniGridWithDefaultPeriod() $this->assertEquals($revenue, $this->getTotalTransactionAmount()); } - public function testUserGetsTransactionRevenuesOfAMiniGridWithPeriod() - { + public function testUserGetsTransactionRevenuesOfAMiniGridWithPeriod() { $clusterCount = 1; $meterCount = 2; $transactionCount = 1; @@ -126,8 +121,7 @@ public function testUserGetsTransactionRevenuesOfAMiniGridWithPeriod() $this->assertEquals($revenue, $this->getTotalTransactionAmount()); } - protected function getTotalTransactionAmount() - { + protected function getTotalTransactionAmount() { $clusterIds = $this->clusterIds; return Transaction::query() @@ -160,8 +154,7 @@ static function ($q) { )->get()->pluck('amount')->sum(); } - protected function createTestData($clusterCount = 1, $meterCount = 1, $transactionCount = 1) - { + protected function createTestData($clusterCount = 1, $meterCount = 1, $transactionCount = 1) { $this->user = UserFactory::new()->create(); $this->city = CityFactory::new()->create(); $this->company = CompanyFactory::new()->create(); @@ -285,8 +278,7 @@ protected function createTestData($clusterCount = 1, $meterCount = 1, $transacti } } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); @@ -294,8 +286,7 @@ public function actingAs($user, $driver = null) return $this; } - protected function generateUniqueNumber(): int - { + protected function generateUniqueNumber(): int { return $this->faker->unique()->randomNumber() + $this->faker->unique()->randomNumber() + $this->faker->unique()->randomNumber() + $this->faker->unique()->randomNumber() + $this->faker->unique()->randomNumber(); diff --git a/src/backend/tests/Feature/MiniGridTest.php b/src/backend/tests/Feature/MiniGridTest.php index 34ec2b034..096e0b126 100644 --- a/src/backend/tests/Feature/MiniGridTest.php +++ b/src/backend/tests/Feature/MiniGridTest.php @@ -15,8 +15,7 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class MiniGridTest extends TestCase -{ +class MiniGridTest extends TestCase { use RefreshMultipleDatabases; use WithFaker; @@ -32,8 +31,7 @@ class MiniGridTest extends TestCase private $miniGridIds = []; - public function testUserGetsMiniGridList() - { + public function testUserGetsMiniGridList() { $clusterCount = 1; $miniGridCount = 2; $this->createTestData($clusterCount, $miniGridCount); @@ -42,8 +40,7 @@ public function testUserGetsMiniGridList() $this->assertEquals(count($response['data']), count($this->miniGridIds)); } - public function testUserGetsMiniGridById() - { + public function testUserGetsMiniGridById() { $clusterCount = 1; $miniGridCount = 2; $this->createTestData($clusterCount, $miniGridCount); @@ -52,8 +49,7 @@ public function testUserGetsMiniGridById() $this->assertEquals($response['data']['id'], $this->miniGridIds[0]); } - public function testUserGetsMiniGridByIdWithGeographicalInformation() - { + public function testUserGetsMiniGridByIdWithGeographicalInformation() { $clusterCount = 1; $miniGridCount = 2; $this->createTestData($clusterCount, $miniGridCount); @@ -62,8 +58,7 @@ public function testUserGetsMiniGridByIdWithGeographicalInformation() $this->assertEquals(array_key_exists('location', $response['data']), true); } - public function testUserCreatesNewMiniGrid() - { + public function testUserCreatesNewMiniGrid() { $clusterCount = 1; $miniGridCount = 0; $this->createTestData($clusterCount, $miniGridCount); @@ -81,8 +76,7 @@ public function testUserCreatesNewMiniGrid() $this->assertEquals(count(MiniGrid::query()->get()), 1); } - public function testUserUpdatesAMiniGrid() - { + public function testUserUpdatesAMiniGrid() { $clusterCount = 1; $miniGridCount = 1; $this->createTestData($clusterCount, $miniGridCount); @@ -95,8 +89,7 @@ public function testUserUpdatesAMiniGrid() $this->assertEquals($response['data']['name'], $miGridData['name']); } - protected function createTestData($clusterCount = 1, $miniGridCount = 1) - { + protected function createTestData($clusterCount = 1, $miniGridCount = 1) { $this->user = UserFactory::new()->create(); $this->company = CompanyFactory::new()->create(); $this->companyDatabase = CompanyDatabaseFactory::new()->create(); @@ -130,8 +123,7 @@ protected function createTestData($clusterCount = 1, $miniGridCount = 1) } } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); @@ -139,8 +131,7 @@ public function actingAs($user, $driver = null) return $this; } - protected function generateUniqueNumber(): int - { + protected function generateUniqueNumber(): int { return $this->faker->unique()->randomNumber() + $this->faker->unique()->randomNumber() + $this->faker->unique()->randomNumber(); } diff --git a/src/backend/tests/Feature/PersonTest.php b/src/backend/tests/Feature/PersonTest.php index 27cf4f480..46e4a3dcb 100644 --- a/src/backend/tests/Feature/PersonTest.php +++ b/src/backend/tests/Feature/PersonTest.php @@ -18,13 +18,11 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class PersonTest extends TestCase -{ +class PersonTest extends TestCase { use RefreshMultipleDatabases; use WithFaker; - public function testUserGetsCustomerList() - { + public function testUserGetsCustomerList() { $user = UserFactory::new()->create(); $city = CityFactory::new()->create(); $company = CompanyFactory::new()->create(); @@ -44,8 +42,7 @@ public function testUserGetsCustomerList() $this->assertEquals(2, count($response['data'])); } - public function testUserGetsAllRegisteredPersonList() - { + public function testUserGetsAllRegisteredPersonList() { $user = UserFactory::new()->create(); $city = CityFactory::new()->create(); $company = CompanyFactory::new()->create(); @@ -57,8 +54,7 @@ public function testUserGetsAllRegisteredPersonList() $this->assertEquals(2, count($response['data'])); } - public function testUserGetPersonById() - { + public function testUserGetPersonById() { $user = UserFactory::new()->create(); $city = CityFactory::new()->create(); $company = CompanyFactory::new()->create(); @@ -69,8 +65,7 @@ public function testUserGetPersonById() $this->assertEquals($response['data']['name'], $person->name); } - public function testUserCanCreateNewPersonAsACustomer() - { + public function testUserCanCreateNewPersonAsACustomer() { $this->withExceptionHandling(); $user = UserFactory::new()->create(); $city = CityFactory::new()->create(); @@ -99,8 +94,7 @@ public function testUserCanCreateNewPersonAsACustomer() $this->assertEquals($personAddress->street, $postData['street']); } - public function testUserCanCreateNewPersonAsAMaintenanceUser() - { + public function testUserCanCreateNewPersonAsAMaintenanceUser() { $this->withExceptionHandling(); $user = UserFactory::new()->create(); $city = CityFactory::new()->create(); @@ -132,8 +126,7 @@ public function testUserCanCreateNewPersonAsAMaintenanceUser() $this->assertEquals($maintenanceUser->person->name, $postData['name']); } - public function testUserCanUpdateAPerson() - { + public function testUserCanUpdateAPerson() { $user = UserFactory::new()->create(); $city = CityFactory::new()->create(); $company = CompanyFactory::new()->create(); @@ -154,8 +147,7 @@ public function testUserCanUpdateAPerson() $this->assertEquals($updatedPerson->surname, 'updated surname'); } - public function testUserCanSearchAPersonByName() - { + public function testUserCanSearchAPersonByName() { $user = UserFactory::new()->create(); $city = CityFactory::new()->create(); $company = CompanyFactory::new()->create(); @@ -165,8 +157,7 @@ public function testUserCanSearchAPersonByName() $this->assertEquals($response['data'][0]['id'], $person->id); } - public function testUserCanSearchAPersonByPhoneNumber() - { + public function testUserCanSearchAPersonByPhoneNumber() { $user = UserFactory::new()->create(); $city = CityFactory::new()->create(); $company = CompanyFactory::new()->create(); @@ -180,8 +171,7 @@ public function testUserCanSearchAPersonByPhoneNumber() $this->assertEquals($responseData['addresses'][0]['phone'], $address->phone); } - public function testUserCanGetPersonsTransactions() - { + public function testUserCanGetPersonsTransactions() { $user = UserFactory::new()->create(); $city = CityFactory::new()->create(); $company = CompanyFactory::new()->create(); @@ -206,8 +196,7 @@ public function testUserCanGetPersonsTransactions() $this->assertEquals($transaction->amount, $response['data'][0]['amount']); } - public function testUserCanDeleteAPerson() - { + public function testUserCanDeleteAPerson() { $user = UserFactory::new()->create(); $city = CityFactory::new()->create(); $company = CompanyFactory::new()->create(); @@ -218,8 +207,7 @@ public function testUserCanDeleteAPerson() $this->assertEquals(0, $personListCount); } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); diff --git a/src/backend/tests/Feature/SendSmsTest.php b/src/backend/tests/Feature/SendSmsTest.php index d22ee01a7..439a12c67 100644 --- a/src/backend/tests/Feature/SendSmsTest.php +++ b/src/backend/tests/Feature/SendSmsTest.php @@ -23,12 +23,10 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class SendSmsTest extends TestCase -{ +class SendSmsTest extends TestCase { use RefreshDatabase; - public function testStoreAndSend() - { + public function testStoreAndSend() { Queue::fake(); $this->withoutExceptionHandling(); $person = $this->initializeData(); @@ -40,8 +38,7 @@ public function testStoreAndSend() $this->assertEquals(1, $smsCount); } - private function initializeData() - { + private function initializeData() { $bodies = [ [ 'reference' => 'SmsTransactionHeader', @@ -202,8 +199,7 @@ private function initializeData() return $p; } - private function getData($person, $user): array - { + private function getData($person, $user): array { $data = [ 'person_id' => $person->id, 'message' => 'Its a dummy message', @@ -213,8 +209,7 @@ private function getData($person, $user): array return $data; } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); @@ -222,8 +217,7 @@ public function actingAs($user, $driver = null) return $this; } - public function testStoreSms() - { + public function testStoreSms() { Queue::fake(); $this->withoutExceptionHandling(); $person = $this->initializeData(); diff --git a/src/backend/tests/Feature/SocialTariffPiggyBankTest.php b/src/backend/tests/Feature/SocialTariffPiggyBankTest.php index 92d1d5767..5d5df2c73 100644 --- a/src/backend/tests/Feature/SocialTariffPiggyBankTest.php +++ b/src/backend/tests/Feature/SocialTariffPiggyBankTest.php @@ -17,14 +17,12 @@ use Illuminate\Support\Facades\Queue; use Tests\TestCase; -class SocialTariffPiggyBankTest extends TestCase -{ +class SocialTariffPiggyBankTest extends TestCase { use RefreshDatabase; use WithFaker; /** @test */ - public function testAddPiggyBankBalance() - { + public function testAddPiggyBankBalance() { MeterTariffFactory::new()->create(); MeterTariff::first()->socialTariff()->create([ 'tariff_id' => 1, @@ -59,8 +57,7 @@ public function testAddPiggyBankBalance() } /** @test */ - public function changeTariffAndResetSavings() - { + public function changeTariffAndResetSavings() { Queue::fake(); // create tariff MeterTariffFactory::new()->times(2)->create(); diff --git a/src/backend/tests/Feature/SubConnectionTypeTest.php b/src/backend/tests/Feature/SubConnectionTypeTest.php index 5fe69e2f6..feab24ad5 100644 --- a/src/backend/tests/Feature/SubConnectionTypeTest.php +++ b/src/backend/tests/Feature/SubConnectionTypeTest.php @@ -5,12 +5,10 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class SubConnectionTypeTest extends TestCase -{ +class SubConnectionTypeTest extends TestCase { use CreateEnvironments; - public function testUserGetsSubConnectionTypeList() - { + public function testUserGetsSubConnectionTypeList() { $connectionTypeCount = 1; $subConnectionTypeCount = 1; $meterTariffCount = 1; @@ -22,8 +20,7 @@ public function testUserGetsSubConnectionTypeList() $this->assertEquals(count($response['data']), count($this->subConnectionTypes)); } - public function testUserGetsSubConnectionTypesByConnectionTypeId() - { + public function testUserGetsSubConnectionTypesByConnectionTypeId() { $connectionTypeCount = 2; $subConnectionTypeCount = 1; $meterTariffCount = 1; @@ -38,8 +35,7 @@ public function testUserGetsSubConnectionTypesByConnectionTypeId() $this->assertEquals($response['data'][0]['connection_type_id'], $this->connectonTypes[0]->id); } - public function testUserCreatesNewSubConnectionType() - { + public function testUserCreatesNewSubConnectionType() { $connectionTypeCount = 1; $subConnectionTypeCount = 0; $meterTariffCount = 1; @@ -56,8 +52,7 @@ public function testUserCreatesNewSubConnectionType() $this->assertEquals($response['data']['name'], $subConnectionTypeData['name']); } - public function testUserUpdatesASubConnectionType() - { + public function testUserUpdatesASubConnectionType() { $connectionTypeCount = 1; $subConnectionTypeCount = 1; $meterTariffCount = 1; @@ -73,8 +68,7 @@ public function testUserUpdatesASubConnectionType() $this->assertEquals($response['data']['name'], $subConnectionTypeData['name']); } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); diff --git a/src/backend/tests/Feature/TargetTest.php b/src/backend/tests/Feature/TargetTest.php index 9168c0b5f..6860ec424 100644 --- a/src/backend/tests/Feature/TargetTest.php +++ b/src/backend/tests/Feature/TargetTest.php @@ -5,12 +5,10 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class TargetTest extends TestCase -{ +class TargetTest extends TestCase { use CreateEnvironments; - public function testUserGetsTargetList() - { + public function testUserGetsTargetList() { $this->createTestData(); $this->createCluster(); $this->createMiniGrid(); @@ -23,8 +21,7 @@ public function testUserGetsTargetList() $this->assertEquals(count($response['data']), $targetCount); } - public function testUserGetsTargetById() - { + public function testUserGetsTargetById() { $this->createTestData(); $this->createCluster(); $this->createMiniGrid(); @@ -37,8 +34,7 @@ public function testUserGetsTargetById() $this->assertEquals($response['data']['id'], $this->targets[0]->id); } - public function testUserCreatesNewTarget() - { + public function testUserCreatesNewTarget() { $this->withExceptionHandling(); $this->createTestData(); $this->createCluster(); @@ -69,8 +65,7 @@ public function testUserCreatesNewTarget() $this->assertEquals($response['data']['target_date'], $targetData['period']); } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); diff --git a/src/backend/tests/Feature/TicketTest.php b/src/backend/tests/Feature/TicketTest.php index cb29e9386..7f7ed2c32 100644 --- a/src/backend/tests/Feature/TicketTest.php +++ b/src/backend/tests/Feature/TicketTest.php @@ -7,12 +7,10 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class TicketTest extends TestCase -{ +class TicketTest extends TestCase { use CreateEnvironments; - public function testUserGetsTicketUserList() - { + public function testUserGetsTicketUserList() { $this->createTestData(); $this->createTicketUser(); $response = $this->actingAs($this->user)->get('/tickets/api/users'); @@ -20,8 +18,7 @@ public function testUserGetsTicketUserList() $this->assertEquals(1, count($response['data'])); } - public function testUserCreatesATicketUser() - { + public function testUserCreatesATicketUser() { $this->createTestData(); $postData = [ 'username' => 'test', @@ -34,8 +31,7 @@ public function testUserCreatesATicketUser() $this->assertEquals($ticketUser->user_name, $postData['username']); } - public function testUserCreatesATicket() - { + public function testUserCreatesATicket() { $this->createTestData(); $this->createPerson(); $this->createTicketCategory(); @@ -56,8 +52,7 @@ public function testUserCreatesATicket() $response->assertStatus(200); } - public function testUserGetsTicketList() - { + public function testUserGetsTicketList() { $this->createTestData(); $this->createPerson(); $this->createTicketCategory(); @@ -70,8 +65,7 @@ public function testUserGetsTicketList() $this->assertEquals(1, count($response['data']['data'])); } - public function testUserGetsTicketByTrelloId() - { + public function testUserGetsTicketByTrelloId() { $this->createTestData(); $this->createPerson(); $this->createTicketCategory(); @@ -86,8 +80,7 @@ public function testUserGetsTicketByTrelloId() $this->assertEquals($this->person->id, $response['data']['owner_id']); } - public function testUserClosesATicket() - { + public function testUserClosesATicket() { $this->createTestData(); $this->createPerson(); $this->createTicketCategory(); @@ -102,8 +95,7 @@ public function testUserClosesATicket() $this->assertEquals($trelloId, $response['data']['id']); } - public function testUserGetsAgentsTicketList() - { + public function testUserGetsAgentsTicketList() { $this->createTestData(); $this->createPerson(); $this->createAgentCommission(); @@ -118,8 +110,7 @@ public function testUserGetsAgentsTicketList() $this->assertEquals(1, count($response['data']['data'])); } - public function testUserCreatesATicketCategory() - { + public function testUserCreatesATicketCategory() { $this->createTestData(); $postData = [ 'labelName' => 'test category', @@ -133,8 +124,7 @@ public function testUserCreatesATicketCategory() $this->assertEquals($ticketCategory->label_name, $postData['labelName']); } - public function testUserGetsTicketCategoryList() - { + public function testUserGetsTicketCategoryList() { $this->createTestData(); $ticketCategoryCount = 5; $this->createTicketCategory($ticketCategoryCount); @@ -144,8 +134,7 @@ public function testUserGetsTicketCategoryList() $this->assertEquals($ticketCategoryCount, TicketCategory::query()->count()); } - public function testUserGetsTicketListForACustomer() - { + public function testUserGetsTicketListForACustomer() { $this->createTestData(); $this->createPerson(); $this->createAgentCommission(); @@ -160,8 +149,7 @@ public function testUserGetsTicketListForACustomer() $this->assertEquals(1, count($response['data']['data'])); } - public function testUserAddsCommentToTicketByTrelloId() - { + public function testUserAddsCommentToTicketByTrelloId() { $this->createTestData(); $this->createPerson(); $this->createTicketCategory(); @@ -180,8 +168,7 @@ public function testUserAddsCommentToTicketByTrelloId() $response->assertStatus(200); } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); diff --git a/src/backend/tests/Feature/TimeOfUsageTest.php b/src/backend/tests/Feature/TimeOfUsageTest.php index d4479a7ed..9850b704d 100644 --- a/src/backend/tests/Feature/TimeOfUsageTest.php +++ b/src/backend/tests/Feature/TimeOfUsageTest.php @@ -6,12 +6,10 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class TimeOfUsageTest extends TestCase -{ +class TimeOfUsageTest extends TestCase { use CreateEnvironments; - public function testUserDeletesTimeOfUsageOfTariff() - { + public function testUserDeletesTimeOfUsageOfTariff() { $this->createTestData(); $meterTariffCount = 5; $withTimeOfUsage = true; @@ -21,8 +19,7 @@ public function testUserDeletesTimeOfUsageOfTariff() $response->assertStatus(200); } - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); diff --git a/src/backend/tests/Feature/TokenProcessorTest.php b/src/backend/tests/Feature/TokenProcessorTest.php index f873b9e83..2ee1e08cb 100644 --- a/src/backend/tests/Feature/TokenProcessorTest.php +++ b/src/backend/tests/Feature/TokenProcessorTest.php @@ -25,13 +25,11 @@ use Illuminate\Support\Facades\Queue; use Tests\TestCase; -class TokenProcessorTest extends TestCase -{ +class TokenProcessorTest extends TestCase { use RefreshDatabase; use WithFaker; - public function testWithValidTransaction() - { + public function testWithValidTransaction() { Queue::fake(); PersonFactory::new()->create(); MeterTariffFactory::new()->create(); diff --git a/src/backend/tests/Feature/UserResourceTest.php b/src/backend/tests/Feature/UserResourceTest.php index d5e313249..f74ca3889 100644 --- a/src/backend/tests/Feature/UserResourceTest.php +++ b/src/backend/tests/Feature/UserResourceTest.php @@ -10,13 +10,11 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class UserResource extends TestCase -{ +class UserResource extends TestCase { use RefreshDatabase; use WithFaker; - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); @@ -25,8 +23,7 @@ public function actingAs($user, $driver = null) } /** @test */ - public function listRegisteredUsers(): void - { + public function listRegisteredUsers(): void { $user = UserFactory::new()->create(); // create random users UserFactory::times(30)->create(); @@ -37,8 +34,7 @@ public function listRegisteredUsers(): void } /** @test */ - public function createUser(): void - { + public function createUser(): void { $this->withoutExceptionHandling(); $user = UserFactory::new()->create(); $response = $this->actingAs($user)->post('/api/users', [ @@ -53,8 +49,7 @@ public function createUser(): void } /** @test */ - public function updateUserPassword(): void - { + public function updateUserPassword(): void { $user = UserFactory::new()->create(); // create user $this->actingAs($user)->post('/api/users', [ @@ -79,8 +74,7 @@ public function updateUserPassword(): void } /** @test */ - public function resetUserPassword(): void - { + public function resetUserPassword(): void { $user = UserFactory::new()->create(); // create user $this->actingAs($user)->post('/api/users', [ @@ -97,8 +91,7 @@ public function resetUserPassword(): void } /** @test */ - public function resetPasswordWithNonExistingEmail(): void - { + public function resetPasswordWithNonExistingEmail(): void { $request = $this->post('/api/users/password', ['email' => 'ako@inensus.com']); $request->assertStatus(422); diff --git a/src/backend/tests/RefreshMultipleDatabases.php b/src/backend/tests/RefreshMultipleDatabases.php index 049c2b129..76b4fb6bd 100644 --- a/src/backend/tests/RefreshMultipleDatabases.php +++ b/src/backend/tests/RefreshMultipleDatabases.php @@ -7,12 +7,10 @@ use Illuminate\Foundation\Testing\RefreshDatabaseState; use Illuminate\Support\Facades\Artisan; -trait RefreshMultipleDatabases -{ +trait RefreshMultipleDatabases { use RefreshDatabase; - protected function refreshInMemoryDatabase() - { + protected function refreshInMemoryDatabase() { Artisan::call( 'migrate:fresh', ['--database' => 'micro_power_manager', '--path' => '/database/migrations/base'] @@ -25,8 +23,7 @@ protected function refreshInMemoryDatabase() $this->app[Kernel::class]->setArtisan(null); } - protected function refreshTestDatabase() - { + protected function refreshTestDatabase() { if (!RefreshDatabaseState::$migrated) { Artisan::call( 'migrate:fresh', diff --git a/src/backend/tests/TestCase.php b/src/backend/tests/TestCase.php index 61dd33b7b..aaf78024d 100644 --- a/src/backend/tests/TestCase.php +++ b/src/backend/tests/TestCase.php @@ -6,16 +6,14 @@ use Illuminate\Foundation\Testing\TestCase as BaseTestCase; use Tymon\JWTAuth\Facades\JWTAuth; -abstract class TestCase extends BaseTestCase -{ +abstract class TestCase extends BaseTestCase { use CreatesApplication; /** * generates an jwt for the given user * if user is not present it tries to generate a token for the first user. */ - protected function headers(?User $user = null) - { + protected function headers(?User $user = null) { if (!$user) { $user = User::create([ 'name' => 'John Doe', diff --git a/src/backend/tests/Unit/AgentSellApplianceTest.php b/src/backend/tests/Unit/AgentSellApplianceTest.php index 3aeeaa499..d44973b8b 100644 --- a/src/backend/tests/Unit/AgentSellApplianceTest.php +++ b/src/backend/tests/Unit/AgentSellApplianceTest.php @@ -17,13 +17,11 @@ use Tests\TestCase; use Tymon\JWTAuth\Facades\JWTAuth; -class AgentSellApplianceTest extends TestCase -{ +class AgentSellApplianceTest extends TestCase { use RefreshDatabase; use WithFaker; - public function actingAs($user, $driver = null) - { + public function actingAs($user, $driver = null) { $token = JWTAuth::fromUser($user); $this->withHeader('Authorization', "Bearer {$token}"); parent::actingAs($user); @@ -36,8 +34,7 @@ public function actingAs($user, $driver = null) * * @return void */ - public function testAgentSellAppliance() - { + public function testAgentSellAppliance() { $this->initData(); $data = [ 'agent_assigned_appliance_id' => 2, @@ -61,8 +58,7 @@ public function testAgentSellAppliance() $this->assertEquals($data['down_payment'], $paymentHistory->amount); } - public function initData() - { + public function initData() { $user = UserFactory::new()->create(); $this->actingAs($user); PersonFactory::new()->create(); diff --git a/src/backend/tests/Unit/Exports/DailyTransactions.php b/src/backend/tests/Unit/Exports/DailyTransactions.php index 7e6d6aefe..3125db1fe 100644 --- a/src/backend/tests/Unit/Exports/DailyTransactions.php +++ b/src/backend/tests/Unit/Exports/DailyTransactions.php @@ -2,12 +2,9 @@ use Tests\TestCase; -class DailyTransactions extends TestCase -{ +class DailyTransactions extends TestCase { /** * Get all transactions from the database (Seeder) and gets only the confirmed ones. */ - public function testGetDailyTransactions() - { - } + public function testGetDailyTransactions() {} } diff --git a/src/backend/tests/Unit/SmsProcessorTest.php b/src/backend/tests/Unit/SmsProcessorTest.php index 4fa02b129..f4adbf0d5 100644 --- a/src/backend/tests/Unit/SmsProcessorTest.php +++ b/src/backend/tests/Unit/SmsProcessorTest.php @@ -25,13 +25,11 @@ use Illuminate\Support\Facades\Queue; use Tests\TestCase; -class SmsProcessorTest extends TestCase -{ +class SmsProcessorTest extends TestCase { /* ./vendor/bin/phpunit --filter sms_sending_with_transaction */ use RefreshDatabase; - public function testTokenCreationWithValidTransaction() - { + public function testTokenCreationWithValidTransaction() { Queue::fake(); $transaction = $this->initializeData(); $transactionContainer = TransactionDataContainer::initialize($transaction); @@ -43,8 +41,7 @@ public function testTokenCreationWithValidTransaction() Queue::assertPushed(TokenProcessor::class); } - public function testSmsSendingWithTransaction() - { + public function testSmsSendingWithTransaction() { Queue::fake(); $transaction = $this->initializeData(); $transaction->sender = '905494322161'; @@ -56,8 +53,7 @@ public function testSmsSendingWithTransaction() Queue::assertPushed(SmsProcessor::class); } - public function testSmsSendingWithResendInformationWithNoTransaction() - { + public function testSmsSendingWithResendInformationWithNoTransaction() { Queue::fake(); $transaction = $this->initializeData(); $transaction->sender = '905494322161'; @@ -74,8 +70,7 @@ public function testSmsSendingWithResendInformationWithNoTransaction() Queue::assertPushed(SmsProcessor::class); } - private function addSmsBodies() - { + private function addSmsBodies() { $bodies = [ [ 'reference' => 'SmsTransactionHeader', @@ -175,8 +170,7 @@ private function addSmsBodies() return SmsBody::query()->get(); } - private function initializeData() - { + private function initializeData() { // create person MainSettingsFactory::new()->create(); diff --git a/src/backend/tests/Unit/Transaction/AccessRateTest.php b/src/backend/tests/Unit/Transaction/AccessRateTest.php index 794a46dd5..caef849bf 100644 --- a/src/backend/tests/Unit/Transaction/AccessRateTest.php +++ b/src/backend/tests/Unit/Transaction/AccessRateTest.php @@ -21,13 +21,11 @@ use Illuminate\Support\Facades\Bus; use Tests\TestCase; -class AccessRateTest extends TestCase -{ +class AccessRateTest extends TestCase { use RefreshDatabase; use WithFaker; - private function initApplication(): void - { + private function initApplication(): void { Bus::fake(); $manufacturer = ManufacturerFactory::new()->create(); $meterType = MeterTypeFactory::new()->create(); @@ -61,8 +59,7 @@ private function initApplication(): void /** * @throws \Exception */ - public function testWithNoAccessRate(): void - { + public function testWithNoAccessRate(): void { $this->initApplication(); $transaction = $this->createFakeTransaction(500); $transactionContainer = TransactionDataContainer::initialize($transaction); @@ -70,8 +67,7 @@ public function testWithNoAccessRate(): void $this->assertEquals(0, $transactionData->accessRateDebt); } - public function testWithCoverAccessRate(): void - { + public function testWithCoverAccessRate(): void { $this->initApplication(); $transaction = $this->createFakeTransaction(500); $transactionContainer = TransactionDataContainer::initialize($transaction); @@ -85,8 +81,7 @@ public function testWithCoverAccessRate(): void $this->assertEquals(0, $accessRatePayment->debt); } - public function testWithNonCoverAccessRate(): void - { + public function testWithNonCoverAccessRate(): void { $this->initApplication(); $transaction = $this->createFakeTransaction(500); $transactionContainer = TransactionDataContainer::initialize($transaction); @@ -100,8 +95,7 @@ public function testWithNonCoverAccessRate(): void $this->assertEquals(500, $accessRatePayment->debt); } - public function testWithExactlyAccessRateDebt() - { + public function testWithExactlyAccessRateDebt() { $this->initApplication(); $transaction = $this->createFakeTransaction(1000); @@ -120,8 +114,7 @@ public function testWithExactlyAccessRateDebt() $this->assertEquals(0, $accessRatePayment->debt); } - private function createFakeTransaction(int $amount) - { + private function createFakeTransaction(int $amount) { $vodacomTransaction = VodacomTransactionFactory::new()->create(); $transaction = TransactionFactory::new()->make(); $transaction->amount = $amount; diff --git a/src/backend/tests/Unit/Transaction/VodacomTransactionTest.php b/src/backend/tests/Unit/Transaction/VodacomTransactionTest.php index 45db0a761..411b735be 100644 --- a/src/backend/tests/Unit/Transaction/VodacomTransactionTest.php +++ b/src/backend/tests/Unit/Transaction/VodacomTransactionTest.php @@ -11,16 +11,14 @@ use MPM\Transaction\Provider\VodacomTransactionProvider; use Tests\TestCase; -class VodacomTransactionTest extends TestCase -{ +class VodacomTransactionTest extends TestCase { use RefreshDatabase; use WithFaker; /** * @var Response */ - public function testTransactionSentFromUnknownIpAddress(): void - { + public function testTransactionSentFromUnknownIpAddress(): void { $request = Request::create( URL::route('vodacomTransaction'), 'POST', @@ -36,8 +34,7 @@ public function testTransactionSentFromUnknownIpAddress(): void self::assertEquals(401, $response->status()); } - public function testTransactionSentFromWhiteListedIpAddress(): void - { + public function testTransactionSentFromWhiteListedIpAddress(): void { $request = Request::create( URL::route('vodacomTransaction'), 'POST',