Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.3.7] - 2025-10-20

- API migration support UUIDs (FE-58)

## [3.3.6] - 2025-10-07

- Remove duplicated `LiveKitSettings` object with the parsing issue which is already in `aira_call` (FE-81)
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ packages:
path: ".."
relative: true
source: path
version: "3.3.6"
version: "3.3.7"
flutter_lints:
dependency: "direct dev"
description:
Expand Down
5 changes: 5 additions & 0 deletions lib/src/models/access_offer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class AccessOfferDetails {
enabled = json['enabled'],
expired = json['expired'],
id = json['id'],
uuid = json['uuid'],
key = json['key'],
message = json['message'],
name = json['name'],
Expand Down Expand Up @@ -58,6 +59,7 @@ class AccessOfferDetails {
bool? enabled;
bool? expired;
int id;
String uuid;
Comment on lines 60 to +62

Copilot AI Oct 20, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The uuid field is marked as non-nullable and required in AccessOfferDetails, but existing API responses may not include this field. This could cause deserialization failures. Consider making this field nullable (String?) to handle cases where the UUID is not yet available.

Copilot uses AI. Check for mistakes.
String? key;
String? message;
String name;
Expand Down Expand Up @@ -123,6 +125,7 @@ class AccountDetails {
: acceptBusinessUsers = json['acceptBusinessUsers'],
accountCode = json['accountCode'],
accountId = json['accountId'],
uuid = json['uuid'],
accountType = AccountType.fromName(json['accountType']),
email = json['email'],
firstname = json['firstname'],
Expand All @@ -132,6 +135,7 @@ class AccountDetails {
bool? acceptBusinessUsers;
String? accountCode;
int? accountId;
String? uuid;
AccountType? accountType;
String? email;
String? firstname;
Expand All @@ -147,6 +151,7 @@ class AccountDetails {
'firstname': firstname,
'name': name,
'type': type,
'uuid': uuid,
};
}

Expand Down
2 changes: 2 additions & 0 deletions lib/src/models/account.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ enum AccessAiRestriction {

class Account {
final int id;
final String uuid;
Comment thread
ming-chu marked this conversation as resolved.
final String name;
final AccountType type;

Expand All @@ -44,6 +45,7 @@ class Account {

Account.fromJson(Map<String, dynamic> json)
: id = json['id'],
uuid = json['uuid'],
name = json['name'],
type = AccountType.fromName(json['accountType']),
accessAI = AccessAiRestriction.fromValue(json['accessAi']);
Expand Down
24 changes: 20 additions & 4 deletions lib/src/models/callHistory/call_history.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@ import 'package:flutter_aira/src/models/feedback.dart';
class SessionFeedback {
SessionFeedback({
required this.serviceId,
required this.serviceUuid,
Comment on lines 12 to +13

Copilot AI Oct 20, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Constructor parameters serviceId and serviceUuid are marked as required, but the corresponding fields are nullable (int? and String?). This creates a breaking change and forces callers to provide values that could be null. Consider making these optional parameters to match the nullable field declarations.

Suggested change
required this.serviceId,
required this.serviceUuid,
this.serviceId,
this.serviceUuid,

Copilot uses AI. Check for mistakes.
this.requestReview = false,
this.appFeedback,
this.agentFeedback,
this.aiFeedback,
});

factory SessionFeedback.fromJson(Map<String, dynamic> json) {
factory SessionFeedback.fromJson({
required Map<String, dynamic> json,
required String serviceUuid,
}) {
String? commentRaw = json['comment'];
Map<String, dynamic> commentJson;
try {
Expand All @@ -32,6 +36,7 @@ class SessionFeedback {
bool requestReview = commentJson['agent']?['requestReview'] ?? false;
return SessionFeedback(
serviceId: json['serviceId'],
serviceUuid: serviceUuid,
requestReview: requestReview,
appFeedback: Feedback.fromJson(commentJson['app']),
agentFeedback: Feedback.fromJson(commentJson['agent']),
Expand All @@ -42,6 +47,7 @@ class SessionFeedback {
Map<String, dynamic> toJson() {
return {
'serviceId': serviceId,
'serviceUuid': serviceUuid,
'requestReview': requestReview,
'app': appFeedback?.toJson(),
'agent': agentFeedback?.toJson(),
Expand All @@ -50,7 +56,11 @@ class SessionFeedback {
}

/// Service request ID.
int serviceId;
/// Please check the [serviceUuid] if [serviceId] not exist.
int? serviceId;

/// please check the [serviceId] if [serviceUuid] not exist.
Comment on lines +59 to +62

Copilot AI Oct 20, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent capitalization in documentation comments. Line 59 starts with 'Please' (capitalized) while line 62 starts with 'please' (lowercase). Additionally, both comments should say 'does not exist' instead of 'not exist' for proper grammar.

Suggested change
/// Please check the [serviceUuid] if [serviceId] not exist.
int? serviceId;
/// please check the [serviceId] if [serviceUuid] not exist.
/// Please check the [serviceUuid] if [serviceId] does not exist.
int? serviceId;
/// Please check the [serviceId] if [serviceUuid] does not exist.

Copilot uses AI. Check for mistakes.
String? serviceUuid;

/// True if the Explorer requested special attention to his review.
bool requestReview;
Expand Down Expand Up @@ -82,14 +92,18 @@ class CallSession {
endTimeStamp = (json['endTimeStamp'] as String?)?.dateTime,
requestSource = json['requestSource'],
requestTimeStamp = (json['requestTimeStamp'] as String?)?.dateTime,
serviceId = json['serviceid'],
serviceId = json['serviceid'] ?? json['serviceId'],
serviceUuid = json['serviceUuid'],
startTimeStamp = (json['startTimeStamp'] as String?)?.dateTime,
status = json['status'],
userFirstname = json['firstname'],
userId = json['userId'],
userFeedback = null == json['userFeedback']
? null
: SessionFeedback.fromJson(json['userFeedback']),
: SessionFeedback.fromJson(
json: json['userFeedback'],
serviceUuid: json['serviceUuid'],
),
buildAi =
json['buildAi'] != null ? BuildAi.fromJson(json['buildAi']) : null,
userFeedbackForm = FeedbackForm.fromJson(json['userFeedbackForm']),
Expand All @@ -114,6 +128,8 @@ class CallSession {
/// ID representing the Service Request.
int serviceId;

String serviceUuid;

/// Start time of the call.
DateTime? startTimeStamp;

Expand Down
22 changes: 11 additions & 11 deletions lib/src/platform_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -368,15 +368,15 @@ class PlatformClient {
static Future<void> uploadSensorData({
required String apiKey,
required String airaToken,
required String serviceRequestId,
required String serviceRequestUuid,
required String platformHost,
required int batchNumber,
required Map<String, dynamic> body,
}) async {
// Send the request
final uri = Uri.https(
platformHost,
'/api/service-request/$serviceRequestId/sensors/$batchNumber',
'/api/service-request/$serviceRequestUuid/sensors/$batchNumber',
);

final headers = {
Expand Down Expand Up @@ -446,11 +446,11 @@ class PlatformClient {

/// Update service request's Build AI Program allow sharing status.
Future<void> updateSessionShareStatus(
int serviceId,
String callId,
bool value,
) async {
await _httpPut(
'/api/service-request/$serviceId/build-ai/allow-sharing',
'/api/service-request/$callId/build-ai/allow-sharing',
body: jsonEncode(
{'value': value},
),
Expand Down Expand Up @@ -527,7 +527,7 @@ class PlatformClient {
Map<String, dynamic>? agentFeedback = feedback.agentFeedback?.toJson();
agentFeedback?['requestReview'] = feedback.requestReview;
String body = jsonEncode({
'serviceId': feedback.serviceId,
'serviceId': feedback.serviceUuid ?? feedback.serviceId,
'comment': jsonEncode({
'schemaVersion': 2,
'agent': agentFeedback,
Expand All @@ -544,15 +544,15 @@ class PlatformClient {
}

/// Uploads a photo for a service request.
Future<void> uploadPhoto(int serviceRequestId, ByteBuffer photo) async {
Future<void> uploadPhoto(String callId, ByteBuffer photo) async {
_verifyIsLoggedIn();

return uploadPhotoWithUint8List(serviceRequestId, photo.asUint8List());
return uploadPhotoWithUint8List(callId, photo.asUint8List());
}

/// Uploads a photo for a service request.
Future<void> uploadPhotoWithUint8List(
int serviceRequestId,
String callId,
Uint8List photo,
) async {
_verifyIsLoggedIn();
Expand All @@ -565,7 +565,7 @@ class PlatformClient {
'category': 'sr_trigger',
'entityid': _userId.toString(),
'entitytype': 'user',
'serviceid': serviceRequestId.toString(),
'serviceid': callId,
};
http.MultipartFile file = http.MultipartFile.fromBytes(
'file',
Expand Down Expand Up @@ -793,14 +793,14 @@ class PlatformClient {
}

/// This API returns the same data as on the call-history API, just for a single session.
Future<CallSession> getCallHistorySingleCall(int serviceRequestId) async {
Future<CallSession> getCallHistorySingleCall(String callId) async {
_verifyIsLoggedIn();

Map<String, dynamic> response = await _httpGet(
'/api/user/service/history/bu',
queryParameters: {
'userId': _userId.toString(),
'serviceId': serviceRequestId.toString(),
'serviceId': callId,
},
);

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_aira
description: The Aira Flutter SDK.
version: 3.3.6
version: 3.3.7
homepage: https://github.com/aira/flutter_aira

environment:
Expand Down