import 'package:drift/drift.dart';
import 'package:uuid/uuid.dart';

class Campaigns extends Table {
  TextColumn get localId => text().clientDefault(() => const Uuid().v7().toString())();
  TextColumn get serverId => text().nullable()();
  TextColumn get title => text()();
  TextColumn get localBannerPath => text()();
  TextColumn get serverBannerUrl => text().nullable()();
  DateTimeColumn get startDate => dateTime().nullable()();
  DateTimeColumn get endDate => dateTime().nullable()();
  TextColumn get actionType => text().nullable()();
  TextColumn get actionReferenceId => text().nullable()();
  BoolColumn get isActive => boolean().withDefault(const Constant(true))();
  TextColumn get syncStatus => text().withDefault(const Constant('dirty'))();
  DateTimeColumn get createdAt => dateTime().withDefault(currentDateAndTime)();
  DateTimeColumn get updatedAt => dateTime().withDefault(currentDateAndTime)();
  DateTimeColumn get deletedAt => dateTime().nullable()();

  @override
  // TODO: implement primaryKey
  Set<Column<Object>>? get primaryKey => {localId};
}