part of '../product.dart';

@freezed
class Product with _$Product {
  const factory Product({
    required String id,
    required String organizationId,
    required String categoryId,
    required String sku,
    required String name,
    required String description,
    required int price,
    required int cost,
    required String businessType,
    required String imageUrl,
    required String printerType,
    required Map<String, dynamic> metadata,
    required bool isActive,
    required DateTime createdAt,
    required DateTime updatedAt,
    required List<ProductVariant> variants,
  }) = _Product;

  /// ✅ factory kosong untuk default state
  factory Product.empty() => Product(
    id: '',
    organizationId: '',
    categoryId: '',
    sku: '',
    name: '',
    description: '',
    price: 0,
    cost: 0,
    businessType: '',
    imageUrl: '',
    printerType: '',
    metadata: {},
    isActive: false,
    createdAt: DateTime.now(),
    updatedAt: DateTime.now(),
    variants: [],
  );
}
