using JSMR.Application.Scanning.Contracts;
using JSMR.Domain.Enums;

namespace JSMR.Tests.Unit;

internal static class DLSiteWorkTestFactory
{
    private static int _counter = 0;

    public static DLSiteWork Create(DateOnly? expectedDate = null, DateOnly? salesDate = null)
    {
        int id = Interlocked.Increment(ref _counter);

        return new DLSiteWork
        {
            ProductName = $"Test Product {id}",
            ProductId = $"RJ_TEST_{id:00000000}",
            Maker = "Test Maker",
            MakerId = "RG_TEST",
            ImageUrl = "//img.dlsite.jp/test_main.jpg",
            SmallImageUrl = "//img.dlsite.jp/test_sam.jpg",
            AgeRating = AgeRating.AllAges,

            // Relevant fields for these tests:
            ExpectedDate = expectedDate,
            SalesDate = salesDate,

            // The rest can be safe defaults:
            Downloads = 0,
            StarRating = null,
            Votes = null,
            Description = null,
            Genres = [],
            Tags = [],
            Creators = [],
            HasTrial = false
        };
    }
}