From 724832bc069e6cc0c0507f5e07cc04edef77dd5f Mon Sep 17 00:00:00 2001 From: Denis Voronin Date: Fri, 17 Feb 2017 19:52:31 +0200 Subject: [PATCH 01/12] CRM-7676: Magento Channels are created in INACTIVE state --- .../ChannelBundle/Form/Type/ChannelType.php | 6 +++ .../Schema/OroChannelBundleInstaller.php | 2 +- .../Schema/v1_9/ActivateAllChannelsQuery.php | 48 +++++++++++++++++++ .../Schema/v1_9/OroChannelBundle.php | 19 ++++++++ .../Tests/Unit/Form/Type/ChannelTypeTest.php | 5 +- 5 files changed, 77 insertions(+), 3 deletions(-) create mode 100644 src/Oro/Bundle/ChannelBundle/Migrations/Schema/v1_9/ActivateAllChannelsQuery.php create mode 100644 src/Oro/Bundle/ChannelBundle/Migrations/Schema/v1_9/OroChannelBundle.php diff --git a/src/Oro/Bundle/ChannelBundle/Form/Type/ChannelType.php b/src/Oro/Bundle/ChannelBundle/Form/Type/ChannelType.php index 0fec2672a3b..fbd9e15eeba 100644 --- a/src/Oro/Bundle/ChannelBundle/Form/Type/ChannelType.php +++ b/src/Oro/Bundle/ChannelBundle/Form/Type/ChannelType.php @@ -4,6 +4,7 @@ use Symfony\Component\Form\FormView; use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\Extension\Core\Type\HiddenType; use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface; @@ -60,6 +61,11 @@ public function buildForm(FormBuilderInterface $builder, array $options) 'empty_value' => '', ] ); + $builder->add( + 'status', + HiddenType::class, + ['data' => Channel::STATUS_ACTIVE] + ); } /** diff --git a/src/Oro/Bundle/ChannelBundle/Migrations/Schema/OroChannelBundleInstaller.php b/src/Oro/Bundle/ChannelBundle/Migrations/Schema/OroChannelBundleInstaller.php index 2bd281fc9be..c63c8422993 100644 --- a/src/Oro/Bundle/ChannelBundle/Migrations/Schema/OroChannelBundleInstaller.php +++ b/src/Oro/Bundle/ChannelBundle/Migrations/Schema/OroChannelBundleInstaller.php @@ -33,7 +33,7 @@ public function setExtendExtension(ExtendExtension $extendExtension) */ public function getMigrationVersion() { - return 'v1_8'; + return 'v1_9'; } /** diff --git a/src/Oro/Bundle/ChannelBundle/Migrations/Schema/v1_9/ActivateAllChannelsQuery.php b/src/Oro/Bundle/ChannelBundle/Migrations/Schema/v1_9/ActivateAllChannelsQuery.php new file mode 100644 index 00000000000..b5c01f59f5b --- /dev/null +++ b/src/Oro/Bundle/ChannelBundle/Migrations/Schema/v1_9/ActivateAllChannelsQuery.php @@ -0,0 +1,48 @@ +doExecute($logger, true); + + return $logger->getMessages(); + } + + /** + * {@inheritdoc} + */ + public function execute(LoggerInterface $logger) + { + $this->doExecute($logger); + } + + /** + * @param LoggerInterface $logger + * @param bool $dryRun + */ + public function doExecute(LoggerInterface $logger, $dryRun = false) + { + $sql = 'UPDATE orocrm_channel SET status = :status'; + $params = ['status' => true]; + $types = ['status' => Type::BOOLEAN]; + + $this->logQuery($logger, $sql, $params, $types); + if (!$dryRun) { + $this->connection->executeUpdate($sql, $params, $types); + } + } +} diff --git a/src/Oro/Bundle/ChannelBundle/Migrations/Schema/v1_9/OroChannelBundle.php b/src/Oro/Bundle/ChannelBundle/Migrations/Schema/v1_9/OroChannelBundle.php new file mode 100644 index 00000000000..b0a40c56d93 --- /dev/null +++ b/src/Oro/Bundle/ChannelBundle/Migrations/Schema/v1_9/OroChannelBundle.php @@ -0,0 +1,19 @@ +addQuery(new ActivateAllChannelsQuery()); + } +} diff --git a/src/Oro/Bundle/ChannelBundle/Tests/Unit/Form/Type/ChannelTypeTest.php b/src/Oro/Bundle/ChannelBundle/Tests/Unit/Form/Type/ChannelTypeTest.php index 464be78f9f0..d30400db15e 100644 --- a/src/Oro/Bundle/ChannelBundle/Tests/Unit/Form/Type/ChannelTypeTest.php +++ b/src/Oro/Bundle/ChannelBundle/Tests/Unit/Form/Type/ChannelTypeTest.php @@ -49,7 +49,7 @@ public function testBuildForm() { $fields = []; - $this->builder->expects($this->exactly(3))->method('add') + $this->builder->expects($this->exactly(4))->method('add') ->will( $this->returnCallback( function ($filedName, $fieldType) use (&$fields) { @@ -64,7 +64,8 @@ function ($filedName, $fieldType) use (&$fields) { [ 'name' => 'text', 'entities' => 'oro_channel_entities', - 'channelType' => 'genemu_jqueryselect2_choice' + 'channelType' => 'genemu_jqueryselect2_choice', + 'status' => 'Symfony\Component\Form\Extension\Core\Type\HiddenType' ], $fields ); From 35bed8b14ae8dd1656cd1875241b3c13eb64d329 Mon Sep 17 00:00:00 2001 From: Alexandr Parkhomenko Date: Mon, 20 Feb 2017 13:05:33 +0200 Subject: [PATCH 02/12] CRM-7608: Can't save changes in Opportunity through edit form (2.0) (#7500) - Replaced `recomputeSingleEntityChangeSet` on custom change set recalculation to fix problem with entity update if workflow enabled --- ...OpportunityEditWithEnabledWorkflowTest.php | 81 +++++++++++ .../Fixture/AbstractOpportunityFixtures.php | 134 ++++++++++++++++++ .../Fixture/LoadOpenOpportunityFixtures.php | 40 ++++++ 3 files changed, 255 insertions(+) create mode 100644 src/Oro/Bundle/SalesBundle/Tests/Functional/Controller/OpportunityEditWithEnabledWorkflowTest.php create mode 100644 src/Oro/Bundle/SalesBundle/Tests/Functional/Fixture/AbstractOpportunityFixtures.php create mode 100644 src/Oro/Bundle/SalesBundle/Tests/Functional/Fixture/LoadOpenOpportunityFixtures.php diff --git a/src/Oro/Bundle/SalesBundle/Tests/Functional/Controller/OpportunityEditWithEnabledWorkflowTest.php b/src/Oro/Bundle/SalesBundle/Tests/Functional/Controller/OpportunityEditWithEnabledWorkflowTest.php new file mode 100644 index 00000000000..13bb41750d6 --- /dev/null +++ b/src/Oro/Bundle/SalesBundle/Tests/Functional/Controller/OpportunityEditWithEnabledWorkflowTest.php @@ -0,0 +1,81 @@ +initClient( + ['debug' => false], + array_merge($this->generateBasicAuthHeader(), array('HTTP_X-CSRF-Header' => 1)) + ); + $this->client->useHashNavigation(true); + $this->workflowManager = $this->client->getContainer()->get('oro_workflow.manager'); + $this->workflowManager->activateWorkflow('opportunity_flow'); + $this->loadFixtures([ + LoadOpenOpportunityFixtures::class + ]); + } + + /** + * {@inheritdoc} + */ + protected function tearDown() + { + unset($this->workflowManager); + parent::tearDown(); + } + + public function testEditOpportunity() + { + $newOpportunityName = 'Changed name'; + + $opportunity = $this->getReference('open_opportunity'); + + $crawler = $this->client->request( + 'GET', + $this->getUrl('oro_sales_opportunity_update', ['id' => $opportunity->getId()]) + ); + + /** @var Form $form */ + $form = $crawler->selectButton('Save and Close')->form(); + $form['oro_sales_opportunity_form[name]']->setValue($newOpportunityName); + + $this->client->followRedirects(true); + $this->client->submit($form); + + $result = $this->client->getResponse(); + $this->assertHtmlResponseStatusCodeEquals($result, 200); + + $crawler = $this->client->request( + 'GET', + $this->getUrl('oro_sales_opportunity_update', ['id' => $opportunity->getId()]) + ); + + $form = $crawler->selectButton('Save and Close')->form(); + + $opportunityName = $form['oro_sales_opportunity_form[name]']; + + $this->assertEquals( + $newOpportunityName, + $opportunityName->getValue(), + "Changed opportunity name through edit form with enabled 'Opportunity workflow' is fault !" + ); + } +} diff --git a/src/Oro/Bundle/SalesBundle/Tests/Functional/Fixture/AbstractOpportunityFixtures.php b/src/Oro/Bundle/SalesBundle/Tests/Functional/Fixture/AbstractOpportunityFixtures.php new file mode 100644 index 00000000000..4198c627f26 --- /dev/null +++ b/src/Oro/Bundle/SalesBundle/Tests/Functional/Fixture/AbstractOpportunityFixtures.php @@ -0,0 +1,134 @@ +user)) { + $this->user = $this->em->getRepository('OroUserBundle:User')->findOneBy(['username' => 'admin']); + } + + return $this->user; + } + + /** + * @return Organization + */ + protected function getOrganization() + { + if (empty($this->organization)) { + $this->organization = $this->em->getRepository('OroOrganizationBundle:Organization')->getFirst(); + } + return $this->organization; + } + + /** + * @return void + */ + protected function createChannel() + { + $factory = $this->container->get('oro_channel.builder.factory'); + + $channel = $factory + ->createBuilder() + ->setName('Default channel') + ->setChannelType('b2b') + ->setStatus(Channel::STATUS_ACTIVE) + ->setOwner($this->organization) + ->setEntities() + ->getChannel(); + + $this->em->persist($channel); + $this->em->flush(); + + $this->setReference('default_channel', $channel); + } + + /** + * @return void + */ + protected function createB2bCustomer() + { + $customer = new B2bCustomer(); + $account = $this->getReference('default_account'); + $customer->setAccount($account); + $customer->setName("Default customer"); + $customer->setOrganization($this->getOrganization()); + $customer->setDataChannel($this->getReference('default_channel')); + + $this->em->persist($customer); + $this->em->flush(); + + $accountManager = $this->container->get('oro_sales.manager.account_customer'); + + $accountCustomer = $accountManager->getAccountCustomerByTarget($customer); + $this->setReference('default_account_customer', $accountCustomer); + } + + /** + * @return void + */ + protected function createAccount() + { + $account = new Account(); + $account->setName('Default account'); + $account->setOrganization($this->getOrganization()); + + $this->em->persist($account); + $this->em->flush(); + + $this->setReference('default_account', $account); + } + + /** + * @return void + */ + abstract protected function createOpportunity(); + + /** + * {@inheritDoc} + */ + public function load(ObjectManager $manager) + { + $this->em = $manager; + $this->createChannel(); + $this->createAccount(); + $this->createB2bCustomer(); + + $this->createOpportunity(); + } +} diff --git a/src/Oro/Bundle/SalesBundle/Tests/Functional/Fixture/LoadOpenOpportunityFixtures.php b/src/Oro/Bundle/SalesBundle/Tests/Functional/Fixture/LoadOpenOpportunityFixtures.php new file mode 100644 index 00000000000..1f00616d76d --- /dev/null +++ b/src/Oro/Bundle/SalesBundle/Tests/Functional/Fixture/LoadOpenOpportunityFixtures.php @@ -0,0 +1,40 @@ +setName('test_opportunity_open'); + + $opportunity->setCustomerAssociation($this->getReference('default_account_customer')); + $opportunity->setOrganization($this->getOrganization()); + $opportunity->setOwner($this->getUser()); + + $budgetAmount = MultiCurrency::create(50, 'USD'); + $opportunity->setBudgetAmount($budgetAmount); + + $closeRevenue = MultiCurrency::create(0, 'USD'); + $opportunity->setCloseRevenue($closeRevenue); + + $opportunity->setProbability(40); + + $enumClass = ExtendHelper::buildEnumValueClassName(Opportunity::INTERNAL_STATUS_CODE); + $opportunity->setStatus($this->em->getReference($enumClass, 'in_progress')); + + $this->em->persist($opportunity); + $this->em->flush(); + + $this->setReference('open_opportunity', $opportunity); + } +} From f5b549c4acc3a95f0361c6b378969caf70cbbe9e Mon Sep 17 00:00:00 2001 From: Sergey Zhuravel Date: Mon, 20 Feb 2017 15:37:33 +0200 Subject: [PATCH 03/12] BAP-13889: Impossible to install Oro products (#7722) --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4a6d8218b88..5722c4c8b5d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ before_script: - composer require --no-update --dev "phpunit/phpunit:5.7.*" - composer require --no-update --dev "squizlabs/php_codesniffer:2.7.*" - composer require --no-update --dev "phpmd/phpmd:2.5.*" - - composer global show fxp/composer-asset-plugin 1.2.2 || composer global require fxp/composer-asset-plugin:1.2.2 + - composer global require fxp/composer-asset-plugin - travis_wait composer update --prefer-dist --optimize-autoloader --no-interaction --no-suggest --prefer-stable - set +e; DIFF=$(git diff --name-only --diff-filter=ACMR $TRAVIS_COMMIT_RANGE | grep -e ".*\.php$"); set -e; From fd04ad4ccc61e084ed1054d516f9253d8dfe5506 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Nenad=C3=A1l?= Date: Wed, 22 Feb 2017 14:39:44 +0100 Subject: [PATCH 04/12] =?UTF-8?q?OEE-1399:=20Life=20Time=20Sales=20Value?= =?UTF-8?q?=20not=20working=20for=20Accounts=20on=20the=20Publi=E2=80=A6?= =?UTF-8?q?=20(#7306)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OEE-1399: Life Time Sales Value not working for Accounts on the Public Demo of OroCRM --- .../Repository/LifetimeHistoryRepository.php | 44 ++++++++++------- .../EventListener/ChannelDoctrineListener.php | 47 ++++++++----------- .../Provider/Lifetime/AmountProvider.php | 6 --- .../ChannelDoctrineListenerTest.php | 12 ++--- .../Provider/Lifetime/AmountProviderTest.php | 2 +- .../Data/ORM/UpdateLifetimeHistory.php | 7 ++- 6 files changed, 59 insertions(+), 59 deletions(-) diff --git a/src/Oro/Bundle/ChannelBundle/Entity/Repository/LifetimeHistoryRepository.php b/src/Oro/Bundle/ChannelBundle/Entity/Repository/LifetimeHistoryRepository.php index 646e604221f..6d5c0c4dbd6 100644 --- a/src/Oro/Bundle/ChannelBundle/Entity/Repository/LifetimeHistoryRepository.php +++ b/src/Oro/Bundle/ChannelBundle/Entity/Repository/LifetimeHistoryRepository.php @@ -3,46 +3,58 @@ namespace Oro\Bundle\ChannelBundle\Entity\Repository; use Doctrine\ORM\EntityRepository; - use Oro\Bundle\AccountBundle\Entity\Account; use Oro\Bundle\ChannelBundle\Entity\Channel; use Oro\Bundle\ChannelBundle\Entity\LifetimeValueHistory; use Oro\Bundle\SalesBundle\Entity\Customer as CustomerAssociation; use Oro\Bundle\SalesBundle\Entity\Manager\AccountCustomerManager; +use Oro\Component\DoctrineUtils\ORM\QueryUtils; class LifetimeHistoryRepository extends EntityRepository { /** * Calculates lifetime value based on "customer identity" values, limited by channel if given * - * @param string $identityFQCN - * @param string $lifetimeField + * @param array $customerIdentities [customerClass => lifetimeField, ...] * @param Account $account * @param Channel $channel * * @return double */ - public function calculateAccountLifetime($identityFQCN, $lifetimeField, Account $account, Channel $channel = null) + public function calculateAccountLifetime(array $customerIdentities, Account $account, Channel $channel = null) { - if ($identityFQCN !== 'Oro\Bundle\CustomerBundle\Entity\Customer') { + if (!$customerIdentities) { return 0.0; } - $field = AccountCustomerManager::getCustomerTargetField($identityFQCN); + $qb = $this->getEntityManager()->createQueryBuilder() + ->from(CustomerAssociation::class, 'c') + ->where('c.account = :account') + ->setParameter('account', $account->getId()); + + $selectFields = []; + $channelConditions = []; + foreach ($customerIdentities as $customerClass => $customerLifetimeField) { + $customerAlias = QueryUtils::generateParameterName('customer'); + $qb + ->leftJoin( + sprintf('c.%s', AccountCustomerManager::getCustomerTargetField($customerClass)), + $customerAlias + ); + $selectFields[] = sprintf('COALESCE(SUM(%s.%s), 0)', $customerAlias, $customerLifetimeField); - $qb = $this->getEntityManager()->createQueryBuilder(); - $qb->from($identityFQCN, 'e'); - $qb->join(CustomerAssociation::class, 'ca', 'WITH', sprintf('ca.%s = e', $field)); - $qb->select(sprintf('SUM(e.%s)', $lifetimeField)); - $qb->andWhere('ca.account = :account'); - $qb->setParameter('account', $account); + $channelConditions[] = sprintf('%s.dataChannel = :channel', $customerAlias); + } - if (null !== $channel) { - $qb->andWhere('e.dataChannel = :channel'); - $qb->setParameter('channel', $channel); + if ($channel) { + $qb + ->andWhere(call_user_func_array([$qb->expr(), 'orX'], $channelConditions)) + ->setParameter('channel', $channel->getId()); } - return (float)$qb->getQuery()->getSingleScalarResult(); + $qb->select(sprintf('(%s)', implode(' + ', $selectFields))); + + return (float) $qb->getQuery()->getSingleScalarResult(); } /** diff --git a/src/Oro/Bundle/ChannelBundle/EventListener/ChannelDoctrineListener.php b/src/Oro/Bundle/ChannelBundle/EventListener/ChannelDoctrineListener.php index 4afec0f1a20..2ccfff00488 100644 --- a/src/Oro/Bundle/ChannelBundle/EventListener/ChannelDoctrineListener.php +++ b/src/Oro/Bundle/ChannelBundle/EventListener/ChannelDoctrineListener.php @@ -63,13 +63,11 @@ public function onFlush(OnFlushEventArgs $args) $entities = $this->getChangedTrackedEntities(); foreach ($entities as $entity) { - $className = ClassUtils::getClass($entity); if ($this->uow->isScheduledForUpdate($entity)) { $this->checkAndUpdate($entity, $this->uow->getEntityChangeSet($entity)); } else { $account = $this->getAccount($entity); $this->scheduleUpdate( - $className, $account, $entity->getDataChannel() ); @@ -91,23 +89,21 @@ public function postFlush(PostFlushEventArgs $args) if (count($this->queued) > 0) { $toOutDate = []; - foreach ($this->queued as $customerIdentity => $groupedByEntityUpdates) { - foreach ($groupedByEntityUpdates as $data) { - /** @var Account $account */ - $account = is_object($data['account']) - ? $data['account'] - : $this->em->getReference('OroAccountBundle:Account', $data['account']); + foreach ($this->queued as $data) { + /** @var Account $account */ + $account = is_object($data['account']) + ? $data['account'] + : $this->em->getReference('OroAccountBundle:Account', $data['account']); - /** @var Channel $channel */ - $channel = is_object($data['channel']) - ? $data['channel'] - : $this->em->getReference('OroChannelBundle:Channel', $data['channel']); + /** @var Channel $channel */ + $channel = is_object($data['channel']) + ? $data['channel'] + : $this->em->getReference('OroChannelBundle:Channel', $data['channel']); - $entity = $this->createHistoryEntry($customerIdentity, $account, $channel); - $toOutDate[] = [$account, $channel, $entity]; + $entity = $this->createHistoryEntry($account, $channel); + $toOutDate[] = [$account, $channel, $entity]; - $this->em->persist($entity); - } + $this->em->persist($entity); } $this->isInProgress = true; @@ -134,9 +130,7 @@ public function scheduleEntityUpdate($customerIdentityEntity, Account $account = throw new \RuntimeException('UOW is missing, listener is not initialized'); } - $customerIdentity = ClassUtils::getClass($customerIdentityEntity); - - $this->scheduleUpdate($customerIdentity, $account, $channel); + $this->scheduleUpdate($account, $channel); } /** @@ -188,12 +182,12 @@ protected function checkAndUpdate($entity, array $changeSet) if ($this->isUpdateRequired($className, $changeSet)) { $account = $this->getAccount($entity); $channel = $entity->getDataChannel(); - $this->scheduleUpdate($className, $account, $channel); + $this->scheduleUpdate($account, $channel); $oldChannel = $this->getOldValue($changeSet, 'dataChannel'); $oldAccount = $this->getOldValue($changeSet, 'account'); if ($oldChannel || $oldAccount) { - $this->scheduleUpdate($className, $oldAccount ? : $account, $oldChannel ? : $channel); + $this->scheduleUpdate($oldAccount ? : $account, $oldChannel ? : $channel); } } } @@ -211,11 +205,10 @@ protected function isUpdateRequired($className, array $changeSet) } /** - * @param string $customerIdentity * @param Account $account * @param Channel $channel */ - protected function scheduleUpdate($customerIdentity, Account $account = null, Channel $channel = null) + protected function scheduleUpdate(Account $account = null, Channel $channel = null) { if ($account && $channel) { // skip removal, history items will be flushed by FK constraints @@ -225,7 +218,7 @@ protected function scheduleUpdate($customerIdentity, Account $account = null, Ch $key = sprintf('%s__%s', spl_object_hash($account), spl_object_hash($channel)); - $this->queued[$customerIdentity][$key] = [ + $this->queued[$key] = [ 'account' => $account->getId() ? : $account, 'channel' => $channel->getId() ? : $channel ]; @@ -246,17 +239,15 @@ protected function getOldValue(array $changeSet, $key) } /** - * @param string $customerIdentity * @param Account $account * @param Channel $channel * * @return LifetimeValueHistory */ - protected function createHistoryEntry($customerIdentity, Account $account, Channel $channel) + protected function createHistoryEntry(Account $account, Channel $channel) { $lifetimeAmount = $this->getLifetimeRepository()->calculateAccountLifetime( - $customerIdentity, - $this->customerIdentities[$customerIdentity], + $this->customerIdentities, $account, $channel ); diff --git a/src/Oro/Bundle/ChannelBundle/Provider/Lifetime/AmountProvider.php b/src/Oro/Bundle/ChannelBundle/Provider/Lifetime/AmountProvider.php index 74e92263baa..03b5f76334b 100644 --- a/src/Oro/Bundle/ChannelBundle/Provider/Lifetime/AmountProvider.php +++ b/src/Oro/Bundle/ChannelBundle/Provider/Lifetime/AmountProvider.php @@ -78,12 +78,6 @@ public function getChannelAccountLifetimeQueryBuilder($addChannelParam = false) $qb->setParameter('status', $qb->expr()->literal(LifetimeValueHistory::STATUS_NEW)); $qb->setMaxResults(1); - if (!$addChannelParam) { - $qb - ->andWhere('ch.status = :channel_status OR ch.id IS NULL') - ->setParameter('channel_status', Channel::STATUS_ACTIVE); - } - return $qb; } diff --git a/src/Oro/Bundle/ChannelBundle/Tests/Unit/EventListener/ChannelDoctrineListenerTest.php b/src/Oro/Bundle/ChannelBundle/Tests/Unit/EventListener/ChannelDoctrineListenerTest.php index 5bd7efbdd0e..476407508ad 100644 --- a/src/Oro/Bundle/ChannelBundle/Tests/Unit/EventListener/ChannelDoctrineListenerTest.php +++ b/src/Oro/Bundle/ChannelBundle/Tests/Unit/EventListener/ChannelDoctrineListenerTest.php @@ -148,19 +148,17 @@ public function testPostFlush() $account2 = clone $account; $queue = [ - 'Oro\Bundle\ChannelBundle\Tests\Unit\Stubs\Entity\Customer' => [ - uniqid('accountId__channelId', true) => ['account' => $account, 'channel' => $channel], - uniqid('accountId__channelId', true) => ['account' => $account2, 'channel' => $channel], - ] + uniqid('accountId__channelId', true) => ['account' => $account, 'channel' => $channel], + uniqid('accountId__channelId', true) => ['account' => $account2, 'channel' => $channel], ]; $this->lifetimeRepo->expects($this->exactly(2))->method('calculateAccountLifetime') ->with( - $this->equalTo('Oro\Bundle\ChannelBundle\Tests\Unit\Stubs\Entity\Customer'), - $this->equalTo('lifetime'), + ['Oro\Bundle\ChannelBundle\Tests\Unit\Stubs\Entity\Customer' => 'lifetime'], $this->isInstanceOf('Oro\Bundle\AccountBundle\Entity\Account'), $this->isInstanceOf('Oro\Bundle\ChannelBundle\Entity\Channel') - )->will($this->onConsecutiveCalls(100, 200)); + ) + ->will($this->onConsecutiveCalls(100, 200)); $this->em->expects($this->exactly(2))->method('persist'); $this->em->expects($this->once())->method('flush'); diff --git a/src/Oro/Bundle/ChannelBundle/Tests/Unit/Provider/Lifetime/AmountProviderTest.php b/src/Oro/Bundle/ChannelBundle/Tests/Unit/Provider/Lifetime/AmountProviderTest.php index 58d72a83562..50a3f30c6eb 100644 --- a/src/Oro/Bundle/ChannelBundle/Tests/Unit/Provider/Lifetime/AmountProviderTest.php +++ b/src/Oro/Bundle/ChannelBundle/Tests/Unit/Provider/Lifetime/AmountProviderTest.php @@ -75,7 +75,7 @@ public function lifetimeValueProvider() 'get account summary lifetime' => [ 'SELECT SUM(l0_.amount) AS sclr_0 FROM LifetimeValueHistory l0_ ' . 'LEFT JOIN Channel c1_ ON l0_.data_channel_id = c1_.id ' . - 'WHERE l0_.account_id = ? AND l0_.status = ? AND (c1_.status = ? OR c1_.id IS NULL) LIMIT 1', + 'WHERE l0_.account_id = ? AND l0_.status = ? LIMIT 1', 100.00 ], 'get account lifetime in channel' => [ diff --git a/src/Oro/Bundle/MagentoBundle/Migrations/Data/ORM/UpdateLifetimeHistory.php b/src/Oro/Bundle/MagentoBundle/Migrations/Data/ORM/UpdateLifetimeHistory.php index 67cd3729507..9566fd02d9b 100644 --- a/src/Oro/Bundle/MagentoBundle/Migrations/Data/ORM/UpdateLifetimeHistory.php +++ b/src/Oro/Bundle/MagentoBundle/Migrations/Data/ORM/UpdateLifetimeHistory.php @@ -59,6 +59,11 @@ public function load(ObjectManager $manager) $brokenAccountQb = $this->getBrokenAccountsQueryBuilder($customerIdentityClass, $lifetimeField, $lifetimeRepo); $brokenAccountsData = new BufferedQueryResultIterator($brokenAccountQb); + $customerIdentities = []; + foreach ($lifetimeSettings as $singleChannelTypeData) { + $customerIdentities[$singleChannelTypeData['entity']] = $singleChannelTypeData['field']; + } + $toOutDate = []; foreach ($brokenAccountsData as $brokenDataRow) { /** @var Account $account */ @@ -66,7 +71,7 @@ public function load(ObjectManager $manager) /** @var Channel $channel */ $channel = $manager->getReference($channelClass, $brokenDataRow['channel_id']); $lifetimeAmount = $lifetimeRepo - ->calculateAccountLifetime($customerIdentityClass, $lifetimeField, $account, $channel); + ->calculateAccountLifetime($customerIdentities, $account, $channel); $history = new LifetimeValueHistory(); $history->setAmount($lifetimeAmount); From a16aa657b0fcb18c5061d6ed091b27b4128a8a50 Mon Sep 17 00:00:00 2001 From: Makar Date: Wed, 22 Feb 2017 21:13:47 +0200 Subject: [PATCH 05/12] CRM-7778: Embedded forms does not work after migration to 2.0 (#7800) --- .../Schema/OroCRMBundleInstaller.php | 7 ++-- .../Schema/v1_3/EmbededFormType.php | 33 +++++++++++++++++++ .../Schema/v1_3/TaggingEntityName.php | 33 +++++++++++++++++++ 3 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 src/Oro/Bundle/CRMBundle/Migrations/Schema/v1_3/EmbededFormType.php create mode 100644 src/Oro/Bundle/CRMBundle/Migrations/Schema/v1_3/TaggingEntityName.php diff --git a/src/Oro/Bundle/CRMBundle/Migrations/Schema/OroCRMBundleInstaller.php b/src/Oro/Bundle/CRMBundle/Migrations/Schema/OroCRMBundleInstaller.php index 4e3444dbf8d..622c893d896 100644 --- a/src/Oro/Bundle/CRMBundle/Migrations/Schema/OroCRMBundleInstaller.php +++ b/src/Oro/Bundle/CRMBundle/Migrations/Schema/OroCRMBundleInstaller.php @@ -9,9 +9,10 @@ use Oro\Bundle\MigrationBundle\Migration\Installation; use Oro\Bundle\MigrationBundle\Migration\QueryBag; - use Oro\Bundle\CRMBundle\Migrations\Schema\v1_1\MigrateRelations; use Oro\Bundle\CRMBundle\Migrations\Schema\v1_2\MigrateGridViews; +use Oro\Bundle\CRMBundle\Migrations\Schema\v1_3\EmbededFormType; +use Oro\Bundle\CRMBundle\Migrations\Schema\v1_3\TaggingEntityName; class OroCRMBundleInstaller implements Installation, ContainerAwareInterface { @@ -22,7 +23,7 @@ class OroCRMBundleInstaller implements Installation, ContainerAwareInterface */ public function getMigrationVersion() { - return 'v1_2'; + return 'v1_3'; } /** @@ -33,6 +34,8 @@ public function up(Schema $schema, QueryBag $queries) if ($this->container->hasParameter('installed') && $this->container->getParameter('installed')) { MigrateRelations::updateWorkFlow($schema, $queries); MigrateGridViews::updateGridViews($queries); + EmbededFormType::updateEmbededFormType($queries); + TaggingEntityName::updateTaggingEntityName($queries); } } } diff --git a/src/Oro/Bundle/CRMBundle/Migrations/Schema/v1_3/EmbededFormType.php b/src/Oro/Bundle/CRMBundle/Migrations/Schema/v1_3/EmbededFormType.php new file mode 100644 index 00000000000..f089c6aaae8 --- /dev/null +++ b/src/Oro/Bundle/CRMBundle/Migrations/Schema/v1_3/EmbededFormType.php @@ -0,0 +1,33 @@ +addQuery(new UpdateTableFieldQuery( + 'oro_embedded_form', + 'form_type', + 'orocrm_', + 'oro_' + )); + } +} diff --git a/src/Oro/Bundle/CRMBundle/Migrations/Schema/v1_3/TaggingEntityName.php b/src/Oro/Bundle/CRMBundle/Migrations/Schema/v1_3/TaggingEntityName.php new file mode 100644 index 00000000000..d9421a9fd48 --- /dev/null +++ b/src/Oro/Bundle/CRMBundle/Migrations/Schema/v1_3/TaggingEntityName.php @@ -0,0 +1,33 @@ +addQuery(new UpdateTableFieldQuery( + 'oro_tag_tagging', + 'entity_name', + 'OroCRM', + 'Oro' + )); + } +} From 0b7c335bfe0e0df28a8333138efe8c73206890b5 Mon Sep 17 00:00:00 2001 From: Alexander Tarakanov Date: Thu, 23 Feb 2017 16:07:12 +0200 Subject: [PATCH 06/12] BAP-12203 : Documentation for all API resources (#7599) --- .../Resources/config/oro/api.yml | 3 +- .../Resources/doc/api/account.md | 379 ++++++++++ .../Resources/translations/messages.en.yml | 28 +- .../Resources/translations/messages.en.yml | 12 +- .../CaseBundle/Resources/config/oro/api.yml | 12 +- .../Resources/doc/api/case_comment.md | 336 +++++++++ .../Resources/doc/api/case_entity.md | 573 ++++++++++++++ .../Resources/doc/api/case_priority.md | 15 + .../Resources/doc/api/case_source.md | 15 + .../Resources/doc/api/case_status.md | 15 + .../Resources/translations/messages.en.yml | 122 ++- .../Resources/config/oro/api.yml | 1 + .../Resources/doc/api/channel.md | 15 + .../Resources/config/oro/api.yml | 10 +- .../Resources/doc/api/contact.md | 712 +++++++++++++++++- .../Resources/doc/api/contact_address.md | 299 ++++++++ .../ContactBundle/Resources/doc/api/group.md | 190 +++++ .../ContactBundle/Resources/doc/api/method.md | 15 + .../ContactBundle/Resources/doc/api/source.md | 15 + .../Resources/translations/messages.en.yml | 204 +++-- .../SalesBundle/Resources/config/oro/api.yml | 57 +- .../Resources/doc/api/b2b_customer.md | 567 +++++++++++++- .../SalesBundle/Resources/doc/api/lead.md | 568 ++++++++++++++ .../Resources/doc/api/lead_address.md | 243 ++++++ .../Resources/doc/api/opportunity.md | 234 +++++- .../doc/api/opportunity_close_reason.md | 15 + .../Resources/doc/api/opportunity_status.md | 15 + .../Resources/doc/api/sale_funnel.md | 281 +++++++ .../Resources/translations/messages.en.yml | 334 +++++--- 29 files changed, 5053 insertions(+), 232 deletions(-) create mode 100644 src/Oro/Bundle/AccountBundle/Resources/doc/api/account.md create mode 100644 src/Oro/Bundle/CaseBundle/Resources/doc/api/case_comment.md create mode 100644 src/Oro/Bundle/CaseBundle/Resources/doc/api/case_entity.md create mode 100644 src/Oro/Bundle/CaseBundle/Resources/doc/api/case_priority.md create mode 100644 src/Oro/Bundle/CaseBundle/Resources/doc/api/case_source.md create mode 100644 src/Oro/Bundle/CaseBundle/Resources/doc/api/case_status.md create mode 100644 src/Oro/Bundle/ChannelBundle/Resources/doc/api/channel.md create mode 100644 src/Oro/Bundle/ContactBundle/Resources/doc/api/contact_address.md create mode 100644 src/Oro/Bundle/ContactBundle/Resources/doc/api/group.md create mode 100644 src/Oro/Bundle/ContactBundle/Resources/doc/api/method.md create mode 100644 src/Oro/Bundle/ContactBundle/Resources/doc/api/source.md create mode 100644 src/Oro/Bundle/SalesBundle/Resources/doc/api/lead.md create mode 100644 src/Oro/Bundle/SalesBundle/Resources/doc/api/lead_address.md create mode 100644 src/Oro/Bundle/SalesBundle/Resources/doc/api/opportunity_close_reason.md create mode 100644 src/Oro/Bundle/SalesBundle/Resources/doc/api/opportunity_status.md create mode 100644 src/Oro/Bundle/SalesBundle/Resources/doc/api/sale_funnel.md diff --git a/src/Oro/Bundle/AccountBundle/Resources/config/oro/api.yml b/src/Oro/Bundle/AccountBundle/Resources/config/oro/api.yml index e05fb8ee7eb..21d2286d895 100644 --- a/src/Oro/Bundle/AccountBundle/Resources/config/oro/api.yml +++ b/src/Oro/Bundle/AccountBundle/Resources/config/oro/api.yml @@ -1,3 +1,4 @@ api: entities: - Oro\Bundle\AccountBundle\Entity\Account: ~ + Oro\Bundle\AccountBundle\Entity\Account: + documentation_resource: '@OroAccountBundle/Resources/doc/api/account.md' diff --git a/src/Oro/Bundle/AccountBundle/Resources/doc/api/account.md b/src/Oro/Bundle/AccountBundle/Resources/doc/api/account.md new file mode 100644 index 00000000000..5a511911fc9 --- /dev/null +++ b/src/Oro/Bundle/AccountBundle/Resources/doc/api/account.md @@ -0,0 +1,379 @@ +# Oro\Bundle\AccountBundle\Entity\Account + +## ACTIONS + +### get + +Retrieve a specific account record. + +{@inheritdoc} + +### get_list + +Retrieve a collection of account records. + +{@inheritdoc} + +### create + +Create a new account record. +The created record is returned in the response. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"accounts", + "attributes":{ + "extend_description":null, + "name":"Gartner management group" + }, + "relationships":{ + "owner":{ + "data":{ + "type":"users", + "id":"44" + } + }, + "contacts":{ + "data":[ + { + "type":"contacts", + "id":"1" + }, + { + "type":"contacts", + "id":"3" + }, + { + "type":"contacts", + "id":"22" + } + ] + }, + "defaultContact":{ + "data":{ + "type":"contacts", + "id":"1" + } + }, + "organization":{ + "data":{ + "type":"organizations", + "id":"1" + } + } + } + } +} +``` +{@/request} + +### update + +Edit a specific account record. +The updated record is returned in the response. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"accounts", + "id":"51", + "attributes":{ + "extend_description":null, + "name":"Life Plan Counselling" + }, + "relationships":{ + "owner":{ + "data":{ + "type":"users", + "id":"44" + } + }, + "contacts":{ + "data":[ + { + "type":"contacts", + "id":"1" + }, + { + "type":"contacts", + "id":"3" + }, + { + "type":"contacts", + "id":"22" + } + ] + }, + "defaultContact":{ + "data":{ + "type":"contacts", + "id":"1" + } + }, + "organization":{ + "data":{ + "type":"organizations", + "id":"1" + } + } + } + } +} +``` +{@/request} + +### delete + +Delete a specific account record. + +{@inheritdoc} + +### delete_list + +Delete a collection of account records. +The list of records that will be deleted, could be limited by filters. + +{@inheritdoc} + +## FIELDS + +### name + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +### id + +#### update + +{@inheritdoc} + +**The required field** + +## SUBRESOURCES + +### contacts + +#### get_subresource + +Retrieve contact records assigned to a specific account record. + +#### get_relationship + +Retrieve contact IDs assigned to a specific account record. + +#### add_relationship + +Set contacts records for a specific account record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": [ + { + "type": "contacts", + "id": "1" + }, + { + "type": "contacts", + "id": "3" + }, + { + "type": "contacts", + "id": "22" + } + ] +} +``` +{@/request} + +#### update_relationship + +Replace the list of contacts assigned to a specific account record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": [ + { + "type": "contacts", + "id": "1" + }, + { + "type": "contacts", + "id": "3" + }, + { + "type": "contacts", + "id": "22" + } + ] +} +``` +{@/request} + +#### delete_relationship + +Remove contact records from a specific account record. + +### defaultContact + +#### get_subresource + +Retrieve the contact record that is default for a specific account record. + +#### get_relationship + +Retrieve the ID of the default contact assigned to a specific account record. + +#### update_relationship + +Replace the default contact record assigned to a specific account record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "contacts", + "id": "1" + } +} +``` +{@/request} + +### organization + +#### get_subresource + +Retrieve the record of the organization a specific account belongs to. + +#### get_relationship + +Retrieve the ID of the organization record that a specific account record belongs to. + +#### update_relationship + +Replace the organization a specific account belongs to. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "organizations", + "id": "1" + } +} +``` +{@/request} + +### owner + +#### get_subresource + +Retrieve the record of the user who is the owner of a specific lead record. + +#### get_relationship + +Retrieve the ID of a user who is the owner of a specific account record. + +#### update_relationship + +Replace the owner of a specific account record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "users", + "id": "44" + } +} +``` +{@/request} + +### referredBy + +#### get_subresource + +Retrieve the account records that refer to a specific account record. + +**Please note:** + +*This parameter is currently unavailable via the OroCRM interface.* + +#### get_relationship + +Retrieve the IDs of account records that refer to a specific account record. + +**Please note:** + +*This parameter is currently unavailable via the OroCRM interface.* + +#### update_relationship + +Replace the account records that refer to a specific account record. + +**Please note:** + +*This parameter is currently unavailable via the OroCRM interface.* + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "accounts", + "id": "2" + } +} +``` +{@/request} diff --git a/src/Oro/Bundle/AccountBundle/Resources/translations/messages.en.yml b/src/Oro/Bundle/AccountBundle/Resources/translations/messages.en.yml index 9c7eb49c042..56fadee9cdb 100644 --- a/src/Oro/Bundle/AccountBundle/Resources/translations/messages.en.yml +++ b/src/Oro/Bundle/AccountBundle/Resources/translations/messages.en.yml @@ -34,19 +34,29 @@ oro: # entity_label: Account entity_plural_label: Accounts - entity_description: Represent account - id.label: Id - name.label: Account name + entity_description: Accounts represent a person, a company or a group of people. Account aggregates details of all the customer identities assigned to it, providing for a 360-degree view of the customer activity. + id: + label: Id + description: The unique identifier of an account record. + name: + label: Account name + description: Unique name that identifies an account record. owner.label: Owner - contacts.label: Contacts - default_contact.label: Default Contact + contacts: + label: Contacts + description: The collection of contacts related to an account. + default_contact: + label: Default Contact + description: The default contact details for an account. phone.label: Phone email.label: Email assigned.label: Assigned - referred_by.label: Referred By - - extend_description.label: Description - + referred_by: + label: Referred By + description: A link to a different account. ***The parameter is currently deprecated.*** + extend_description: + label: Description + description: Details or a short description of an account record. lifetime_value.label: Lifetime sales value contact: diff --git a/src/Oro/Bundle/ActivityContactBundle/Resources/translations/messages.en.yml b/src/Oro/Bundle/ActivityContactBundle/Resources/translations/messages.en.yml index 9fb628e1b7f..3a4362095cb 100644 --- a/src/Oro/Bundle/ActivityContactBundle/Resources/translations/messages.en.yml +++ b/src/Oro/Bundle/ActivityContactBundle/Resources/translations/messages.en.yml @@ -2,22 +2,22 @@ oro: activity_contact: ac_last_contact_date: label: Last contact datetime - description: Represents last contact attempt datetime + description: Date and time of the last contact attempt (email sent, call logged, or other contact activity). Marketing emails are not counted. ac_last_contact_date_in: label: Last incoming contact datetime - description: Represents last incoming contact attempt datetime + description: Date and time of the last incoming contact attempt (email received, incoming call logged, or other contact activity). Marketing emails are not counted. ac_last_contact_date_out: label: Last outgoing contact datetime - description: Represents last outgoing contact attempt datetime + description: Date and time of the last outgoing contact attempt (email sent, outgoing call logged, or other contact activity). Marketing emails are not counted. ac_contact_count: label: Total times contacted - description: Represents total number of all contact attempts + description: The total number of all contact attempts (emails sent, calls logged, and other contact activities). Marketing emails are not counted. ac_contact_count_in: label: Total number of incoming contact attempts - description: Represents total number of incoming contact attempts + description: The total number of all incoming contact attempts (emails sent, calls logged, and other contact activities). Marketing emails are not counted. ac_contact_count_out: label: Total number of outgoing contact attempts - description: Represents total number of outgoing contact attempts + description: The total number of all outgoing contact attempts (emails sent, outgoing calls logged, and other contact activities). Marketing emails are not counted. days_since_last_contact: label: Days since the last contact diff --git a/src/Oro/Bundle/CaseBundle/Resources/config/oro/api.yml b/src/Oro/Bundle/CaseBundle/Resources/config/oro/api.yml index b42b05a24f5..7655ec68580 100644 --- a/src/Oro/Bundle/CaseBundle/Resources/config/oro/api.yml +++ b/src/Oro/Bundle/CaseBundle/Resources/config/oro/api.yml @@ -1,4 +1,12 @@ api: entities: - Oro\Bundle\CaseBundle\Entity\CaseComment: ~ - Oro\Bundle\CaseBundle\Entity\CaseEntity: ~ + Oro\Bundle\CaseBundle\Entity\CaseComment: + documentation_resource: '@OroCaseBundle/Resources/doc/api/case_comment.md' + Oro\Bundle\CaseBundle\Entity\CaseEntity: + documentation_resource: '@OroCaseBundle/Resources/doc/api/case_entity.md' + Oro\Bundle\CaseBundle\Entity\CasePriority: + documentation_resource: '@OroCaseBundle/Resources/doc/api/case_priority.md' + Oro\Bundle\CaseBundle\Entity\CaseSource: + documentation_resource: '@OroCaseBundle/Resources/doc/api/case_source.md' + Oro\Bundle\CaseBundle\Entity\CaseStatus: + documentation_resource: '@OroCaseBundle/Resources/doc/api/case_status.md' diff --git a/src/Oro/Bundle/CaseBundle/Resources/doc/api/case_comment.md b/src/Oro/Bundle/CaseBundle/Resources/doc/api/case_comment.md new file mode 100644 index 00000000000..0bdd5c9d082 --- /dev/null +++ b/src/Oro/Bundle/CaseBundle/Resources/doc/api/case_comment.md @@ -0,0 +1,336 @@ +# Oro\Bundle\CaseBundle\Entity\CaseComment + +## ACTIONS + +### get + +Retrieve a specific case comment record. + +{@inheritdoc} + +### get_list + +Retrieve a collection of case comment records. + +{@inheritdoc} + +### create + +Create a new case comment record. +The created record is returned in the response. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"casecomments", + "attributes":{ + "message":"Hello\n\npublic Signature" + }, + "relationships":{ + "case":{ + "data":{ + "type":"cases", + "id":"57" + } + }, + "owner":{ + "data":{ + "type":"users", + "id":"1" + } + }, + "organization":{ + "data":{ + "type":"organizations", + "id":"1" + } + } + } + } +} +``` +{@/request} + +### update + +Edit a specific case comment record. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"casecomments", + "id":"370", + "attributes":{ + "message":"Hello\n\npublic Signature" + }, + "relationships":{ + "case":{ + "data":{ + "type":"cases", + "id":"57" + } + }, + "owner":{ + "data":{ + "type":"users", + "id":"1" + } + }, + "organization":{ + "data":{ + "type":"organizations", + "id":"1" + } + } + } + } +} +``` +{@/request} + +### delete + +Delete a specific case comment record. + +{@inheritdoc} + +### delete_list + +Delete a collection of case comment records. +The list of records that will be deleted, could be limited by filters. + +{@inheritdoc} + +## FIELDS + +### id + +#### update + +{@inheritdoc} + +**The required field** + +### case + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +### message + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +## SUBRESOURCES + +### attachment + +#### get_subresource + +Retrieve the record of the attachment uploaded with a specific case comment. + +#### get_relationship + +Retrieve the ID of the file attached to a specific case comment. + +#### update_relationship + +Replace the file attached to a specific case comment. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "files", + "id": "4" + } +} +``` +{@/request} + +### case + +#### get_subresource + +Retrieve the record of the case a specific case comment was made on. + +#### get_relationship + +Retrieve the ID of the case that a specific case comment was made on. + +#### update_relationship + +Replace the case that a specific case comment was made on. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "cases", + "id": "22" + } +} +``` +{@/request} + +### contact + +#### get_subresource + +Retrieve the records of the contact who is an author of a specific case comment. + +#### get_relationship + +Retrieve the ID of the contact who is an author of a specific case comment. + +#### update_relationship + +Replace the contact who is an author of a specific case comment. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "contacts", + "id": "40" + } +} +``` +{@/request} + +### organization + +#### get_subresource + +Retrieve the record of the organization a specific case comment belongs to. + +#### get_relationship + +Retrieve the ID of the organization that a specific case comment belongs to. + +#### update_relationship + +Replace the organization that a specific case comment belongs to. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "organizations", + "id": "1" + } +} +``` +{@/request} + +### owner + +#### get_subresource + +Retrieve the records of the user who is an owner of a specific case comment record. + +This user is also considered the case comment author if the *contact* field value is not specified for the case comment. + +#### get_relationship + +Retrieve the ID of the user who is an owner of a specific case comment. + +#### update_relationship + +Replace the owner for a specific case comment. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "users", + "id": "14" + } +} +``` +{@/request} + +### updatedBy + +#### get_subresource + +Retrieve the record of the user who last updated a specific case comment record. + +#### get_relationship + +Retrieve the ID of the user who last updated a specific case comment record. + +#### update_relationship + +Replace the user who last updated a specific case comment record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "users", + "id": "45" + } +} +``` +{@/request} diff --git a/src/Oro/Bundle/CaseBundle/Resources/doc/api/case_entity.md b/src/Oro/Bundle/CaseBundle/Resources/doc/api/case_entity.md new file mode 100644 index 00000000000..208a2e66b48 --- /dev/null +++ b/src/Oro/Bundle/CaseBundle/Resources/doc/api/case_entity.md @@ -0,0 +1,573 @@ +# Oro\Bundle\CaseBundle\Entity\CaseEntity + +## ACTIONS + +### get + +Retrieve a specific case record. + +{@inheritdoc} + +### get_list + + +Retrieve a collection of case records. + +{@inheritdoc} + +### create + +Create a new case record. +The created record is returned in the response. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"cases", + "attributes":{ + "subject":"Parvis imbutus tentabis grandia tutus", + "description":"Pax tibi, Marce, evangelista meus. Hic requiescet corpus tuum.", + "resolution":"Per capsulam." + }, + "relationships":{ + "source":{ + "data":{ + "type":"casesources", + "id":"other" + } + }, + "status":{ + "data":{ + "type":"casestatuses", + "id":"open" + } + }, + "priority":{ + "data":{ + "type":"casepriorities", + "id":"high" + } + }, + "relatedContact":{ + "data":{ + "type":"contacts", + "id":"3" + } + }, + "assignedTo":{ + "data":{ + "type":"users", + "id":"20" + } + }, + "owner":{ + "data":{ + "type":"users", + "id":"35" + } + }, + "comments":{ + "data":[ + { + "type":"casecomments", + "id":"1" + }, + { + "type":"casecomments", + "id":"2" + } + ] + }, + "organization":{ + "data":{ + "type":"organizations", + "id":"1" + } + } + } + } +} +``` +{@/request} + +### update + +Edit a specific case record. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"cases", + "id":"22", + "attributes":{ + "subject":"Parvis imbutus tentabis grandia tutus", + "description":"Pax tibi, Marce, evangelista meus. Hic requiescet corpus tuum.", + "resolution":"Per capsulam." + }, + "relationships":{ + "source":{ + "data":{ + "type":"casesources", + "id":"other" + } + }, + "status":{ + "data":{ + "type":"casestatuses", + "id":"open" + } + }, + "priority":{ + "data":{ + "type":"casepriorities", + "id":"high" + } + }, + "relatedContact":{ + "data":{ + "type":"contacts", + "id":"3" + } + }, + "assignedTo":{ + "data":{ + "type":"users", + "id":"20" + } + }, + "owner":{ + "data":{ + "type":"users", + "id":"35" + } + }, + "comments":{ + "data":[ + { + "type":"casecomments", + "id":"1" + }, + { + "type":"casecomments", + "id":"2" + } + ] + }, + "organization":{ + "data":{ + "type":"organizations", + "id":"1" + } + } + } + } +} +``` +{@/request} + +### delete + +Delete a specific case record. + +{@inheritdoc} + +### delete_list + +Delete a collection of case records. +The list of records that will be deleted, could be limited by filters. + +{@inheritdoc} + +## FIELDS + +### id + +#### update + +{@inheritdoc} + +**The required field** + +### subject + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +### source + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +### status + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +### priority + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +## SUBRESOURCES + +### assignedTo + +#### get_subresource + +Retrieve the user record that a specific case record is assigned to. + +#### get_relationship + +Retrieve the ID of the user that a specific case is assigned to. + +#### update_relationship + +Replace the user that a specific case is assigned to. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "users", + "id": "20" + } +} +``` +{@/request} + +### comments + +#### get_subresource + +Retrieve the records of the comments made on a specific case. + +#### get_relationship + +Retrieve the IDs of the comments made on a specific case. + +#### add_relationship + +Set comments made on a specific case. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": [ + { + "type": "casecomments", + "id": "3" + }, + { + "type": "casecomments", + "id": "4" + } + ] +} +``` +{@/request} + +#### update_relationship + +Replace comments made on a specific case. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": [ + { + "type": "casecomments", + "id": "3" + }, + { + "type": "casecomments", + "id": "4" + } + ] +} +``` +{@/request} + +#### delete_relationship + +Remove comments made on a specidic case. + +### organization + +#### get_subresource + +Retrieve the record of the organization a specific case belongs to. + +#### get_relationship + +Retrieve the ID of the organization that a specific case belongs to. + +#### update_relationship + +Replace the organization that a specific case belongs to. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "organizations", + "id": "1" + } +} +``` +{@/request} + +### owner + +#### get_subresource + +Retrieve the records of the user who is an owner of a specific case record. + +#### get_relationship + +Retrieve the ID of the user who is an owner of a specific case. + +#### update_relationship + +Replace the owner for a specific case. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "users", + "id": "35" + } +} +``` +{@/request} + +### priority + +#### get_subresource + +Retrieve the priority record configured for a specific case record. + +#### get_relationship + +Retrieve the ID of the priority configured for a specific case. + +#### update_relationship + +Replace the priority configured for a specific case. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "casepriorities", + "id": "high" + } +} +``` +{@/request} + +### relatedAccount + +#### get_subresource + +Retrieve the record of the account that is related to a specific case. + +#### get_relationship + +Retrieve the ID of the account that is related to a specific case. + +#### update_relationship + +Replace the account that is related to a specific case. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "accounts", + "id": "8" + } +} +``` +{@/request} + +### relatedContact + +#### get_subresource + +Retrieve the record of the contact that is related to a specific case. + +#### get_relationship + +Retrieve the ID of the contact that is related to a specific case. + +#### update_relationship + +Replace the contact that is related to a specific case. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "contacts", + "id": "3" + } +} +``` +{@/request} + +### source + +#### get_subresource + +Retrieve the record of the source configured for a specific case record. + +#### get_relationship + +Retrieve the ID of the source configured for a specific case. + +#### update_relationship + +Replace the source configured for a specific case. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "casesources", + "id": "email" + } +} +``` +{@/request} + +### status + +#### get_subresource + +Retrieve the status record configured for a specific case record. + +#### get_relationship + +Retrieve the ID of the status configured for a specific case. + +#### update_relationship + +Replace the status configured for a specific case. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "casestatuses", + "id": "closed" + } +} +``` +{@/request} + + + + + + + + diff --git a/src/Oro/Bundle/CaseBundle/Resources/doc/api/case_priority.md b/src/Oro/Bundle/CaseBundle/Resources/doc/api/case_priority.md new file mode 100644 index 00000000000..665e80e359e --- /dev/null +++ b/src/Oro/Bundle/CaseBundle/Resources/doc/api/case_priority.md @@ -0,0 +1,15 @@ +# Oro\Bundle\CaseBundle\Entity\CasePriority + +## ACTIONS + +### get + +Retrieve a specific case priority record. + +{@inheritdoc} + +### get_list + +Retrieve a collection of case priority records. + +{@inheritdoc} \ No newline at end of file diff --git a/src/Oro/Bundle/CaseBundle/Resources/doc/api/case_source.md b/src/Oro/Bundle/CaseBundle/Resources/doc/api/case_source.md new file mode 100644 index 00000000000..d7b1cc34e5e --- /dev/null +++ b/src/Oro/Bundle/CaseBundle/Resources/doc/api/case_source.md @@ -0,0 +1,15 @@ +# Oro\Bundle\CaseBundle\Entity\CaseSource + +## ACTIONS + +### get + +Retrieve a specific case source record. + +{@inheritdoc} + +### get_list + +Retrieve a collection of case source records. + +{@inheritdoc} \ No newline at end of file diff --git a/src/Oro/Bundle/CaseBundle/Resources/doc/api/case_status.md b/src/Oro/Bundle/CaseBundle/Resources/doc/api/case_status.md new file mode 100644 index 00000000000..d7bcef80816 --- /dev/null +++ b/src/Oro/Bundle/CaseBundle/Resources/doc/api/case_status.md @@ -0,0 +1,15 @@ +# Oro\Bundle\CaseBundle\Entity\CaseStatus + +## ACTIONS + +### get + +Retrieve a specific case status record. + +{@inheritdoc} + +### get_list + +Retrieve a collection of case status records. + +{@inheritdoc} \ No newline at end of file diff --git a/src/Oro/Bundle/CaseBundle/Resources/translations/messages.en.yml b/src/Oro/Bundle/CaseBundle/Resources/translations/messages.en.yml index 71ec55decbc..a63b7102b8a 100644 --- a/src/Oro/Bundle/CaseBundle/Resources/translations/messages.en.yml +++ b/src/Oro/Bundle/CaseBundle/Resources/translations/messages.en.yml @@ -27,21 +27,47 @@ oro: # entity_label: Case entity_plural_label: Cases - entity_description: Represent case - subject.label: Subject - description.label: Description - resolution.label: Resolution + entity_description: Issues that were reported by customers or found internally and are managed by users. + subject: + label: Subject + description: The short title or description of the issue. + description: + label: Description + description: The detailed description of the issue. + resolution: + label: Resolution + description: The case resolution information in a free from. owner.label: Owner - assigned_to.label: Assigned To - closed_at.label: Closed On - reported_at.label: Reported On - related_contact.label: Related Contact - related_account.label: Related Account - source.label: Source - status.label: Status - priority.label: Priority - comments.label: Comments - id.label: Id + assigned_to: + label: Assigned To + description: The user that the case is assigned to. + closed_at: + label: Closed On + description: The date and time when the case was closed. + reported_at: + label: Reported On + description: The date and time when the case was reported. + related_contact: + label: Related Contact + description: The contact that is related to the case. + related_account: + label: Related Account + description: The account that is related to the case. + source: + label: Source + description: How the information about the issue was recieved. + status: + label: Status + description: The current phase of work on the case. + priority: + label: Priority + description: The order in which the case should be managed. + comments: + label: Comments + description: The comments made on the case. + id: + label: Id + description: The unique identifier of the case record. organization.label: Organization casecomment: @@ -50,16 +76,30 @@ oro: # entity_label: Case Comment entity_plural_label: Case Comments - entity_description: Represent case comment - message.label: Message - public.label: Make Public - contact.label: Contact Author - case.label: Related case - updated_by.label: Updated By + entity_description: The comments made on the case. + message: + label: Message + description: The case comment text. + public: + label: Make Public + description: Defiens wether the comment must be public on Zendesk. + contact: + label: Contact Author + description: The author of the case comment. If the value is not specified, the user who is the case comment owner is considered the case comment author. + case: + label: Related case + description: The case that the comment was made on. + updated_by: + label: Updated By + description: The user who last updated a specific case comment record. owner.label: Owner - id.label: Id + id: + label: Id + description: The unique identifier of the case comment record. organization.label: Organization - attachment.label: Attachment + attachment: + label: Attachment + description: The file that is attached to the case comment. action: add: Add Comment @@ -81,25 +121,41 @@ oro: casepriority: entity_label: Case Priority entity_plural_label: Case Priorities - entity_description: Represent case priority - name.label: Name - label.label: Label - order.label: Order + entity_description: The case priority helps determine the order in which cases must be managed. + name: + label: Name + description: The unique identifier of the case priority record. + label: + label: Label + description: The label of the case priority ('High,' 'Normal,' or 'Low'). + order: + label: Order + description: The order in which case priorities appear in the list on the interface. The higher the number, the higher is the priority. casesource: entity_label: Case Source entity_plural_label: Case Sources - entity_description: Represent case source - name.label: Name - label.label: Label + entity_description: How the information about the issue was recieved. + name: + label: Name + description: The unique identifier of the case source record. + label: + label: Label + description: The label of the case source ('Email,' 'Other,' 'Phone,' or 'Web'). casestatus: entity_label: Case Status entity_plural_label: Case Statuses - entity_description: Represent case status - name.label: Name - label.label: Label - order.label: Order + entity_description: The phase of work on the case. + name: + label: Name + description: The unique identifier of the case status record. + label: + label: Label + description: The label of the case status ('Open,' 'In Progress,' 'Resolved,' or 'Closed'). + order: + label: Order + description: The order in which case statuses are usually assigned to the case. The higher the number, the more advanced case management stage the case status represents. block: additional: Additional diff --git a/src/Oro/Bundle/ChannelBundle/Resources/config/oro/api.yml b/src/Oro/Bundle/ChannelBundle/Resources/config/oro/api.yml index 95fcfb94c33..62a8ea08566 100644 --- a/src/Oro/Bundle/ChannelBundle/Resources/config/oro/api.yml +++ b/src/Oro/Bundle/ChannelBundle/Resources/config/oro/api.yml @@ -1,6 +1,7 @@ api: entities: Oro\Bundle\ChannelBundle\Entity\Channel: + documentation_resource: '@OroChannelBundle/Resources/doc/api/channel.md' actions: create: false update: false diff --git a/src/Oro/Bundle/ChannelBundle/Resources/doc/api/channel.md b/src/Oro/Bundle/ChannelBundle/Resources/doc/api/channel.md new file mode 100644 index 00000000000..ce52b0bd0ff --- /dev/null +++ b/src/Oro/Bundle/ChannelBundle/Resources/doc/api/channel.md @@ -0,0 +1,15 @@ +# Oro\Bundle\ChannelBundle\Entity\Channel + +## ACTIONS + +### get + +Retrieve a collection of channel records. + +{@inheritdoc} + +### get_list + +Retrieve a specific channel record. + +{@inheritdoc} \ No newline at end of file diff --git a/src/Oro/Bundle/ContactBundle/Resources/config/oro/api.yml b/src/Oro/Bundle/ContactBundle/Resources/config/oro/api.yml index 1a25a5d0166..13c6e95fe06 100644 --- a/src/Oro/Bundle/ContactBundle/Resources/config/oro/api.yml +++ b/src/Oro/Bundle/ContactBundle/Resources/config/oro/api.yml @@ -49,7 +49,8 @@ api: options: data_field: email - Oro\Bundle\ContactBundle\Entity\ContactAddress: ~ + Oro\Bundle\ContactBundle\Entity\ContactAddress: + documentation_resource: '@OroContactBundle/Resources/doc/api/contact_address.md' Oro\Bundle\ContactBundle\Entity\ContactEmail: # this entity does not have own Data API resource @@ -59,4 +60,9 @@ api: # this entity does not have own Data API resource actions: false - Oro\Bundle\ContactBundle\Entity\Group: ~ + Oro\Bundle\ContactBundle\Entity\Group: + documentation_resource: '@OroContactBundle/Resources/doc/api/group.md' + Oro\Bundle\ContactBundle\Entity\Method: + documentation_resource: '@OroContactBundle/Resources/doc/api/method.md' + Oro\Bundle\ContactBundle\Entity\Source: + documentation_resource: '@OroContactBundle/Resources/doc/api/source.md' diff --git a/src/Oro/Bundle/ContactBundle/Resources/doc/api/contact.md b/src/Oro/Bundle/ContactBundle/Resources/doc/api/contact.md index 319b2c66d94..14a4ee7d8e4 100644 --- a/src/Oro/Bundle/ContactBundle/Resources/doc/api/contact.md +++ b/src/Oro/Bundle/ContactBundle/Resources/doc/api/contact.md @@ -2,57 +2,121 @@ ## FIELDS +### id + +#### update + +{@inheritdoc} + +**The required field** + ### emails -An array of emails. +An array of email addresses. -Format of data: [{"email": first@email.com}, {"email": second@email.com}] +Format of data: [{""email"": first@email.com}, {""email"": second@email.com}] -#### create, update +#### create + +An array of email addresses. -An array of emails. +Format of data: [{""email"": first@email.com}, {""email"": second@email.com}] -Format of data: [{"email": first@email.com}, {"email": second@email.com}] +Data should contain full collection of email addresses of the contact. -The data should contain full collection of emails. +**Conditionally required field:** +*At least one of the fields First name, Last name, Emails or Phones must be defined.* + +#### update + +An array of email addresses. + +Format of data: [{""email"": first@email.com}, {""email"": second@email.com}] + +Data should contain full collection of email addresses of the contact. + +**Please note:** +*At least one of the fields First name, Last name, Emails or Phones must remain defined.* ### phones -An array of phones. +An array of phone numbers. Format of data: [{"phone": phonenumber1}, {"phone": phonenumber2}] -#### create, update +#### create -An array of phones. +An array of phone numbers. Format of data: [{"phone": phonenumber1}, {"phone": phonenumber2}] -The data should contain full collection of phones. +Data should contain full collection of phone numbers of the contact. + +**Conditionally required field:** +*At least one of the fields First name, Last name, Emails or Phones must be defined.* + +#### update + +An array of phone numbers. + +Format of data: [{"phone": phonenumber1}, {"phone": phonenumber2}] + +Data should contain full collection of phone numbers of the contact. + +**Please note:** +*At least one of the fields First name, Last name, Emails or Phones must remain defined.* ### primaryEmail -The primary email address. +Primary email address of the contact. #### create, update The email address that should be set as the primary one. -*Please note* - -The primary email address will be added to **emails** collection if it does not contain it yet. +**Please note:** The primary email address will be added to **emails** collection if it does not contain it yet. ### primaryPhone -The primary phone number. +Primary phone number of the contact. #### create, update The phone number that should be set as the primary one. -*Please note* +**Please note:** The primary phone number will be added to **phones** collection if it does not contain it yet. + +###firstName + +####create + +{@inheritdoc} -The primary phone number will be added to **phones** collection if it does not contain it yet. +**Conditionally required field:** +*At least one of the fields First name, Last name, Emails or Phones must be defined.* + +####update + +{@inheritdoc} + +**Please note:** +*At least one of the fields First name, Last name, Emails or Phones must remain defined.* + +###lastName + +####create + +{@inheritdoc} + +**Conditionally required field:** +*At least one of the fields First name, Last name, Emails or Phones must be defined.* + +####update + +{@inheritdoc} + +**Please note:** +*At least one of the fields First name, Last name, Emails or Phones must remain defined.* ## FILTERS @@ -71,3 +135,617 @@ Filter records by primary email address. ### primaryPhone Filter records by primary phone number. + +## ACTIONS + +### get + +Retreive a specific contact record. + +{@inheritdoc} + +### get_list + +Retrieve a collection of contact records. + +{@inheritdoc} + +### create + +Create a new contact record. +The created record is returned in the response. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"contacts", + "attributes":{ + "firstName":"Jerry", + "lastName":"Coleman", + "primaryPhone":"585-255-1127", + "primaryEmail":"JerryAColeman@armyspy.com" + }, + "relationships":{ + "owner":{ + "data":{ + "type":"users", + "id":"5" + } + }, + "organization":{ + "data":{ + "type":"organizations", + "id":"1" + } + } + } + } +} +``` +{@/request} + +### update + +Edit a specific contact record. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"contacts", + "id":"1", + "attributes":{ + "middleName":"Muriell", + "lastName":"Coleman", + "jobTitle":"CEO", + "skype":"skype.skype" + }, + "relationships":{ + "method":{ + "data":{ + "type":"contactmethods", + "id":"phone" + } + }, + "organization":{ + "data":{ + "type":"organizations", + "id":"1" + } + }, + "defaultInAccounts":{ + "data":[ + { + "type":"accounts", + "id":"1" + }, + { + "type":"accounts", + "id":"37" + } + ] + }, + "picture":{ + "data":{ + "type":"files", + "id":"2" + } + } + } + } +} +``` +{@/request} + +### delete + +Delete a specific contact record. + +{@inheritdoc} + +### delete_list + +Delete a collection of contact records. +The list of records that will be deleted, could be limited by filters. + +{@inheritdoc} + +## SUBRESOURCES + +### accounts + +#### get_subresource + +Retreive the account records a specific contact record is assigned to. + +#### get_relationship + +Retrieve the IDs of the account records which a specific contact record is assigned to. + +#### update_relationship + +Replace accounts assigned to a specific contact record + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": [ + { + "type": "accounts", + "id": "1" + } + ] +} +``` +{@/request} + +#### add_relationship + +Set account records for a specific contact. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": [ + { + "type": "accounts", + "id": "2" + } + ] +} +``` +{@/request} + +#### delete_relationship + +Remove account records from a specific contact. + +###addresses + +#### get_subresource + +Retrieve a record of addresses assigned to a specific contact record. + +#### get_relationship + +Retrieve IDs of address records assigned to a specific contact record. + +#### update_relationship + +Replace the list of addresses assigned to a specific contact record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":[ + { + "type":"contactaddresses", + "id":"6" + } + ] +} +``` +{@/request} + +#### add_relationship + +Set address records for a specific contact record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":[ + { + "type":"contactaddresses", + "id":"7" + } + ] +} +``` +{@/request} + +#### delete_relationship + +Remove address records from a specific contact record. + +### assignedTo + +#### get_subresource + +Retreive the record of the user to whom a specific contact record is assigned. + +#### get_relationship + +Get a user record which a specific contact record will be assigned to. + +#### update_relationship + +Replace the user a specific contact record is assigned to. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "users", + "id": "5" + } +} +``` +{@/request} + +### createdBy + +#### get_subresource + +Retrieve the record of the user who created a specific contact record. + +#### get_relationship + +Retreive the ID of the user who created a specific contact record. + +#### update_relationship + +Replace the user who created a specific contact record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "users", + "id": "47" + } +} +``` +{@/request} + +### defaultInAccounts + +#### get_subresource + +Retrieve the account records for which a specific contact record is default. + +#### get_relationship + +Retrieve the IDs of the accounts for which a specific contact record is default. + +#### add_relationship + +Set accounts for which a specific contact record will be default. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": [ + { + "type": "accounts", + "id": "2" + } + ] +} +``` +{@/request} + +#### update_relationship + +Replace accounts for which a specific contact record is default. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": [ + { + "type": "accounts", + "id": "1" + } + ] +} +``` +{@/request} + +#### delete_relationship + +Remove an account from the list of accounts for which a specific contact record is default. + +### groups + +#### get_subresource + +Retreive the records of groups a specific contact record belongs to. + +#### get_relationship + +Retrieve the IDs of the groups a specific contact record belongs to. + +#### add_relationship + +Set groups a specific contact will belong to. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": [ + { + "type": "contactgroups", + "id": "1" + } + ] +} +``` +{@/request} + +#### update_relationship + +Replace the groups a specific contact record belongs to. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": [ + { + "type": "contactgroups", + "id": "1" + } + ] +} +``` +{@/request} + +#### delete_relationship + +Remove a specific contact record from the groups. + +### method + +#### get_subresource + +Retrieve the record of the contact method configured for a specific contact record. + +#### get_relationship + +Retrieve the ID of the contact method configured for a specific contact record. + +#### update_relationship + +Replace the contact method configured for a specific contact record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "contactmethods", + "id": "phone" + } +} +``` +{@/request} + +### organization + +#### get_subresource + +Retrieve the record of the organization a specific contact record belongs to. + +#### get_relationship + +Retrieve the ID of the organization record which a specific contact record will belong to. + +#### update_relationship + +Replace the organization a specific contact record belongs to. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "organizations", + "id": "1" + } +} +``` +{@/request} + +### owner + +#### get_subresource + +Retrieve the record of the user who is an owner of a specific contact record. + +#### get_relationship + +Retrieve the ID of the user who is an owner of a specific contact record. + +#### update_relationship + +Replace the owner of a specific contact record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "users", + "id": "5" + } +} +``` +{@/request} + +### picture + +#### get_subresource + +Retrieve the picture configured for a specific contact record. + +#### get_relationship + +Retrive the ID of the picture configured for a specific contact record. + +#### update_relationship + +Replace the picture for a specific contact record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "files", + "id": "2" + } +} +``` +{@/request} + +### reportsTo + +#### get_subresource + +Retrieve the record of the contact a specific contact record reports to. + +#### get_relationship + +Retieve the ID of the contact a specific contact record reports to. + +#### update_relationship + +Replace the contact a specific contact record reports to. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "contacts", + "id": "1" + } +} +``` +{@/request} + +### source + +#### get_subresource + +Retrieve the source record configured for a specific contact record. + +#### get_relationship + +Retrieve the source of a specific contact record. + +#### update_relationship + +Replace the source of a specific contact record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "contactsources", + "id": "website" + } +} +``` +{@/request} + +### updatedBy + +#### get_subresource + +Retrieve the record of the user who updated a specific contact record. + +#### get_relationship + +Retrieve the ID of the user who updated a specific contact record. + +#### update_relationship + +Replace the user who updated a specific contact record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "users", + "id": "1" + } +} +``` +{@/request} diff --git a/src/Oro/Bundle/ContactBundle/Resources/doc/api/contact_address.md b/src/Oro/Bundle/ContactBundle/Resources/doc/api/contact_address.md new file mode 100644 index 00000000000..c8bfa600c18 --- /dev/null +++ b/src/Oro/Bundle/ContactBundle/Resources/doc/api/contact_address.md @@ -0,0 +1,299 @@ +# Oro\Bundle\ContactBundle\Entity\ContactAddress + +## ACTIONS + +### get + +Retrieve a specific contact address record. + +{@inheritdoc} + +### get_list + +Retrieve a collection of contact address records. + +{@inheritdoc} + +### create + +Create a new contact address record. +The created record is returned in the response. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"contactaddresses", + "attributes":{ + "primary":true, + "label":"Primary Address", + "street":"873 John Avenue", + "city":"Jackson", + "postalCode":"49201", + "firstName":"Ramona", + "lastName":"Venters" + }, + "relationships":{ + "owner":{ + "data":{ + "type":"contacts", + "id":"1" + } + }, + "country":{ + "data":{ + "type":"countries", + "id":"US" + } + }, + "region":{ + "data":{ + "type":"regions", + "id":"US-MI" + } + } + } + } +} +``` +{@/request} + +### update + +Edit a specific contact address record. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"contactaddresses", + "id":"79", + "attributes":{ + "primary":true, + "label":"Primary Address", + "street":"873 John Avenue", + "city":"Jackson", + "postalCode":"49201", + "firstName":"Ramona", + "lastName":"Venters" + }, + "relationships":{ + "owner":{ + "data":{ + "type":"contacts", + "id":"1" + } + }, + "country":{ + "data":{ + "type":"countries", + "id":"US" + } + }, + "region":{ + "data":{ + "type":"regions", + "id":"US-MI" + } + } + } + } +} +``` +{@/request} + +### delete + +Delete a specific contact address record. + +{@inheritdoc} + +### delete_list + +Delete a collection of contact address records. +The list of records that will be deleted, could be limited by filters. + +{@inheritdoc} + +## FIELDS + +### id + +#### update + +{@inheritdoc} + +**The required field** + +### country + +#### create + +{@inheritdoc} + +**The required field** + +### owner + +#### create + +{@inheritdoc} + +**The required field** + +## SUBRESOURCES + +### country + +#### get_subresource + +Retrieve the record of the country configured for a specific contact address record. + +#### get_relationship + +Retrieve the ID of the country configured for a specific contact address record. + +#### update_relationship + +Replace the country configured for a specific contact address record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "countries", + "id": "US" + } +} +``` +{@/request} + +### owner + +#### get_subresource + +Retrieve the record of the contact who is the owner of a specific contact address record. + +#### get_relationship + +Retrieve the ID of the contact who is the owner of a specific contact address record. + +#### update_relationship + +Replace the owner of a specific contact address record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "contacts", + "id": "1" + } +} +``` +{@/request} + +### region + +#### get_subresource + +Retrieve the record of the region configured for a specific contact address record. + +#### get_relationship + +Retrieve the ID of the region that is configured for a specific contact address record. + +#### update_relationship + +Replace the region that is configured for a specific contact address record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "regions", + "id": "US-NY" + } +} +``` +{@/request} + +### types + +#### get_subresource + +Retrieve a collection of the address type records that are configured for a specific contact address record. + +#### get_relationship + +Retrieve the IDs of the address types ('billing,' 'shipping') that are configured for a specific contact address record. + +#### add_relationship + +Set the address types for a specific contact address record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":[ + { + "type":"addresstypes", + "id":"billing" + } + ] +} +``` +{@/request} + +#### update_relationship + +Replace the address types for a specific contact address record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":[ + { + "type":"addresstypes", + "id":"billing" + } + ] +} +``` +{@/request} + +#### delete_relationship + +Remove the address types of a specific contact address record. \ No newline at end of file diff --git a/src/Oro/Bundle/ContactBundle/Resources/doc/api/group.md b/src/Oro/Bundle/ContactBundle/Resources/doc/api/group.md new file mode 100644 index 00000000000..64f8ff6f7e2 --- /dev/null +++ b/src/Oro/Bundle/ContactBundle/Resources/doc/api/group.md @@ -0,0 +1,190 @@ +# Oro\Bundle\ContactBundle\Entity\Group + +## ACTIONS + +### get + +Retrieve a specific contact group record. + +{@inheritdoc} + +### get_list + +Retrieve a collection of contact group records. + +{@inheritdoc} + +### create + +Create a new contact group record. +The created record is returned in the response. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"contactgroups", + "attributes":{ + "label":"Sales Pro Group" + }, + "relationships":{ + "owner":{ + "data":{ + "type":"users", + "id":"1" + } + }, + "organization":{ + "data":{ + "type":"organizations", + "id":"1" + } + } + } + } +} +``` +{@/request} + +### update + +Edit a specific contact group record. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"contactgroups", + "id":"1", + "attributes":{ + "label":"Sales Group" + }, + "relationships":{ + "owner":{ + "data":{ + "type":"users", + "id":"1" + } + }, + "organization":{ + "data":{ + "type":"organizations", + "id":"1" + } + } + } + } +} +``` +{@/request} + +### delete + +Delete a specific contact group record. + +{@inheritdoc} + +### delete_list + +Delete a collection of contact group records. +The list of records that will be deleted, could be limited by filters. + +{@inheritdoc} + +## FIELDS + +### id + +#### update + +{@inheritdoc} + +**The required field** + +### label + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +## SUBRESOURCES + +### organization + +#### get_subresource + +Retrieve the record of the organization a specific contact group record belongs to. + +#### get_relationship + +Retrieve the ID of the organization record which a specific contact group record belongs to. + +#### update_relationship + +Replace the organization a specific contact group record belongs to. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "organizations", + "id": "1" + } +} +``` +{@/request} + +### owner + +#### get_subresource + +Retrieve the record of the user who is the owner of a specific contact group record. + +#### get_relationship + +Retrieve the ID of the user who is the owner of a specific contact group record. + +#### update_relationship + +Replace the owner of a specific contact group record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "users", + "id": "1" + } +} +``` +{@/request} diff --git a/src/Oro/Bundle/ContactBundle/Resources/doc/api/method.md b/src/Oro/Bundle/ContactBundle/Resources/doc/api/method.md new file mode 100644 index 00000000000..6a784d4c3c6 --- /dev/null +++ b/src/Oro/Bundle/ContactBundle/Resources/doc/api/method.md @@ -0,0 +1,15 @@ +# Oro\Bundle\ContactBundle\Entity\Method + +## ACTIONS + +### get + +Retrieve a collection of contact method records. + +{@inheritdoc} + +### get_list + +Retrieve a specific contact method record. + +{@inheritdoc} diff --git a/src/Oro/Bundle/ContactBundle/Resources/doc/api/source.md b/src/Oro/Bundle/ContactBundle/Resources/doc/api/source.md new file mode 100644 index 00000000000..4db5f661f12 --- /dev/null +++ b/src/Oro/Bundle/ContactBundle/Resources/doc/api/source.md @@ -0,0 +1,15 @@ +# Oro\Bundle\ContactBundle\Entity\Source + +## ACTIONS + +### get + +Retrieve a collection of contact source records. + +{@inheritdoc} + +### get_list + +Retrieve a specific contact source record. + +{@inheritdoc} diff --git a/src/Oro/Bundle/ContactBundle/Resources/translations/messages.en.yml b/src/Oro/Bundle/ContactBundle/Resources/translations/messages.en.yml index 7950e42c79e..269cf68358f 100644 --- a/src/Oro/Bundle/ContactBundle/Resources/translations/messages.en.yml +++ b/src/Oro/Bundle/ContactBundle/Resources/translations/messages.en.yml @@ -41,75 +41,159 @@ oro: # # Entity Oro\Bundle\ContactBundle\Entity\Contact # - entity_description: Represent contact + entity_description: Personal information of people with whom a user gets in touch during the business activities. entity_label: Contact entity_plural_label: Contacts import: Import Contacts - accounts.label: Accounts + accounts: + label: Accounts + description: A collection of accounts the contact is related to. Might indicate employment or other close relations. add_entity: Add contact - addresses.label: Addresses - assigned_to.label: Assigned to - birthday.label: Birthday - created_by.label: Created By - description.label: Description + addresses: + label: Addresses + description: Collection of Contact addresses: mailing, business, home, billing, etc. + assigned_to: + label: Assigned to + description: OroCRM user who is responsible for managing relations with the contact. + birthday: + label: Birthday + description: Date of contact's birthday. + created_by: + label: Created By + description: OroCRM user who has created the record. + description: + label: Description + description: Extended description of the contact. email.label: Email emails.label: Emails - facebook.label: Facebook - fax.label: Fax - first_name.label: First name - gender.label: Gender - google_plus.label: Google+ - groups.label: Groups + facebook: + label: Facebook + description: Facebook profile of the contact. + fax: + label: Fax + description: Fax number of the contact. + first_name: + label: First name + description: First name of the contact person. + gender: + label: Gender + description: Gender of the contact person. + google_plus: + label: Google+ + description: Google+ profile of the contact. + groups: + label: Groups + description: Contact groups the contact belongs to. id.label: Id - linked_in.label: LinkedIn - job_title.label: Job Title - last_name.label: Last name - method.label: Contact Method - middle_name.label: Middle name - name_prefix.label: Name prefix - name_suffix.label: Name suffix + linked_in: + label: LinkedIn + description: LinkedIn profile of the contact. + job_title: + label: Job Title + description: Job title of the contact person within their organization. + last_name: + label: Last name + description: Last name of the contact person. + middle_name: + label: Middle name + description: Middle name of the contact person. + name_prefix: + label: Name prefix + description: Name prefix or honorific of the contact person (Mr./Ms., Dr., Prof., etc.) + name_suffix: + label: Name suffix + description: Name suffix of the contact person (Sr./Jr., M.D., OBE, etc.) owner.label: Owner - reports_to.label: Reports to + reports_to: + label: Reports to + description: A contact who serves as direct supervisor of the contact within their organization. phones.label: Phones primary_email.label: Primary Email primary_phone.label: Primary Phone - primary_addr.label: Primary Address - skype.label: Skype + skype: + label: Skype + description: Skype profile of the contact. social.label: Social - source.label: Source - twitter.label: Twitter - updated_by.label: Updated By - picture.label: Picture + twitter: + label: Twitter + description: Twitter profile of the contact. + updated_by: + label: Updated By + description: OroCRM user who had last updated the record. + picture: + label: Picture + description: Photo or other identifying image of the contact. organization.label: Organization - default_in_accounts.label: Accounts Default Contact + default_in_accounts: + label: Accounts Default Contact + description: A collection of accounts where the contact is set as default. # # Entity Oro\Bundle\ContactBundle\Entity\ContactAddress # contactaddress: - city.label: City - country.label: Country - entity_description: Represent contact's address + city: + label: City + description: The city specified in the contact address. + country: + label: Country + description: The country specified in the contact address. + entity_description: The address configured for the contact. entity_label: Contact Address entity_plural_label: Contact Addresses - first_name.label: First name + first_name: + label: First name + description: The first name that is specified in the contact address. id.label: Id - label.label: Label - last_name.label: Last name - middle_name.label: Middle name - name_prefix.label: Name prefix - name_suffix.label: Name suffix - organization.label: Organization - owner.label: Owner - postal_code.label: Zip/Postal Code - primary.label: Primary - region.label: State + label: + label: Label + description: The label specified for the contact address. The label is used to refer to the contact address on the interface. + last_name: + label: Last name + description: The last name that is specified in the contact address. + middle_name: + label: Middle name + description: The middle name that is specified in the contact address. + + name_prefix: + label: Name prefix + description: The name prefix specified in the contact address. + name_suffix: + label: Name suffix + description: The name suffix specified in the contact address. + organization: + label: Organization + description: The organization that is specified in the contact address. + owner: + label: Owner + description: The contact who is the owner of the contact address. The contact address is displayed on the view page of this contact. + postal_code: + label: Zip/Postal Code + description: The postal code specified in the contact address. + primary: + label: Primary + description: Defines whether the contact address is a primary contact address. + region: + label: State + description: The region specified in the contact address. region_text.label: State - street.label: Street - street2.label: Street 2 - types.label: Types + street: + label: Street + description: The first line of the street address. Usually contains the street name and the building number. + street2: + label: Street 2 + description: The second line of the street address. May contain the appartment number, P.O. box, building name, etc. + types: + label: Types + description: The address types (whether it is a billing address, shipping address, or both) configured for the contact address. + created: + label: Created at + description: The date and time when the contact address was created. + updated: + label: Updated at + description: The date and time when the contact address was last updated. country_name.label: Country name country_iso2_code.label: Country ISO2 code @@ -145,11 +229,13 @@ oro: # Entity Oro\Bundle\ContactBundle\Entity\Group # group: - entity_description: Represent contact's group + entity_description: The set of contacts classed together by some common factor. Contact groups are mainly used to simplify the configuration of filters and segments. entity_label: Contact Group entity_plural_label: Contact Groups id.label: Id - label.label: Label + label: + label: Label + description: The name used to refer to the contact group on the interface. manage: Manage groups owner.label: Owner organization.label: Organization @@ -159,23 +245,37 @@ oro: # Entity Oro\Bundle\ContactBundle\Entity\Method # method: - entity_description: Represent contact's method + entity_description: The mean of communications with the contact. entity_label: Contact Method entity_plural_label: Contact Methods - label.label: Label name.label: Name + description: Preferred way of communication for this contact. + label: Contact Method + method: + description: Source of the contact. + label: Source + label.label: Label + label.description: The label of the contact method ('Email,' 'Mail,' or ' Phone'). + # # Entity Oro\Bundle\ContactBundle\Entity\Source # source: - entity_description: Represent contact's source + entity_description: How the information about the contact was recieved. entity_label: Contact Source entity_plural_label: Contact Sources - label.label: Label name.label: Name + description: Source of the contact. + label: Source + source: + description: Source of the contact. + label: Source + label.label: Source + label.description: The label of the contact source ('Phone Call,' 'Other Source,' TV,' or 'Website'). + widgets: - account_contacts: Contacts + account_contacts: Contacts account: no_contacts_exist: No contacts exist diff --git a/src/Oro/Bundle/SalesBundle/Resources/config/oro/api.yml b/src/Oro/Bundle/SalesBundle/Resources/config/oro/api.yml index ab41d8bfb81..766d341e0cf 100644 --- a/src/Oro/Bundle/SalesBundle/Resources/config/oro/api.yml +++ b/src/Oro/Bundle/SalesBundle/Resources/config/oro/api.yml @@ -12,8 +12,51 @@ api: plural_alias: leadstatuses entities: + Extend\Entity\EV_Opportunity_Status: + fields: + name: + description: The name of the opportunity status. + default: + description: Determines whether a particular status is set as default for new opportunity records. + priority: + description: The order in which opportunity statuses are ranked. First appears the status with the higher priority. + actions: + get: + documentation: Retrieve a specific opportunity status record. Opportunity status defines a deal's stage (Open, Closed Won, etc.) + get_list: + documentation: Retrieve a collection of opportunity statuses. Opportunity status defines a deal's stage (Open, Closed Won, etc.) + + Extend\Entity\EV_Lead_Status: + fields: + name: + description: The name of the lead status ('New,' 'Qualified,' or 'Disqualified'). + default: + description: Determines whether a particular status is set as default for new lead records. + priority: + description: The order in which lead statuses are ranked. First appears the status with the higher priority. + actions: + get: + documentation: Retrieve a specific lead status record. Lead status defines whether a lead is interested in your product. + get_list: + documentation: Retrieve a collection of lead status records. Lead status defines whether a lead is interested in your product. + + Extend\Entity\EV_Lead_Source: + fields: + default: + description: Determines whether a particular source is set as default for new lead records. + name: + description: The name of the lead source. + priority: + description: The order in which lead sources are ranked. First appears the source with the higher priority. + actions: + get: + documentation: Retrieve a specific lead source record. Lead source defines how the information about the lead was received. + get_list: + documentation: Retrieve a collection of lead source records. Lead source defines how the information about the lead was received. + # deprecated since 1.10. Enum type is used instead Oro\Bundle\SalesBundle\Entity\OpportunityStatus: { exclude: true } + # deprecated since 1.10. Enum type is used instead Oro\Bundle\SalesBundle\Entity\LeadStatus: { exclude: true } @@ -73,6 +116,7 @@ api: actions: false Oro\Bundle\SalesBundle\Entity\Lead: + documentation_resource: '@OroSalesBundle/Resources/doc/api/lead.md' fields: address: exclude: true @@ -107,6 +151,8 @@ api: target: exclude: true data_type: association:manyToOne:customer + customer_f2bbc387: + description: Test record. filters: fields: phones: @@ -132,7 +178,8 @@ api: customerAssociation: exclude: true - Oro\Bundle\SalesBundle\Entity\LeadAddress: ~ + Oro\Bundle\SalesBundle\Entity\OpportunityCloseReason: + documentation_resource: '@OroSalesBundle/Resources/doc/api/opportunity_close_reason.md' Oro\Bundle\SalesBundle\Entity\LeadPhone: # this entity does not have own Data API resource @@ -148,6 +195,8 @@ api: fields: customerAssociation: exclude: true + + fields: closedAt: exclude: true @@ -169,4 +218,8 @@ api: target: data_type: association:manyToOne:customer - Oro\Bundle\SalesBundle\Entity\SalesFunnel: ~ + Oro\Bundle\SalesBundle\Entity\SalesFunnel: + documentation_resource: '@OroSalesBundle/Resources/doc/api/sale_funnel.md' + + Oro\Bundle\SalesBundle\Entity\LeadAddress: + documentation_resource: '@OroSalesBundle/Resources/doc/api/lead_address.md' diff --git a/src/Oro/Bundle/SalesBundle/Resources/doc/api/b2b_customer.md b/src/Oro/Bundle/SalesBundle/Resources/doc/api/b2b_customer.md index 9bf2a77a0b0..669dff094e6 100644 --- a/src/Oro/Bundle/SalesBundle/Resources/doc/api/b2b_customer.md +++ b/src/Oro/Bundle/SalesBundle/Resources/doc/api/b2b_customer.md @@ -1,58 +1,276 @@ # Oro\Bundle\SalesBundle\Entity\B2bCustomer +## ACTIONS + +### get + +Retrieve a specific business customer records. + +{@inheritdoc} + +### get_list + +Retrieve a collection of business customer records. + +{@inheritdoc} + +### create + +Create a new business customer record. +The created record is returned in the response. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"b2bcustomers", + "attributes":{ + "name":"Life Plan Counselling East", + "primaryPhone":"585-255-1127", + "primaryEmail":"JerryAColeman@armyspy.com", + "phones":[ + { + "phone":"585-255-1127" + } + ], + "emails":[ + { + "email":"JerryAColeman@armyspy.com" + } + ] + }, + "relationships":{ + "shippingAddress":{ + "data":{ + "type":"addresses", + "id":"1" + } + }, + "billingAddress":{ + "data":{ + "type":"addresses", + "id":"2" + } + }, + "account":{ + "data":{ + "type":"accounts", + "id":"26" + } + }, + "leads":{ + "data":[ + { + "type":"leads", + "id":"7" + } + ] + }, + "opportunities":{ + "data":[ + { + "type":"opportunities", + "id":"24" + } + ] + }, + "owner":{ + "data":{ + "type":"users", + "id":"27" + } + }, + "organization":{ + "data":{ + "type":"organizations", + "id":"1" + } + }, + "dataChannel":{ + "data":{ + "type":"channels", + "id":"1" + } + } + } + } +} +``` +{@/request} + +### update + +Edit a specific business customer record. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"b2bcustomers", + "id":"27", + "attributes":{ + "website":"www.site.com", + "employees":"25", + "ownership":"founder", + "ticker_symbol":"HPQ", + "rating":"hight", + "lifetime":"256.45" + }, + "relationships":{ + "shippingAddress":{ + "data":{ + "type":"addresses", + "id":"7" + } + }, + "billingAddress":{ + "data":{ + "type":"addresses", + "id":"5" + } + }, + "contact":{ + "data":{ + "type":"contacts", + "id":"7" + } + }, + "owner":{ + "data":{ + "type":"users", + "id":"28" + } + }, + "dataChannel":{ + "data":{ + "type":"channels", + "id":"2" + } + } + } + } +} +``` +{@/request} + +### delete_list + +Delete a collection of business customer records. +The list of records that will be deleted, could be limited by filters. + +{@inheritdoc} + +### delete + +Delete a specific business customer record. + +{@inheritdoc} + ## FIELDS +### id + +#### update + +{@inheritdoc} + +**The required field** + ### emails -An array of emails. +An array of email addresses. Format of data: [{"email": first@email.com}, {"email": second@email.com}] #### create, update -An array of emails. +An array of email addresses. Format of data: [{"email": first@email.com}, {"email": second@email.com}] -The data should contain full collection of emails. +Data should contain full collection of email addresses of the business customer. ### phones -An array of phones. +An array of phone numbers. Format of data: [{"phone": phonenumber1}, {"phone": phonenumber2}] #### create, update -An array of phones. +An array of phone numbers. Format of data: [{"phone": phonenumber1}, {"phone": phonenumber2}] -The data should contain full collection of phones. +Data should contain full collection of phone numbers of the business customer. ### primaryEmail -The primary email address. +Primary email address of the business customer. #### create, update The email address that should be set as the primary one. -*Please note* +**Please note:** -The primary email address will be added to **emails** collection if it does not contain it yet. +*The primary email address will be added to **emails** collection if it does not contain it yet.* ### primaryPhone -The primary phone number. +Primary phone number of the business customer. #### create, update The phone number that should be set as the primary one. -*Please note* +**Please note:** + +*The primary phone number will be added to **phones** collection if it does not contain it yet.* + +### account + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +### dataChannel + +#### create + +{@inheritdoc} -The primary phone number will be added to **phones** collection if it does not contain it yet. +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* ## FILTERS @@ -71,3 +289,328 @@ Filter records by primary email address. ### primaryPhone Filter records by primary phone number. + +## SUBRESOURCES + +### account + +#### get_subresource + +Retrieve the accout record that a specific business customer record is assigned to. + +#### get_relationship + +Retrieve the IDs of the accounts that a specific business customer is assigned to. + +#### update_relationship + +Replace the accounts that a specific business customer is assigned to. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "accounts", + "id": "26" + } +} +``` +{@/request} + +### billingAddress + +#### get_subresource + +Retrieve the record of the billing address configured for a specific business customer. + +#### get_relationship + +Retrieve the ID of the billing address that is configured for a specific business customer. + +#### update_relationship + +Replace the billing address for a specific business customer. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "addresses", + "id": "2" + } +} +``` +{@/request} + +### contact + +#### get_subresource + +Retrieve the record of the contact that is specified for a specific business customer. + +#### get_relationship + +Retrieve the ID of the contact that is assigned to a specific business customer. + +#### update_relationship + +Replace the contact for a specific business customer. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "contacts", + "id": "7" + } +} +``` +{@/request} + +### dataChannel + +#### get_subresource + +Retrieve the record of the channel via which an information about a specific business customer is received. + +#### get_relationship + +Retrieve the ID of the channel via which information about a specific business customer is received. + +#### update_relationship + +Replace the channel for a specific business customer. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "channels", + "id": "1" + } +} +``` +{@/request} + +### leads + +#### get_subresource + +Retrieve the records of the leads that a specific business customer is assigned to. + +#### get_relationship + +Retrieve the IDs of the leads that a specific business customer is assigned to. + +#### add_relationship + +Set the leads that a specific business customer will be assinged to. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":[ + { + "type":"leads", + "id":"5" + }, + { + "type":"leads", + "id":"7" + } + ] +} +``` +{@/request} + +#### update_relationship + +Replace the leads that a specific business customer is assigned to. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":[ + { + "type":"leads", + "id":"5" + }, + { + "type":"leads", + "id":"7" + } + ] +} +``` +{@/request} + +#### delete_relationship + +Remove the leads that a specific business customer is assigned to. + +### opportunities + +#### get_subresource + +Retrieve the records of the opportunities that a specific business customer is assigned to. + +#### get_relationship + +Retrieve the IDs of the opportunities that a specific business customer is assigned to. + +#### add_relationship + +Set the opportunities that a specific business customer will be assigned to. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": [ + { + "type": "opportunities", + "id": "24" + } + ] +} +``` +{@/request} + +#### update_relationship + +Replace the opportunities that a specific business customer is assigned to. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": [ + { + "type": "opportunities", + "id": "24" + } + ] +} +``` +{@/request} + +#### delete_relationship + +Remove the opportunities that a specific business customer is assigned to. + +### organization + +#### get_subresource + +Retrieve the record of the organization that a specific business customer belongs to. + +#### get_relationship + +Retrieve the ID of the organization that a specific business customer belongs to. + +#### update_relationship + +Replace the organization that a specific business customer belongs to. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "organizations", + "id": "1" + } +} +``` +{@/request} + +### owner + +#### get_subresource + +Retrieve the record of the user who is the owner of a specific business customer. + +#### get_relationship + +Retrieve the ID of the user who is an owner of a specific business customer. + +#### update_relationship + +Replace the owner for a specific business customer. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "users", + "id": "6" + } +} +``` +{@/request} + +### shippingAddress + +#### get_subresource + +Retrieve the shipping address records configured for a specific business customer record. + +#### get_relationship + +Retrieve the ID of the shipping address configured for a specific business cusotmer. + +#### update_relationship + +Replace the shipping address for a specific business customer. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "addresses", + "id": "1" + } +} +``` +{@/request} diff --git a/src/Oro/Bundle/SalesBundle/Resources/doc/api/lead.md b/src/Oro/Bundle/SalesBundle/Resources/doc/api/lead.md new file mode 100644 index 00000000000..d5e26018644 --- /dev/null +++ b/src/Oro/Bundle/SalesBundle/Resources/doc/api/lead.md @@ -0,0 +1,568 @@ +# Oro\Bundle\SalesBundle\Entity\Lead + +## ACTIONS + +### get + +Get a specific lead record. + +{@inheritdoc} + +### get_list + +Get a collection of lead records. +The list of records that will be returned, could be limited by filters. + +{@inheritdoc} + +### create + +Create a new Lead record. +The created record is returned in the response. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"leads", + "id":"1", + "attributes":{ + "name":"Frank Lead" + }, + "relationships":{ + "owner":{ + "data":{ + "type":"users", + "id":"1" + } + }, + "organization":{ + "data":{ + "type":"organizations", + "id":"1" + } + }, + "dataChannel":{ + "data":{ + "type":"channels", + "id":"1" + } + }, + "status":{ + "data":{ + "type":"leadstatuses", + "id":"new" + } + } + } + } +} +``` +{@/request} + +### update + +Edit a specific lead record +The updated record is returned in the response. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"leads", + "id":"1", + "attributes":{ + "namePrefix":"Mr.", + "jobTitle":"HR", + "companyName":"Sure Save", + "website":"http://qwe.qwe.qwe", + "numberOfEmployees":"35", + "phones":[ + { + "phone":"225-56-78" + } + ], + "emails":[ + { + "email":"RamonaCVentersNew@gustr.com" + } + ] + }, + "relationships":{ + "contact":{ + "data":{ + "type":"contacts", + "id":"4" + } + }, + "addresses":{ + "data":[ + { + "type":"leadaddresses", + "id":"6" + } + ] + }, + "status":{ + "data":{ + "type":"leadstatuses", + "id":"Qualified" + } + } + } + } +} +``` +{@/request} + +### delete + +Delete a specific lead record + +{@inheritdoc} + +### delete_list + +Delete a collection of lead records. +The list of records that will be deleted, could be limited by filters. + +{@inheritdoc} + +## FIELDS + +### id + +#### update + +{@inheritdoc} + +**The required field** + +###status + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +###dataChannel + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +###name + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +### emails + +An array of email addresses. + +Format of data: [{"email": first@email.com}, {"email": second@email.com}] + +#### create, update + +An array of email addresses. + +Format of data: [{"email": first@email.com}, {"email": second@email.com}] + +Data should contain full collection of email addresses of the lead. + +### phones + +An array of phone numbers. + +Format of data: [{"phone": phonenumber1}, {"phone": phonenumber2}] + +#### create, update + +An array of phone numbers. + +Format of data: [{"phone": phonenumber1}, {"phone": phonenumber2}] + +Data should contain full collection of phone numbers of the lead. + +### primaryEmail + +Primary email address of the lead. + +#### create, update + +The email address that should be set as the primary one. + +**Please note:** + +*The primary email address will be added to **emails** collection if it does not contain it yet.* + +### primaryPhone + +Primary phone number of the lead. + +#### create, update + +The phone number that should be set as the primary one. + +**Please note:** + +*The primary phone number will be added to **phones** collection if it does not contain it yet.* + +## SUBRESOURCES + +###addresses + +#### get_subresource + +Retrieve a record of addresses assigned to a specific lead record. + +#### get_relationship + +Retrieve IDs of address records assigned to a specific lead record. + +#### update_relationship + +Replace the list of addresses assigned to a specific lead record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":[ + { + "type":"leadaddresses", + "id":"6" + } + ] +} +``` +{@/request} + +#### add_relationship + +Set address records for a specific lead record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":[ + { + "type":"leadaddresses", + "id":"7" + } + ] +} +``` +{@/request} + +#### delete_relationship + +Remove address records from a specific lead record. + +### contact + +#### get_subresource + +Retrieve a contact record assigned to a specific lead record. + +#### get_relationship + +Retrieve contact IDs assigned to a specific lead record. + +#### update_relationship + +Replace a contact record assigned to a specific lead record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "contacts", + "id": "6" + } +} +``` +{@/request} + +### customer + +#### get_subresource + +Retrieve a business customer record assigned to a specific lead record. + +#### get_relationship + +Retrieve the ID of a customer record assigned to a specific lead record. + +#### update_relationship + +Replace the ID of a customer record assigned to a specific lead record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "b2bcustomers", + "id": "7" + } +} +``` +{@/request} + +### dataChannel + +#### get_subresource + +Retrieve channel record to which a lead is assigned. + +#### get_relationship + +Retrieve the ID of a channel record assigned to a specific lead record. + +#### update_relationship + +Replace the ID of a channel assigned to a specific lead record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "channels", + "id": "1" + } +} +``` +{@/request} + +### opportunities + +#### get_subresource + +Retrieve a record of an opportunity converted from a specific lead record. + +#### get_relationship + +Retrieve the ID of an opportunity record converted from a specific lead record. + +#### update_relationship + +Replace the opportunity record assigned to a specific lead record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": [ + { + "type": "opportunities", + "id": "5" + } + ] +} +``` +{@/request} + +#### add_relationship + +Set an opportunity record for a specific lead record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": [ + { + "type": "opportunities", + "id": "54" + } + ] +} +``` +{@/request} + +#### delete_relationship + +Remove an opportunity record assigned to a specific lead record. + +### organization + +#### get_subresource + +Retrieve a record of an organization that a specific lead record belongs to. + +#### get_relationship + +Retrieve the ID of an organization record that a lead belongs to. + +#### update_relationship + +Replace the organization a specific lead belongs to + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "organizations", + "id": "1" + } +} +``` +{@/request} + +### owner + +#### get_subresource + +Retrieve a record of the user who is the owner of a specific lead record. + +#### get_relationship + +Retrieve the ID of a user who is the owner of a specific lead record. + +#### update_relationship + +Replace the owner of a specific lead record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "users", + "id": "37" + } +} +``` +{@/request} + +### source + +#### get_subresource + +Retrieve the source record configured for a specific lead record. + +#### get_relationship + +Retrieve the source of a specific lead record. + +#### update_relationship + +Replace the source of a specific lead record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "leadsources", + "id": "partner" + } +} +``` +{@/request} + +### status + +#### get_subresource + +Retrieve the status record configured for a specific lead record. + +#### get_relationship + +Retrieve the ID of the status record configured for a specific lead record. + +#### update_relationship + +Replace the status of a specific lead record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "leadstatuses", + "id": "new" + } +} +``` +{@/request} diff --git a/src/Oro/Bundle/SalesBundle/Resources/doc/api/lead_address.md b/src/Oro/Bundle/SalesBundle/Resources/doc/api/lead_address.md new file mode 100644 index 00000000000..0b7c72f20f6 --- /dev/null +++ b/src/Oro/Bundle/SalesBundle/Resources/doc/api/lead_address.md @@ -0,0 +1,243 @@ +# Oro\Bundle\SalesBundle\Entity\LeadAddress + +## ACTIONS + +### get + +Retrieve a specific lead address record. + +{@inheritdoc} + +### get_list + +Retrieve a collection of lead address records. + +{@inheritdoc} + +### create + +Create a new lead address record. +The created record is returned in the response. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"leadaddresses", + "attributes":{ + "primary":true, + "label":"Primary Address", + "street":"873 John Avenue", + "city":"Jackson", + "postalCode":"49201", + "firstName":"Ramona", + "lastName":"Venters" + }, + "relationships":{ + "owner":{ + "data":{ + "type":"leads", + "id":"1" + } + }, + "country":{ + "data":{ + "type":"countries", + "id":"US" + } + }, + "region":{ + "data":{ + "type":"regions", + "id":"US-MI" + } + } + } + } +} +``` +{@/request} + +### update + +Edit a specific lead address record. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"leadaddresses", + "id" : "106", + "attributes":{ + "primary":true, + "label":"Primary Address", + "street":"873 John Avenue", + "city":"Jackson", + "postalCode":"49201", + "firstName":"Ramona", + "lastName":"Venters" + }, + "relationships":{ + "owner":{ + "data":{ + "type":"leads", + "id":"1" + } + }, + "country":{ + "data":{ + "type":"countries", + "id":"US" + } + }, + "region":{ + "data":{ + "type":"regions", + "id":"US-MI" + } + } + } + } +} +``` +{@/request} + +### delete + +Delete a specific lead address record. + +{@inheritdoc} + +### delete_list + +Delete a collection of lead address records. +The list of records that will be deleted, could be limited by filters. + +{@inheritdoc} + +## FIELDS + +### id + +#### update + +{@inheritdoc} + +**The required field** + +### country + +#### create + +{@inheritdoc} + +**The required field** + +### owner + +#### create + +{@inheritdoc} + +**The required field** + +## SUBRESOURCES + +### country + +#### get_subresource + +Retrieve the record of the country configured for a specific lead address record. + +#### get_relationship + +Retrieve the ID of the country configured for a specific lead address record. + +#### update_relationship + +Replace the country configured for a specific lead address record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "countries", + "id": "US" + } +} +``` +{@/request} + +### owner + +#### get_subresource + +Retrieve the record of the lead who is the owner of a specific lead address record. + +#### get_relationship + +Retrieve the ID of the lead who is the owner of a specific lead address record. + +#### update_relationship + +Replace the owner of a specific lead address record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "leads", + "id": "1" + } +} +``` +{@/request} + +### region + +#### get_subresource + +Retrieve the record of the region configured for a specific lead address record. + +#### get_relationship + +Retrieve the ID of the region that is configured for a specific lead address record. + +#### update_relationship + +Replace the region that is configured for a specific lead address record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "regions", + "id": "US-MI" + } +} +``` +{@/request} diff --git a/src/Oro/Bundle/SalesBundle/Resources/doc/api/opportunity.md b/src/Oro/Bundle/SalesBundle/Resources/doc/api/opportunity.md index b50650a585b..70d7a4255c3 100644 --- a/src/Oro/Bundle/SalesBundle/Resources/doc/api/opportunity.md +++ b/src/Oro/Bundle/SalesBundle/Resources/doc/api/opportunity.md @@ -21,6 +21,57 @@ The created record is returned in the response. {@inheritdoc} +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"opportunities", + "attributes":{ + "name":"Roy Greenwell", + "budgetAmountCurrency":"USD", + "budgetAmountValue":"5765.0000" + }, + "relationships":{ + "contact":{ + "data":{ + "type":"contacts", + "id":"2" + } + }, + "owner":{ + "data":{ + "type":"users", + "id":"43" + } + }, + "organization":{ + "data":{ + "type":"organizations", + "id":"1" + } + }, + "customerAssociation":{ + "data":{ + "type":"b2bcustomers", + "id":"9" + } + }, + "status":{ + "data":{ + "type":"opportunitystatuses", + "id":"in_progress" + } + } + } + } +} +``` +{@/request} + ### update Update existing Opportunity record. @@ -28,6 +79,58 @@ The updated record is returned in the response. {@inheritdoc} +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"opportunities", + "id":"52", + "attributes":{ + "name":"Roy Greenwell", + "budgetAmountCurrency":"USD", + "budgetAmountValue":"5765.0000" + }, + "relationships":{ + "contact":{ + "data":{ + "type":"contacts", + "id":"2" + } + }, + "owner":{ + "data":{ + "type":"users", + "id":"43" + } + }, + "organization":{ + "data":{ + "type":"organizations", + "id":"1" + } + }, + "customerAssociation":{ + "data":{ + "type":"b2bcustomers", + "id":"9" + } + }, + "status":{ + "data":{ + "type":"opportunitystatuses", + "id":"in_progress" + } + } + } + } +} +``` +{@/request} + ### delete Delete existing Opportunity record. @@ -51,7 +154,23 @@ The list of records that will be deleted, could be limited by filters. **The required field** -### customer +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +### customerAssociation + +#### create + +{@inheritdoc} + +**The required field** + +### status #### create @@ -75,6 +194,21 @@ Get the reason for opportunity closure. Update the reason for opportunity closure. +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "opportunityclosereasons", + "id": "outsold" + } +} +``` +{@/request} + ### contact #### get_subresource @@ -89,20 +223,41 @@ Get the person on the customer side who is directly related to the opportunity. Update the person on the customer side who is directly related to the opportunity. -### customer +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "contacts", + "id": "2" + } +} +``` +{@/request} + +### customerAssociation #### get_subresource Get full information about a B2B customer the opportunity is created for. +**The method is planned for refactor.** + #### get_relationship Get a B2B customer the opportunity is created for. +**The method is planned for refactor.** + #### update_relationship Update a B2B customer the opportunity is created for. +**The method is planned for refactor.** + ### lead #### get_subresource @@ -117,6 +272,21 @@ Get the sale prospect that has been successfully qualified into this opportunity Update the sale prospect that has been successfully qualified into this opportunity. +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "leads", + "id": "1" + } +} +``` +{@/request} + ### organization #### get_subresource @@ -131,6 +301,21 @@ Get an organization to which the opportunity belongs. Update an organization to which the opportunity belongs. +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "organizations", + "id": "1" + } +} +``` +{@/request} + ### owner #### get_subresource @@ -145,6 +330,21 @@ Get an user who owns the opportunity Update an user who owns the opportunity. +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "users", + "id": "43" + } +} +``` +{@/request} + ### status #### get_subresource @@ -159,3 +359,33 @@ Get a stage in the process of a sale. Update a stage in the process of a sale. +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "opportunitystatuses", + "id": "in_progress" + } +} +``` +{@/request} + +# Extend\Entity\EV_Opportunity_Status + +## ACTIONS + +### get + +Retrieve a specific opportunity status record MD. + +{@inheritdoc} + +### get_list + +Retrieve a collection of opportunity statuses MD. + +{@inheritdoc} diff --git a/src/Oro/Bundle/SalesBundle/Resources/doc/api/opportunity_close_reason.md b/src/Oro/Bundle/SalesBundle/Resources/doc/api/opportunity_close_reason.md new file mode 100644 index 00000000000..7c4f24b2673 --- /dev/null +++ b/src/Oro/Bundle/SalesBundle/Resources/doc/api/opportunity_close_reason.md @@ -0,0 +1,15 @@ +# Oro\Bundle\SalesBundle\Entity\OpportunityCloseReason + +## ACTIONS + +### get + +Retrieve a specific opportunity close reason record. + +{@inheritdoc} + +### get_list + +Retrieve the collection of opportunity closed reason records. + +{@inheritdoc} \ No newline at end of file diff --git a/src/Oro/Bundle/SalesBundle/Resources/doc/api/opportunity_status.md b/src/Oro/Bundle/SalesBundle/Resources/doc/api/opportunity_status.md new file mode 100644 index 00000000000..5a45cb85ac6 --- /dev/null +++ b/src/Oro/Bundle/SalesBundle/Resources/doc/api/opportunity_status.md @@ -0,0 +1,15 @@ +# Extend\Entity\EV_Opportunity_Status + +## ACTIONS + +### get + +Retrieve a specific opportunity status record. + +{@inheritdoc} + +### get_list + +Retrieve a collection of opportunity statuses. + +{@inheritdoc} diff --git a/src/Oro/Bundle/SalesBundle/Resources/doc/api/sale_funnel.md b/src/Oro/Bundle/SalesBundle/Resources/doc/api/sale_funnel.md new file mode 100644 index 00000000000..8fc3bccaddc --- /dev/null +++ b/src/Oro/Bundle/SalesBundle/Resources/doc/api/sale_funnel.md @@ -0,0 +1,281 @@ +# Oro\Bundle\SalesBundle\Entity\SalesFunnel + +## ACTIONS + +### get + +Retrieve a specific sales process record. + +{@inheritdoc} + +### get_list + +Retrieve a collection of sales processes records. + +{@inheritdoc} + +### create + +Create a new sales process record. +The created record is returned in the response. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"salesfunnels", + "attributes":{ + "startDate":"2017-02-21" + }, + "relationships":{ + "owner":{ + "data":{ + "type":"users", + "id":"1" + } + }, + "lead":{ + "data":{ + "type":"leads", + "id":"31" + } + }, + "opportunity":{ + "data":null + }, + "organization":{ + "data":{ + "type":"organizations", + "id":"1" + } + } + } + } +} +``` +{@/request} + +### update + +Edit a specific sales process record. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"salesfunnels", + "id":"1", + "attributes":{ + "startDate":"2017-02-21" + }, + "relationships":{ + "owner":{ + "data":{ + "type":"users", + "id":"1" + } + }, + "lead":{ + "data":{ + "type":"leads", + "id":"31" + } + }, + "organization":{ + "data":{ + "type":"organizations", + "id":"1" + } + } + } + } +} +``` +{@/request} + +### delete + +Delete a specific sales process record. + +{@inheritdoc} + +### delete_list + +Delete a collection of sales processes records. +The list of records that will be deleted, could be limited by filters. + +{@inheritdoc} + +## FIELDS + +### id + +#### update + +{@inheritdoc} + +**The required field** + +### startDate + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +### lead + +#### create + +{@inheritdoc} + +**Conditionally required field:** +*At least one of the fields Lead or Opportunity must be defined.* + +### opportunity + +#### create + +{@inheritdoc} + +**Conditionally required field:** +*At least one of the fields Lead or Opportunity must be defined.* + +## SUBRESOURCES + +### lead + +#### get_subresource + +Retrieve a record of a lead that belongs to a specific sales process record. + +#### get_relationship + +Retrieve the ID of a lead record that belongs to a specific sales process record. + +#### update_relationship + +Replace a lead record the belongs to a specific sales process record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "leads", + "id": "1" + } +} +``` +{@/request} + +### opportunity + +#### get_subresource + +Retrieve a record of an opportunity that belongs to a specific sales process record. + +#### get_relationship + +Retrieve the ID of an opportunity record that belongs to a specific sales process record. + +#### update_relationship + +Replace an opportunity record that belongs to a specific sales process record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "opportunities", + "id": "1" + } +} +``` +{@/request} + +### organization + +#### get_subresource + +Retrieve the record of the organization a specific sales process record belongs to. + +#### get_relationship + +Retrieve the ID of an organization record that a sales process belongs to. + +#### update_relationship + +Replace the organization a specific sales process belongs to. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "organizations", + "id": "1" + } +} +``` +{@/request} + +### owner + +#### get_subresource + +Retrieve the record of the user who is the owner of a specific sales process record. + +#### get_relationship + +Retrieve the ID of a user who is the owner of a specific sales process record. + +#### update_relationship + +Replace the owner of a specific sales process record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "users", + "id": "1" + } +} +``` +{@/request} diff --git a/src/Oro/Bundle/SalesBundle/Resources/translations/messages.en.yml b/src/Oro/Bundle/SalesBundle/Resources/translations/messages.en.yml index 7dd7b8d2d7d..cdf68730eec 100644 --- a/src/Oro/Bundle/SalesBundle/Resources/translations/messages.en.yml +++ b/src/Oro/Bundle/SalesBundle/Resources/translations/messages.en.yml @@ -136,14 +136,16 @@ oro: name.label: Name label.label: Label # - # Oro/Bundle/SalesBundle/Entity/OpportunityStatus.php + # Oro/Bundle/SalesBundle/Entity/OpportunityStatus.php //deprecated since 1.10. Enum type is used instead + # Extend/Entity/EV_Opportunity_Status.php # opportunitystatus: entity_label: Opportunity Status entity_plural_label: Opportunity Statuses - entity_description: Represent opportunity status + entity_description: A deal's stage (Open, Closed Won, etc.) name.label: Name label.label: Label + # # Oro/Bundle/SalesBundle/Entity/Opportunity.php # @@ -154,57 +156,61 @@ oro: id.label: Id name: label: Opportunity name - description: The name used to refer to the opportunity in the system + description: The name used to refer to the opportunity in the system. close_date: label: Expected close date - description: The expected close date for open opportunity, and actual close date for the closed one + description: The expected close date for open opportunity, and actual close date for the closed one. probability: label: Probability - description: The perceived probability of opportunity being successfully closed + description: The perceived probability of opportunity being successfully closed. budget_amount: label: Budget amount - description: The expected revenue of the opportunity + description: The expected revenue of the opportunity. budget_amount_value: label: Budget Amount + description: Defines the budget value amount for an opportunity. budget_amount_currency: label: Budget Amount Currency + description: The currency specified for the budget amount value. + budget_amount_base_currency: + label: Budget Amount (%sign%) base_budget_amount_value: label: Budget Amount In Base Currency close_revenue: label: Close revenue - description: The actual revenue received from the opportunity after it's been closed + description: The actual revenue received from the opportunity after it's been closed. close_revenue_value: label: Close revenue + description: Defines the close revenue value for an opportunity. close_revenue_currency: label: Close revenue Currency + description: The currency specified for the close renevue value. base_close_revenue_value: label: Close Revenue In Base Currency customer_need: label: Customer need - description: The detailed description of customers' needs that constitute the business opportunity + description: The detailed description of customers' needs that constitute the business opportunity. proposed_solution: label: Proposed solution - description: The detailed description of the solution proposed to the customer by the sales representative + description: The detailed description of the solution proposed to the customer by the sales representative. status: label: Status - description: A stage in the process of a sale + description: A stage in the process of a sale. close_reason: label: Close reason - description: The reason for opportunity closure (both won and lost) + description: The reason for opportunity closure (both won and lost). contact: label: Contact - description: The person on the customer side who is directly related to the opportunity + description: The person on the customer side who is directly related to the opportunity. owner.label: Owner notes: label: Additional comments - description: Any additional notes made by the sales representative + description: Any additional notes made by the sales representative. lead: label: Lead - description: The sale prospect that has been successfully qualified into this opportunity + description: The sale prospect that has been successfully qualified into this opportunity. organization.label: Organization - customer: - label: Account - description: A customer or an account the opportunity is created for + customer.label: Account data_channel: label: Channel description: One of active channels, from which the application will get information on this opportunity. @@ -213,8 +219,8 @@ oro: updated_at.label: Updated At closed_at.label: Closed At customer_association: - label : Customer - description: A customer or an account the opportunity is created for + label: Customer + description: A customer or an account the opportunity is created for. add_entity: Add opportunity @@ -242,56 +248,117 @@ oro: opportunityclosereason: entity_label: Opportunity Close Reason entity_plural_label: Opportunity Close Reasons - entity_description: Represent opportunity close reason + entity_description: The reason for closing an opportunity. name.label: Name - label.label: Label + label: + label: Label + description: The label of the opportunity close reason record. # # Oro/Bundle/SalesBundle/Entity/Lead.php # lead: entity_label: Lead entity_plural_label: Leads - entity_description: Represent lead + entity_description: Leads are prospects or potential sales in a form of contact data. Lead records represent commercial activity with people or businesses that have authority, budget and interest to purchase goods and/or services. add_entity: Add lead id.label: Id - name.label: Lead name - name_prefix.label: Name prefix - first_name.label: First name - middle_name.label: Middle name - last_name.label: Last name - name_suffix.label: Name suffix - job_title.label: Job title - phone_number.label: Phone number - phones.label: Phones - email.label: Email - emails.label: Emails - company_name.label: Company name - website.label: Website - number_of_employees.label: Number of employees - industry.label: Industry - status.label: Status - contact.label: Contact + name: + label: Lead name + description: Unique name that identifies the lead record. + name_prefix: + label: Name prefix + description: Name prefix or honorific of the lead person (Mr./Ms., Dr., Prof., etc.) + first_name: + label: First name + description: First name of the lead person. + middle_name: + label: Middle name + description: Middle name of the lead person. + last_name: + label: Last name + description: Last name of the lead person. + name_suffix: + label: Name suffix + description: Name suffix of the lead person (Sr./Jr., M.D., OBE, etc.) + job_title: + label: Job title + description: Job title of the lead person within the company. + phone_number: + label: Phone number + description: + phones: + label: Phones + description: Collection of lead phone numbers. + email: + label: Email + emails: + label: Emails + description: Collection of lead email addresses. + company_name: + label: Company name + description: Name of the company or organization the lead represents or belongs to. + website: + label: Website + description: Personal or corporate website of the lead. + number_of_employees: + label: Number of employees + description: Number of employees within the lead's company. + industry: + label: Industry + description: Industry where the lead's company is operating. + status: + label: Status + description: Current status of the lead. + contact: + label: Contact + description: A contact the lead was converted into. owner.label: Owner - address.label: Address - addresses.label: Address - add_address.label: Add Address - details.label: Lead Details - source.label: Source - notes.label: Additional comments - twitter.label: Twitter - linked_in.label: LinkedIn - opportunities.label: Opportunities + address: + label: Address + description: + addresses: + label: Address + description: Collection of lead addresses: mailing, business, home, billing, etc. + add_address: + label: Add Address + description: + details: + label: Lead Details + description: + source: + label: Source + description: Source of the lead. + notes: + label: Additional comments + description: Additional notes made to the lead record. + twitter: + label: Twitter + description: Twitter profile of the lead person or company. + linked_in: + label: LinkedIn + description: LinkedIn profile of the lead person or company. + opportunities: + label: Opportunities + description: A collection of opportunities to which the lead was converted. information: Lead Information contact_information: Contact Information - campaign.label: Campaign + campaign: + label: Campaign + description: organization.label: Organization customer.label: Account - data_channel.label: Channel - assigned.label: Assigned - primary_phone.label: Primary Phone - primary_email.label: Primary Email - primary_addr.label: Primary Address - customer_association.label : Customer + data_channel: + label: Channel + description: Sales channel within OroCRM to which the lead belongs. **(Will be removed in 2.0;)** + assigned: + label: Assigned + description: + primary_phone: + label: Primary Phone + description: + primary_email: + label: Primary Email + description: source: unclassified: No source others: Others @@ -302,6 +369,9 @@ oro: error: Unable to convert lead to opportunity feature.label: Lead feature.description: Enables Lead entity + customer_association: + label: Customer + description: A customer or an account the lead is created for. datagrid: number_of_employees: '# of employees' @@ -320,31 +390,68 @@ oro: # Entity Oro\Bundle\SalesBundle\Entity\LeadAddress # leadaddress: - city.label: City - country.label: Country - entity_description: Represent lead's address + city: + label: City + description: The city specified in the lead address. + country: + label: Country + description: The region specified in the lead address. + entity_description: The address configured for a lead. entity_label: Lead Address entity_plural_label: Lead Addresses - first_name.label: First name - id.label: Id - label.label: Label - last_name.label: Last name - middle_name.label: Middle name - name_prefix.label: Name prefix - name_suffix.label: Name suffix - organization.label: Organization - owner.label: Owner - postal_code.label: Zip/Postal Code - primary.label: Primary - region.label: State + first_name: + label: First name + description: The first name that is specified in the lead address. + id: + label: Id + label: + label: Label + description: The label specified for the lead address. The label is used to refer to the lead address on the interface. + last_name: + label: Last name + description: The last name that is specified in the lead address. + middle_name: + label: Middle name + description: The middle name that is specified in the lead address. + name_prefix: + label: Name prefix + description: The name prefix specified in the lead address. + name_suffix: + label: Name suffix + description: The name suffix specified in the lead address. + organization: + label: Organization + description: The organization that is specified in the lead address. + owner: + label: Owner + description: The lead who is the owner of the lead address. The lead address is displayed on the view page of this lead. + postal_code: + label: Zip/Postal Code + description: The postal code specified in the lead address. + primary: + label: Primary + description: Defines whether the lead address is a primary lead address. + region: + label: State + description: The region specified in the lead address. region_text.label: State - street.label: Street - street2.label: Street 2 + street: + label: Street + description: The first line of the street address. Usually contains the street name and the building number. + street2: + label: Street 2 + description: The second line of the street address. May contain the appartment number, P.O. box, building name, etc. country_name.label: Country name country_iso2_code.label: Country ISO2 code country_iso3_code.label: Country ISO3 code region_name.label: State name region_code.label: State ISO code + created: + label: Created at + description: The date and time when the lead address was created. + updated: + label: Created at + description: The date and time when the lead address was last updated. # # Entity Oro/Bundle/SalesBundle/Entity/LeadPhone.php @@ -373,11 +480,18 @@ oro: salesfunnel: entity_label: Sales Process entity_plural_label: Sales Processes + entity_description: Sales funnel is a sales process that involves a series of steps which enable sales force to close deals (Currently deprecated). new_entity: New Sales Process id.label: 'Sales #' - start_date.label: Start Date - lead.label: Lead - opportunity.label: Opportunity + start_date: + label: Start Date + description: The date of the sales process initiation. + lead: + label: Lead + description: The lead that forms a part of a sales process. + opportunity: + label: Opportunity + description: The opportunity that forms a part of a sales process. owner.label: Owner data_channel.label: Channel organization.label: Organization @@ -396,32 +510,63 @@ oro: b2bcustomer: entity_label: Business Customer entity_plural_label: Business Customers - entity_description: Represent business customer + entity_description: Customer identity that represents customers involved in business-to-business activities. id.label: Id - name.label: Customer name - lifetime.label: Lifetime sales value - shipping_address.label: Shipping Address - billing_address.label: Billing Address - account.label: Account - contact.label: Contact - data_channel.label: Channel - leads.label: Leads - opportunities.label: Opportunities + name: + label: Customer name + description: The name of the business customer. + lifetime: + label: Lifetime sales value + description: The lifetime sales value associated with the business customer. + shipping_address: + label: Shipping Address + description: The shipping address configured for the business customer. + billing_address: + label: Billing Address + description: The billing address configured for the business customer. + account: + label: Account + description: The account that a business customer is assigned to. + contact: + label: Contact + description: The contact that is specified for the business customer. + data_channel: + label: Channel + description: The channel via which information about the business customer is received. + leads: + label: Leads + description: The leads that a business customer is assigned to. + opportunities: + label: Opportunities + description: The opportunities that a business customer is assigned to. owner.label: Owner tags.label: Tags - ownership.label: Ownership - emails.label: Emails + ownership: + label: Ownership + description: The type of legal ownership of the business customer. phones.label: Phones - rating.label: Rating - ticker_symbol.label: Ticker symbol - website.label: Website + rating: + label: Rating + description: The rating of the business customer. + ticker_symbol: + label: Ticker symbol + description: The ticker symbol of the business customer. + website: + label: Website + description: The address of the business customer's website. phones.label: Phones emails.label: Emails - employees.label: Employees email.label: Email + employees: + label: Employees + description: The number of employees of the business customer. organization.label: Organization - opportunities.select: Select opportunities - leads.select: Select leads + opportunities: + select: Select opportunities + description: + leads: + select: Select leads + description: asd primary_phone.label: Primary Phone primary_email.label: Primary Email datagrid: @@ -467,6 +612,7 @@ oro: owner.label: Owner primary.label: Primary + # # Entity Oro\Bundle\SalesBundle\Entity\Customer # @@ -475,10 +621,10 @@ oro: entity_plural_label: Customers id.label: Id account.label: Account - customer_association_label: Customer importexport.empty_account: 'Customer Account must not be empty.' importexport.multiple_association: 'Association with multiple Customers is not allowed.' importexport.not_matched_account: 'Customer does not match the Account.' + label: Account widgets: b2bcustomer_information: Business Customer Information From cd4584e6395156d5863c97c6af6d6555abc72c27 Mon Sep 17 00:00:00 2001 From: Maksym Perepelytsya Date: Thu, 23 Feb 2017 21:30:16 +0200 Subject: [PATCH 07/12] CRM-7767: Business Customers > Fatal Error on inline editing - disable account form field processing if form has not related data --- .../Form/Extension/CustomerAssociationAccountExtension.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Oro/Bundle/SalesBundle/Form/Extension/CustomerAssociationAccountExtension.php b/src/Oro/Bundle/SalesBundle/Form/Extension/CustomerAssociationAccountExtension.php index ef60ff1683e..7cc910f04a4 100644 --- a/src/Oro/Bundle/SalesBundle/Form/Extension/CustomerAssociationAccountExtension.php +++ b/src/Oro/Bundle/SalesBundle/Form/Extension/CustomerAssociationAccountExtension.php @@ -86,6 +86,9 @@ function (FormEvent $event) { $target = $event->getData(); $account = $event->getForm()->get('customer_association_account')->getData(); if (!$this->doctrineHelper->isNewEntity($target)) { + if (!$account) { + return; + } $customer = $this->manager->getAccountCustomerByTarget($target); $customer->setTarget($account, $target); } else { From 7fb2c127fd28852c5d42636572e156cc99b38a72 Mon Sep 17 00:00:00 2001 From: Alexander Tarakanov Date: Fri, 24 Feb 2017 04:45:22 +0200 Subject: [PATCH 08/12] BAP-12203 : Documentation for all API resources: (#7839) - added MagentoBundle documentation --- .../Resources/config/oro/api.yml | 47 +- .../Resources/doc/api/address.md | 347 ++++++ .../MagentoBundle/Resources/doc/api/cart.md | 674 +++++++++++ .../Resources/doc/api/cart_address.md | 193 ++++ .../Resources/doc/api/cart_item.md | 350 ++++++ .../Resources/doc/api/cart_status.md | 15 + .../Resources/doc/api/customer.md | 553 +++++++++ .../MagentoBundle/Resources/doc/api/order.md | 563 +++++++++ .../Resources/doc/api/order_address.md | 287 +++++ .../Resources/doc/api/order_item.md | 224 ++++ .../Resources/doc/api/product.md | 224 ++++ .../MagentoBundle/Resources/doc/api/region.md | 84 ++ .../MagentoBundle/Resources/doc/api/store.md | 177 +++ .../Resources/doc/api/website.md | 127 ++ .../Resources/translations/messages.en.yml | 1020 ++++++++++++----- 15 files changed, 4573 insertions(+), 312 deletions(-) create mode 100644 src/Oro/Bundle/MagentoBundle/Resources/doc/api/address.md create mode 100644 src/Oro/Bundle/MagentoBundle/Resources/doc/api/cart.md create mode 100644 src/Oro/Bundle/MagentoBundle/Resources/doc/api/cart_address.md create mode 100644 src/Oro/Bundle/MagentoBundle/Resources/doc/api/cart_item.md create mode 100644 src/Oro/Bundle/MagentoBundle/Resources/doc/api/cart_status.md create mode 100644 src/Oro/Bundle/MagentoBundle/Resources/doc/api/customer.md create mode 100644 src/Oro/Bundle/MagentoBundle/Resources/doc/api/order.md create mode 100644 src/Oro/Bundle/MagentoBundle/Resources/doc/api/order_address.md create mode 100644 src/Oro/Bundle/MagentoBundle/Resources/doc/api/order_item.md create mode 100644 src/Oro/Bundle/MagentoBundle/Resources/doc/api/product.md create mode 100644 src/Oro/Bundle/MagentoBundle/Resources/doc/api/region.md create mode 100644 src/Oro/Bundle/MagentoBundle/Resources/doc/api/store.md create mode 100644 src/Oro/Bundle/MagentoBundle/Resources/doc/api/website.md diff --git a/src/Oro/Bundle/MagentoBundle/Resources/config/oro/api.yml b/src/Oro/Bundle/MagentoBundle/Resources/config/oro/api.yml index 7dde6258b0d..3fd56280af9 100644 --- a/src/Oro/Bundle/MagentoBundle/Resources/config/oro/api.yml +++ b/src/Oro/Bundle/MagentoBundle/Resources/config/oro/api.yml @@ -1,10 +1,17 @@ api: entities: - Oro\Bundle\MagentoBundle\Entity\Address: ~ - Oro\Bundle\MagentoBundle\Entity\Cart: ~ - Oro\Bundle\MagentoBundle\Entity\CartAddress: ~ - Oro\Bundle\MagentoBundle\Entity\CartItem: ~ + Oro\Bundle\MagentoBundle\Entity\Address: + documentation_resource: '@OroMagentoBundle/Resources/doc/api/address.md' + Oro\Bundle\MagentoBundle\Entity\Cart: + documentation_resource: '@OroMagentoBundle/Resources/doc/api/cart.md' + Oro\Bundle\MagentoBundle\Entity\CartAddress: + documentation_resource: '@OroMagentoBundle/Resources/doc/api/cart_address.md' + Oro\Bundle\MagentoBundle\Entity\CartItem: + documentation_resource: '@OroMagentoBundle/Resources/doc/api/cart_item.md' + Oro\Bundle\MagentoBundle\Entity\CartStatus: + documentation_resource: '@OroMagentoBundle/Resources/doc/api/cart_status.md' Oro\Bundle\MagentoBundle\Entity\Customer: + documentation_resource: '@OroMagentoBundle/Resources/doc/api/customer.md' fields: orders: exclude: true @@ -25,13 +32,31 @@ api: # Oro\Bundle\MagentoBundle\Entity\CustomerGroup: ~ # Oro\Bundle\MagentoBundle\Entity\MagentoSoapTransport: ~ # Oro\Bundle\MagentoBundle\Entity\NewsletterSubscriber: ~ - Oro\Bundle\MagentoBundle\Entity\Order: ~ - Oro\Bundle\MagentoBundle\Entity\OrderAddress: ~ - Oro\Bundle\MagentoBundle\Entity\OrderItem: ~ - Oro\Bundle\MagentoBundle\Entity\Product: ~ - Oro\Bundle\MagentoBundle\Entity\Region: ~ - Oro\Bundle\MagentoBundle\Entity\Store: ~ - Oro\Bundle\MagentoBundle\Entity\Website: ~ + Oro\Bundle\MagentoBundle\Entity\Order: + documentation_resource: '@OroMagentoBundle/Resources/doc/api/order.md' + Oro\Bundle\MagentoBundle\Entity\OrderAddress: + documentation_resource: '@OroMagentoBundle/Resources/doc/api/order_address.md' + Oro\Bundle\MagentoBundle\Entity\OrderItem: + documentation_resource: '@OroMagentoBundle/Resources/doc/api/order_item.md' + Oro\Bundle\MagentoBundle\Entity\Product: + documentation_resource: '@OroMagentoBundle/Resources/doc/api/product.md' + Oro\Bundle\MagentoBundle\Entity\Region: + documentation_resource: '@OroMagentoBundle/Resources/doc/api/region.md' + fields: + code: + description: The part of after hyphen of an ISO 3166-2 region code. + combinedCode: + description: The identifier of an entity. The region (country subdivision) code according to ISO 3166-2. + countryCode: + description: The country code specified for a region. The part before hyphen of an ISO 3166-2 region code. + name: + description: The name used to refer to a region on the interface. + regionId: + description: The region ID assigned to a Magento region. + Oro\Bundle\MagentoBundle\Entity\Store: + documentation_resource: '@OroMagentoBundle/Resources/doc/api/store.md' + Oro\Bundle\MagentoBundle\Entity\Website: + documentation_resource: '@OroMagentoBundle/Resources/doc/api/website.md' # remove this exclusion when NewsletterSubscriber entity will be enabled for Data API Extend\Entity\EV_Mage_Subscr_Status: { exclude: true} diff --git a/src/Oro/Bundle/MagentoBundle/Resources/doc/api/address.md b/src/Oro/Bundle/MagentoBundle/Resources/doc/api/address.md new file mode 100644 index 00000000000..294fa439be5 --- /dev/null +++ b/src/Oro/Bundle/MagentoBundle/Resources/doc/api/address.md @@ -0,0 +1,347 @@ +# Oro\Bundle\MagentoBundle\Entity\Address + +## ACTIONS + +### get + +Retrieve a specific Magento customer address record. + +{@inheritdoc} + +### get_list + +Retrieve a collection of Magento customer address records. + +{@inheritdoc} + +### create + +Create a new Magento customer address record. +The created record is returned in the response. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"magentoaddresses", + "attributes":{ + "label":"main", + "street":"Lake", + "city":"Gurdiff", + "postalCode":"05246", + "namePrefix":"Dr.", + "firstName":"Yougin", + "middleName":"Albert", + "lastName":"Martin", + "phone":"+14569453", + "primary":true, + "organization":"Sales Corp", + "originId":"1245" + }, + "relationships":{ + "country":{ + "data":{ + "type":"countries", + "id":"US" + } + }, + "region":{ + "data":{ + "type":"regions", + "id":"US-MI" + } + }, + "owner":{ + "data":{ + "type":"magentocustomers", + "id":"11" + } + } + } + } +} +``` +{@/request} + +### update + +Edit a specific Magento customer address record. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"magentoaddresses", + "id":"1", + "attributes":{ + "label":"main", + "street":"Lake", + "city":"Gurdiff", + "postalCode":"05246", + "namePrefix":"Dr.", + "firstName":"Yougin", + "middleName":"Albert", + "lastName":"Martin", + "phone":"+14569453", + "primary":true, + "organization":"Sales Corp", + "originId":"1245", + "nameSuffix": null + }, + "relationships":{ + "country":{ + "data":{ + "type":"countries", + "id":"US" + } + }, + "region":{ + "data":{ + "type":"regions", + "id":"US-MI" + } + }, + "owner":{ + "data":{ + "type":"magentocustomers", + "id":"11" + } + } + } + } +} +``` +{@/request} + +### delete + +Delete a specific Magento customer address record. + +{@inheritdoc} + +### delete_list + +Delete a collection of Magento customer address records. +The list of records that will be deleted, could be limited by filters. + +{@inheritdoc} + +## FIELDS + +### id + +#### update + +{@inheritdoc} + +**The required field** + +### owner + +#### create + +{@inheritdoc} + +**The required field** + +### country + +#### create + +{@inheritdoc} + +**The required field** + +## SUBRESOURCES + +### contactAddress + +#### get_subresource + +Retrieve the contact address record configured for a specific Magento customer address record. + +#### get_relationship + +Retrieve the ID of the contact address record configured for a specific Magento customer address record. + +#### update_relationship + +Replace the contact address configured for a specific Magento customer address record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "contactaddresses", + "id": "77" + } +} +``` +{@/request} + +### country + +#### get_subresource + +Retrieve the record of the country configured for a specific Magento customer address record. + +#### get_relationship + +Retrieve the ID of the country configured for a specific Magento customer address record. + +#### update_relationship + +Replace the country configured for a specific Magento customer address record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "countries", + "id": "US" + } +} +``` +{@/request} + +### owner + +#### get_subresource + +Retrieve the record of the Magento customer who is the owner of a specific Magento customer address record. + +#### get_relationship + +Retrieve the ID of the Magento customer who is the owner of a specific Magento customer address record. + +#### update_relationship + +Replace the owner of a specific Magento customer address record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "magentocustomers", + "id": "11" + } +} +``` +{@/request} + +### region + +#### get_subresource + +Retrieve the record of the region configured for a specific Magento customer address record. + +#### get_relationship + +Retrieve the ID of the region configured for a specific Magento customer address record. + +#### update_relationship + +Replace the region configured for a specific Magento customer address record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "regions", + "id": "US-MI" + } +} +``` +{@/request} + +### types + +#### get_subresource + +Retrieve a collection of the address type records that are configured for a specific Magento customer address record. + +#### get_relationship + +Retrieve the IDs of the address types ('billing,' 'shipping') that are configured for a specific Magento customer address record. + +#### add_relationship + +Set the address types for a specific Magento customer address record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":[ + { + "type":"addresstypes", + "id":"billing" + }, + { + "type":"addresstypes", + "id":"shipping" + } + ] +} +``` +{@/request} + +#### update_relationship + +Replace the address types for a specific Magento customer address record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":[ + { + "type":"addresstypes", + "id":"billing" + }, + { + "type":"addresstypes", + "id":"shipping" + } + ] +} +``` +{@/request} + +#### delete_relationship + +Remove the address types of a specific Magento customer address record. diff --git a/src/Oro/Bundle/MagentoBundle/Resources/doc/api/cart.md b/src/Oro/Bundle/MagentoBundle/Resources/doc/api/cart.md new file mode 100644 index 00000000000..f1b15633595 --- /dev/null +++ b/src/Oro/Bundle/MagentoBundle/Resources/doc/api/cart.md @@ -0,0 +1,674 @@ +# Oro\Bundle\MagentoBundle\Entity\Cart + +## ACTIONS + +### get + +Retrieve a specific Magento shopping cart record. + +{@inheritdoc} + +### get_list + +Retrieve a collection of records represented by Magento shopping carts. + +{@inheritdoc} + +### create + +Create a new Magento shopping cart record. +The created record is returned in the response. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"magentocarts", + "id":"1", + "attributes":{ + "itemsQty":2, + "itemsCount":2, + "baseCurrencyCode":"USD", + "storeCurrencyCode":"USD", + "quoteCurrencyCode":"USD", + "storeToBaseRate":1, + "storeToQuoteRate":1, + "email":"DonaldESchiller@einrot.com", + "isGuest":false, + "subTotal":"205.6619", + "grandTotal":"215.6619", + "taxAmount":"15.9019", + "createdAt":"2017-02-13T15:42:19Z", + "updatedAt":"2017-02-13T15:42:19Z", + "originId":0, + "firstName":"Donald", + "lastName":"Schiller" + }, + "relationships":{ + "cartItems":{ + "data":[ + { + "type":"magentocartitems", + "id":"1" + }, + { + "type":"magentocartitems", + "id":"2" + } + ] + }, + "customer":{ + "data":{ + "type":"magentocustomers", + "id":"18" + } + }, + "store":{ + "data":{ + "type":"magentostores", + "id":"1" + } + }, + "status":{ + "data":{ + "type":"magentocartstatuses", + "id":"open" + } + }, + "owner":{ + "data":{ + "type":"users", + "id":"21" + } + }, + "organization":{ + "data":{ + "type":"organizations", + "id":"1" + } + }, + "dataChannel":{ + "data":{ + "type":"channels", + "id":"2" + } + } + } + } +} +``` +{@/request} + +### update + +Edit a specific Magento shopping cart record. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "magentocarts", + "id": "546", + "attributes": { + "itemsQty": 2, + "itemsCount": 2, + "baseCurrencyCode": "USD", + "storeCurrencyCode": "USD", + "quoteCurrencyCode": "USD", + "storeToBaseRate": 1, + "storeToQuoteRate": 1, + "email": "DonaldESchiller@einrot.com", + "giftMessage": null, + "isGuest": false, + "paymentDetails": null, + "notes": null, + "statusMessage": null, + "importedAt": null, + "syncedAt": null, + "subTotal": 205.66, + "grandTotal": 215.66, + "taxAmount": 15.9, + "createdAt": "2017-02-13T15:42:19Z", + "updatedAt": "2017-02-13T15:42:19Z", + "originId": 0, + "firstName": "Donald", + "lastName": "Schiller" + }, + "relationships": { + "cartItems": { + "data": [ + { + "type": "magentocartitems", + "id": "1" + }, + { + "type": "magentocartitems", + "id": "2" + } + ] + }, + "customer": { + "data": { + "type": "magentocustomers", + "id": "18" + } + }, + "store": { + "data": { + "type": "magentostores", + "id": "1" + } + }, + "shippingAddress": { + "data": null + }, + "billingAddress": { + "data": null + }, + "status": { + "data": { + "type": "magentocartstatuses", + "id": "open" + } + }, + "opportunity": { + "data": null + }, + "owner": { + "data": { + "type": "users", + "id": "21" + } + }, + "organization": { + "data": { + "type": "organizations", + "id": "1" + } + }, + "dataChannel": { + "data": { + "type": "channels", + "id": "2" + } + } + } + } +} +``` +{@/request} + +### delete + +Delete a specific Magento shopping cart record. + +{@inheritdoc} + +### delete_list + +Delete a collection of Magento shopping cartrecords. +The list of records that will be deleted, could be limited by filters. + +{@inheritdoc} + +## FIELDS + +### id + +#### update + +{@inheritdoc} + +**The required field** + +### baseCurrencyCode + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +### storeCurrencyCode + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +### quoteCurrencyCode + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +### storeToBaseRate + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +### storeToQuoteRate + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +### isGuest + +#### create + +{@inheritdoc} + +**The required field** + +### dataChannel + +#### create + +{@inheritdoc} + +**The required field** + +### itemsQty + +#### create + +{@inheritdoc} + +**The required field** + +### itemsCount + +#### create + +{@inheritdoc} + +**The required field** + +## SUBRESOURCES + +### billingAddress + +#### get_subresource + +Retrieve a billing address record configured for a specific Magento shopping cart record. + +#### get_relationship + +Retrieve the ID of the billing address configured for a specific Magento shopping cart record. + +#### update_relationship + +Replace the billing address for a specific Magento shopping cart record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "magentocartaddresses", + "id": "5" + } +} +``` +{@/request} + +### cartItems + +#### get_subresource + +Retrieve records of cart items the belong to a specific Magento shopping cart record. + +#### get_relationship + +Retrieve the IDs of cart items assigned to a specific Magento shopping cart record. + +#### add_relationship + +Set the cart items that will be assigned to a specific Magento shopping cart record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": [ + { + "type": "magentocartitems", + "id": "1" + }, + { + "type": "magentocartitems", + "id": "2" + } + ] +} +``` +{@/request} + +#### update_relationship + +Replace the cart items that are assigned to a specific Magento shopping cart record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": [ + { + "type": "magentocartitems", + "id": "1" + }, + { + "type": "magentocartitems", + "id": "2" + } + ] +} +``` +{@/request} + +#### delete_relationship + +Remove the cart items that are assigned to a specific Magento shopping cart record. + + +### customer + +#### get_subresource + +Retrieve records of a Magento customer to whom a specific Magento shopping cart belongs. + +#### get_relationship + +Retrieve the ID of the Magento customer to whom a specific Magento shopping cart record belongs. + +#### update_relationship + +Replace the Magento customer to whom a specific Magento shopping cart record belongs. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "magentocustomers", + "id": "18" + } +} +``` +{@/request} + +### dataChannel + +#### get_subresource + +Retrieve channel record to which a specific Magento shopping cart is assigned. + +#### get_relationship + +Retrieve the ID of the channel via which information about a specific Magento shopping cart is received. + +#### update_relationship + +Replace the channel for a specific Magento shopping cart record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "channels", + "id": "2" + } +} +``` +{@/request} + +### opportunity + +#### get_subresource + +Retrieve a record of an opportunity that was converted from a specific Magento shopping cart record. + +#### get_relationship + +Retrieve the ID of an opportunity record converted from a specific Magento shopping cart record. + +#### update_relationship + +Replace the opportunity record assigned to a Magento shopping cart record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "opportunities", + "id": "1" + } +} +``` +{@/request} + +### organization + +#### get_subresource + +Retrieve a record of an organization that a specificMagento shopping cart record belongs to. + +#### get_relationship + +Retrieve the ID of an organization record that a Magento shopping cart record belongs to. + +#### update_relationship + +Replace the organization a specific Magento shopping cart record belongs to. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "organizations", + "id": "1" + } +} +``` +{@/request} + +### owner + +#### get_subresource + +Retrieve a record of the user who is the owner of a specific Magento shopping cart record. + +#### get_relationship + +Retrieve the ID of a user who is the owner of a specific Magento shopping cart record. + +#### update_relationship + +Replace the owner of a specific Magento shopping cart record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "users", + "id": "21" + } +} +``` +{@/request} + +### store + +#### get_subresource + +Retrieve the store record assigned to a specific Magento shopping cart record. + +#### get_relationship + +Retrieve the ID of the store from which a specific Magento shopping cart has been received. + +#### update_relationship + +Replace the store from which a specific Magento shopping cart has been received. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "magentostores", + "id": "1" + } +} +``` +{@/request} + +### status + +#### get_subresource + +Retrieve the status record configured for a specific Magento shopping cart record. + +#### get_relationship + +Retrieve the ID of the status record configured for a specific Magento shopping cart record. + +#### update_relationship + +Replace the status of a specific Magento shopping cart record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "magentocartstatuses", + "id": "open" + } +} +``` +{@/request} + +### shippingAddress + +#### get_subresource + +Retrieve the shipping address configured for a specific Magento shopping cart record. + +#### get_relationship + +Retrieve the ID of the shipping address configured for a specific Magento shopping cart record. + +#### update_relationship + +Replace the shipping address for a specific Magento shopping cart record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "magentocartaddresses", + "id": "1" + } +} +``` +{@/request} diff --git a/src/Oro/Bundle/MagentoBundle/Resources/doc/api/cart_address.md b/src/Oro/Bundle/MagentoBundle/Resources/doc/api/cart_address.md new file mode 100644 index 00000000000..d02e137d00c --- /dev/null +++ b/src/Oro/Bundle/MagentoBundle/Resources/doc/api/cart_address.md @@ -0,0 +1,193 @@ +# Oro\Bundle\MagentoBundle\Entity\CartAddress + +## ACTIONS + +### get + +Retrieve a specific Magento cart address record. + +{@inheritdoc} + +### get_list + +Retrieve a collection of records represented by Magento cart addresses. + +{@inheritdoc} + +### create + +Create a new Magento cart address record. +The created record is returned in the response. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"magentocartaddresses" + }, + "attributes":{ + "street":"Lake", + "city":"Gurdiff", + "postalCode":"05246", + "namePrefix":"Dr.", + "firstName":"Yougin", + "middleName":"Albert", + "lastName":"Martin", + "phone":"+14569453", + "primary":true, + "organization":"Sales Corp", + "originId":"1245" + }, + "relationships":{ + "country":{ + "data":{ + "type":"countries", + "id":"US" + } + }, + "region":{ + "data":{ + "type":"regions", + "id":"US-MI" + } + } + } +} +``` +{@/request} + +### update + +Edit a specific Magento cart address record. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"magentocartaddresses", + "id":"4", + "attributes":{ + "street":"Lake", + "city":"Gurdiff", + "postalCode":"05246", + "namePrefix":"Dr.", + "firstName":"Yougin", + "middleName":"Albert", + "lastName":"Martin", + "phone":"+14569453", + "organization":"Sales Corp", + "originId":"1245" + }, + "relationships":{ + "country":{ + "data":{ + "type":"countries", + "id":"US" + } + }, + "region":{ + "data":{ + "type":"regions", + "id":"US-MI" + } + } + } + } +} +``` +{@/request} + +### delete + +Delete a specific Magento cart address record. + +{@inheritdoc} + +### delete_list + +Delete a collection of Magento cart addresses records. +The list of records that will be deleted, could be limited by filters. + +{@inheritdoc} + +## FIELDS + +### id + +#### update + +{@inheritdoc} + +**The required field** + +## SUBRESOURCES + +### country + +#### get_subresource + +Retrieve the record of the country configured for a specific Magento cart address record. + +#### get_relationship + +Retrieve the ID of the country configured for a specific Magento cart address record. + +#### update_relationship + +Replace the country configured for a specific Magento cart address record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "countries", + "id": "US" + } +} +``` +{@/request} + +### region + +#### get_subresource + +Retrieve the record of the region configured for a specific Magento cart address record. + +#### get_relationship + +Retrieve the ID of the region configured for a specific Magento cart address record. + +#### update_relationship + +Replace the region configured for a specific Magento cart address record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "regions", + "id": "US-MI" + } +} +``` +{@/request} diff --git a/src/Oro/Bundle/MagentoBundle/Resources/doc/api/cart_item.md b/src/Oro/Bundle/MagentoBundle/Resources/doc/api/cart_item.md new file mode 100644 index 00000000000..ecd1548d6fb --- /dev/null +++ b/src/Oro/Bundle/MagentoBundle/Resources/doc/api/cart_item.md @@ -0,0 +1,350 @@ +# Oro\Bundle\MagentoBundle\Entity\CartItem + +## ACTIONS + +### get + +Retrieve a specific Magento shopping cart item record. + +{@inheritdoc} + +### get_list + +Retrieve a collection records that represent Magento shopping cart items. + +{@inheritdoc} + +### create + +Create a new Magento shopping cart item record. +The created record is returned in the response. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"magentocartitems", + "attributes":{ + "productId":72, + "freeShipping":"1", + "description":"Item from cart", + "isVirtual":false, + "priceInclTax":"128.7988", + "rowTotal":"128.7988", + "taxAmount":"9.9588", + "productType":"simple", + "removed":false, + "sku":"sku-chair", + "name":"Chair", + "qty":1, + "price":"118.8400", + "discountAmount":"0.0000", + "taxPercent":0.0838, + "createdAt":"2017-02-15T15:42:19Z", + "updatedAt":"2017-02-15T15:42:19Z" + }, + "relationships":{ + "cart":{ + "data":{ + "type":"magentocarts", + "id":"1" + } + }, + "owner":{ + "data":{ + "type":"organizations", + "id":"1" + } + } + } + } +} +``` +{@/request} + +### update + +Edit a specific Magento shopping cart item record. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"magentocartitems", + "id":"1", + "attributes":{ + "productId":72, + "freeShipping":"1", + "description":"Item from cart", + "isVirtual":false, + "priceInclTax":"128.7988", + "rowTotal":"128.7988", + "taxAmount":"9.9588", + "productType":"simple", + "removed":false, + "sku":"sku-chair", + "name":"Chair", + "qty":1, + "price":"118.8400", + "discountAmount":"0.0000", + "taxPercent":0.0838, + "createdAt":"2017-02-15T15:42:19Z", + "updatedAt":"2017-02-15T15:42:19Z" + }, + "relationships":{ + "cart":{ + "data":{ + "type":"magentocarts", + "id":"1" + } + }, + "owner":{ + "data":{ + "type":"organizations", + "id":"1" + } + } + } + } +} +``` +{@/request} + +### delete + +Delete a specific Magento shopping cart item record. + +{@inheritdoc} + +### delete_list + +Delete a collection of Magento shopping cart items records. +The list of records that will be deleted, could be limited by filters. + +{@inheritdoc} + +## FIELDS + +### id + +#### update + +{@inheritdoc} + +**The required field** + +### productId + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +### freeShipping + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +### isVirtual + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +### rowTotal + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +### taxAmount + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +### productType + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +### name + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +### qty + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +### price + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +## SUBRESOURCES + +### cart + +#### get_subresource + +Retrieve the Magento cart record configured for a specific Magento shopping cart item record. + +#### get_relationship + +Retrieve the ID of the Magento cart record configured for a specific Magento shopping cart item record. + +#### update_relationship + +Replace the Magento cart record configured for a specific Magento shopping cart item record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "magentocarts", + "id": "1" + } +} +``` +{@/request} + +### owner + +#### get_subresource + +Retrieve the record of the organization that is the owner of a specific Magento shopping cart item record. + +#### get_relationship + +Retrieve the ID of the organization that is the owner of a specific Magento shopping cart item record. + +#### update_relationship + +Replace the owner of a specific Magento shopping cart item record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "organizations", + "id": "1" + } +} +``` +{@/request} diff --git a/src/Oro/Bundle/MagentoBundle/Resources/doc/api/cart_status.md b/src/Oro/Bundle/MagentoBundle/Resources/doc/api/cart_status.md new file mode 100644 index 00000000000..80c6704d452 --- /dev/null +++ b/src/Oro/Bundle/MagentoBundle/Resources/doc/api/cart_status.md @@ -0,0 +1,15 @@ +# Oro\Bundle\MagentoBundle\Entity\CartStatus + +## ACTIONS + +### get + +Retrieve a collection of Magento shopping cart statuses. + +{@inheritdoc} + +### get_list + +Retrieve a record of a specific Magento shopping cart status. + +{@inheritdoc} \ No newline at end of file diff --git a/src/Oro/Bundle/MagentoBundle/Resources/doc/api/customer.md b/src/Oro/Bundle/MagentoBundle/Resources/doc/api/customer.md new file mode 100644 index 00000000000..9248d6f5180 --- /dev/null +++ b/src/Oro/Bundle/MagentoBundle/Resources/doc/api/customer.md @@ -0,0 +1,553 @@ +# Oro\Bundle\MagentoBundle\Entity\Customer + +## ACTIONS + +### get + +Retrieve a specific Magento customer record. + +{@inheritdoc} + +### get_list + +Retrieve a collection of Magento customer records. + +{@inheritdoc} + +### create + +Create a new Magento customer record. +The created record is returned in the response. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"magentocustomers", + "attributes":{ + "firstName":"Jerry", + "lastName":"Coleman", + "birthday":"1969-11-07", + "email":"JerryAColeman@armyspy.com", + "createdAt":"2017-02-15T15:42:19Z", + "updatedAt":"2017-02-15T15:42:19Z", + "confirmed":true, + "guest":false, + "isActive":false, + "vat":"14605165", + "lifetime":"0.0000", + "currency":"USD", + "originId":1 + }, + "relationships":{ + "website":{ + "data":{ + "type":"magentowebsites", + "id":"1" + } + }, + "store":{ + "data":{ + "type":"magentostores", + "id":"1" + } + }, + "contact":{ + "data":{ + "type":"contacts", + "id":"1" + } + }, + "account":{ + "data":{ + "type":"accounts", + "id":"1" + } + }, + "owner":{ + "data":{ + "type":"users", + "id":"1" + } + }, + "organization":{ + "data":{ + "type":"organizations", + "id":"1" + } + }, + "dataChannel":{ + "data":{ + "type":"channels", + "id":"2" + } + } + } + } +} +``` +{@/request} + +### update + +Edit a specific Magento customer record. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"magentocustomers", +"id":"245", + "attributes":{ + "firstName":"Jerry", + "lastName":"Coleman", + "birthday":"1969-11-07", + "email":"JerryAColeman@armyspy.com", + "createdAt":"2017-02-15T15:42:19Z", + "updatedAt":"2017-02-15T15:42:19Z", + "confirmed":true, + "guest":false, + "isActive":false, + "vat":"14605165", + "lifetime":"0.0000", + "currency":"USD", + "originId":1 + }, + "relationships":{ + "website":{ + "data":{ + "type":"magentowebsites", + "id":"1" + } + }, + "store":{ + "data":{ + "type":"magentostores", + "id":"1" + } + }, + "account":{ + "data":{ + "type":"accounts", + "id":"1" + } + }, + "owner":{ + "data":{ + "type":"users", + "id":"1" + } + }, + "organization":{ + "data":{ + "type":"organizations", + "id":"1" + } + }, + "dataChannel":{ + "data":{ + "type":"channels", + "id":"2" + } + } + } + } +} +``` +{@/request} + +### delete + +Delete a specific Magento customer record + +{@inheritdoc} + +### delete_list + +Delete a collection of Magento customer records. +The list of records that will be deleted, could be limited by filters. + +{@inheritdoc} + +## FIELDS + +### id + +#### update + +{@inheritdoc} + +**The required field** + +### dataChannel + +#### create + +{@inheritdoc} + +**The required field** + +### lastName + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +### firstName + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +### email + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +### group + +#### create + +{@inheritdoc} + +**The required field** + +### Store + +#### create + +{@inheritdoc} + +**The required field** + +## SUBRESOURCES + +### addresses + +#### get_subresource + +Retrieve the address records assigned to a specific Magento customer record. + +#### get_relationship + +Retrieve the IDs of the address records that are assigned to a Magento customer record. + +#### add_relationship + +Set address records for a specific Magento customer record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": [ + { + "type": "magentoaddresses", + "id": "1" + }, + { + "type": "magentoaddresses", + "id": "2" + } + ] +} +``` +{@/request} + +#### update_relationship + +Replace address records assigned to a specific Magento customer record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": [ + { + "type": "magentoaddresses", + "id": "1" + }, + { + "type": "magentoaddresses", + "id": "2" + } + ] +} +``` +{@/request} + +#### delete_relationship + +Remove address records from a specific Magento customer record. + +### account + +#### get_subresource + +Retrieve the account records a specific Magento customer is assigned to. + +#### get_relationship + +Retrieve the IDs of the account records which a specific Magento customer record is assigned to. + +#### update_relationship + +Replace accounts assigned to a specific Magento customer record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "accounts", + "id": "1" + } +} +``` +{@/request} + +### carts + +#### get_subresource + +Retrieve cart records assigned to a specific Magento customer record. + +#### get_relationship + +Retrieve the IDs of the cart records assigned to a specific Magento customer record. + +### contact + +#### get_subresource + +Retrieve a contact record assigned to a specific Magento customer record. + +#### get_relationship + +Retrieve contact IDs assigned to a specific Magento customer record. + +#### update_relationship + +Replace a contact record assigned to a specific Magento customer record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "contacts", + "id": "1" + } +} +``` +{@/request} + +### dataChannel + +#### get_subresource + +Retrieve channel record to which a specific Magento customer is assigned. + +#### get_relationship + +Retrieve the ID of a channel via which information about a specific Magento customer record is received. + +#### update_relationship + +Replace the channel for a specific Magento customer record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "channels", + "id": "2" + } +} +``` +{@/request} + +### orders + +#### get_subresource + +Retrieve order records the belong to a specific Magento customer record. + +#### get_relationship + +Retrieve the IDs of the orders created by a specific Magento customer. + +### organization + +#### get_subresource + +Retrieve the record of the organization a specific Magento customer record belongs to. + +#### get_relationship + +Retrieve the ID of an organization record that a Magento customer record belongs to. + +#### update_relationship + +Replace the organization a specific Magento customer record belongs to. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "organizations", + "id": "1" + } +} +``` +{@/request} + +### owner + +#### get_subresource + +Retrieve the record of the user who is the owner of a specific Magento customer. + +#### get_relationship + +Retrieve the ID of a user who is the owner of a specific Magento customer record. + +#### update_relationship + +Replace the owner of a specific Magento customer record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "users", + "id": "1" + } +} +``` +{@/request} + +### store + +#### get_subresource + +Retrieve the store record assigned to a specific Magento customer record. + +#### get_relationship + +Retrieve the ID of the store from which a specific Magento customer records have been received. + +#### update_relationship + +Replace the store from which a specific Magento customer records have been received. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "magentostores", + "id": "1" + } +} +``` +{@/request} + +### website + +#### get_subresource + +Retrieve the Magento website record to which a specific Magento customer record is assigned. + +#### get_relationship + +Retrieve the ID of the Magento website to which a specific Magento customer record is assigned. + +#### update_relationship + +Replace the Magento website to which a specific Magento customer record is assigned. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "magentowebsites", + "id": "1" + } +} +``` +{@/request} diff --git a/src/Oro/Bundle/MagentoBundle/Resources/doc/api/order.md b/src/Oro/Bundle/MagentoBundle/Resources/doc/api/order.md new file mode 100644 index 00000000000..81e1207ed58 --- /dev/null +++ b/src/Oro/Bundle/MagentoBundle/Resources/doc/api/order.md @@ -0,0 +1,563 @@ +# Oro\Bundle\MagentoBundle\Entity\Order + +## ACTIONS + +### get + +Retrieve a specific Magento order record. + +{@inheritdoc} + +### get_list + +Retrieve a collection of Magento order records. + +{@inheritdoc} + +### create + +Create a new Magento order record. +The created record is returned in the response. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"magentoorders", + "attributes":{ + "incrementId":"0", + "isVirtual":false, + "isGuest":false, + "storeName":"Admin", + "totalPaidAmount":215.661888, + "totalInvoicedAmount":"215.6619", + "totalRefundedAmount":"0.0000", + "totalCanceledAmount":"0.0000", + "currency":"USD", + "paymentMethod":"Ccsave", + "paymentDetails":"N/A", + "subtotalAmount":"205.6619", + "shippingAmount":"9.0000", + "shippingMethod":"flatrate_flatrate", + "totalAmount":"215.6619", + "status":"Completed", + "createdAt":"2017-02-15T15:42:19Z", + "updatedAt":"2017-02-15T15:42:19Z", + "firstName":"Donald", + "lastName":"Schiller" + }, + "relationships":{ + "customer":{ + "data":{ + "type":"magentocustomers", + "id":"18" + } + }, + "addresses":{ + "data":[ + { + "type":"magentoorderaddresses", + "id":"1" + }, + { + "type":"magentoorderaddresses", + "id":"22" + } + ] + }, + "store":{ + "data":{ + "type":"magentostores", + "id":"1" + } + }, + "cart":{ + "data":{ + "type":"magentocarts", + "id":"1" + } + }, + "items":{ + "data":[ + { + "type":"magentoorderitems", + "id":"1" + }, + { + "type":"magentoorderitems", + "id":"2" + } + ] + }, + "owner":{ + "data":{ + "type":"users", + "id":"21" + } + }, + "organization":{ + "data":{ + "type":"organizations", + "id":"1" + } + }, + "dataChannel":{ + "data":{ + "type":"channels", + "id":"2" + } + } + } + } +} +``` +{@/request} + +### update + +Edit a specific Magento order record. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"magentoorders", + "id":"1", + "attributes":{ + "incrementId":"0", + "isVirtual":false, + "isGuest":false, + "storeName":"Admin", + "totalPaidAmount":215.661888, + "totalInvoicedAmount":"215.6619", + "totalRefundedAmount":"0.0000", + "totalCanceledAmount":"0.0000", + "currency":"USD", + "paymentMethod":"Ccsave", + "paymentDetails":"N/A", + "subtotalAmount":"205.6619", + "shippingAmount":"9.0000", + "shippingMethod":"flatrate_flatrate", + "totalAmount":"215.6619", + "status":"Completed", + "createdAt":"2017-02-15T15:42:19Z", + "updatedAt":"2017-02-15T15:42:19Z", + "firstName":"Donald", + "lastName":"Schiller" + }, + "relationships":{ + "customer":{ + "data":{ + "type":"magentocustomers", + "id":"18" + } + }, + "addresses":{ + "data":[ + { + "type":"magentoorderaddresses", + "id":"1" + }, + { + "type":"magentoorderaddresses", + "id":"22" + } + ] + }, + "store":{ + "data":{ + "type":"magentostores", + "id":"1" + } + }, + "cart":{ + "data":{ + "type":"magentocarts", + "id":"1" + } + }, + "items":{ + "data":[ + { + "type":"magentoorderitems", + "id":"1" + }, + { + "type":"magentoorderitems", + "id":"2" + } + ] + }, + "owner":{ + "data":{ + "type":"users", + "id":"21" + } + }, + "organization":{ + "data":{ + "type":"organizations", + "id":"1" + } + }, + "dataChannel":{ + "data":{ + "type":"channels", + "id":"2" + } + } + } + } +} +``` +{@/request} + +### delete + +Delete a specific Magento order record. + +{@inheritdoc} + +### delete_list + +Delete a collection of Magento order records. +The list of records that will be deleted, could be limited by filters. + +{@inheritdoc} + +## FIELDS + +### id + +#### update + +{@inheritdoc} + +**The required field** + +### incrementId + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +### status + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +### dataChannel + +#### create + +{@inheritdoc} + +**The required field** + +## SUBRESOURCES + +### addresses + +#### get_subresource + +Retrieve the address records assigned to a specific Magento order record. + +#### get_relationship + +Retrieve the IDs of the address records that are assigned to a Magento order record. + +#### add_relationship + +Set address records for a specific Magento order record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": [ + { + "type": "magentoorderaddresses", + "id": "1" + }, + { + "type": "magentoorderaddresses", + "id": "22" + } + ] +} +``` +{@/request} + +#### update_relationship + +Replace address records assigned to a specific Magento order record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": [ + { + "type": "magentoorderaddresses", + "id": "1" + }, + { + "type": "magentoorderaddresses", + "id": "22" + } + ] +} +``` +{@/request} + +#### delete_relationship + +Remove address records from a specific Magento order record. + +### items + +#### get_subresource + +Retrieve the records of items are assigned to a specific Magento order. + +#### get_relationship + +Retrieve the IDs of the items assigned to a specific Magento order record. + +#### add_relationship + +Set item records for a specific Magento order record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":[ + { + "type":"magentoorderitems", + "id":"1" + }, + { + "type":"magentoorderitems", + "id":"2" + } + ] +} +``` +{@/request} + +#### update_relationship + +Replace records of items assigned to a specific Magento order record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":[ + { + "type":"magentoorderitems", + "id":"1" + }, + { + "type":"magentoorderitems", + "id":"2" + } + ] +} +``` +{@/request} + +#### delete_relationship + +Remove records of items assigned to a specific Magento order record. + +### cart + +#### get_subresource + +Retrieve a cart record assigned to a specific Magento order record. + +#### get_relationship + +Retrieve the ID of a cart record assigned to a specific Magento order record. + +#### update_relationship + +Replace a cart record assigned to a specific Magento order record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "magentocarts", + "id": "1" + } +} +``` +{@/request} + +### customer + +#### get_subresource + +Retrieve a record of Magento customer to whom a specific Magento order belongs. + +#### get_relationship + +Retrieve the ID of a customer record assigned to a specific Magento order record. + +#### update_relationship + +Replace the custom record assigned to a specific Magento order record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "magentocustomers", + "id": "18" + } +} +``` +{@/request} + +### dataChannel + +#### get_subresource + +Retrieve channel record to which a specific Magento order is assigned. + +#### get_relationship + +Retrieve the ID of a channel via which information about specific Magento order record is received. + +#### update_relationship + +Replace the channel for a specific Magento order record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "channels", + "id": "2" + } +} +``` +{@/request} + +### owner + +#### get_subresource + +Retrieve the record of the user who is the owner of a specific Magento order record. + +#### get_relationship + +Retrieve the ID of a user who is the owner of a specific Magento order record. + +#### update_relationship + +Replace the owner of a specific Magento order record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "users", + "id": "21" + } +} +``` +{@/request} + +### store + +#### get_subresource + +Retrieve the store record assigned to a specific Magento order record. + +#### get_relationship + +Retrieve the ID of the store from which a specific Magento order records have been received. + +#### update_relationship + +Replace the store from which a specific Magento order records have been received. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "magentostores", + "id": "1" + } +} +``` +{@/request} diff --git a/src/Oro/Bundle/MagentoBundle/Resources/doc/api/order_address.md b/src/Oro/Bundle/MagentoBundle/Resources/doc/api/order_address.md new file mode 100644 index 00000000000..d6aa78ccacd --- /dev/null +++ b/src/Oro/Bundle/MagentoBundle/Resources/doc/api/order_address.md @@ -0,0 +1,287 @@ +# Oro\Bundle\MagentoBundle\Entity\OrderAddress + +## ACTIONS + +### get + +Retrieve a specific Magento order address record. + +{@inheritdoc} + +### get_list + +Retrieve a collection of Magento order addresses. + +{@inheritdoc} + +### create + +Create a new Magento order address record. +The created record is returned in the response. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"magentoorderaddresses", + "attributes":{ + "street":"First street", + "city":"City", + "postalCode":"123456", + "firstName":"John", + "lastName":"Doe" + }, + "relationships":{ + "owner":{ + "data":{ + "type":"magentoorders", + "id":"1" + } + }, + "country":{ + "data":{ + "type":"countries", + "id":"US" + } + }, + "region":{ + "data":{ + "type":"regions", + "id":"US-AK" + } + } + } + } +} +``` +{@/request} + +### update + +Edit a specific Magento order address record. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"magentoorderaddresses", + "id":"1", + "attributes":{ + "street":"First street", + "city":"City", + "postalCode":"123456", + "firstName":"John", + "lastName":"Doe" + }, + "relationships":{ + "owner":{ + "data":{ + "type":"magentoorders", + "id":"1" + } + }, + "country":{ + "data":{ + "type":"countries", + "id":"US" + } + }, + "region":{ + "data":{ + "type":"regions", + "id":"US-AK" + } + } + } + } +} +``` +{@/request} + +### delete + +Delete a specific Magento order address record. + +{@inheritdoc} + +### delete_list + +Delete a collection of Magento order address records. +The list of records that will be deleted, could be limited by filters. + +{@inheritdoc} + +## FIELDS + +### id + +#### update + +{@inheritdoc} + +**The required field** + +## SUBRESOURCES + +### types + +#### get_subresource + +Retrieve a collection of the address type records that are configured for a specific Magento order address record. + +#### get_relationship + +Retrieve the IDs of the address types ('billing,' 'shipping') that are configured for a specificMagento order address record. + +#### add_relationship + +Set the address types for a specific Magento order address record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":[ + { + "type":"addresstypes", + "id":"billing" + }, + { + "type":"addresstypes", + "id":"shipping" + } + ] +} +``` +{@/request} + +#### update_relationship + +Replace the address types for a specific Magento order address record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":[ + { + "type":"addresstypes", + "id":"billing" + }, + { + "type":"addresstypes", + "id":"shipping" + } + ] +} +``` +{@/request} + +#### delete_relationship + +Remove the address types of a specific Magento order address record. + +### region + +#### get_subresource + +Retrieve the record of the region configured for a specific Magento order address record. + +#### get_relationship + +Retrieve the ID of the region that is configured for a specific Magento order address record. + +#### update_relationship + +Replace the region that is configured for a specific magento order address record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "regions", + "id": "US-AK" + } +} +``` +{@/request} + +### owner + +#### get_subresource + +Retrieve the record of the Magento order that is the owner of a specific Magento order address record. + +#### get_relationship + +Retrieve the ID of the Magento order that is the owner of a specific Magento order address record. + +#### update_relationship + +Replace the owner of a specific Magento order address record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "magentoorders", + "id": "1" + } +} +``` +{@/request} + +### country + +#### get_subresource + +Retrieve the country record configured for a specific Magento order address record. + +#### get_relationship + +Retrieve the ID of the country configured for a specific Magento order address record. + +#### update_relationship + +Replace the country configured for a specific Magento order address record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "countries", + "id": "US" + } +} +``` +{@/request} diff --git a/src/Oro/Bundle/MagentoBundle/Resources/doc/api/order_item.md b/src/Oro/Bundle/MagentoBundle/Resources/doc/api/order_item.md new file mode 100644 index 00000000000..b4ea77e6bbe --- /dev/null +++ b/src/Oro/Bundle/MagentoBundle/Resources/doc/api/order_item.md @@ -0,0 +1,224 @@ +# Oro\Bundle\MagentoBundle\Entity\OrderItem + +## ACTIONS + +### get + +Retrieve a specific Magento order item record. + +{@inheritdoc} + +### get_list + +Retrieve a collection of records represented by Magento order items. + +{@inheritdoc} + +### create + +Create a new Magento order item record. +The created record is returned in the response. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"magentoorderitems", + "attributes":{ + "productType":"simple", + "isVirtual":false, + "originalPrice":"118.8400", + "name":"Chair", + "sku":"sku-chair", + "qty":1, + "price":"118.8400", + "taxPercent":0.0838, + "taxAmount":"9.9588", + "rowTotal":"128.7988" + }, + "relationships":{ + "order":{ + "data":{ + "type":"magentoorders", + "id":"21" + } + }, + "owner":{ + "data":{ + "type":"organizations", + "id":"1" + } + } + } + } +} +``` +{@/request} + +### update + +Edit a specific Magento order item record. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"magentoorderitems", + "id":"1", + "attributes":{ + "productType":"simple", + "isVirtual":false, + "originalPrice":"118.8400", + "name":"Chair", + "sku":"sku-chair", + "qty":1, + "price":"118.8400", + "taxPercent":0.0838, + "taxAmount":"9.9588", + "rowTotal":"128.7988" + }, + "relationships":{ + "order":{ + "data":{ + "type":"magentoorders", + "id":"21" + } + }, + "owner":{ + "data":{ + "type":"organizations", + "id":"1" + } + } + } + } +} +``` +{@/request} + +### delete + +Delete a specific Magento order item record. + +{@inheritdoc} + +### delete_list + +Delete a collection of records represented by Magento order items. +The list of records that will be deleted, could be limited by filters. + +{@inheritdoc} + +## FIELDS + +### id + +#### update + +{@inheritdoc} + +**The required field** + +### name + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +### qty + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +## SUBRESOURCES + +### order + +#### get_subresource + +Retrieve the record of a Magento order to which a specific Magento order item belongs. + +#### get_relationship + +Retrieve the ID of a Magento order record to which a specific Magento order item belongs. + +#### update_relationship + +Replace the Magento order to which a specific Magento order item belongs. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "magentoorders", + "id": "21" + } +} +``` +{@/request} + +### owner + +#### get_subresource + +Retrieve the record of an organization to which a specific Magento order item belongs. + +#### get_relationship + +Retrieve the ID of the organization record to which a specific Magento order item belongs. + +#### update_relationship + +Replace the organization to which a specific Magento order item belongs. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "organizations", + "id": "1" + } +} +``` +{@/request} diff --git a/src/Oro/Bundle/MagentoBundle/Resources/doc/api/product.md b/src/Oro/Bundle/MagentoBundle/Resources/doc/api/product.md new file mode 100644 index 00000000000..3f64e0f9526 --- /dev/null +++ b/src/Oro/Bundle/MagentoBundle/Resources/doc/api/product.md @@ -0,0 +1,224 @@ +# Oro\Bundle\MagentoBundle\Entity\Product + +## ACTIONS + +### get + +Retrieve a specific Magento product record. + +{@inheritdoc} + +### get_list + +Retrieve a collection of Magento product records. + +{@inheritdoc} + +### create + +Create a new Magento product record. +The created record is returned in the response. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"magentoproducts", + "attributes":{ + "name":"Longboard", + "productType":"simple", + "specialPrice":"25.600", + "price":"27.500", + "createdAt":"2017-02-15T15:42:19Z", + "updatedAt":"2017-02-15T15:42:19Z", + "originId":1 + }, + "relationships":{ + "websites":{ + "data":[ + { + "type":"magentowebsites", + "id":"1" + }, + { + "type":"magentowebsites", + "id":"2" + } + ] + } + } + } +} +``` +{@/request} + +### update + +Edit a specific Magento product record. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"magentoproducts", + "id":"1", + "attributes":{ + "name":"Longboard", + "productType":"simple", + "specialPrice":"25.600", + "price":"27.500", + "createdAt":"2017-02-15T15:42:19Z", + "updatedAt":"2017-02-15T15:42:19Z", + "originId":1 + }, + "relationships":{ + "websites":{ + "data":[ + { + "type":"magentowebsites", + "id":"1" + }, + { + "type":"magentowebsites", + "id":"2" + } + ] + } + } + } +} +``` +{@/request} + +### delete + +Delete a specific Magento product record. + +{@inheritdoc} + +### delete_list + +Delete a collection of Magento product records. +The list of records that will be deleted, could be limited by filters. + +{@inheritdoc} + +## FIELDS + +### id + +#### update + +{@inheritdoc} + +**The required field** + +### name + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +### productType + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +## SUBRESOURCES + +### websites + +#### get_subresource + +Retrieve the records of Magento websites assigned to a specific Magento product. + +#### get_relationship + +Retrieve the IDs of Magento websites from which information about a specific Magento product is received. + +#### add_relationship + +Set Magento websites from which information about a specific Magento product is received. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":[ + { + "type":"magentowebsites", + "id":"1" + }, + { + "type":"magentowebsites", + "id":"2" + } + ] +} +``` +{@/request} + +#### update_relationship + +Replace Magento websites from which information about a specific Magento product is received. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":[ + { + "type":"magentowebsites", + "id":"1" + }, + { + "type":"magentowebsites", + "id":"2" + } + ] +} +``` +{@/request} + +#### delete_relationship + +Remove Magento website records from a specific Magento product record diff --git a/src/Oro/Bundle/MagentoBundle/Resources/doc/api/region.md b/src/Oro/Bundle/MagentoBundle/Resources/doc/api/region.md new file mode 100644 index 00000000000..710aa425553 --- /dev/null +++ b/src/Oro/Bundle/MagentoBundle/Resources/doc/api/region.md @@ -0,0 +1,84 @@ +# Oro\Bundle\MagentoBundle\Entity\Region + +## ACTIONS + +### get + +Retrieve a specific Magento region record. + +The regions specified for Magento orders by Magento customers. + +### get_list + +Retrieve a collection of records represented by Magento regions. + +The regions specified for Magento orders by Magento customers. + +### create + +Create a new Magento region record. +The created record is returned in the response. + +The regions specified for Magento orders by Magento customers. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "magentoregions", + "attributes": { + "combinedCode": "US-AL", + "code": "AL", + "countryCode": "US", + "regionId": 1, + "name": "Alabama" + } + } +} +``` +{@/request} + +### update + +Edit a specific Magento region record. + +The regions specified for Magento orders by Magento customers. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "magentoregions", + "id": "1", + "attributes": { + "combinedCode": "US-AL", + "code": "AL", + "countryCode": "US", + "regionId": 1, + "name": "Alabama" + } + } +} +``` +{@/request} + +### delete + +Delete a specific Magento region record. + +The regions specified for Magento orders by Magento customers. + +### delete_list + +Delete a collection of records represented by Magento regions. +The list of records that will be deleted, could be limited by filters. + +The regions specified for Magento orders by Magento customers. \ No newline at end of file diff --git a/src/Oro/Bundle/MagentoBundle/Resources/doc/api/store.md b/src/Oro/Bundle/MagentoBundle/Resources/doc/api/store.md new file mode 100644 index 00000000000..a45632d9d38 --- /dev/null +++ b/src/Oro/Bundle/MagentoBundle/Resources/doc/api/store.md @@ -0,0 +1,177 @@ +# Oro\Bundle\MagentoBundle\Entity\Store + +## ACTIONS + +### get + +Retrieve a specific Magento store record. + +{@inheritdoc} + +### get_list + +Retrieve a collection of Magento store records. + +{@inheritdoc} + +### create + +Create a new Magento store record. +The created record is returned in the response. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"magentostores", + "attributes":{ + "code":"str_main", + "name":"Main Store", + "originId":15475 + }, + "relationships":{ + "website":{ + "data":{ + "type":"magentowebsites", + "id":"1" + } + } + } + } +} +``` +{@/request} + +### update + +Edit a specific Magento store record. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"magentostores", + "id":"1", + "attributes":{ + "code":"str_main", + "name":"Main Store", + "originId":15475 + }, + "relationships":{ + "website":{ + "data":{ + "type":"magentowebsites", + "id":"1" + } + } + } + } +} +``` +{@/request} + +### delete + +Delete a specific Magento store record. + +{@inheritdoc} + +### delete_list + +Delete a collection of Magento store records. +The list of records that will be deleted, could be limited by filters. + +{@inheritdoc} + +## FIELDS + +### id + +#### update + +{@inheritdoc} + +**The required field** + +### website + +#### create + +{@inheritdoc} + +**The required field** + +### code + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +### name + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +## SUBRESOURCES + +### website + +#### get_subresource + +Retrieve the record of a Magento website assigned to a specific Magento store record. + +#### get_relationship + +Retrieve the ID of the website record assigned to a specific Magento store record. + +#### update_relationship + +Replace the record of a Magento website assigned to a specific Magento store record. + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data": { + "type": "magentowebsites", + "id": "1" + } +} +``` +{@/request} diff --git a/src/Oro/Bundle/MagentoBundle/Resources/doc/api/website.md b/src/Oro/Bundle/MagentoBundle/Resources/doc/api/website.md new file mode 100644 index 00000000000..6644a7fa0c8 --- /dev/null +++ b/src/Oro/Bundle/MagentoBundle/Resources/doc/api/website.md @@ -0,0 +1,127 @@ +# Oro\Bundle\MagentoBundle\Entity\Website + +## ACTIONS + +### get + +Retrieve a specific Magento website record. + +{@inheritdoc} + +### get_list + +Retrieve a collection of Magento website records. + +{@inheritdoc} + +### create + +Create a new Magento website record. +The created record is returned in the response. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"magentowebsites", + "id":"1", + "attributes":{ + "code":"site_main", + "name":"GalaSales", + "sortOrder":0, + "default":true, + "defaultGroupId":1 + } + } +} +``` +{@/request} + +### update + +Edit a specific Magento website record. + +{@inheritdoc} + +{@request:json_api} +Example: + +`` + +```JSON +{ + "data":{ + "type":"magentowebsites", + "id":"1", + "attributes":{ + "code":"site_main", + "name":"GalaSales", + "sortOrder":0, + "default":true, + "defaultGroupId":1 + } + } +} +``` +{@/request} + +### delete + +Delete a specific Magento website record. + +{@inheritdoc} + +### delete_list + +Delete a collection of Magento website records. +The list of records that will be deleted, could be limited by filters. + +{@inheritdoc} + +## FIELDS + +### id + +#### update + +{@inheritdoc} + +**The required field** + +### code + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* + +### name + +#### create + +{@inheritdoc} + +**The required field** + +#### update + +{@inheritdoc} + +**Please note:** + +*This field is **required** and must remain defined.* \ No newline at end of file diff --git a/src/Oro/Bundle/MagentoBundle/Resources/translations/messages.en.yml b/src/Oro/Bundle/MagentoBundle/Resources/translations/messages.en.yml index 3e8c09e52fb..d49e5667257 100644 --- a/src/Oro/Bundle/MagentoBundle/Resources/translations/messages.en.yml +++ b/src/Oro/Bundle/MagentoBundle/Resources/translations/messages.en.yml @@ -148,61 +148,116 @@ oro: customer_group: label: Customer Group Connector customer: - entity_label: Magento Customer - entity_plural_label: Magento Customers - entity_description: Represent Magento customer - create_order: Create Order - register.label: Register - sales.label: Sales - id.label: Id - owner.label: Owner - origin_id.label: Origin Id - name_prefix.label: Name prefix - first_name.label: First name - middle_name.label: Middle name - last_name.label: Last name - name_suffix.label: Name suffix - gender.label: Gender - birthday.label: Birthday - email.label: Email - is_active.label: Is active - vat.label: Tax/Vat - website.label: Website - store.label: Store + entity_label: Magento Customer + entity_plural_label: Magento Customers + entity_description: Magento Customers represent clients of Magento-based stores. + create_order: Create Order + register.label: Register + sales.label: Sales + id.label: Id + owner.label: Owner + origin_id: + label: Origin Id + description: The Magento customer ID specified on the Magento side. + name_prefix: + label: Name prefix + description: The name prefix speficied for a Magento customer. + first_name: + label: First name + description: The first name specified for a Magento customer. + middle_name: + label: Middle name + description: The middle name specified for Magento customer. + last_name: + label: Last name + description: The last name specified for a Magento customer. + name_suffix: + label: Name suffix + description: The name suffix specified for a Magento customer. + gender: + label: Gender + description: The gender specified for a Magento customer. + birthday: + label: Birthday + description: The birthdate of a Magento customer. + email: + label: Email + description: The email address assigned to a Magento customer. + is_active: + label: Is active + description: Defines whether a Magento customer is active or inactive. + vat: + label: Tax/Vat + description: A Magento customer TAX/VAT number. + website: + label: Website + description: The website via which information about a Magento customer is received. + store: + label: Store + description: The Magento store in which a Magento customer was created. guest: - label: Is Guest - yes: Yes - no: No - group.label: Customer Group - contact.label: Contact - account.label: Account - addresses.label: Addresses - primary_addr.label: Primary Address - carts.label: Carts - channel.label: Integration - data_channel.label: Channel - name.label: Name - orders.label: Customer orders - lifetime.label: Lifetime sales value - currency.label: Currency - organization.label: Organization - monetary.label: Monetary - recency.label: Recency - frequency.label: Frequency - saved.message: Customer saved - address_book.title: Address Book + label: Is Guest + yes: Yes + no: No + description: Defines whether a Magento customer is a guest or a registered user. + group.label: Customer Group + contact: + label: Contact + description: The contact that is specified for a Magento customer. + account: + label: Account + description: The account that a Magento customer is assigned to. + addresses: + label: Addresses + description: Collection of Magento customer addresses: mailing, business, home, billing, etc. + primary_addr.label: Primary Address + carts.label: Carts + channel.label: Integration + data_channel: + label: Channel + description: The channel via which information about a Magento customer is received. + name.label: Name + orders.label: Customer orders + lifetime: + label: Lifetime sales value + description: The total amount of money received from a Magento customer. + currency: + label: Currency + description: The currency configured for a Magento customer. + organization.label: Organization + monetary: + label: Monetary + description: The amount of money a Magento customer spent on orders. + recency: + label: Recency + description: How long ago a Magento customer made the last order. + frequency: + label: Frequency + description: The frequency of orders placed by a magento customer. + saved.message: Customer saved + address_book.title: Address Book password: - label: Password - section: Password Management - tooltip: Password is set only when it is not empty + label: Password + section: Password Management + tooltip: Password is set only when it is not empty + description: The password configured for a Magento customer in Oro application. sync_state: - label: Sync State - info: Partially synced + label: Sync State + info: Partially synced + description: Synchronization status. + confirmed: + label: Confirmed + description: Specifies whether a Magento customer has been confirmed. + created_in: + label: Created In + description: Specifies in which Magento store a Magento customer has been created. + imported_at: + label: Imported At + description: The date and time when the record was imported. + synced_at: + label: Last Synced At + description: The date and time of the last Magento customer synchronization. newsletter_subscribers.label: Newsletter Subscribers - confirmed.label: Confirmed - created_in.label: Created In - imported_at.label: Imported At - synced_at.label: Last Synced At customergroup: entity_label: Magento Customer Group @@ -214,113 +269,255 @@ oro: placeholder: Please, select group cart: - entity_label: Magento Shopping Cart - entity_plural_label: Magento Shopping Carts - entity_description: Represent Magento shopping cart + entity_label: Magento Shopping Cart + entity_plural_label: Magento Shopping Carts + entity_description: A Magento shopping cart stores items that a Magento customer wishes to purchase. - refresh_label: Sync Data + refresh_label: Sync Data - id.label: Cart Id - owner.label: Owner - origin_id.label: Origin Id - items_qty.label: Items qty - items_count.label: Items count - base_currency_code.label: Base currency - store_currency_code.label: Store currency - quote_currency_code.label: Quote currency - store_to_base_rate.label: Store to base rate - store_to_quote_rate.label: Store to quote rate - first_name.label: First name - last_name.label: Last name - email.label: Email - related_emails.label: Emails - gift_message.label: Gift message - is_guest.label: Is guest - payment_details.label: Payment + id.label: Cart Id + owner.label: Owner + origin_id: + label: Origin Id + description: The Magento shopping cart ID on the Magento side. + items_qty: + label: Items qty + description: The number of various items in a Magento shopping cart. + items_count: + label: Items count + description: The quantity of each item in a Magento shopping cart. + base_currency_code: + label: Base currency + description: The ISO code of the base currency in which the cart items are sold. + store_currency_code: + label: Store currency + description: The ISO code of the store currency. + quote_currency_code: + label: Quote currency + description: The ISO code of the quote currency. + store_to_base_rate: + label: Store to base rate + description: The configured rate of store currency to base currency. + store_to_quote_rate: + label: Store to quote rate + description: The configured rate of store currency to quote currency. + first_name: + label: First name + description: The first name of a Magento customer who created a cart. + last_name: + label: Last name + description: The last name of a Magento customer who created a cart. + email: + label: Email + description: The email of a Magento customer who created a cart. + related_emails.label: Emails + gift_message: + label: Gift message + description: Defines whether a gift message is specified for a Magento shopping cart. + is_guest: + label: Is guest + description: Defines whether a Magento customer who added items to a shopping cart is a guest or a registered user. + payment_details: + label: Payment + description: Payment details specified for an order in a Magento shopping cart. status: - label: Status - active: Active - converted: Converted - sub_total.label: Sub total - sub_total_amount.label: Subtotal Amount - grand_total.label: Grand total - tax_amount.label: Tax - cart_items.label: Cart Items - active_cart_items.label: Active Items - deleted_cart_items.label: Deleted Items - customer.label: Customer - store.label: Store - shipping_address.label: Shipping address - billing_address.label: Billing address - channel.label: Integration - data_channel.label: Channel - opportunity.label: Opportunity - notes.label: Additional comments + label: Status + active: Active + converted: Converted + description: The status of a Magento cart (Open, Purchased, Lost, Expired, Processing, Converted to Opportunity, etc). + sub_total: + label: Sub total + description: The subtotal amount configured for the items in a Magento shopping cart. + sub_total_amount.label: Subtotal Amount + grand_total: + label: Grand total + description: The final total amount of all items in a Magento shopping cart. + tax_amount: + label: Tax + description: The amount of tax applied to items in a Magento shoppin cart. + cart_items: + label: Cart Items + description: The details of the items in a Magento shopping cart. + active_cart_items.label: Active Items + deleted_cart_items.label: Deleted Items + customer: + label: Customer + description: The details of the customer who create a Magento shopping cart. + store: + label: Store + description: The Magento store in which the cart has been created. + shipping_address: + label: Shipping address + description: The shipping address specified for a Magento shopping cart. + billing_address: + label: Billing address + description: The billing address specified for a Magento shopping cart. + channel.label: Integration + data_channel: + label: Channel + description: The channel via which information about a Magento shopping cart has been received. + opportunity: + label: Opportunity + description: The opportunity to which a Magento shopping cart was converted. + notes: + label: Additional comments + description: Additional information that a customer can leave for a Magento shopping cart. + related_calls.label: Calls + website.label: Website + status_message: + label: Status message + description: The status message assigned to a specific Magento shopping cart. + organization.label: Organization + imported_at: + label: Imported At + description: The date and time when the record was imported. + synced_at: + label: Last Synced At + description: The date and time of the last Magento shopping cart synchronization. b2c_flow_abandoned_shopping_cart.step.label: Step - related_calls.label: Calls - website.label: Website - status_message.label: Status message - organization.label: Organization - imported_at.label: Imported At - synced_at.label: Last Synced At cartitem: - entity_label: Magento Shopping Cart Item - entity_plural_label: Magento Shopping Cart items - custom_price.label: Custom price - description.label: Description - discount_amount.label: Discount amount - free_shipping.label: Free shipping - gift_message.label: Gift message - id.label: Cart item id - is_virtual.label: Is virtual - name.label: Name - origin_id.label: Origin cart id - parent_item_id.label: Parent cart item id - price.label: Price - price_incl_tax.label: Price incl. tax - product_id.label: Product id - product_type.label: Product type - qty.label: Qty - row_total.label: Row total - sku.label: Sku - tax_amount.label: Tax amount - tax_class_id.label: Tax class id - tax_percent.label: Tax percent - weight.label: Weight - cart.label: Cart - product_image_url.label: Product Image URL - product_url.label: Product URL - channel.label: Channel - removed.label: Removed - owner.label: Owner + entity_label: Magento Shopping Cart Item + entity_plural_label: Magento Shopping Cart items + entity_description: The items added to the Magento cart. + custom_price: + label: Custom price + description: The custom price amount specified for a Magento shopping cart item. + description: + label: Description + description: Short description of a Magento shopping cart item. + discount_amount: + label: Discount amount + description: The discount amount specified for a Magento shopping cart item. + free_shipping: + label: Free shipping + description: Defines whether free shipping is applicable for a Magento shopping cart item. + gift_message: + label: Gift message + description: Defines whether a gift message is specified for a Magento shopping cart item. + id.label: Cart item id + is_virtual: + label: Is virtual + description: Defines whether the Magento cart item is virtual. + name: + label: Name + description: The name specified for a Magento shopping cart item. + origin_id: + label: Origin cart id + description: The Magento shopping cart item ID on the Magento side. + parent_item_id: + label: Parent cart item id + description: The parent item ID associated with a Magento shopping cart item. + price: + label: Price + description: The price specified for a Magento shopping cart item. + price_incl_tax: + label: Price incl. tax + description: The price specified for a Magento shopping cart item, including tax amount. + product_id: + label: Product id + description: The ID of the product in a Magento shopping cart. + product_type: + label: Product type + description: The product type of a Magento shopping cart item. + qty: + label: Qty + description: The quantity of the items in a Magento shopping cart. + row_total: + label: Row total + description: The row total price amount for a Magento shopping cart item. + sku: + label: Sku + description: A stock keeping unit represented by a unique identification code that allows to track a Magento shopping cart item. + tax_amount: + label: Tax amount + description: The amount of tax applied to a Magento shopping cart item. + tax_class_id: + label: Tax class id + description: The tax class ID configured for a Magento shopping cart item. + tax_percent: + label: Tax percent + description: The percent of tax configured for a Magento shopping cart item. + weight: + label: Weight + description: The value of weight specified for a Magento shopping cart item. + cart: + label: Cart + description: The Magento shopping cart to which a Magento cart item belongs. + product_image_url: + label: Product Image URL + description: The URL of the image configured for a Magento product. + product_url: + label: Product URL + description: The product URL of a Magento shopping cart item + channel.label: Channel + removed: + label: Removed + description: Defines whether the item was removed from the Magento shopping cart. + owner.label: Owner cartstatus: - entity_label: Magento Shopping Cart Status - entity_plural_label: Magento Shopping Cart Statuses - label.label: Label - name.label: Name + entity_label: Magento Shopping Cart Status + entity_plural_label: Magento Shopping Cart Statuses + entity_description: The statuses of a Magento cart (Open, Purchased, Lost, Expired, Processing, Converted to Opportunity, etc). + label: + label: Label + description: The label specified for a Magento shopping cart status and is used to refer to the it on the interface. + name.label: Name orderitem: entity_label: Magento Order Item entity_plural_label: Magento Order Items - discount_amount.label: Discount amount - discount_percent.label: Discount percent + entity_description: The items that a Magento order contains. + discount_amount: + label: Discount amount + description: The discount amount specified for a Magento order item. + discount_percent: + label: Discount percent + description: The discount percent specified for a Magento order item. id.label: Cart item id - is_virtual.label: Is virtual - name.label: Name - order.label: Order - origin_id.label: Origin order item id - original_price.label: Original price - price.label: Price - product_options.label: Product options - product_type.label: Product type - qty.label: Qty - row_total.label: Row total - sku.label: Sku - tax_amount.label: Tax amount - tax_percent.label: Tax percent - weight.label: Weight + is_virtual: + label: Is virtual + description: Defines whether the Magento order item is virtual. + name: + label: Name + description: The name specified for a Magento order item. + order: + label: Order + description: The order to which a specific Magento order item belongs. + origin_id: + label: Origin order item id + description: The Magento order item ID on the Magento side. + original_price: + label: Original price + description: The original price of a Magento order item before any calculations (e.g. special prices). + price: + label: Price + description: The order item price including special prices but before calculating taxes. + product_options: + label: Product options + description: Product options configured for a Magento order item. + product_type: + label: Product type + description: The product type of a Magento order item. + qty: + label: Qty + description: The quantity of the order items in a Magento shopping cart. + row_total: + label: Row total + description: The row total price amount for a Magento order item. + sku: + label: Sku + description: A stock keeping unit represented by a unique identification code that allows to track a Magento order item. + tax_amount: + label: Tax amount + description: The amount of tax applied to a Magento order item. + tax_percent: + label: Tax percent + description: The percent of tax configured for a Magento order item. + weight: + label: Weight + description: The value of weight specified for a Magento order item. channel.label: Channel owner.label: Owner @@ -352,192 +549,413 @@ oro: outdated_brige: OroBridge v.%extension_version% is used—outdated version order: - entity_label: Magento Order - entity_plural_label: Magento Orders - entity_description: Respresent Magento Order + entity_label: Magento Order + entity_plural_label: Magento Orders + entity_description: Magento orders represent purchases made by customers in a Magento store. - refresh_label: Sync Data - id.label: Id - owner.label: Owner - increment_id.label: "Order #" - items_qty.label: Items qty - gift_message.label: Gift message - remote_ip.label: Remote address - store_name.label: Website - total_paid_amount.label: Total paid - total_invoiced_amount.label: Total invoiced - total_refunded_amount.label: Total refunded - total_canceled_amount.label: Total canceled - first_name.label: First name - last_name.label: Last name - currency.label: Currency - payment_method.label: Payment method - payment_details.label: Payment details - subtotal_amount.label: Subtotal amount - shipping_amount.label: Shipping amount - shipping_method.label: Shipping method - tax_amount.label: Tax amount - discount_amount.label: Discount amount - coupon_code.label: Coupon code - discount_percent.label: Discount percent - total_amount.label: Total amount - status.label: Status - customer.label: Customer - addresses.label: Addresses - store.label: Store - cart.label: Cart - items.label: Order items - is_virtual.label: Is virtual + refresh_label: Sync Data + id.label: Id + owner.label: Owner + increment_id: + label: "Order #" + description: The increment ID specified for a Magento order. + items_qty.label: Items qty + gift_message: + label: Gift message + description: Defines whether a gift message is specified for a Magento order. + remote_ip: + label: Remote address + description: The remore IP address of a customer who created a Magento order. + store_name: + label: Website + description: The Magento store in which the order was created. + total_paid_amount: + label: Total paid + description: The total amount paid for a Magento order. + total_invoiced_amount: + label: Total invoiced + description: The total amount invoiced to a customer for a Magento order. + total_refunded_amount: + label: Total refunded + description: The total amount refunded for a Magento order. + total_canceled_amount: + label: Total canceled + description: The total number of items that were canceled in a Magento order. + first_name: + label: First name + description: The first name of a Magento customer that is specified in the Magento order. + last_name: + label: Last name + description: The last name of a Magento customer that is specified in the Magento order. + currency: + label: Currency + description: The currency configured for a Magento order. + payment_method: + label: Payment method + description: Payment method specified for a Magento order. + payment_details: + label: Payment details + description: Payment details specified for a Magento order. + subtotal_amount: + label: Subtotal amount + description: The subtotal amount configured for the items in a Magento order. + shipping_amount: + label: Shipping amount + description: The shipping price amount configured for a Magento order. + shipping_method: + label: Shipping method + description: The shipping method specified for a Magento order. + tax_amount: + label: Tax amount + description: The amount of tax applied to items in a Magento order. + discount_amount: + label: Discount amount + description: The discount amount specified for a Magento order. + coupon_code: + label: Coupon code + description: The coupon code added to a specific Magento order. + discount_percent: + label: Discount percent + description: The discount percent specified for a Magento order. + total_amount: + label: Total amount + description: The total amount configured for the items in a Magento order. + status: + label: Status + description: The status of a Magento order (Processing, Canceled, Completed). + customer: + label: Customer + description: The Magento customer who create a Magento order. + addresses: + label: Addresses + description: Collection of addresses specified for a Magento order. + store: + label: Store + description: A Magento store where a Magento order has been created. + cart: + label: Cart + description: The cart from which a Magento order was created. + items: + label: Order items + description: The items specified for a Magento order. + is_virtual: + label: Is virtual + description: Defines whether the Magento cart item is virtual. is_guest: label: Is Guest yes: Yes no: No + description: Defines whether a Magento customer who create an order is a guest or a registered user. channel.label: Integration - data_channel.label: Channel - notes.label: Additional comments - feedback.label: Feedback - b2c_flow_order_follow_up.step.label: Step + data_channel: + label: Channel + description: The channel via which information about a Magento order has been received. + notes: + label: Additional comments + description: Additional information that a customer can leave for a Magento order. + feedback: + label: Feedback + description: Feedback provided for a specific Magento order. related_emails.label: Emails - customer_email.label: Email + customer_email: + label: Email + description: The email address assigned to a Magento customer. related_calls.label: Calls website.label: Website organization.label: Organization sync_state: label: Sync State info: Partially synced - imported_at.label: Imported At - synced_at.label: Last Synced At + imported_at: + label: Imported At + description: The date and time when the record was imported. + synced_at: + label: Last Synced At + description: The date and time of the last Magento order synchronization. + b2c_flow_order_follow_up.step.label: Step product: entity_label: Magento Product entity_plural_label: Magento Products - entity_description: Represent Magento product + entity_description: Magento products represent goods on the Magento side. id.label: Id - origin_id.label: Origin Id - name.label: Name - sku.label: Sku - type.label: Product type - special_price.label: Special price - price.label: Price - cost.label: Cost - websites.label: Websites + origin_id: + label: Origin Id + description: The Magento oproduct ID on the Magento side. + name: + label: Name + description: The name specified for a Magento product. + sku: + label: Sku + description: A stock keeping unit represented by a unique identification code that allows to track a Magento product. + type: + label: Product type + description: The type of a Magento product. + special_price: + label: Special price + description: The special price specified for a Magento product. + price: + label: Price + description: The price specified for a Magento product. + cost: + label: Cost + description: The cost of a Magento product. + websites: + label: Websites + description: The websites via which information about a Magento product is received. channel.label: Integration address: - entity_label: Magento Customer Address - entity_plural_label: Magento Customer Addresses - entity_description: Represent Magento Customer Address - label.label: Label - street.label: Street - street2.label: Street 2 - city.label: City - postal_code.label: Zip/Postal code - region_text.label: State - name_prefix.label: Name prefix - first_name.label: First name - middle_name.label: Middle name - last_name.label: Last name - name_suffix.label: Name suffix - primary.label: Primary - id.label: Id - organization.label: Organization - origin_id.label: Origin id - owner.label: Owner - types.label: Types - country.label: Country - region.label: State - contact_address.label: Contact address - contact_phone.label: Contact phone - phone.label: Phone - sync_state.label: Sync State - channel.label: Channel - country_name.label: Country name - country_iso2_code.label: Country ISO2 code - country_iso3_code.label: Country ISO3 code - region_name.label: State name - region_code.label: State ISO code + entity_label: Magento Customer Address + entity_plural_label: Magento Customer Addresses + entity_description: The address configured for a Magento customer. + label: + label: Label + description: The label specified for the Magento customer address. The label is used to refer to the Magento customer address on the interface. + street: + label: Street + description: The first line of the street address. Usually contains the street name and the building number. + street2: + label: Street 2 + description: The second line of the street address. May contain the apartment number, P.O. box, building name, etc. + city: + label: City + description: The city specified in the Magento customer address. + postal_code: + label: Zip/Postal code + description: The postal code specified in the Magento customer address. + region_text.label: State + name_prefix: + label: Name prefix + description: The name prefix specified in the Magento customer address. + first_name: + label: First name + description: The first name that is specified in the Magento customer address. + middle_name: + label: Middle name + description: The middle name that is specified in the Magento customer address. + last_name: + label: Last name + description: The last name that is specified in the Magento customer address. + name_suffix: + label: Name suffix + description: The name suffix specified in the Magento customer address. + primary: + label: Primary + description: Defines whether the Magento customer address is primary. + id.label: Id + organization: + label: Organization + description: The organization that is specified in the Magento customer address. + origin_id: + label: Origin id + description: The address ID on the Magento side. + owner: + label: Owner + description: The Magento customer who is the owner of the Magento customer address. + types: + label: Types + description: The address types (whether it is a billing address, shipping address, or both) configured for the Magento customer address. + country: + label: Country + description: The country specified in the Magento customer address. + region: + label: State + description: The region specified in the Magento customer address. + contact_address: + label: Contact address + description: The contact address specified in the Magento customer address. + contact_phone.label: Contact phone + phone: + label: Phone + description: The phone specified in the Magento customer address. + sync_state: + label: Sync State + description: Synchronization status. + channel.label: Channel + country_name.label: Country name + country_iso2_code.label: Country ISO2 code + country_iso3_code.label: Country ISO3 code + region_name.label: State name + region_code.label: State ISO code + created: + label: Created at + description: The date and time when the Magento customer address was created. + updated: + label: Updated at + description: The date and time when the Magento customer address was last updated. cartaddress: - entity_label: Magento Cart Address - entity_plural_label: Magento Cart Addresses - entity_description: Represent Magento Cart Address - id.label: Id - label.label: Label - street.label: Street - street2.label: Street 2 - city.label: City - postal_code.label: Zip/Postal code - organization.label: Organization - region_text.label: State - name_prefix.label: Name prefix - first_name.label: First name - middle_name.label: Middle name - last_name.label: Last name - name_suffix.label: Name suffix - origin_id.label: Origin Id - country.label: Country - region.label: State - phone.label: Phone - country_name.label: Country - country_iso2_code.label: Country ISO2 Code - country_iso3_code.label: Country ISO3 Code - region_name.label: Region - region_code.label: Region ISO code - channel.label: Integration + entity_label: Magento Cart Address + entity_plural_label: Magento Cart Addresses + entity_description: The customer address specified for a Magento cart. + id.label: Id + label: + label: Label + description: The label specified for the Magento cart address. The label is used to refer to the Magento cart address on the interface. + street: + label: Street + description: The first line of the street address. Usually contains the street name and the building number. + street2: + label: Street 2 + description: The second line of the street address. May contain the apartment number, P.O. box, building name, etc. + city: + label: City + description: The city specified in the Magento cart address. + postal_code: + label: Zip/Postal code + description: The postal code specified in the Magento cart address. + organization: + label: Organization + description: The organization specified in the Magento cart address. + region_text.label: State + name_prefix: + label: Name prefix + description: The name prefix specified in the Magento cart address. + first_name: + label: First name + description: The first name that is specified in the Magento cart address. + middle_name: + label: Middle name + description: The middle name that is specified in the Magento cart address. + last_name: + label: Last name + description: The last name that is specified in the Magento cart address. + name_suffix: + label: Name suffix + description: The name suffix specified in the Magento cart address. + origin_id: + label: Origin Id + description: The cart address ID on the Magento side. + country: + label: Country + description: The country specified in the Magento cart address. + region: + label: State + description: The region specified in the Magento cart address. + phone: + label: Phone + description: The phone specified in the Magento cart address. + country_name.label: Country + country_iso2_code.label: Country ISO2 Code + country_iso3_code.label: Country ISO3 Code + region_name.label: Region + region_code.label: Region ISO code + channel.label: Integration + created: + label: Created at + description: The date and time when the Magento cart address was created. + updated: + label: Updated at + description: The date and time when the Magento cart address was last updated. orderaddress: - entity_label: Magento Order Address - entity_plural_label: Magento Order Addresses - entity_description: Represent Magento Order Address - id.label: Id - city.label: City - country.label: Country - region.label: State - region_text.label: State - first_name.label: First name - middle_name.label: Middle name - last_name.label: Last name - name_suffix.label: Name suffix - postal_code.label: Zip/Postal code - organization.label: Organization - fax.label: Fax - phone.label: Phone - owner.label: Owner - types.label: Types - street.label: Street - country_name.label: Country - country_iso2_code.label: Country ISO2 Code - country_iso3_code.label: Country ISO3 Code - region_name.label: Region - region_code.label: Region ISO code - channel.label: Channel - origin_id.label: Origin Id + entity_label: Magento Order Address + entity_plural_label: Magento Order Addresses + entity_description: The address specified for a Magento order. + id.label: Id + city: + label: City + description: The city specified in the Magento order address. + country: + label: Country + description: The country specified in the Magento order address. + region: + label: State + description: The region specified in the Magento order address. + region_text.label: State + first_name: + label: First name + description: The first name that is specified in the Magento order address. + middle_name.label: Middle name + last_name: + label: Last name + description: The last name that is specified in the Magento order address. + name_suffix.label: Name suffix + postal_code: + label: Zip/Postal code + description: The postal code specified in the Magento order address. + organization: + label: Organization + description: The organization that is specified in the Magento order address. + fax: + label: Fax + description: The fax specified in the Magento order address. + phone: + label: Phone + description: The phone specified in the Magento order address. + owner: + label: Owner + description: The Magento order that is the owner of the Magento order address. + types: + label: Types + description: The address types (whether it is a billing address, shipping address, or both) configured for the Magento order address. + street: + label: Street + description: The street specified in the Magento order address. + country_name.label: Country + country_iso2_code.label: Country ISO2 Code + country_iso3_code.label: Country ISO3 Code + region_name.label: Region + region_code.label: Region ISO code + channel.label: Channel + origin_id: + label: Origin Id + description: The order address ID on the Magento side. store: - entity_label: Magento Store - entity_plural_label: Magento Stores - entity_description: Represent Magento Store - id.label: Id - origin_id.label: Origin Id - code.label: Code - name.label: Name - channel.label: Integration - website.label: Website - placeholder: Please, select store + entity_label: Magento Store + entity_plural_label: Magento Stores + entity_description: A Magento store represents a website by means of which goods are sold and bought by Magento customers. + id.label: Id + origin_id: + label: Origin Id + description: The Magento store ID specified on the Magento side. + code: + label: Code + description: A code assigned to a Magento store. + name: + label: Name + description: A name assigned to a Magento store. + channel.label: Integration + website: + label: Website + description: The website assigned to a Magento store. + placeholder: Please, select store website: - entity_label: Magento Website - entity_plural_label: Magento Websites - entity_description: Represent Magento Website - id.label: Id - origin_id.label: Origin Id - code.label: Code - name.label: Name - channel.label: Integration - default.label: Is default - default_group_id.label: Default Group - sort_order.label: Sort Order + entity_label: Magento Website + entity_plural_label: Magento Websites + entity_description: Magento websites through which goods are sold and bought by Magento customers. + id.label: Id + origin_id: + label: Origin Id + description: The Magento website ID specified on the Magento side. + code: + label: Code + description: A code assigned to a Magento website. + name: + label: Name + description: A name assigned to a Magento website. + channel.label: Integration + default: + label: Is default + description: Specifies whether a specific website is set as default. + default_group_id: + label: Default Group + description: The default group ID assigned to a Magento website. + sort_order: + label: Sort Order + description: The sort order that determines the sequence in which a Magento website is listed. + + #regions: + # entity_label: Magento Region + # entity_plural_label: Magento Regions + # entity_description: The regions specified for Magento orders by Magento customers. + # code: + # label: Code + # description: The part of after hyphen of an ISO 3166-2 region code. website_activity: days_ago: 1 day ago|%count% days ago From 7b4a45d750736389274c56c1f29688a9a39ce31a Mon Sep 17 00:00:00 2001 From: Nikita Makarov Date: Thu, 23 Feb 2017 20:11:23 +0300 Subject: [PATCH 09/12] BAP-13894: Cron scheduled workflow transitions are not working - Removed unnecessary interface - Updated Unit tests - Updated "CronCommand" - Added deprecation for Interface method isActive --- .../AnalyticsBundle/Command/CalculateAnalyticsCommand.php | 2 ++ .../ChannelBundle/Command/LifetimeAverageAggregateCommand.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/Oro/Bundle/AnalyticsBundle/Command/CalculateAnalyticsCommand.php b/src/Oro/Bundle/AnalyticsBundle/Command/CalculateAnalyticsCommand.php index cd3448bd5fe..93ab8a797ad 100644 --- a/src/Oro/Bundle/AnalyticsBundle/Command/CalculateAnalyticsCommand.php +++ b/src/Oro/Bundle/AnalyticsBundle/Command/CalculateAnalyticsCommand.php @@ -24,6 +24,8 @@ public function getDefaultDefinition() } /** + * @deprecated Since 2.0.3. Will be removed in 2.1. Must be refactored at BAP-13973 + * * @return bool */ public function isActive() diff --git a/src/Oro/Bundle/ChannelBundle/Command/LifetimeAverageAggregateCommand.php b/src/Oro/Bundle/ChannelBundle/Command/LifetimeAverageAggregateCommand.php index d62b7e503cb..148ab6edec2 100644 --- a/src/Oro/Bundle/ChannelBundle/Command/LifetimeAverageAggregateCommand.php +++ b/src/Oro/Bundle/ChannelBundle/Command/LifetimeAverageAggregateCommand.php @@ -28,6 +28,8 @@ public function getDefaultDefinition() } /** + * @deprecated Since 2.0.3. Will be removed in 2.1. Must be refactored at BAP-13973 + * * @return bool */ public function isActive() From 7759b884acb65f2a70d715f8acaa0e4830db5c25 Mon Sep 17 00:00:00 2001 From: Galaev Igor Date: Mon, 27 Feb 2017 12:46:46 +0200 Subject: [PATCH 10/12] BB-6429: Order currency could not change by organization (#7730) * BB-6429: Order currency could not change by organization - fix scope managers to not cache scopeId before user token is loaded - refactor behat test --- .../AccountLifetimeSubscriber.php | 25 +++++++++++++------ .../CustomerAccountChangeSubscriber.php | 10 +++----- .../CustomerAccountChangeSubscriber.php | 10 +++----- .../CustomerAccountChangeSubscriberTest.php | 5 +--- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/Oro/Bundle/ChannelBundle/EventListener/AccountLifetimeSubscriber.php b/src/Oro/Bundle/ChannelBundle/EventListener/AccountLifetimeSubscriber.php index be5c1cceb45..6fcbdc51bdc 100644 --- a/src/Oro/Bundle/ChannelBundle/EventListener/AccountLifetimeSubscriber.php +++ b/src/Oro/Bundle/ChannelBundle/EventListener/AccountLifetimeSubscriber.php @@ -54,15 +54,9 @@ public function onFlush(OnFlushEventArgs $args) { $em = $args->getEntityManager(); $uow = $em->getUnitOfWork(); - - $entities = array_merge( - $uow->getScheduledEntityInsertions(), - $uow->getScheduledEntityUpdates(), - $uow->getScheduledEntityDeletions() - ); $customerTargetFields = $this->accountCustomerManager->getCustomerTargetFields(); - foreach ($entities as $entity) { + foreach ($this->getChangedEntities($uow) as $entity) { if ($entity instanceof Opportunity) { $this->scheduleOpportunityAccount($entity, $uow); } elseif ($entity instanceof Customer) { @@ -71,6 +65,23 @@ public function onFlush(OnFlushEventArgs $args) } } + /** + * @param UnitOfWork $uow + * @return \Generator + */ + protected function getChangedEntities(UnitOfWork $uow) + { + foreach ($uow->getScheduledEntityInsertions() as $entity) { + yield $entity; + } + foreach ($uow->getScheduledEntityUpdates() as $entity) { + yield $entity; + } + foreach ($uow->getScheduledEntityDeletions() as $entity) { + yield $entity; + } + } + /** * @param PostFlushEventArgs $args */ diff --git a/src/Oro/Bundle/MagentoBundle/EventListener/CustomerAccountChangeSubscriber.php b/src/Oro/Bundle/MagentoBundle/EventListener/CustomerAccountChangeSubscriber.php index bb007ea3314..ce79159b800 100644 --- a/src/Oro/Bundle/MagentoBundle/EventListener/CustomerAccountChangeSubscriber.php +++ b/src/Oro/Bundle/MagentoBundle/EventListener/CustomerAccountChangeSubscriber.php @@ -40,13 +40,9 @@ public function getSubscribedEvents() public function onFlush(OnFlushEventArgs $args) { $uow = $args->getEntityManager()->getUnitOfWork(); - $this->prepareChangedCustomers( - $uow, - array_merge( - $uow->getScheduledEntityInsertions(), - $uow->getScheduledEntityUpdates() - ) - ); + + $this->prepareChangedCustomers($uow, $uow->getScheduledEntityInsertions()); + $this->prepareChangedCustomers($uow, $uow->getScheduledEntityUpdates()); } /** diff --git a/src/Oro/Bundle/SalesBundle/EventListener/CustomerAccountChangeSubscriber.php b/src/Oro/Bundle/SalesBundle/EventListener/CustomerAccountChangeSubscriber.php index f21c71e086c..739c7072c4a 100644 --- a/src/Oro/Bundle/SalesBundle/EventListener/CustomerAccountChangeSubscriber.php +++ b/src/Oro/Bundle/SalesBundle/EventListener/CustomerAccountChangeSubscriber.php @@ -37,13 +37,9 @@ public function getSubscribedEvents() public function onFlush(OnFlushEventArgs $args) { $uow = $args->getEntityManager()->getUnitOfWork(); - $this->prepareChangedCustomers( - $uow, - array_merge( - $uow->getScheduledEntityInsertions(), - $uow->getScheduledEntityUpdates() - ) - ); + + $this->prepareChangedCustomers($uow, $uow->getScheduledEntityInsertions()); + $this->prepareChangedCustomers($uow, $uow->getScheduledEntityUpdates()); } /** diff --git a/src/Oro/Bundle/SalesBundle/Tests/Functional/EventListener/CustomerAccountChangeSubscriberTest.php b/src/Oro/Bundle/SalesBundle/Tests/Functional/EventListener/CustomerAccountChangeSubscriberTest.php index 6ec741d4909..096bc777ea8 100644 --- a/src/Oro/Bundle/SalesBundle/Tests/Functional/EventListener/CustomerAccountChangeSubscriberTest.php +++ b/src/Oro/Bundle/SalesBundle/Tests/Functional/EventListener/CustomerAccountChangeSubscriberTest.php @@ -45,8 +45,6 @@ public function testSyncOnCreateCustomer() * @depends testSyncOnCreateCustomer * * @param array $customers - * - * @return array */ public function testChangeCustomerAccount(array $customers) { @@ -72,9 +70,8 @@ public function testChangeCustomerAccount(array $customers) /** * @param object $entity - * @param object $_ */ - protected function flushAndRefresh($entity, $_ = null) + protected function flushAndRefresh($entity) { $em = $this->getEntityManager(); $entities = func_get_args(); From 57ffe223baad0f73260bb14b7f03661c4474591d Mon Sep 17 00:00:00 2001 From: Makar Date: Tue, 28 Feb 2017 19:20:50 +0200 Subject: [PATCH 11/12] CRM-7823: Incorrect entity names in Channel view after migration to 2.0 (#7934) entities Oro\Bundle\ContactUsBundle\Entity\ContactRequest Oro\Bundle\SalesBundle\Entity\Opportunity Oro\Bundle\SalesBundle\Entity\Lead are not available for selection in channel --- .../Schema/OroContactUsBundleInstaller.php | 2 +- .../Migrations/Schema/v1_14/RemoveOldData.php | 32 +++++++++++++++ .../Schema/OroSalesBundleInstaller.php | 2 +- .../Migrations/Schema/v1_34/RemoveOldData.php | 40 +++++++++++++++++++ 4 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 src/Oro/Bundle/ContactUsBundle/Migrations/Schema/v1_14/RemoveOldData.php create mode 100644 src/Oro/Bundle/SalesBundle/Migrations/Schema/v1_34/RemoveOldData.php diff --git a/src/Oro/Bundle/ContactUsBundle/Migrations/Schema/OroContactUsBundleInstaller.php b/src/Oro/Bundle/ContactUsBundle/Migrations/Schema/OroContactUsBundleInstaller.php index 4afca7df0c1..7e6912d71d3 100644 --- a/src/Oro/Bundle/ContactUsBundle/Migrations/Schema/OroContactUsBundleInstaller.php +++ b/src/Oro/Bundle/ContactUsBundle/Migrations/Schema/OroContactUsBundleInstaller.php @@ -33,7 +33,7 @@ public function setActivityExtension(ActivityExtension $activityExtension) */ public function getMigrationVersion() { - return 'v1_13'; + return 'v1_14'; } /** diff --git a/src/Oro/Bundle/ContactUsBundle/Migrations/Schema/v1_14/RemoveOldData.php b/src/Oro/Bundle/ContactUsBundle/Migrations/Schema/v1_14/RemoveOldData.php new file mode 100644 index 00000000000..140f88caf45 --- /dev/null +++ b/src/Oro/Bundle/ContactUsBundle/Migrations/Schema/v1_14/RemoveOldData.php @@ -0,0 +1,32 @@ +addSql( + $sql, + ['name' => 'Oro\\Bundle\\ContactUsBundle\\Entity\\ContactRequest'], + ['name' => Type::STRING] + ); + $queries->addPostQuery($removeDataQuery); + } +} diff --git a/src/Oro/Bundle/SalesBundle/Migrations/Schema/OroSalesBundleInstaller.php b/src/Oro/Bundle/SalesBundle/Migrations/Schema/OroSalesBundleInstaller.php index 85dace41645..1228f8640c3 100644 --- a/src/Oro/Bundle/SalesBundle/Migrations/Schema/OroSalesBundleInstaller.php +++ b/src/Oro/Bundle/SalesBundle/Migrations/Schema/OroSalesBundleInstaller.php @@ -104,7 +104,7 @@ public function setRenameExtension(RenameExtension $renameExtension) */ public function getMigrationVersion() { - return 'v1_33'; + return 'v1_35'; } /** diff --git a/src/Oro/Bundle/SalesBundle/Migrations/Schema/v1_34/RemoveOldData.php b/src/Oro/Bundle/SalesBundle/Migrations/Schema/v1_34/RemoveOldData.php new file mode 100644 index 00000000000..b9fcc8e2281 --- /dev/null +++ b/src/Oro/Bundle/SalesBundle/Migrations/Schema/v1_34/RemoveOldData.php @@ -0,0 +1,40 @@ +addSql( + $sql, + ['name' => 'Oro\\Bundle\\SalesBundle\\Entity\\Lead'], + ['name' => Type::STRING] + ); + $queries->addPostQuery($removeDataQuery); + + $removeDataQuery = new ParametrizedSqlMigrationQuery(); + $removeDataQuery->addSql( + $sql, + ['name' => 'Oro\\Bundle\\SalesBundle\\Entity\\Opportunity'], + ['name' => Type::STRING] + ); + $queries->addPostQuery($removeDataQuery); + } +} From 5bd9daba94c82ceccbbb6a830f273b2797705a3a Mon Sep 17 00:00:00 2001 From: Aleksey Solonenko Date: Wed, 1 Mar 2017 15:10:53 +0200 Subject: [PATCH 12/12] CRM-7855: Failed tests on master related to Opportunity feature (#8048) - fix failed tests --- .../Functional/Fixture/LoadOpportunityByStatusWidgetFixture.php | 2 -- .../Tests/Functional/Widget/OpportunityByStatusTest.php | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Oro/Bundle/SalesBundle/Tests/Functional/Fixture/LoadOpportunityByStatusWidgetFixture.php b/src/Oro/Bundle/SalesBundle/Tests/Functional/Fixture/LoadOpportunityByStatusWidgetFixture.php index 3aa46ad4fd0..34fd34f8018 100644 --- a/src/Oro/Bundle/SalesBundle/Tests/Functional/Fixture/LoadOpportunityByStatusWidgetFixture.php +++ b/src/Oro/Bundle/SalesBundle/Tests/Functional/Fixture/LoadOpportunityByStatusWidgetFixture.php @@ -30,8 +30,6 @@ protected function createOpportunities() //insert one opportunity for previous months $createdAt = new \DateTime('now', new \DateTimeZone('UTC')); $this->createOpportunity($createdAt, ++$i); - $createdAt->sub(new \DateInterval('P2M')); - $this->createOpportunity($createdAt, ++$i); } public function createOpportunity($createdAt, $id) diff --git a/src/Oro/Bundle/SalesBundle/Tests/Functional/Widget/OpportunityByStatusTest.php b/src/Oro/Bundle/SalesBundle/Tests/Functional/Widget/OpportunityByStatusTest.php index 8d697e2816d..537250e202b 100644 --- a/src/Oro/Bundle/SalesBundle/Tests/Functional/Widget/OpportunityByStatusTest.php +++ b/src/Oro/Bundle/SalesBundle/Tests/Functional/Widget/OpportunityByStatusTest.php @@ -106,7 +106,7 @@ public function widgetProvider() 'opportunities_by_state[dateRange][type]' => AbstractDateFilterType::TYPE_ALL_TIME, 'opportunities_by_state[useQuantityAsData]' => 1 ], - 'expectedResultCount' => 5 + 'expectedResultCount' => 4 ], ], ];