refactor: Projektstruktur in app/ und backend/ aufgeteilt

This commit is contained in:
2026-03-24 15:06:44 +01:00
parent 5f5d5995c5
commit 2673ef658d
449 changed files with 28551 additions and 167 deletions

View 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,
});
}

View 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,
});
}

View 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,
});
}

View 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,
});
}

View 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,
});
}

View 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,
});
}