refactor: Projektstruktur in app/ und backend/ aufgeteilt
This commit is contained in:
48
app/lib/entities/chat_message_entity.dart
Normal file
48
app/lib/entities/chat_message_entity.dart
Normal file
@@ -0,0 +1,48 @@
|
||||
import 'package:objectbox/objectbox.dart';
|
||||
|
||||
@Entity()
|
||||
class ChatMessageEntity {
|
||||
@Id()
|
||||
int id = 0;
|
||||
|
||||
@Unique()
|
||||
String messageId;
|
||||
|
||||
@Index()
|
||||
String conversationKey;
|
||||
|
||||
String content;
|
||||
|
||||
String contentType; // 'TEXT' or 'IMAGE'
|
||||
|
||||
@Property(type: PropertyType.date)
|
||||
@Index()
|
||||
DateTime createdAt;
|
||||
|
||||
String origin; // 'INCOMING' or 'OUTGOING'
|
||||
|
||||
String messageType; // 'NORMAL', 'JOB_ASSIGNMENT', etc.
|
||||
|
||||
String? jobId;
|
||||
|
||||
String? jobNumber;
|
||||
|
||||
bool read;
|
||||
|
||||
bool pendingSync;
|
||||
|
||||
ChatMessageEntity({
|
||||
required this.messageId,
|
||||
required this.conversationKey,
|
||||
required this.content,
|
||||
this.contentType = 'TEXT',
|
||||
required this.createdAt,
|
||||
required this.origin,
|
||||
required this.messageType,
|
||||
this.jobId,
|
||||
this.jobNumber,
|
||||
this.read = false,
|
||||
this.pendingSync = false,
|
||||
});
|
||||
}
|
||||
|
||||
26
app/lib/entities/job_entity.dart
Normal file
26
app/lib/entities/job_entity.dart
Normal file
@@ -0,0 +1,26 @@
|
||||
import 'package:objectbox/objectbox.dart';
|
||||
|
||||
@Entity()
|
||||
class JobEntity {
|
||||
@Id()
|
||||
int id = 0;
|
||||
|
||||
@Unique()
|
||||
String jobId; // The original job ID from the Job model
|
||||
|
||||
String jobData; // JSON-encoded job data
|
||||
|
||||
@Property(type: PropertyType.date)
|
||||
DateTime createdAt;
|
||||
|
||||
@Property(type: PropertyType.date)
|
||||
DateTime updatedAt;
|
||||
|
||||
JobEntity({
|
||||
required this.jobId,
|
||||
required this.jobData,
|
||||
required this.createdAt,
|
||||
required this.updatedAt,
|
||||
});
|
||||
}
|
||||
|
||||
23
app/lib/entities/photo_entity.dart
Normal file
23
app/lib/entities/photo_entity.dart
Normal file
@@ -0,0 +1,23 @@
|
||||
import 'package:objectbox/objectbox.dart';
|
||||
|
||||
@Entity()
|
||||
class PhotoEntity {
|
||||
@Id()
|
||||
int id = 0;
|
||||
|
||||
String taskId;
|
||||
|
||||
int photoIndex;
|
||||
|
||||
String data; // Base64-encoded photo data
|
||||
|
||||
@Property(type: PropertyType.date)
|
||||
DateTime createdAt;
|
||||
|
||||
PhotoEntity({
|
||||
required this.taskId,
|
||||
required this.photoIndex,
|
||||
required this.data,
|
||||
required this.createdAt,
|
||||
});
|
||||
}
|
||||
27
app/lib/entities/queued_message_entity.dart
Normal file
27
app/lib/entities/queued_message_entity.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
import 'package:objectbox/objectbox.dart';
|
||||
|
||||
@Entity()
|
||||
class QueuedMessageEntity {
|
||||
@Id()
|
||||
int id = 0;
|
||||
|
||||
@Unique()
|
||||
String messageId;
|
||||
|
||||
String topic;
|
||||
|
||||
String payload; // JSON-encoded payload
|
||||
|
||||
@Property(type: PropertyType.date)
|
||||
DateTime createdAt;
|
||||
|
||||
int retryCount;
|
||||
|
||||
QueuedMessageEntity({
|
||||
required this.messageId,
|
||||
required this.topic,
|
||||
required this.payload,
|
||||
required this.createdAt,
|
||||
this.retryCount = 0,
|
||||
});
|
||||
}
|
||||
30
app/lib/entities/task_status_entity.dart
Normal file
30
app/lib/entities/task_status_entity.dart
Normal file
@@ -0,0 +1,30 @@
|
||||
import 'package:objectbox/objectbox.dart';
|
||||
|
||||
@Entity()
|
||||
class TaskStatusEntity {
|
||||
@Id()
|
||||
int id = 0;
|
||||
|
||||
@Unique()
|
||||
String taskId;
|
||||
|
||||
bool completed;
|
||||
|
||||
@Property(type: PropertyType.date)
|
||||
DateTime? completedAt;
|
||||
|
||||
@Property(type: PropertyType.date)
|
||||
DateTime createdAt;
|
||||
|
||||
@Property(type: PropertyType.date)
|
||||
DateTime updatedAt;
|
||||
|
||||
TaskStatusEntity({
|
||||
required this.taskId,
|
||||
required this.completed,
|
||||
this.completedAt,
|
||||
required this.createdAt,
|
||||
required this.updatedAt,
|
||||
});
|
||||
}
|
||||
|
||||
26
app/lib/entities/user_data_entity.dart
Normal file
26
app/lib/entities/user_data_entity.dart
Normal file
@@ -0,0 +1,26 @@
|
||||
import 'package:objectbox/objectbox.dart';
|
||||
|
||||
@Entity()
|
||||
class UserDataEntity {
|
||||
@Id()
|
||||
int id = 0;
|
||||
|
||||
@Unique()
|
||||
String key;
|
||||
|
||||
String value;
|
||||
|
||||
@Property(type: PropertyType.date)
|
||||
DateTime createdAt;
|
||||
|
||||
@Property(type: PropertyType.date)
|
||||
DateTime updatedAt;
|
||||
|
||||
UserDataEntity({
|
||||
required this.key,
|
||||
required this.value,
|
||||
required this.createdAt,
|
||||
required this.updatedAt,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user