<?php

namespace App\Contracts;

use App\DTOs\ProductOwner\ActivationRequestData;
use App\DTOs\ProductOwner\ActivationResponseData;
use App\DTOs\ProductOwner\AdminUpdateCheckData;
use App\DTOs\ProductOwner\HeartbeatPayloadData;
use App\DTOs\ProductOwner\LicenseValidationResponseData;
use App\DTOs\ProductOwner\ModulePurchaseResponseData;
use App\DTOs\ProductOwner\WalletBalanceData;
use App\DTOs\ProductOwner\WalletLedgerData;

interface ProductOwnerClientContract
{
    public function activate(ActivationRequestData $request): ActivationResponseData;

    public function validateLicense(string $licenseKey, string $installationId): LicenseValidationResponseData;

    public function sendHeartbeat(string $installationId, ?HeartbeatPayloadData $payload = null): bool;

    /**
     * @return array<string, mixed>|null
     */
    public function fetchAdminIntegrityManifest(string $installationId, string $version): ?array;

    /**
     * @return list<array<string, mixed>>
     */
    public function listMarketplaceModules(): array;

    public function getWalletBalance(string $installationId): ?WalletBalanceData;

    public function getWalletLedger(string $installationId): ?WalletLedgerData;

    public function purchaseModule(string $installationId, string $moduleUuid): ModulePurchaseResponseData;

    public function initializeModule(string $installationId, string $moduleUuid): bool;

    public function checkAdminUpdate(string $installationId, string $currentVersion): AdminUpdateCheckData;
}
