Skip to content

Commit

Permalink
Merge remote-tracking branch 'mainline/develop' into MAGETWO-36298
Browse files Browse the repository at this point in the history
  • Loading branch information
Susan Wright committed Apr 27, 2015
2 parents b739792 + 385f475 commit ee53fb0
Show file tree
Hide file tree
Showing 100 changed files with 6,220 additions and 492 deletions.
3 changes: 3 additions & 0 deletions app/code/Magento/Customer/Model/Resource/GroupRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ public function getList(SearchCriteriaInterface $searchCriteria)

/** @var \Magento\Customer\Model\Resource\Group\Collection $collection */
$collection = $this->groupFactory->create()->getCollection();
$collection->addTaxClass();

//Add filters from root filter group to the collection
/** @var FilterGroup $group */
Expand Down Expand Up @@ -234,6 +235,8 @@ protected function translateField($field)
return 'customer_group_code';
case GroupInterface::ID:
return 'customer_group_id';
case GroupInterface::TAX_CLASS_NAME:
return 'class_name';
default:
return $field;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public function testGetCurrentStatus($status, $lastLoginAt, $lastVisitAt, $lastL
'customer/online_customers/online_minutes_interval',
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
)
->willReturn(60); //TODO: it's value mocked because unit tests run data providers before all testsuite
->willReturn(240); //TODO: it's value mocked because unit tests run data providers before all testsuite

$this->customerLog->expects($this->any())->method('getLastLoginAt')->willReturn($lastLoginAt);
$this->customerLog->expects($this->any())->method('getLastVisitAt')->willReturn($lastVisitAt);
Expand Down
37 changes: 30 additions & 7 deletions app/code/Magento/Quote/Api/CartItemRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,45 @@ public function getList($cartId);
public function save(\Magento\Quote\Api\Data\CartItemInterface $cartItem);

/**
* Remove bundle option
* Removes the specified item from the specified cart.
*
* @param int $cartId The cart ID.
* @param int $itemId The item ID of the item to be removed.
* @return bool
* @throws \Magento\Framework\Exception\NoSuchEntityException The specified item or cart does not exist.
* @throws \Magento\Framework\Exception\CouldNotSaveException The item could not be removed.
*/
public function deleteById($cartId, $itemId);

/**
* Lists items that are assigned to a specified cart.
*
* @param int $customerId Customer ID.
* @return \Magento\Quote\Api\Data\CartItemInterface[] Array of items.
* @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart does not exist.
*/
public function getListForCustomer($customerId);

/**
* Adds the specified item to the specified cart.
*
* @param \Magento\Quote\Api\Data\CartItemInterface $cartItem
* @return void
* @throws \Magento\Framework\Exception\CouldNotSaveException
* @param int $customerId Customer ID.
* @param \Magento\Quote\Api\Data\CartItemInterface $cartItem The item.
* @return \Magento\Quote\Api\Data\CartItemInterface Item.
* @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart does not exist.
* @throws \Magento\Framework\Exception\CouldNotSaveException The specified item could not be saved to the cart.
* @throws \Magento\Framework\Exception\InputException The specified item or cart is not valid.
*/
public function delete(\Magento\Quote\Api\Data\CartItemInterface $cartItem);
public function saveForCustomer($customerId, \Magento\Quote\Api\Data\CartItemInterface $cartItem);

