-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1859 from bakaphp/development
Version 1.1
- Loading branch information
Showing
47 changed files
with
1,198 additions
and
179 deletions.
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
27 changes: 27 additions & 0 deletions
27
app/Console/Commands/Connectors/Shopify/ShopifyUploadCategoryCommand.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,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Console\Commands\Connectors\Shopify; | ||
|
||
use Illuminate\Console\Command; | ||
use Kanvas\Connectors\Shopify\Actions\UploadCategoriesToCollectionAction; | ||
use Kanvas\Apps\Models\Apps; | ||
use Kanvas\Inventory\Categories\Models\Categories; | ||
use Kanvas\Inventory\Warehouses\Models\Warehouses; | ||
|
||
class ShopifyUploadCategoryCommand extends Command | ||
{ | ||
protected $signature = "kanvas:upload-categories-to-shopify {app_id} {categories_id} {warehouse_id} {shopify_id}"; | ||
protected $description = " | ||
"; | ||
|
||
public function handle() | ||
{ | ||
$app = Apps::getById((int) $this->argument('app_id')); | ||
$categories = Categories::getById((int) $this->argument('categories_id'), $app); | ||
$warehouses = Warehouses::getById((int) $this->argument('warehouse_id'), $app); | ||
$shopifyId = $this->argument('shopify_id'); | ||
(new UploadCategoriesToCollectionAction($categories, $app, $warehouses, $shopifyId))->execute(); | ||
} | ||
} |
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,44 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Console\Commands\Guild; | ||
|
||
use Baka\Traits\KanvasJobsTrait; | ||
use Illuminate\Console\Command; | ||
use Kanvas\Apps\Models\Apps; | ||
use Kanvas\Companies\Models\Companies; | ||
use Kanvas\Connectors\Apollo\Actions\DailyUsageReportAction; | ||
|
||
class GuildDailyReportCommand extends Command | ||
{ | ||
use KanvasJobsTrait; | ||
|
||
/** | ||
* The name and signature of the console command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'kanvas-guild:daily-report {app_id?} {company_id?}'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string|null | ||
*/ | ||
protected $description = 'Send daily report to the guild'; | ||
|
||
public function handle(): void | ||
{ | ||
//@todo make this run for multiple apps by looking for them at apps settings flag | ||
$app = Apps::getById($this->argument('app_id')); | ||
$company = Companies::getById($this->argument('company_id')); | ||
$this->overwriteAppService($app); | ||
|
||
//for now just apollo, but this should be for sending all the different reports | ||
$this->info('Sending Apollo Daily Report - ' . date('Y-m-d')); | ||
$apolloDailyReport = new DailyUsageReportAction($app, $company); | ||
$result = $apolloDailyReport->execute(); | ||
$this->info('Total report send ' . count($result)); | ||
} | ||
} |
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
27 changes: 27 additions & 0 deletions
27
app/GraphQL/Ecosystem/Mutations/ImporterTemplate/ImporterTemplateManagementMutation.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,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\GraphQL\Ecosystem\Mutations\ImporterTemplate; | ||
|
||
use Kanvas\MappersImportersTemplates\Models\MapperImporterTemplate; | ||
use Kanvas\MappersImportersTemplates\DataTransferObject\MapperImporterTemplate as MapperImportersTemplatesDto; | ||
use Kanvas\Apps\Models\Apps; | ||
use Kanvas\MappersImportersTemplates\Actions\CreateMapperImporterTemplateAction; | ||
|
||
class ImporterTemplateManagementMutation | ||
{ | ||
public function create(mixed $root, array $req): MapperImporterTemplate | ||
{ | ||
$req = $req['input']; | ||
$dto = new MapperImportersTemplatesDto( | ||
users: auth()->user(), | ||
companies: auth()->user()->getCurrentCompany(), | ||
apps: app(Apps::class), | ||
name: $req['name'], | ||
attributes: $req['attributes'], | ||
description: $req['description'] ?? null, | ||
); | ||
return (new CreateMapperImporterTemplateAction($dto))->execute(); | ||
} | ||
} |
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
Oops, something went wrong.