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