Skip to content

Commit

Permalink
Merge pull request #2600 from bakaphp/development
Browse files Browse the repository at this point in the history
v 1.13.2
  • Loading branch information
kaioken authored Dec 5, 2024
2 parents f40c948 + 281afb3 commit b6b7fbf
Show file tree
Hide file tree
Showing 23 changed files with 393 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace App\Console\Commands\Connectors\ESim;

use Baka\Traits\KanvasJobsTrait;
use Exception;
use Illuminate\Console\Command;
use Kanvas\Apps\Models\Apps;
use Kanvas\Companies\Models\Companies;
Expand Down Expand Up @@ -57,8 +58,15 @@ public function handle()
continue;
}

$response = $eSimService->getAppliedBundleStatus($iccid, $bundle);
$iccidStatus = $eSimService->checkStatus($iccid);
try {
$response = $eSimService->getAppliedBundleStatus($iccid, $bundle);
$iccidStatus = $eSimService->checkStatus($iccid);
} catch (Exception $e) {
$this->info("Message ID: {$message->id} has an error: {$e->getMessage()}");
$message->setPrivate();

continue;
}

if (! empty($response)) {
$inactiveStatuses = [
Expand Down
10 changes: 10 additions & 0 deletions app/Console/Commands/Workflows/KanvasWorkflowSynActionCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
use Kanvas\Connectors\Internal\Activities\UnPublishExpiredProductActivity;
use Kanvas\Connectors\Internal\Activities\UnPublishExpiredProductsAfterImportActivity;
use Kanvas\Connectors\Internal\Activities\UserCustomFieldActivity;
use Kanvas\Connectors\IPlus\Workflows\Activities\SyncOrderWithIPlusActivities;
use Kanvas\Connectors\IPlus\Workflows\Activities\SyncPeopleWithIPlusActivities;
use Kanvas\Connectors\NetSuite\Webhooks\ProcessNetSuiteCompanyCustomerWebhookJob;
use Kanvas\Connectors\NetSuite\Workflow\SyncCompanyWithNetSuiteActivity;
use Kanvas\Connectors\NetSuite\Workflow\SyncPeopleWithNetSuiteActivity;
Expand All @@ -27,6 +29,9 @@
use Kanvas\Connectors\Shopify\Jobs\ProcessShopifyInventoryLevelWebhookJob;
use Kanvas\Connectors\Shopify\Jobs\ProcessShopifyOrderWebhookJob;
use Kanvas\Connectors\Shopify\Jobs\ProcessShopifyProductWebhookJob;
use Kanvas\Connectors\Shopify\Workflows\Activities\CreateShopifyDraftOrderActivity;
use Kanvas\Connectors\Shopify\Workflows\Activities\CreateUserActivity;
use Kanvas\Connectors\Shopify\Workflows\Activities\DeleteVariantFromShopifyActivity;
use Kanvas\Connectors\Shopify\Workflows\Activities\SyncProductWithShopifyActivity;
use Kanvas\Connectors\Shopify\Workflows\Activities\SyncProductWithShopifyWithIntegrationActivity;
use Kanvas\Connectors\Stripe\Jobs\ImportStripePlanWebhookJob;
Expand Down Expand Up @@ -87,6 +92,11 @@ public function handle(): void
CashierStripeWebhookJob::class,
CreateOrderInESimActivity::class,
AmplitudeEventStreamWebhookJob::class,
CreateShopifyDraftOrderActivity::class,
DeleteVariantFromShopifyActivity::class,
CreateUserActivity::class,
SyncOrderWithIPlusActivities::class,
SyncPeopleWithIPlusActivities::class,
];

$createdActions = [];
Expand Down
11 changes: 10 additions & 1 deletion app/GraphQL/Souk/Mutations/Cart/CartManagementMutation.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public function add(mixed $root, array $request): array
$items = $request['items'];
$user = auth()->user();
$company = $user->getCurrentCompany();
$currentUserCompany = $company;
$cart = app('cart')->session($user->getId());
$app = app(Apps::class);

Expand All @@ -36,10 +37,18 @@ public function add(mixed $root, array $request): array
foreach ($items as $item) {
$variant = Variants::getByIdFromCompany($item['variant_id'], $company);

//$variantPrice = $variant->variantWarehouses()->firstOrFail()->price;
$variantPrice = $useCompanySpecificPrice
? $variant->variantChannels()
->whereHas('channel', fn ($query) => $query->where('slug', $currentUserCompany->uuid))
->firstOrFail()->price
: $variant->variantWarehouses()
->firstOrFail()->price;

$cart->add([
'id' => $variant->getId(),
'name' => $variant->name,
'price' => $useCompanySpecificPrice ? $variant->variantChannels('slug', $company->uuid)->firstOrFail()->price : $variant->variantWarehouses()->firstOrFail()->price, //@todo modify to use channel instead of warehouse
'price' => $variantPrice, //@todo modify to use channel instead of warehouse
'quantity' => $item['quantity'],
'attributes' => $variant->product->attributes ? $variant->product->attributes->map(function ($attribute) {
return [
Expand Down
84 changes: 42 additions & 42 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class () extends Migration {
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('filesystem_mappers', function (Blueprint $table) {
//
$table->boolean('is_default')->default(0)->after('configuration');
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('filesystem_mappers', function (Blueprint $table) {
//
$table->dropColumn('is_default');
});
}
};
2 changes: 2 additions & 0 deletions graphql/schemas/Ecosystem/Filesystem/mapper.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ type FilesystemMapper {
file_header: Mixed!
mapping: Mixed!
configuration: Mixed
is_default: Boolean
system_module: SystemModule! @belongsTo(relation: "systemModule")
created_at: DateTime!
updated_at: DateTime
Expand All @@ -17,6 +18,7 @@ input FilesystemMapperInput {
file_header: Mixed!
mapping: Mixed!
configuration: Mixed
is_default: Boolean
}

input FilesystemImportInput {
Expand Down
Loading

0 comments on commit b6b7fbf

Please sign in to comment.