part of '../category.dart';

@freezed
class ListCategory with _$ListCategory {
  const factory ListCategory({
    required List<Category> categories,
    required int totalCount,
    required int page,
    required int limit,
    required int totalPages,
  }) = _ListCategory;

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

@freezed
class Category with _$Category {
  const factory Category({
    required String id,
    required String organizationId,
    required String name,
    required String description,
    required String businessType,
    required int order,
    required Map<String, dynamic> metadata,
    required String createdAt,
    required String updatedAt,
  }) = _Category;

  factory Category.empty() => const Category(
    id: '',
    organizationId: '',
    name: '',
    description: '',
    businessType: '',
    order: 0,
    metadata: {},
    createdAt: '',
    updatedAt: '',
  );

  factory Category.all() => const Category(
    id: 'all',
    organizationId: '',
    name: 'Semua',
    businessType: 'restaurant',
    metadata: {},
    createdAt: '',
    updatedAt: '',
    description: '',
    order: 1,
  );
}
