# AHS VirtualStock Integration Module

VirtualStock API integration extension for Yii2.

## Installation

```bash
composer require portalpeople/ahs-virtualstock
```

## Configuration

Add to your application configuration:

```php
'modules' => [
    'virtualstock' => [
        'class' => 'PortalPeople\virtualstock\Module',
        'apiEndpoint' => 'https://www.sandbox.the-edge.io/restapi/v4/',
        'apiKey' => 'your-api-key',
        'apiSecret' => 'your-api-secret',
    ],
],
```

## Order Import Poller

Run the pull-based order import command:

```bash
./yii virtualstock/order-import/run
```

Optional flags:

```bash
./yii virtualstock/order-import/run --limit=200 --cursor="2026-03-06T00:00:00Z"
./yii virtualstock/order-import/run --dryRun=1
```

Suggested cron schedule:

```cron
*/5 * * * * cd /var/www/vhosts/.../NGauge_Base && ./yii virtualstock/order-import/run
```

## Requirements

- PHP 8.4+
- Yii2 Framework
- GuzzleHTTP 7.0+

## License

MIT
