// Wire shape returned by GET /api/client/version. `version` is the
// server-bundled APK version (raw — may have a "v" prefix from the
// git tag); `apkUrl` is server-relative (e.g. "/api/client/apk").

class UpdateInfo {
  const UpdateInfo({
    required this.version,
    required this.apkUrl,
    required this.sizeBytes,
  });

  final String version;
  final String apkUrl;
  final int sizeBytes;

  factory UpdateInfo.fromJson(Map<String, dynamic> j) => UpdateInfo(
        version: (j['version'] as String?) ?? '',
        apkUrl: (j['apk_url'] as String?) ?? '/api/client/apk',
        sizeBytes: (j['size_bytes'] as num?)?.toInt() ?? 0,
      );
}
