Skip to content

Commit

Permalink
CC-16681: Adjusted address2 field to be optional instead of required. (
Browse files Browse the repository at this point in the history
…#19)

CC-16681 Adjusted address fields to be optional instead of required.
  • Loading branch information
michbeck authored Aug 8, 2022
1 parent 00accdd commit f24548e
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 15 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# AvalaraTax Module
[![CI](https://github.com/spryker-eco/avalara-tax/actions/workflows/ci.yml/badge.svg)](https://github.com/spryker-eco/avalara-tax/actions/workflows/ci.yml)
[![Latest Stable Version](https://poser.pugx.org/spryker-eco/avalara-tax/v/stable.svg)](https://packagist.org/packages/spryker-eco/avalara-tax)
[![License](https://img.shields.io/github/license/spryker-eco/avalara-tax.svg?b=master)](https://github.com/spryker-eco/avalara-tax)
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.4-8892BF.svg)](https://php.net/)

AvalaraTax module allows the Spryker project to connect to the Avalara tax service.
Expand All @@ -13,4 +14,4 @@ composer require spryker-eco/avalara-tax

## Documentation

[Spryker Documentation](https://academy.spryker.com/developing_with_spryker/module_guide/modules.html)
[Spryker Documentation](https://docs.spryker.com/docs/scos/user/technology-partners/202108.0/taxes/avalara.html)
3 changes: 0 additions & 3 deletions phpstan.json

This file was deleted.

3 changes: 3 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
parameters:
level: 8
paths:
- src/
checkGenericClassInNonGenericObjectType: false
checkMissingIterableValueType: false
ignoreErrors:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@
<transfer name="Quote">
<property name="orderReference" type="string"/>
<property name="avalaraCreateTransactionResponse" type="AvalaraCreateTransactionResponse"/>
<property name="store" type="Store"/>
<property name="items" type="Item[]" singular="item"/>
</transfer>

<transfer name="ProductConcrete">
Expand Down Expand Up @@ -274,6 +276,7 @@
</transfer>

<transfer name="Stock">
<property name="name" type="string"/>
<property name="address" type="StockAddress"/>
</transfer>

Expand All @@ -293,6 +296,7 @@

<transfer name="StockProduct">
<property name="stockType" type="string"/>
<property name="sku" type="string"/>
</transfer>

</transfers>
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ protected function addTransactionLevelAddress(
return $transactionBuilder->withAddress(
$avalaraAddressTransfer->getTypeOrFail(),
$addressTransfer->getAddress1OrFail(),
$addressTransfer->getAddress2OrFail(),
$addressTransfer->getAddress3() ?? '',
(string)$addressTransfer->getAddress2(),
(string)$addressTransfer->getAddress3(),
$addressTransfer->getCityOrFail(),
$addressTransfer->getZipCodeOrFail(),
$addressTransfer->getIso2CodeOrFail(),
Expand Down Expand Up @@ -144,7 +144,7 @@ protected function addItemLevelAddress(
return $transactionBuilder->withLineAddress(
$avalaraAddressTransfer->getTypeOrFail(),
$addressTransfer->getAddress1OrFail(),
$addressTransfer->getAddress2OrFail(),
(string)$addressTransfer->getAddress2(),
(string)$addressTransfer->getAddress3(),
$addressTransfer->getCityOrFail(),
$addressTransfer->getZipCodeOrFail(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ protected function resolveAvalaraTransactionType(CalculableObjectTransfer $calcu
abstract protected function hasShipmentAddress(CalculableObjectTransfer $calculableObjectTransfer): bool;

/**
* @param \Generated\Shared\Transfer\ItemTransfer[]|\ArrayObject $itemTransfers
* @param \ArrayObject<\Generated\Shared\Transfer\ItemTransfer> $itemTransfers
* @param \Generated\Shared\Transfer\AvalaraCreateTransactionResponseTransfer $avalaraCreateTransactionResponseTransfer
*
* @return void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected function hasShipmentAddress(CalculableObjectTransfer $calculableObject
}

/**
* @param \Generated\Shared\Transfer\ItemTransfer[]|\ArrayObject $itemTransfers
* @param \ArrayObject<\Generated\Shared\Transfer\ItemTransfer> $itemTransfers
* @param \Generated\Shared\Transfer\AvalaraCreateTransactionResponseTransfer $avalaraCreateTransactionResponseTransfer
*
* @return void
Expand All @@ -61,7 +61,7 @@ protected function calculateTaxForItemTransfers(

/**
* @param \Generated\Shared\Transfer\ItemTransfer $itemTransfer
* @param \Generated\Shared\Transfer\AvalaraTransactionLineTransfer[]|\ArrayObject $avalaraTransactionLineTransfers
* @param \ArrayObject<\Generated\Shared\Transfer\AvalaraTransactionLineTransfer> $avalaraTransactionLineTransfers
* @param array<string> $zipCodeRegionNameMap
*
* @return void
Expand All @@ -86,7 +86,7 @@ protected function calculateItemTax(

/**
* @param \Generated\Shared\Transfer\ItemTransfer $itemTransfer
* @param \Generated\Shared\Transfer\AvalaraTransactionLineTransfer[]|\ArrayObject $avalaraTransactionLineTransfers
* @param \ArrayObject<\Generated\Shared\Transfer\AvalaraTransactionLineTransfer> $avalaraTransactionLineTransfers
* @param array<string> $zipCodeRegionNameMap
*
* @return \Generated\Shared\Transfer\AvalaraTransactionLineTransfer|null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ protected function hasShipmentAddress(CalculableObjectTransfer $calculableObject
}

/**
* @param \Generated\Shared\Transfer\ItemTransfer[]|\ArrayObject $itemTransfers
* @param \ArrayObject<\Generated\Shared\Transfer\ItemTransfer> $itemTransfers
* @param \Generated\Shared\Transfer\AvalaraCreateTransactionResponseTransfer $avalaraCreateTransactionResponseTransfer
*
* @return void
Expand All @@ -48,7 +48,7 @@ protected function calculateTaxForItemTransfers(
}

/**
* @param \Generated\Shared\Transfer\ItemTransfer[]|\ArrayObject $itemTransfers
* @param \ArrayObject<\Generated\Shared\Transfer\ItemTransfer> $itemTransfers
* @param string $groupKey
* @param \Generated\Shared\Transfer\AvalaraTransactionLineTransfer $avalaraTransactionLineTransfer
*
Expand All @@ -69,7 +69,7 @@ protected function calculateItemsTaxByGroupKey(
}

/**
* @param \Generated\Shared\Transfer\AvalaraTransactionLineTransfer[]|\ArrayObject $avalaraTransactionLineTransfers
* @param \ArrayObject<\Generated\Shared\Transfer\AvalaraTransactionLineTransfer> $avalaraTransactionLineTransfers
*
* @return array<\Generated\Shared\Transfer\AvalaraTransactionLineTransfer>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function expandCartItemsWithAvalaraTaxCode(CartChangeTransfer $cartChange
}

/**
* @param \Generated\Shared\Transfer\ItemTransfer[]|\ArrayObject $itemTransfers
* @param \ArrayObject<\Generated\Shared\Transfer\ItemTransfer> $itemTransfers
*
* @return array<string>
*/
Expand Down

0 comments on commit f24548e

Please sign in to comment.