Files
prosappweb/lib/models/comment_entity.dart
T
Lizandro GuarnizoandClaude Sonnet 4.6 15175c1b91 replace: swap prosappweb content for prosapp_web_app (more complete version)
prosapp_web_app has chat, dashboard, calendar, support, 13 providers and
Fluro URL routing. Keep Dockerfile + nginx.conf from previous prosappweb.
Upgrade google_fonts 6.2.1 → 8.1.0 (Dart 3.12 compat fix).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-18 15:26:32 -05:00

59 lines
1.4 KiB
Dart

import 'package:cloud_firestore/cloud_firestore.dart';
class CommentEntity {
final String authorId;
final String destinationId;
final String serviceId;
final String content;
final double score;
final bool isFromUser;
final Timestamp createdAt;
const CommentEntity({
required this.authorId,
required this.destinationId,
required this.serviceId,
required this.content,
required this.score,
required this.isFromUser,
required this.createdAt,
});
static CommentEntity fromDocument(Map<String, dynamic> doc) {
return CommentEntity(
authorId: doc['author_id'] as String,
destinationId: doc['destination_id'] as String,
serviceId: doc['service_id'] as String,
content: doc['content'] as String,
score: doc['score'] as double,
isFromUser: doc['is_from_user'] as bool,
createdAt: doc['created_at'] as Timestamp,
);
}
Map<String, dynamic> toDocument() {
return {
'author_id': authorId,
'destination_id': destinationId,
'service_id': serviceId,
'content': content,
'score': score,
'is_from_user': isFromUser,
'created_at': createdAt,
};
}
@override
String toString() {
return '''CommentEntity{
authorId: $authorId,
destinationId: $destinationId,
serviceId: $serviceId,
content: $content,
score: $score,
isFromUser: $isFromUser,
createdAt: $createdAt
}''';
}
}