feat: migrate Firebase → NestJS REST API backend
Replace all Firebase SDK (Auth, Firestore, Storage) with HTTP calls to backend.prosapp.co/api/v1: - New ApiService singleton (JWT token, GET/POST/PATCH/DELETE/upload) - auth_provider: Firebase Auth → /auth/login, /auth/register, /auth/phone/* - services_provider + calendar_services_provider → /services endpoints - professional_provider + professionals_provider → /professional-info, /users/professionals - profile_form_provider + professional_form_provider → /users/me, /storage/upload - cities/professions/settings providers → /cities, /professions, /settings - firebase_chat_repository → polling via /chats endpoints (3s interval) - firebase_score_repository → polling via /comments endpoints (10s interval) - professional_detail_provider → /users/:id + /professional-info/:id - dashboard_view: Firestore.add → POST /services - chat_view + rating_view: FirebaseAuth.uid → AuthProvider.user.id - Models: Timestamp → String for createdAt fields - google_fonts upgraded to ^8.1.0 (Dart 3.12 compat) - Remove firebase_core, firebase_auth, cloud_firestore, firebase_storage from pubspec Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
15175c1b91
commit
60216fd0e3
@@ -1,5 +1,3 @@
|
||||
import 'package:cloud_firestore/cloud_firestore.dart';
|
||||
|
||||
class CommentEntity {
|
||||
final String authorId;
|
||||
final String destinationId;
|
||||
@@ -7,7 +5,7 @@ class CommentEntity {
|
||||
final String content;
|
||||
final double score;
|
||||
final bool isFromUser;
|
||||
final Timestamp createdAt;
|
||||
final String createdAt;
|
||||
|
||||
const CommentEntity({
|
||||
required this.authorId,
|
||||
@@ -21,13 +19,13 @@ class CommentEntity {
|
||||
|
||||
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,
|
||||
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 num?)?.toDouble() ?? 0.0,
|
||||
isFromUser: doc['is_from_user'] as bool? ?? false,
|
||||
createdAt: doc['created_at']?.toString() ?? '',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -45,14 +43,6 @@ class CommentEntity {
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return '''CommentEntity{
|
||||
authorId: $authorId,
|
||||
destinationId: $destinationId,
|
||||
serviceId: $serviceId,
|
||||
content: $content,
|
||||
score: $score,
|
||||
isFromUser: $isFromUser,
|
||||
createdAt: $createdAt
|
||||
}''';
|
||||
return 'CommentEntity{authorId: $authorId, destinationId: $destinationId, score: $score}';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user