Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Integrations Bundle - add support to pass custom options to OrderDAO #9796

Conversation

kuzmany
Copy link
Member

@kuzmany kuzmany commented Mar 17, 2021

Q A
Branch? "features" for all features, enhancements and bug fixes (until 3.3.0 is released)
Bug fix? yes/no
New feature? yes/no
Deprecations? yes/no
BC breaks? yes/no
Automated tests included? yes/no
Related user documentation PR URL mautic/mautic-documentation#...
Related developer documentation PR URL mautic/developer-documentation#195
Issue(s) addressed Fixes #...

Description:

In some cases we need pass custom values to synchronization.
This PR introduce options

Usage by code::

$mauticObjectIds = new ObjectIdsDAO();
$mauticObjectIds->addObjectId('lead', "11");

$options = [
    'integration'      => InesIntegration::NAME,
    'disable-pull'     => true,
    'mautic-object-id' => $mauticObjectIds,
    'options' = [ 'channelId' =>  1, 'typeId' =>  1]
];
$this->syncService->processIntegrationSync($inputOptions);

Usage by command

mautic:integrations:sync IntegrationName --disable-pull --option="chanelId:1" --option="typeId:1"

Steps to test this PR:

  1. Load up this PR
  2. You need integration based on integrations framework
  3. You should able to check getOptions from OrderDAO

Or provide the code review

@kuzmany kuzmany added WIP PR's that are not ready for review and are currently in progress enhancement Any improvement to an existing feature or functionality labels Mar 17, 2021
@kuzmany kuzmany added this to the Mautic 4.0 milestone Mar 17, 2021
@cla-bot cla-bot bot added the cla-signed The PR contributors have signed the contributors agreement label Mar 17, 2021
@codecov
Copy link

codecov bot commented Mar 17, 2021

Codecov Report

Merging #9796 (d508ae1) into features (c3e2676) will increase coverage by 0.01%.
The diff coverage is 91.66%.

Impacted file tree graph

@@              Coverage Diff               @@
##             features    #9796      +/-   ##
==============================================
+ Coverage       39.64%   39.65%   +0.01%     
- Complexity      33978    33985       +7     
==============================================
  Files            1989     1989              
  Lines          105730   105751      +21     
==============================================
+ Hits            41913    41932      +19     
- Misses          63817    63819       +2     
Impacted Files Coverage Δ Complexity Δ
...ntegrationsBundle/Sync/DAO/Sync/Order/OrderDAO.php 30.33% <50.00%> (+0.10%) 35.00 <2.00> (+1.00)
...bundles/IntegrationsBundle/Command/SyncCommand.php 98.50% <100.00%> (+0.12%) 9.00 <0.00> (ø)
...tegrationsBundle/Sync/DAO/Sync/InputOptionsDAO.php 95.52% <100.00%> (+1.07%) 29.00 <6.00> (+6.00)
...s/Direction/Integration/IntegrationSyncProcess.php 79.45% <100.00%> (ø) 14.00 <0.00> (ø)
...ncProcess/Direction/Internal/MauticSyncProcess.php 79.71% <100.00%> (ø) 13.00 <0.00> (ø)

@kuzmany kuzmany added ready-to-test PR's that are ready to test and removed WIP PR's that are not ready for review and are currently in progress labels Mar 19, 2021
@dennisameling dennisameling added the T3 Hard difficulty to fix (issue) or test (PR) label Mar 26, 2021
@dennisameling dennisameling self-requested a review March 26, 2021 13:21
dennisameling
dennisameling previously approved these changes Mar 26, 2021
Copy link
Member

@dennisameling dennisameling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested as follows:

  • Clone HelloWorldBundle since it implements the mautic.sync_integration (there's no built-in plugin that does it) - ran into a bug with Mautic 4 there, so fixed it while at it 😂 Fix mock handler on Mautic 4 plugin-helloworld#5
  • Ran bin/console mautic:integrations:sync helloworld --disable-pull --option="chanelId:1" --option="typeId:1", the option array is coming up correctly:

image

  • Tested the same command without --option, also works without errors.

Thanks! We do need some developer docs for this I think. Will create a separate issue for that.

@dennisameling dennisameling added needs-documentation PR's that need documentation before they can be merged ready-to-commit PR's with 2 successful tests, 1 approval, automated tests and docs and is ready to be merged and removed ready-to-test PR's that are ready to test labels Mar 26, 2021
@dennisameling dennisameling removed the needs-documentation PR's that need documentation before they can be merged label Mar 26, 2021
@RCheesley RCheesley merged commit 9150293 into mautic:features Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The PR contributors have signed the contributors agreement enhancement Any improvement to an existing feature or functionality ready-to-commit PR's with 2 successful tests, 1 approval, automated tests and docs and is ready to be merged T3 Hard difficulty to fix (issue) or test (PR)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants