What changed, and why it matters
This commit adds human-readable toString() methods and helper toMap() methods to three data classes that describe shopping tickets. It only changes how objects look when printed or logged; it does not alter how data is stored, transmitted, validated, or protected. There is no security issue visible in the change.
No security action needed. Treat as a routine developer-experience/logging improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch adds toMap() and overridden toString() implementations to TicketRef, TicketStatus, and TicketFull in lib/services/shopinbit/src/models/ticket.dart. These methods return existing field values in a map format for debugging/logging. No parsing, serialization, network, cryptographic, or access-control logic is modified. No new dependencies or external inputs are introduced.
Changed components
lib/services/shopinbit/src/models/ticket.dartInspect captured patch +41 / −0
diff --git a/lib/services/shopinbit/src/models/ticket.dart b/lib/services/shopinbit/src/models/ticket.dart
index 2f8e91d..06093ff 100644
--- a/lib/services/shopinbit/src/models/ticket.dart
+++ b/lib/services/shopinbit/src/models/ticket.dart
@@ -33,6 +33,16 @@ class TicketRef {
factory TicketRef.fromJson(Map<String, dynamic> json) {
return TicketRef(id: _toInt(json['id']), number: json['number'].toString());
}
+
+ Map<String, dynamic> toMap() {
+ return {
+ "id": id,
+ "number": number,
+ };
+ }
+
+ @override
+ String toString() => toMap().toString();
}
class TicketStatus {
@@ -64,6 +74,20 @@ class TicketStatus {
trackingLink: json['tracking_link'] as String?,
);
}
+
+ Map<String, dynamic> toMap() {
+ return {
+ "ticket_id": ticketId,
+ "state": state.toString(),
+ "updated_at": updatedAt.toIso8601String(),
+ "last_agent_message_at": lastAgentMessageAt?.toIso8601String(),
+ "payment_invoice_status": paymentInvoiceStatus,
+ "tracking_link": trackingLink,
+ };
+ }
+
+ @override
+ String toString() => toMap().toString();
}
class TicketFull {
@@ -102,6 +126,23 @@ class TicketFull {
vatRate: _toInt(json['vat_rate']),
);
}
+
+ Map<String, dynamic> toMap() {
+ return {
+ "id": id,
+ "number": number,
+ "product_name": productName,
+ "customer_price": customerPrice,
+ "partner_price": partnerPrice,
+ "partner_commission": partnerCommission,
+ "net_purchase_price": netPurchasePrice,
+ "net_shipping_costs": netShippingCosts,
+ "vat_rate": vatRate,
+ };
+ }
+
+ @override
+ String toString() => toMap().toString();
}
int _toInt(dynamic value) {
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.