Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First alpha version #1

Merged
merged 1 commit into from
Mar 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions Api/Account/StoreRepositoryInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

namespace ShoppingFeed\Manager\Api\Account;

use Magento\Framework\Exception\CouldNotDeleteException;
use Magento\Framework\Exception\CouldNotSaveException;
use Magento\Framework\Exception\NoSuchEntityException;
use ShoppingFeed\Manager\Api\Data\Account\StoreInterface;


/**
* @api
*/
interface StoreRepositoryInterface
{
/**
* @param StoreInterface $store
* @return StoreInterface
* @throws CouldNotSaveException
*/
public function save(StoreInterface $store);

/**
* @param int $storeId
* @return StoreInterface
* @throws NoSuchEntityException
*/
public function getById($storeId);

/**
* @param StoreInterface $store
* @return bool
* @throws CouldNotDeleteException
*/
public function delete(StoreInterface $store);

/**
* @param int $storeId
* @return bool
* @throws NoSuchEntityException
* @throws CouldNotDeleteException
*/
public function deleteById($storeId);
}
51 changes: 51 additions & 0 deletions Api/AccountRepositoryInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

namespace ShoppingFeed\Manager\Api;

use Magento\Framework\Exception\CouldNotDeleteException;
use Magento\Framework\Exception\CouldNotSaveException;
use Magento\Framework\Exception\NoSuchEntityException;
use ShoppingFeed\Manager\Api\Data\AccountInterface;


/**
* @api
*/
interface AccountRepositoryInterface
{
/**
* @param AccountInterface $account
* @return AccountInterface
* @throws CouldNotSaveException
*/
public function save(AccountInterface $account);

/**
* @param int $accountId
* @return AccountInterface
* @throws NoSuchEntityException
*/
public function getById($accountId);

/**
* @param string $apiToken
* @return AccountInterface
* @throws NoSuchEntityException
*/
public function getByApiToken($apiToken);

/**
* @param AccountInterface $account
* @return bool
* @throws CouldNotDeleteException
*/
public function delete(AccountInterface $account);

/**
* @param int $accountId
* @return bool
* @throws NoSuchEntityException
* @throws CouldNotDeleteException
*/
public function deleteById($accountId);
}
126 changes: 126 additions & 0 deletions Api/Data/Account/StoreInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<?php

namespace ShoppingFeed\Manager\Api\Data\Account;

use Magento\Store\Api\Data\StoreInterface as BaseStoreInterface;
use ShoppingFeed\Manager\DataObject;


interface StoreInterface
{
/**#@+*/
const STORE_ID = 'store_id';
const ACCOUNT_ID = 'account_id';
const BASE_STORE_ID = 'base_store_id';
const SHOPPING_FEED_STORE_ID = 'shopping_feed_store_id';
const SHOPPING_FEED_NAME = 'shopping_feed_name';
const CONFIGURATION = 'configuration';
const CREATED_AT = 'created_at';
const UPDATED_AT = 'updated_at';
/**#@-*/

/**
* @return int|null
*/
public function getId();

/**
* @return int
*/
public function getAccountId();

/**
* @return int
*/
public function getBaseStoreId();

/**
* @return BaseStoreInterface
*/
public function getBaseStore();

/**
* @return int
*/
public function getShoppingFeedStoreId();

/**
* @return string
*/
public function getShoppingFeedName();

/**
* @return DataObject
*/
public function getConfiguration();

/**
* @return string
*/
public function getCreatedAt();

/**
* @return string
*/
public function getUpdatedAt();

/**
* @param string $path
* @return mixed
*/
public function getScopeConfigValue($path);

/**
* @param int $id
* @return StoreInterface
*/
public function setId($id);

/**
* @param int $accountId
* @return StoreInterface
*/
public function setAccountId($accountId);

/**
* @param int $baseStoreId
* @return StoreInterface
*/
public function setBaseStoreId($baseStoreId);

/**
* @param int $shoppingFeedStoreId
* @return StoreInterface
*/
public function setShoppingFeedStoreId($shoppingFeedStoreId);

/**
* @param string $shoppingFeedName
* @return StoreInterface
*/
public function setShoppingFeedName($shoppingFeedName);

/**
* @param DataObject $configuration
* @return StoreInterface
*/
public function setConfiguration(DataObject $configuration);

/**
* @param string $createdAt
* @return StoreInterface
*/
public function setCreatedAt($createdAt);

/**
* @param string $updatedAt
* @return StoreInterface
*/
public function setUpdatedAt($updatedAt);

/**
* @param array $params
* @return StoreInterface
*/
public function importConfigurationData(array $params);
}
23 changes: 23 additions & 0 deletions Api/Data/Account/StoreSearchResultsInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace ShoppingFeed\Manager\Api\Data\Account;

use Magento\Framework\Api\SearchResultsInterface;


/**
* @api
*/
interface StoreSearchResultsInterface extends SearchResultsInterface
{
/**
* @return StoreInterface[]
*/
public function getItems();

/**
* @param StoreInterface[] $items
* @return $this
*/
public function setItems(array $items);
}
94 changes: 94 additions & 0 deletions Api/Data/AccountInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?php

namespace ShoppingFeed\Manager\Api\Data;


interface AccountInterface
{
/**#@+*/
const ACCOUNT_ID = 'account_id';
const SHOPPING_FEED_ACCOUNT_ID = 'shopping_feed_account_id';
CONST API_TOKEN = 'api_token';
const SHOPPING_FEED_LOGIN = 'shopping_feed_login';
const SHOPPING_FEED_EMAIL = 'shopping_feed_email';
const CREATED_AT = 'created_at';
const UPDATED_AT = 'updated_at';
/**#@-*/

/**
* @return int|null
*/
public function getId();

/**
* @return int
*/
public function getShoppingFeedAccountId();

/**
* @return string
*/
public function getApiToken();

/**
* @return string
*/
public function getShoppingFeedLogin();

/**
* @return string
*/
public function getShoppingFeedEmail();

/**
* @return string
*/
public function getCreatedAt();

/**
* @return string
*/
public function getUpdatedAt();

/**
* @param int $id
* @return AccountInterface
*/
public function setId($id);

/**
* @param int $shoppingFeedAccountId
* @return AccountInterface
*/
public function setShoppingFeedAccountId($shoppingFeedAccountId);

/**
* @param string $apiToken
* @return AccountInterface
*/
public function setApiToken($apiToken);

/**
* @param string $shoppingFeedLogin
* @return AccountInterface
*/
public function setShoppingFeedLogin($shoppingFeedLogin);

/**
* @param string $shoppingFeedEmail
* @return AccountInterface
*/
public function setShoppingFeedEmail($shoppingFeedEmail);

/**
* @param string $createdAt
* @return AccountInterface
*/
public function setCreatedAt($createdAt);

/**
* @param string $updatedAt
* @return AccountInterface
*/
public function setUpdatedAt($updatedAt);
}
23 changes: 23 additions & 0 deletions Api/Data/AccountSearchResultsInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace ShoppingFeed\Manager\Api\Data;

use Magento\Framework\Api\SearchResultsInterface;


/**
* @api
*/
interface AccountSearchResultsInterface extends SearchResultsInterface
{
/**
* @return AccountInterface[]
*/
public function getItems();

/**
* @param AccountInterface[] $items
* @return $this
*/
public function setItems(array $items);
}
Loading