part of '../table.dart';

@freezed
class ListTable with _$ListTable {
  const factory ListTable({
    required List<Table> tables,
    required int totalCount,
    required int page,
    required int limit,
    required int totalPages,
  }) = _ListTable;

  factory ListTable.empty() => const ListTable(
    tables: [],
    totalCount: 0,
    page: 0,
    limit: 0,
    totalPages: 0,
  );
}

@freezed
class Table with _$Table {
  const factory Table({
    required String id,
    required String organizationId,
    required String outletId,
    required String tableName,
    required TableStatusType status,
    required int paymentAmount,
    required double positionX,
    required double positionY,
    required int capacity,
    required bool isActive,
    required DateTime createdAt,
    required DateTime updatedAt,
  }) = _Table;

  factory Table.empty() => Table(
    id: '',
    organizationId: '',
    outletId: '',
    tableName: '',
    status: TableStatusType.unknown,
    paymentAmount: 0,
    positionX: 0.0,
    positionY: 0.0,
    capacity: 0,
    isActive: false,
    createdAt: DateTime(1970),
    updatedAt: DateTime(1970),
  );
}
