# Shop Admin: Extension and action examples

<!-- Maintained by scripts/generate-package-readmes.php -->

Use the action functions with records and Data objects supplied by your application.
They pass each argument to the package operation and return its result.

These adapters show container registration. Use the owning package registry when
a contract requires contributor discovery.

Contract adapters wrap an existing implementation. Call their registration function
from your service provider with that implementation; tagged contracts keep their declared tag.
Resolve the backend by its concrete class before registration so the replacement contract
does not resolve itself. Static contract metadata uses one backend class per adapter.

## Action `addOperatorOrderNote`

<!-- example: action addOperatorOrderNote -->

```php
<?php
declare(strict_types=1);

namespace App\CapellExamples\ShopAdmin;

function runAddOperatorOrderNote(\Illuminate\Contracts\Auth\Authenticatable $operator, string $orderId, string $note, string $idempotencyKey): \Capell\Shop\Models\ShopOrderAttachment
{
    return \Capell\ShopAdmin\Actions\AddOperatorOrderNoteAction::run($operator, $orderId, $note, $idempotencyKey);
}
```

## Action `attachOperatorOrderFile`

<!-- example: action attachOperatorOrderFile -->

```php
<?php
declare(strict_types=1);

namespace App\CapellExamples\ShopAdmin;

function runAttachOperatorOrderFile(\Illuminate\Contracts\Auth\Authenticatable $operator, string $orderId, string $fileName, string $contents, string $idempotencyKey): \Capell\Shop\Models\ShopOrderAttachment
{
    return \Capell\ShopAdmin\Actions\AttachOperatorOrderFileAction::run($operator, $orderId, $fileName, $contents, $idempotencyKey);
}
```

## Action `buildOrderAttachmentRows`

<!-- example: action buildOrderAttachmentRows -->

```php
<?php
declare(strict_types=1);

namespace App\CapellExamples\ShopAdmin;

function runBuildOrderAttachmentRows(\Illuminate\Contracts\Auth\Authenticatable $operator, \Capell\Shop\Models\ShopOrder $order): array
{
    return \Capell\ShopAdmin\Actions\BuildOrderAttachmentRowsAction::run($operator, $order);
}
```

## Action `listOperatorOrderActions`

<!-- example: action listOperatorOrderActions -->

```php
<?php
declare(strict_types=1);

namespace App\CapellExamples\ShopAdmin;

function runListOperatorOrderActions(\Illuminate\Contracts\Auth\Authenticatable $operator, string $orderId): array
{
    return \Capell\ShopAdmin\Actions\ListOperatorOrderActionsAction::run($operator, $orderId);
}
```

## Action `listOperatorOrderAttachments`

<!-- example: action listOperatorOrderAttachments -->

```php
<?php
declare(strict_types=1);

namespace App\CapellExamples\ShopAdmin;

function runListOperatorOrderAttachments(\Illuminate\Contracts\Auth\Authenticatable $operator, string $orderId): array
{
    return \Capell\ShopAdmin\Actions\ListOperatorOrderAttachmentsAction::run($operator, $orderId);
}
```

## Action `readOperatorOrderAttachment`

<!-- example: action readOperatorOrderAttachment -->

```php
<?php
declare(strict_types=1);

namespace App\CapellExamples\ShopAdmin;

function runReadOperatorOrderAttachment(\Illuminate\Contracts\Auth\Authenticatable $operator, string $storeId, string $orderId, string $attachmentId): \Capell\Shop\Data\ShopOrderAttachmentFileData
{
    return \Capell\ShopAdmin\Actions\ReadOperatorOrderAttachmentAction::run($operator, $storeId, $orderId, $attachmentId);
}
```

## Action `runOperatorOrderAction`

<!-- example: action runOperatorOrderAction -->

```php
<?php
declare(strict_types=1);

namespace App\CapellExamples\ShopAdmin;

function runRunOperatorOrderAction(\Illuminate\Contracts\Auth\Authenticatable $operator, string $orderId, string $capabilityKey, string $actionKey, array $input, string $idempotencyKey): \Capell\Shop\Data\ShopOrderActionResultData
{
    return \Capell\ShopAdmin\Actions\RunOperatorOrderActionAction::run($operator, $orderId, $capabilityKey, $actionKey, $input, $idempotencyKey);
}
```