import 'package:built_collection/built_collection.dart';
import 'package:built_value/serializer.dart';
import 'package:built_value/standard_json_plugin.dart';
import 'package:cinema/feature/poster/domain/movie.dart';
import 'package:cinema/feature/poster/domain/tmdb_trending_response.dart';

import 'custom_date_time_serializer.dart';

part 'serializers.g.dart';

@SerializersFor([TmdbTrendingResponse, TmdbMovieResult])
final Serializers serializers =
    (_$serializers.toBuilder()
          ..add(CustomDateTimeSerializer())
          ..addPlugin(StandardJsonPlugin())
          ..addBuilderFactory(
            const FullType(BuiltList, [FullType(TmdbMovieResult), FullType(Movie)]),
            () => ListBuilder<TmdbMovieResult>(),
          ))
        .build();