/**
* Removes the specified item from the specified cart.
*
* @param int $cartId The cart ID.
* @param int $customerId Customer ID.
* @param int $itemId The item ID of the item to be removed.
* @return bool
* @throws \Magento\Framework\Exception\NoSuchEntityException The specified item or cart does not exist.
* @throws \Magento\Framework\Exception\CouldNotSaveException The item could not be removed.
*/
public function deleteById($cartId, $itemId);
public function deleteByIdForCustomer($customerId, $itemId);
}
14 changes: 11 additions & 3 deletions app/code/Magento/Quote/Api/CartManagementInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,21 @@
interface CartManagementInterface
{
/**
* Enables an administrative or guest user to create an empty cart and quote for an anonymous customer.
* Creates an empty cart and quote for a guest.
*
* @param int $storeId
* @return int Cart ID.
* @throws \Magento\Framework\Exception\CouldNotSaveException The empty cart and quote could not be created.
*/
public function createEmptyCart();

/**
* Creates an empty cart and quote for a specified customer.
*
* @param int $customerId The customer ID.
* @return int Cart ID.
* @throws \Magento\Framework\Exception\CouldNotSaveException The empty cart and quote could not be created.
*/
public function createEmptyCart($storeId);
public function createEmptyCartForCustomer($customerId);

/**
* Returns information for the cart for a specified customer.
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Quote/Api/Data/CartItemInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ public function setProductType($productType);
/**
* Returns Quote id.
*
* @return int
* @return string
*/
public function getQuoteId();

/**
* Sets Quote id.
*
* @param int $quoteId
* @param string $quoteId
* @return $this
*/
public function setQuoteId($quoteId);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Quote\Api;

/**
* Billing address management interface for guest carts.
*/
interface GuestBillingAddressManagementInterface
{
/**
* Assigns a specified billing address to a specified cart.
*
* @param string $cartId The cart ID.
* @param \Magento\Quote\Api\Data\AddressInterface $address Billing address data.
* @return int Address ID.
* @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart does not exist.
* @throws \Magento\Framework\Exception\InputException The specified cart ID or address data is not valid.
*/
public function assign($cartId, \Magento\Quote\Api\Data\AddressInterface $address);

/**
* Returns the billing address for a specified quote.
*
* @param string $cartId The cart ID.
* @return \Magento\Quote\Api\Data\AddressInterface Quote billing address object.
* @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart does not exist.
*/
public function get($cartId);
}
43 changes: 43 additions & 0 deletions app/code/Magento/Quote/Api/GuestCartItemRepositoryInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Quote\Api;

/**
* Cart Item repository interface for guest carts.
*/
interface GuestCartItemRepositoryInterface
{
/**
* Lists items that are assigned to a specified cart.
*
* @param string $cartId The cart ID.
* @return \Magento\Quote\Api\Data\CartItemInterface[] Array of items.
* @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart does not exist.
*/
public function getList($cartId);

/**
* Adds the specified item to the specified cart.
*
* @param \Magento\Quote\Api\Data\CartItemInterface $cartItem The item.
* @return \Magento\Quote\Api\Data\CartItemInterface Item.
* @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart does not exist.
* @throws \Magento\Framework\Exception\CouldNotSaveException The specified item could not be saved to the cart.
* @throws \Magento\Framework\Exception\InputException The specified item or cart is not valid.
*/
public function save(\Magento\Quote\Api\Data\CartItemInterface $cartItem);

/**
* Removes the specified item from the specified cart.
*
* @param string $cartId The cart ID.
* @param int $itemId The item ID of the item to be removed.
* @return bool
* @throws \Magento\Framework\Exception\NoSuchEntityException The specified item or cart does not exist.
* @throws \Magento\Framework\Exception\CouldNotSaveException The item could not be removed.
*/
public function deleteById($cartId, $itemId);
}
38 changes: 38 additions & 0 deletions app/code/Magento/Quote/Api/GuestCartManagementInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Quote\Api;

/**
* Cart Management interface for guest carts.
*/
interface GuestCartManagementInterface
{
/**
* Enables an customer or guest user to create an empty cart and quote for an anonymous customer.
*
* @return string Cart ID.
* @throws \Magento\Framework\Exception\CouldNotSaveException The empty cart and quote could not be created.
*/
public function createEmptyCart();

/**
* Assigns a specified customer to a specified shopping cart.
*
* @param string $cartId The cart ID.
* @param int $customerId The customer ID.
* @param int $storeId
* @return boolean
*/
public function assignCustomer($cartId, $customerId, $storeId);

/**
* Places an order for a specified cart.
*
* @param string $cartId The cart ID.
* @return int Order ID.
*/
public function placeOrder($cartId);
}
21 changes: 21 additions & 0 deletions app/code/Magento/Quote/Api/GuestCartRepositoryInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Quote\Api;

/**
* Cart Repository interface for guest carts.
*/
interface GuestCartRepositoryInterface
{
/**
* Enables a guest user to return information for a specified cart.
*
* @param string $cartId
* @return \Magento\Quote\Api\Data\CartInterface
* @throws \Magento\Framework\Exception\NoSuchEntityException
*/
public function get($cartId);
}
22 changes: 22 additions & 0 deletions app/code/Magento/Quote/Api/GuestCartTotalRepositoryInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/

namespace Magento\Quote\Api;

/**
* Cart totals repository interface for guest carts.
*/
interface GuestCartTotalRepositoryInterface
{
/**
* Returns quote totals data for a specified cart.
*
* @param string $cartId The cart ID.
* @return \Magento\Quote\Api\Data\TotalsInterface Quote totals data.
* @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart does not exist.
*/
public function get($cartId);
}
44 changes: 44 additions & 0 deletions app/code/Magento/Quote/Api/GuestCouponManagementInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
*
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/

namespace Magento\Quote\Api;

/**
* Coupon management interface for guest carts.
*/
interface GuestCouponManagementInterface
{
/**
* Returns information for a coupon in a specified cart.
*
* @param string $cartId The cart ID.
* @return string The coupon code data.
* @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart does not exist.
*/
public function get($cartId);

/**
* Adds a coupon by code to a specified cart.
*
* @param string $cartId The cart ID.
* @param string $couponCode The coupon code data.
* @return bool
* @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart does not exist.
* @throws \Magento\Framework\Exception\CouldNotSaveException The specified coupon could not be added.
*/
public function set($cartId, $couponCode);

/**
* Deletes a coupon from a specified cart.
*
* @param string $cartId The cart ID.
* @return bool
* @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart does not exist.
* @throws \Magento\Framework\Exception\CouldNotDeleteException The specified coupon could not be deleted.
*/
public function remove($cartId);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Quote\Api;

/**
* Payment method management interface for guest carts.
*/
interface GuestPaymentMethodManagementInterface
{
/**
* Adds a specified payment method to a specified shopping cart.
*
* @param string $cartId The cart ID.
* @param \Magento\Quote\Api\Data\PaymentInterface $method The payment method.
* @return int Payment method ID.
* @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart does not exist.
* @throws \Magento\Framework\Exception\State\InvalidTransitionException The billing or shipping address
* is not set, or the specified payment method is not available.
*/
public function set($cartId, \Magento\Quote\Api\Data\PaymentInterface $method);

/**
* Returns the payment method for a specified shopping cart.
*
* @param string $cartId The cart ID.
* @return \Magento\Quote\Api\Data\PaymentInterface Payment method object.
* @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart does not exist.
*/
public function get($cartId);

/**
* Lists available payment methods for a specified shopping cart.
*
* @param string $cartId The cart ID.
* @return \Magento\Quote\Api\Data\PaymentMethodInterface[] Array of payment methods.
* @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart does not exist.
*/
public function getList($cartId);
}
Loading

0 comments on commit ee53fb0

Please sign in to comment.