-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* angaza plugin created. * fix tailtag bug * (CodeQuality) linting --------- Co-authored-by: Kemal <[email protected]>
- Loading branch information
1 parent
5af56ba
commit 8368c9c
Showing
42 changed files
with
971 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
Website/htdocs/mpmanager/packages/inensus/angaza-shs/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.idea |
21 changes: 21 additions & 0 deletions
21
Website/htdocs/mpmanager/packages/inensus/angaza-shs/LICENSE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 Inensus | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
13 changes: 13 additions & 0 deletions
13
Website/htdocs/mpmanager/packages/inensus/angaza-shs/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
## Package-Development-Starter-Pack | ||
|
||
#### Starter pack for package development to MicroPowerManager. | ||
|
||
- This repo has created by the MicroPowerManager development team for developers who will develop a new package for MicroPowerManager. | ||
- The team suggests developers use this repo when they decide to develop new packages to MicroPowerManager. | ||
- Developers should clone our `Core` project with this url `https://github.com/inensus/MPManager` first. After cloning and running the core project, They have to go into laravel container and navigate to mpmanager & run `php artisan micropowermanager:new-package {{package-name}}` command to clone `this repo` into packages folder in MicroPowerManager core project. | ||
- After cloning Package-Development-Starter-Pack, developers can keep developing the package inside of core project. | ||
- When the developing will have been finished they can upload their packages to `https://packagist.org/` for the other developers usage | ||
|
||
|
||
|
||
|
27 changes: 27 additions & 0 deletions
27
Website/htdocs/mpmanager/packages/inensus/angaza-shs/composer.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "inensus/angaza-shs", | ||
"description": "Angaza SHS integration for Micropowermanager", | ||
"type": "package", | ||
"require": {}, | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "kamuran engin", | ||
"email": "[email protected]", | ||
"role": "Developer" | ||
} | ||
], | ||
"minimum-stability": "dev", | ||
"autoload": { | ||
"psr-4": { | ||
"Inensus\\AngazaSHS\\": "src" | ||
} | ||
}, | ||
"extra": { | ||
"laravel": { | ||
"providers": [ | ||
"AngazaSHSServiceProvider" | ||
] | ||
} | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
Website/htdocs/mpmanager/packages/inensus/angaza-shs/config/angaza-shs.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
|
||
return [ | ||
|
||
]; |
34 changes: 34 additions & 0 deletions
34
...s/mpmanager/packages/inensus/angaza-shs/database/migrations/create_angaza_tables.php.stub
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Support\Facades\Schema; | ||
use Illuminate\Database\Schema\Blueprint; | ||
|
||
class CreateAngazaTables extends Migration | ||
{ | ||
public function up() | ||
{ | ||
if (!Schema:: hasTable('angaza_api_credentials')) { | ||
Schema::create('angaza_api_credentials', static function (Blueprint $table) { | ||
$table->increments('id'); | ||
$table->string('api_url')->default('https://payg.angazadesign.com/nexus/v1'); | ||
$table->string('client_id')->nullable(); | ||
$table->string('client_secret')->nullable(); | ||
$table->timestamps(); | ||
}); | ||
} | ||
if (!Schema:: hasTable('angaza_transactions')) { | ||
Schema::create('angaza_transactions', static function (Blueprint $table) { | ||
$table->increments('id'); | ||
$table->timestamps(); | ||
}); | ||
} | ||
} | ||
|
||
public function down() | ||
{ | ||
Schema::dropIfExists('angaza_api_credentials'); | ||
Schema::dropIfExists('angaza_transactions'); | ||
|
||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
Website/htdocs/mpmanager/packages/inensus/angaza-shs/src/Console/Commands/InstallPackage.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
namespace Inensus\AngazaSHS\Console\Commands; | ||
|
||
use Illuminate\Console\Command; | ||
use Inensus\AngazaSHS\Services\AngazaCredentialService; | ||
use Inensus\AngazaSHS\Services\ManufacturerService; | ||
use Inensus\AngazaSHS\Services\MenuItemService; | ||
|
||
class InstallPackage extends Command | ||
{ | ||
protected $signature = 'angaza-shs:install'; | ||
protected $description = 'Install AngazaSHS Package'; | ||
|
||
public function __construct( | ||
private MenuItemService $menuItemService, | ||
private ManufacturerService $manufacturerService, | ||
private AngazaCredentialService $credentialService | ||
) { | ||
parent::__construct(); | ||
} | ||
public function handle(): void | ||
{ | ||
$this->info('Installing AngazaSHS Integration Package\n'); | ||
$this->manufacturerService->register(); | ||
$this->credentialService->createCredentials(); | ||
$this->info('Package installed successfully..'); | ||
} | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
...tdocs/mpmanager/packages/inensus/angaza-shs/src/Exceptions/AngazaApiResponseException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
namespace Inensus\AngazaSHS\Exceptions; | ||
|
||
class AngazaApiResponseException extends \Exception | ||
{ | ||
public function __construct($message) | ||
{ | ||
parent::__construct($message); | ||
} | ||
} | ||
|
Empty file.
34 changes: 34 additions & 0 deletions
34
...mpmanager/packages/inensus/angaza-shs/src/Http/Controllers/AngazaCredentialController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace Inensus\AngazaSHS\Http\Controllers; | ||
|
||
use Illuminate\Routing\Controller; | ||
use Inensus\AngazaSHS\Http\Requests\AngazaCredentialRequest; | ||
use Inensus\AngazaSHS\Http\Resources\AngazaResource; | ||
use Inensus\AngazaSHS\Services\AngazaCredentialService; | ||
|
||
|
||
class AngazaCredentialController extends Controller | ||
{ | ||
|
||
public function __construct(private AngazaCredentialService $credentialService) | ||
{ | ||
} | ||
|
||
public function show(): AngazaResource | ||
{ | ||
return AngazaResource::make($this->credentialService->getCredentials()); | ||
} | ||
|
||
public function update(AngazaCredentialRequest $request): AngazaResource | ||
{ | ||
$credentials = $this->credentialService->getCredentials(); | ||
$updateData = $request->only([ | ||
'client_id', | ||
'client_secret' | ||
]); | ||
$credentials = $this->credentialService->updateCredentials($credentials, $updateData); | ||
|
||
return AngazaResource::make($credentials); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...tdocs/mpmanager/packages/inensus/angaza-shs/src/Http/Requests/AngazaCredentialRequest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
|
||
namespace Inensus\AngazaSHS\Http\Requests; | ||
|
||
|
||
use Illuminate\Foundation\Http\FormRequest; | ||
use Illuminate\Validation\Rule; | ||
|
||
class AngazaCredentialRequest extends FormRequest | ||
{ | ||
/** | ||
* Get the validation rules that apply to the request. | ||
* | ||
* | ||
* @return array | ||
*/ | ||
public function rules() | ||
{ | ||
return [ | ||
'client_id' => ['required'], | ||
'client_secret' => ['required'], | ||
]; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
Website/htdocs/mpmanager/packages/inensus/angaza-shs/src/Http/Resources/AngazaResource.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
|
||
namespace Inensus\AngazaSHS\Http\Resources; | ||
|
||
|
||
use Illuminate\Http\Request; | ||
use Illuminate\Http\Resources\Json\JsonResource; | ||
|
||
class AngazaResource extends JsonResource | ||
{ | ||
/** | ||
* Transform the resource into an array. | ||
* | ||
* @param Request $request | ||
* @return array | ||
*/ | ||
public function toArray($request) | ||
{ | ||
return parent::toArray($request); | ||
} | ||
} |
Empty file.
26 changes: 26 additions & 0 deletions
26
Website/htdocs/mpmanager/packages/inensus/angaza-shs/src/Models/AngazaCredential.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace Inensus\AngazaSHS\Models; | ||
|
||
use App\Models\BaseModel; | ||
|
||
class AngazaCredential extends BaseModel | ||
{ | ||
|
||
protected $table = 'angaza_api_credentials'; | ||
|
||
public function getClientSecret() | ||
{ | ||
return $this->client_secret; | ||
} | ||
public function getClientId() | ||
{ | ||
return $this->client_id; | ||
} | ||
|
||
public function getApiUrl() | ||
{ | ||
return $this->api_url; | ||
} | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
Website/htdocs/mpmanager/packages/inensus/angaza-shs/src/Models/AngazaTransaction.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace Inensus\AngazaSHS\Models; | ||
|
||
use App\Models\BaseModel; | ||
|
||
class AngazaTransaction extends BaseModel | ||
{ | ||
protected $table = 'angaza_transactions'; | ||
} |
Oops, something went wrong.