Skip to content

Commit

Permalink
preapre taxes
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Aug 11, 2024
1 parent 1c908bb commit f290baf
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
public function up(): void
{
Schema::create('bazar_discount_rates', function (Blueprint $table) {
Schema::create('bazar_buyable_tax_rate', static function (Blueprint $table): void {
$table->id();
$table->timestamps();
});
Expand All @@ -22,6 +22,6 @@ public function up(): void
*/
public function down(): void
{
Schema::dropIfExists('bazar_discount_rates');
Schema::dropIfExists('bazar_buyable_tax_rate');
}
};

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
public function up(): void
{
Schema::create('bazar_taxes', function (Blueprint $table) {
Schema::create('bazar_taxes', static function (Blueprint $table): void {
$table->id();
$table->timestamps();
});
Expand Down
2 changes: 1 addition & 1 deletion src/Gateway/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Cone\Bazar\Gateway;

use Cone\Bazar\Interfaces\Gateway\Manager as Contract;
use Cone\Bazar\Interfaces\Checkoutable;
use Cone\Bazar\Interfaces\Gateway\Manager as Contract;
use Illuminate\Contracts\Container\Container;
use Illuminate\Support\Manager as BaseManager;

Expand Down
4 changes: 2 additions & 2 deletions src/Interfaces/Models/Cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace Cone\Bazar\Interfaces\Models;

use Cone\Bazar\Interfaces\Discountable;
use Cone\Bazar\Interfaces\Checkoutable;
use Cone\Bazar\Interfaces\Discountable;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

interface Cart extends Discountable, Checkoutable
interface Cart extends Checkoutable, Discountable
{
/**
* Get the order for the cart.
Expand Down
4 changes: 2 additions & 2 deletions src/Interfaces/Models/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

namespace Cone\Bazar\Interfaces\Models;

use Cone\Bazar\Interfaces\Discountable;
use Cone\Bazar\Interfaces\Checkoutable;
use Cone\Bazar\Interfaces\Discountable;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Illuminate\Notifications\Notification;

interface Order extends Discountable, Checkoutable
interface Order extends Checkoutable, Discountable
{
/**
* Get the cart for the order.
Expand Down
8 changes: 8 additions & 0 deletions src/Interfaces/Models/Tax.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace Cone\Bazar\Interfaces\Models;

interface Tax
{
//
}
8 changes: 8 additions & 0 deletions src/Interfaces/Models/TaxRate.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace Cone\Bazar\Interfaces\Models;

interface TaxRate
{
//
}
10 changes: 0 additions & 10 deletions src/Models/Discount.php

This file was deleted.

10 changes: 0 additions & 10 deletions src/Models/DiscountRate.php

This file was deleted.

18 changes: 15 additions & 3 deletions src/Models/Tax.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,21 @@

namespace Cone\Bazar\Models;

use Illuminate\Database\Eloquent\Relations\MorphPivot;
use Cone\Bazar\Interfaces\Models\Tax as Contract;
use Cone\Root\Traits\InteractsWithProxy;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Tax extends MorphPivot
class Tax extends Model implements Contract
{
//
use HasFactory;
use InteractsWithProxy;

/**
* Get the proxied interface.
*/
public static function getProxiedInterface(): string
{
return Contract::class;
}
}
16 changes: 14 additions & 2 deletions src/Models/TaxRate.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,21 @@

namespace Cone\Bazar\Models;

use Cone\Bazar\Interfaces\Models\TaxRate as Contract;
use Cone\Root\Traits\InteractsWithProxy;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class TaxRate extends Model
class TaxRate extends Model implements Contract
{
//
use HasFactory;
use InteractsWithProxy;

/**
* Get the proxied interface.
*/
public static function getProxiedInterface(): string
{
return Contract::class;
}
}

0 comments on commit f290baf

Please sign in to comment.