PHPackages                             idci/sam-client-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. idci/sam-client-bundle

ActiveSymfony-bundle

idci/sam-client-bundle
======================

Symfony bundle that provides an api client for SAM app (SAVInsight)

v1.1.8(7mo ago)0154CECILL-CPHPPHP ^8.1

Since Jan 30Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/IDCI-Consulting/SAMClientBundle)[ Packagist](https://packagist.org/packages/idci/sam-client-bundle)[ RSS](/packages/idci-sam-client-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (15)Used By (0)

IDCI SAM Client Bundle
======================

[](#idci-sam-client-bundle)

Symfony bundle that provides an api client for SAM app (SAVInsight)

Installation
------------

[](#installation)

Install this bundle using composer :

```
composer require idci/sam-client-bundle
```

Configuration
-------------

[](#configuration)

### Create an Eightpoint Guzzle HTTP client

[](#create-an-eightpoint-guzzle-http-client)

In the file `config/packages/eight_points_guzzle.yaml`, create a **SAM API** client :

```
eight_points_guzzle:
    clients:
        sam_api:
            base_url: 'https://sam-staging.savinsight.com/api/' # PROD = 'https://sam.savinsight.com/api/'
```

### Configure a cache pool

[](#configure-a-cache-pool)

Create a dedicated **SAM** cache, or use any of your existing pools :

In the file `config/services.yaml`, register your cache pool :

```
# Redis example
app.cache.adapter.redis.sam:
    parent: 'cache.adapter.redis'
    tags:
        - { name: 'cache.pool', namespace: 'SAM' }
```

In the file `config/packages/cache.yaml`, define your cache pool :

```
framework:
    cache:
        # ...
        pools:
            cache.sam:
                public: true
```

### Configure sam-client-bundle

[](#configure-sam-client-bundle)

In `config/packages/`, create a `idci_sam_client.yaml` file :

```
idci_sam_client:
    guzzle_http_client_service_alias: 'eight_points_guzzle.client.sam_api'
    cache_pool_service_alias: 'cache.sam'
    client_id: '%env(string:IDCI_SAM_CLIENT_ID)%'
    client_secret: '%env(string:IDCI_SAM_CLIENT_SECRET)%'
    mode: '%env(string:IDCI_SAM_MODE)%'
```

Required parameters:

- **guzzle\_http\_client\_service\_alias** : The guzzle HTTP client alias
- **client\_id** : The SAM client ID
- **client\_secret** : The SAM client secret
- **mode**: `live` or `staging`

Then, add these environment variable in your `.env` file :

```
###> idci/sam-client-bundle ###
IDCI_SAM_CLIENT_ID=Y2xpZW50X2lk...
IDCI_SAM_CLIENT_SECRET=Y2xpZW50X3NlY3JldA==...
IDCI_SAM_MODE=live
###< idci/sam-client-bundle ###

```

To retrieve more informations about SAM API, go to .

Usage
-----

[](#usage)

### Activity methods

[](#activity-methods)

#### Create activity

[](#create-activity)

```
use IDCI\Bundle\SAMClientBundle\Client\SAMApiClient;
...
$this->samApiClient->createActivity(20000, [
    'date' => new \DateTime,
    'employeeCode' => 'JeanDupont',
]);

$this->samApiClient->createActivityByInternalNumber('internalNumber', [
    'date' => new \DateTime,
    'employeeCode' => 'JeanDupont',
]);

$this->samApiClient->createActivityByExternalId('externalId', [
    'date' => new \DateTime,
    'employeeCode' => 'JeanDupont',
]);
```

option nametypedateDateTimeInterface, string, nullemployeeCodestring, null#### Update activity

[](#update-activity)

```
use IDCI\Bundle\SAMClientBundle\Client\SAMApiClient;
use IDCI\Bundle\SAMClientBundle\Client\Model\Enum\UpdateActivityInputState;
...
$this->samApiClient->updateActivity(20000, 'A020', [
    'status' => UpdateActivityInputState::Paused,
    'date' => new \DateTime,
    'employeeCode' => 'JeanDupont',
]);

$this->samApiClient->createActivityByInternalNumber('internalNumber', 'A020', [
    'status' => UpdateActivityInputState::Paused,
    'date' => new \DateTime,
    'employeeCode' => 'JeanDupont',
]);

$this->samApiClient->createActivityByExternalId('externalId', 'A020', [
    'status' => UpdateActivityInputState::Paused,
    'date' => new \DateTime,
    'employeeCode' => 'JeanDupont',
]);
```

option nametypestatusUpdateActivityInputStatedateDateTimeInterface, string, nullemployeeCodestring, null### Diagnostic methods

[](#diagnostic-methods)

#### Create diagnostic

[](#create-diagnostic)

```
use IDCI\Bundle\SAMClientBundle\Client\SAMApiClient;
use IDCI\Bundle\SAMClientBundle\Client\Model\Enum\CreateDiagnosticInputWatchStateProductState;
...
$this->samApiClient->createDiagnotic(20000, [
    'date' => new \DateTime,
    'watchStates' => [
        [
            'toPrint' => false,
            'internalComment' => 'Fermoir cassé',
            'materialReference' => 'xxxxxx',
            'productState' => CreateDiagnosticInputWatchStateProductState::Broken,
        ],
    ],
    'operations' => [
        [
            'toPrint' => false,
            'internalComment' => 'Remplacement fermoir',
            'materialReference' => 'xxxxxx',
            'mandatory' => true,
            'main' => false,
            'quantity' => 1.00,
        ],
    ],
]);

$this->samApiClient->createDiagnosticByInternalNumber('internalNumber', [
    'date' => new \DateTime,
    'watchStates' => [
        [
            'toPrint' => false,
            'internalComment' => 'Fermoir cassé',
            'materialReference' => 'xxxxxx',
            'productState' => CreateDiagnosticInputWatchStateProductState::Broken,
        ],
    ],
    'operations' => [
        [
            'toPrint' => false,
            'internalComment' => 'Remplacement fermoir',
            'materialReference' => 'xxxxxx',
            'mandatory' => true,
            'main' => false,
            'quantity' => 1.00,
        ],
    ],
]);

$this->samApiClient->createDiagnosticByExternalId('externalId', [
    'date' => new \DateTime,
    'watchStates' => [
        [
            'toPrint' => false,
            'internalComment' => 'Fermoir cassé',
            'materialReference' => 'xxxxxx',
            'productState' => CreateDiagnosticInputWatchStateProductState::Broken,
        ],
    ],
    'operations' => [
        [
            'toPrint' => false,
            'internalComment' => 'Remplacement fermoir',
            'materialReference' => 'xxxxxx',
            'mandatory' => true,
            'main' => false,
            'quantity' => 1.00,
        ],
    ],
]);
```

option nametypedateDateTimeInterface, string, nullwatchStatesarray, nulloperationsarray, null### Business deal methods

[](#business-deal-methods)

#### Create business deal

[](#create-business-deal)

```
use IDCI\Bundle\SAMClientBundle\Client\SAMApiClient;
...
$this->samApiClient->createBusinessDeal([
    'externalId' => 'externalRef',
    'partnerReference' => 'FR center',
    'brandReference' => 'Brand 002',
    'partnerSiteReference' => 'xxxxx',
    'initialRequestorPartnerSiteReference' => 'xxxxx',
    'initialRequestorPartnerReference' => 'xxxxx',
    'invoicingCode' => '001',
    'internalNumber' => 'internalRef',
    'productNature' => 'Watch',
    'productReference' => 'xxxxx',
    'productSerialNumber' => 'xxxxx'
    'batchReference' => 'xxxxx',
    'movementSerialNumberReference' => 'xxxxx',
    'movementReference' => 'xxxxx',
    'interventionCode' => 'INV',
    'progress' => [
        'receptionDate' => new \DateTime,
        'estimateDate' => null,
        'expectedDeliveryDate' => null,
        'workStartDate' => null,
        'workEndDate' => null,
        'deliveryDate' => null,
        'numberDaysWaitingParts' => 2,
    ],
    'accessCode' => 'trackingCode',
    'quickService' => true,
    'interventionInvoicingCode' => '000',
]);
```

option nametypeexternalId\*stringpartnerReference\*stringbrandReference\*stringpartnerSiteReferencestring, nullinitialRequestorPartnerSiteReferencestring, nullinitialRequestorPartnerReferencestring, nullinvoicingCodestring, nullinternalNumberstring, nullproductNaturestring, nullproductReferencestring, nullproductSerialNumberstring, nullbatchReferencestring, nullmovementSerialNumberReferencestring, nullmovementReferencestring, nullinterventionCodestring, nullprogressBusinessDealProgress, arrayaccessCodestring, nullquickServicebool, nullinterventionInvoicingCodestring, null#### Get business deal

[](#get-business-deal)

```
use IDCI\Bundle\SAMClientBundle\Client\SAMApiClient;
...
$this->samApiClient->getBusinessDeal(20000);

$this->samApiClient->getBusinessDealByInternalNumber('internalNumber');

$this->samApiClient->getBusinessDealByExternalId('externalId');

$this->samApiClient->getBusinessDealsModifiedSince('2024-12-01');
```

#### Update business deal

[](#update-business-deal)

```
use IDCI\Bundle\SAMClientBundle\Client\SAMApiClient;
use IDCI\Bundle\SAMClientBundle\Client\Model\Enum\JsonPatchDocumentOperation;
...
$this->samApiClient->updateBusinessDeal(20000, [
    'jsonPatchDocuments' => [
        [
            'op' => JsonPatchDocumentOperation::Add,
            'path' => '',
            'value' => 'new value',
            'from' => '',
        ],
    ],
]);

$this->samApiClient->updateBusinessDealByInternalNumber('internalNumber', [
    'jsonPatchDocuments' => [
        [
            'op' => JsonPatchDocumentOperation::Add,
            'path' => '',
            'value' => 'new value',
            'from' => '',
        ],
    ],
]);

$this->samApiClient->updateBusinessDealByExternalId('externalId', [
    'jsonPatchDocuments' => [
        [
            'op' => JsonPatchDocumentOperation::Add,
            'path' => '',
            'value' => 'new value',
            'from' => '',
        ],
    ],
]);
```

option nametypejsonPatchDocumentsarray#### Delete business deal

[](#delete-business-deal)

```
use IDCI\Bundle\SAMClientBundle\Client\SAMApiClient;
...
$this->samApiClient->deleteBusinessDeal(20000);

$this->samApiClient->deleteBusinessDealByInternalNumber('internalNumber');

$this->samApiClient->deleteBusinessDealByExternalId('externalId');
```

Support
-------

[](#support)

If needed, you can contact [Maëva](mailto:maeva.grondin@idci-consulting.fr).

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance63

Regular maintenance activity

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~25 days

Recently: every ~39 days

Total

11

Last Release

223d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cd741a0b8b7ed0a96db8a20eab052ed110453ed38700091f63ce9db3c5ea8fb8?d=identicon)[idciconsulting](/maintainers/idciconsulting)

---

Top Contributors

[![BeBlood](https://avatars.githubusercontent.com/u/24357558?v=4)](https://github.com/BeBlood "BeBlood (13 commits)")[![ScytheOwens](https://avatars.githubusercontent.com/u/143036198?v=4)](https://github.com/ScytheOwens "ScytheOwens (1 commits)")

### Embed Badge

![Health badge](/badges/idci-sam-client-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/idci-sam-client-bundle/health.svg)](https://phpackages.com/packages/idci-sam-client-bundle)
```

###  Alternatives

[simplesamlphp/simplesamlphp

A PHP implementation of a SAML 2.0 service provider and identity provider.

1.1k12.4M193](/packages/simplesamlphp-simplesamlphp)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19562.3M1.3k](/packages/drupal-core)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
