package com.tt.honeyDue.testing

import com.tt.honeyDue.models.Contractor
import com.tt.honeyDue.models.ContractorSpecialty
import com.tt.honeyDue.models.ContractorSummary
import com.tt.honeyDue.models.Document
import com.tt.honeyDue.models.FeatureBenefit
import com.tt.honeyDue.models.MyResidencesResponse
import com.tt.honeyDue.models.Residence
import com.tt.honeyDue.models.ResidenceSummaryResponse
import com.tt.honeyDue.models.ResidenceType
import com.tt.honeyDue.models.ResidenceUserResponse
import com.tt.honeyDue.models.SubscriptionStatus
import com.tt.honeyDue.models.TaskCategory
import com.tt.honeyDue.models.TaskColumn
import com.tt.honeyDue.models.TaskColumnsResponse
import com.tt.honeyDue.models.TaskFrequency
import com.tt.honeyDue.models.TaskPriority
import com.tt.honeyDue.models.TaskResponse
import com.tt.honeyDue.models.TaskTemplate
import com.tt.honeyDue.models.TaskTemplateCategoryGroup
import com.tt.honeyDue.models.TaskTemplatesGroupedResponse
import com.tt.honeyDue.models.TaskUserResponse
import com.tt.honeyDue.models.TierLimits
import com.tt.honeyDue.models.TotalSummary
import com.tt.honeyDue.models.UsageStats
import com.tt.honeyDue.models.User
import com.tt.honeyDue.models.toSummary
import kotlinx.datetime.DateTimeUnit
import kotlinx.datetime.LocalDate
import kotlinx.datetime.minus
import kotlinx.datetime.plus

/**
 * Deterministic fixture graph for the parity-gallery and snapshot tests.
 *
 * Every date is derived from [FIXED_DATE] (2026-04-15) — no `Clock.System.now()`
 * calls — so identical fixtures render identically every run on both
 * platforms. These fixtures feed [FixtureDataManager] which in turn feeds
 * `LocalDataManager` (Android) and `@Environment(\.dataManager)` (iOS).
 *
 * Populated content target (matches `rc-parity-gallery.md` P1):
 *   - 2 residences (1 primary home + 1 lake cabin)
 *   - 8 tasks (2 overdue, 3 due this week, 2 due later, 1 completed)
 *   - 3 contractors (plumber, electrician, HVAC)
 *   - 5 documents (2 warranties — one expired — + 3 manuals)
 */
object Fixtures {

    // ==================== FIXED CLOCK ====================

    val FIXED_DATE: LocalDate = LocalDate(2026, 4, 15)

    private val FIXED_ISO_TIMESTAMP: String = "2026-04-15T12:00:00Z"

    private fun isoDate(d: LocalDate): String = d.toString() // yyyy-MM-dd
    private fun daysFromFixed(offset: Int): String =
        if (offset == 0) isoDate(FIXED_DATE)
        else if (offset > 0) isoDate(FIXED_DATE.plus(offset, DateTimeUnit.DAY))
        else isoDate(FIXED_DATE.minus(-offset, DateTimeUnit.DAY))

    // ==================== RESIDENCE TYPES ====================

    val residenceTypes: List<ResidenceType> = listOf(
        ResidenceType(id = 1, name = "House"),
        ResidenceType(id = 2, name = "Condo"),
        ResidenceType(id = 3, name = "Apartment"),
        ResidenceType(id = 4, name = "Cabin"),
        ResidenceType(id = 5, name = "Townhouse"),
    )

    // ==================== TASK CATEGORIES ====================

    val taskCategories: List<TaskCategory> = listOf(
        TaskCategory(id = 1, name = "Plumbing", description = "Pipes, faucets, drains", icon = "water", color = "#2196F3", displayOrder = 1),
        TaskCategory(id = 2, name = "Electrical", description = "Wiring, outlets, fixtures", icon = "bolt", color = "#FFB300", displayOrder = 2),
        TaskCategory(id = 3, name = "HVAC", description = "Heating, cooling, ventilation", icon = "thermostat", color = "#00897B", displayOrder = 3),
        TaskCategory(id = 4, name = "Exterior", description = "Roof, siding, landscaping", icon = "house", color = "#6D4C41", displayOrder = 4),
        TaskCategory(id = 5, name = "Interior", description = "Walls, floors, fixtures", icon = "weekend", color = "#8E24AA", displayOrder = 5),
        TaskCategory(id = 6, name = "Appliance", description = "Kitchen & laundry appliances", icon = "kitchen", color = "#E53935", displayOrder = 6),
    )

    // ==================== TASK PRIORITIES ====================

    val taskPriorities: List<TaskPriority> = listOf(
        TaskPriority(id = 1, name = "Urgent", level = 4, color = "#EF4444", displayOrder = 1),
        TaskPriority(id = 2, name = "High", level = 3, color = "#F59E0B", displayOrder = 2),
        TaskPriority(id = 3, name = "Medium", level = 2, color = "#3B82F6", displayOrder = 3),
        TaskPriority(id = 4, name = "Low", level = 1, color = "#10B981", displayOrder = 4),
    )

    // ==================== TASK FREQUENCIES ====================

    val taskFrequencies: List<TaskFrequency> = listOf(
        TaskFrequency(id = 1, name = "One-time", days = null, displayOrder = 1),
        TaskFrequency(id = 2, name = "Monthly", days = 30, displayOrder = 2),
        TaskFrequency(id = 3, name = "Quarterly", days = 90, displayOrder = 3),
        TaskFrequency(id = 4, name = "Annual", days = 365, displayOrder = 4),
        TaskFrequency(id = 5, name = "Custom", days = null, displayOrder = 5),
    )

    // ==================== CONTRACTOR SPECIALTIES ====================

    val contractorSpecialties: List<ContractorSpecialty> = listOf(
        ContractorSpecialty(id = 1, name = "Plumbing", description = "Pipes, fixtures, drains", icon = "water", displayOrder = 1),
        ContractorSpecialty(id = 2, name = "Electrical", description = "Wiring, panels, fixtures", icon = "bolt", displayOrder = 2),
        ContractorSpecialty(id = 3, name = "HVAC", description = "Heating & cooling", icon = "thermostat", displayOrder = 3),
        ContractorSpecialty(id = 4, name = "Roofing", description = "Roof repair & replacement", icon = "roof", displayOrder = 4),
        ContractorSpecialty(id = 5, name = "General", description = "General handyman", icon = "wrench", displayOrder = 5),
    )

    // ==================== USER ====================

    val user: User = User(
        id = 42,
        username = "jane.demo",
        email = "jane.demo@honeydue.example",
        firstName = "Jane",
        lastName = "Demo",
        isActive = true,
        dateJoined = FIXED_ISO_TIMESTAMP,
        lastLogin = FIXED_ISO_TIMESTAMP,
    )

    private val residenceUser: ResidenceUserResponse = ResidenceUserResponse(
        id = 42,
        username = "jane.demo",
        email = "jane.demo@honeydue.example",
        firstName = "Jane",
        lastName = "Demo",
    )

    private val taskUser: TaskUserResponse = TaskUserResponse(
        id = 42,
        username = "jane.demo",
        email = "jane.demo@honeydue.example",
        firstName = "Jane",
        lastName = "Demo",
    )

    // ==================== RESIDENCES ====================

    val primaryHome: Residence = Residence(
        id = 1,
        ownerId = 42,
        owner = residenceUser,
        users = listOf(residenceUser),
        name = "Primary Home",
        propertyTypeId = 1,
        propertyType = residenceTypes[0],
        streetAddress = "1234 Maple Street",
        city = "Madison",
        stateProvince = "WI",
        postalCode = "53703",
        country = "USA",
        bedrooms = 3,
        bathrooms = 2.5,
        squareFootage = 2200,
        lotSize = 0.25,
        yearBuilt = 2005,
        description = "Two-story colonial, attached two-car garage.",
        purchaseDate = daysFromFixed(-365 * 4),
        purchasePrice = 385_000.0,
        isPrimary = true,
        isActive = true,
        overdueCount = 2,
        heatingType = "Gas furnace",
        coolingType = "Central AC",
        waterHeaterType = "Tankless gas",
        roofType = "Asphalt shingle",
        hasPool = false,
        hasSprinklerSystem = true,
        hasSeptic = false,
        hasFireplace = true,
        hasGarage = true,
        hasBasement = true,
        hasAttic = true,
        exteriorType = "Vinyl siding",
        flooringPrimary = "Hardwood",
        landscapingType = "Traditional lawn",
        createdAt = FIXED_ISO_TIMESTAMP,
        updatedAt = FIXED_ISO_TIMESTAMP,
    )

    val lakeCabin: Residence = Residence(
        id = 2,
        ownerId = 42,
        owner = residenceUser,
        users = listOf(residenceUser),
        name = "Lake Cabin",
        propertyTypeId = 4,
        propertyType = residenceTypes[3],
        streetAddress = "56 Lakeshore Drive",
        city = "Minocqua",
        stateProvince = "WI",
        postalCode = "54548",
        country = "USA",
        bedrooms = 2,
        bathrooms = 1.0,
        squareFootage = 1200,
        lotSize = 0.5,
        yearBuilt = 1975,
        description = "Rustic cabin on the lake — detached shed, no basement.",
        purchaseDate = daysFromFixed(-365 * 2),
        purchasePrice = 215_000.0,
        isPrimary = false,
        isActive = true,
        overdueCount = 0,
        heatingType = "Baseboard electric",
        coolingType = "Window units",
        waterHeaterType = "Electric tank",
        roofType = "Metal",
        hasPool = false,
        hasSprinklerSystem = false,
        hasSeptic = true,
        hasFireplace = true,
        hasGarage = false,
        hasBasement = false,
        hasAttic = true,
        exteriorType = "Cedar siding",
        flooringPrimary = "Pine plank",
        landscapingType = "Woodland natural",
        createdAt = FIXED_ISO_TIMESTAMP,
        updatedAt = FIXED_ISO_TIMESTAMP,
    )

    val residences: List<Residence> = listOf(primaryHome, lakeCabin)

    val myResidencesResponse: MyResidencesResponse = MyResidencesResponse(residences = residences)

    val residenceSummaries: Map<Int, ResidenceSummaryResponse> = mapOf(
        primaryHome.id to ResidenceSummaryResponse(
            id = primaryHome.id,
            name = primaryHome.name,
            taskCount = 7,
            pendingCount = 6,
            overdueCount = 2,
        ),
        lakeCabin.id to ResidenceSummaryResponse(
            id = lakeCabin.id,
            name = lakeCabin.name,
            taskCount = 2,
            pendingCount = 2,
            overdueCount = 0,
        ),
    )

    // ==================== TASKS ====================

    private fun task(
        id: Int,
        title: String,
        description: String,
        residenceId: Int,
        priorityId: Int,
        categoryId: Int,
        frequencyId: Int,
        dueDateOffsetDays: Int,
        kanbanColumn: String,
        completed: Boolean = false,
        estimatedCost: Double? = null,
    ): TaskResponse = TaskResponse(
        id = id,
        residenceId = residenceId,
        createdById = 42,
        createdBy = taskUser,
        assignedToId = 42,
        assignedTo = taskUser,
        title = title,
        description = description,
        categoryId = categoryId,
        category = taskCategories.first { it.id == categoryId },
        priorityId = priorityId,
        priority = taskPriorities.first { it.id == priorityId },
        inProgress = false,
        frequencyId = frequencyId,
        frequency = taskFrequencies.first { it.id == frequencyId },
        customIntervalDays = null,
        dueDate = daysFromFixed(dueDateOffsetDays),
        nextDueDate = if (completed) daysFromFixed(dueDateOffsetDays + 90) else null,
        estimatedCost = estimatedCost,
        actualCost = null,
        contractorId = null,
        isCancelled = false,
        isArchived = false,
        parentTaskId = null,
        templateId = null,
        completionCount = if (completed) 1 else 0,
        kanbanColumn = kanbanColumn,
        completions = emptyList(),
        createdAt = FIXED_ISO_TIMESTAMP,
        updatedAt = FIXED_ISO_TIMESTAMP,
    )

    // 2 overdue, 3 due this week, 2 due later, 1 completed
    val tasks: List<TaskResponse> = listOf(
        // Overdue (2)
        task(
            id = 1,
            title = "Replace furnace filter",
            description = "Swap the pleated filter and log replacement date on the side.",
            residenceId = primaryHome.id,
            priorityId = 2,
            categoryId = 3,
            frequencyId = 3,
            dueDateOffsetDays = -5,
            kanbanColumn = "overdue_tasks",
            estimatedCost = 25.0,
        ),
        task(
            id = 2,
            title = "Check smoke detector batteries",
            description = "All six detectors — replace any older than 12 months.",
            residenceId = primaryHome.id,
            priorityId = 1,
            categoryId = 5,
            frequencyId = 4,
            dueDateOffsetDays = -2,
            kanbanColumn = "overdue_tasks",
            estimatedCost = 15.0,
        ),
        // Due this week (3)
        task(
            id = 3,
            title = "Clean gutters",
            description = "Clear leaves and debris from all gutters and downspouts.",
            residenceId = primaryHome.id,
            priorityId = 3,
            categoryId = 4,
            frequencyId = 3,
            dueDateOffsetDays = 3,
            kanbanColumn = "due_soon_tasks",
            estimatedCost = 120.0,
        ),
        task(
            id = 4,
            title = "Test sump pump",
            description = "Pour water into the pit to verify activation and discharge.",
            residenceId = primaryHome.id,
            priorityId = 2,
            categoryId = 1,
            frequencyId = 3,
            dueDateOffsetDays = 5,
            kanbanColumn = "due_soon_tasks",
        ),
        task(
            id = 5,
            title = "Reseal deck",
            description = "Apply one coat of semi-transparent stain to the main deck.",
            residenceId = lakeCabin.id,
            priorityId = 4,
            categoryId = 4,
            frequencyId = 4,
            dueDateOffsetDays = 7,
            kanbanColumn = "due_soon_tasks",
            estimatedCost = 85.0,
        ),
        // Due later (2)
        task(
            id = 6,
            title = "Service HVAC",
            description = "Schedule annual service with North Winds HVAC.",
            residenceId = primaryHome.id,
            priorityId = 3,
            categoryId = 3,
            frequencyId = 4,
            dueDateOffsetDays = 14,
            kanbanColumn = "upcoming_tasks",
            estimatedCost = 175.0,
        ),
        task(
            id = 7,
            title = "Power-wash siding",
            description = "Rent pressure washer; focus on north wall mildew.",
            residenceId = lakeCabin.id,
            priorityId = 4,
            categoryId = 4,
            frequencyId = 4,
            dueDateOffsetDays = 21,
            kanbanColumn = "upcoming_tasks",
            estimatedCost = 60.0,
        ),
        // Completed (1)
        task(
            id = 8,
            title = "Replaced kitchen faucet",
            description = "Upgraded to pull-down sprayer model.",
            residenceId = primaryHome.id,
            priorityId = 3,
            categoryId = 1,
            frequencyId = 1,
            dueDateOffsetDays = -10,
            kanbanColumn = "completed_tasks",
            completed = true,
            estimatedCost = 180.0,
        ),
    )

    /** Kanban columns derived from [tasks] — matches API shape. */
    val taskColumnsResponse: TaskColumnsResponse = run {
        val grouped = tasks.groupBy { it.kanbanColumn ?: "upcoming_tasks" }
        val columnSpec = listOf(
            Triple("overdue_tasks", "Overdue", "#EF4444"),
            Triple("in_progress_tasks", "In Progress", "#F59E0B"),
            Triple("due_soon_tasks", "Due Soon", "#3B82F6"),
            Triple("upcoming_tasks", "Upcoming", "#6366F1"),
            Triple("completed_tasks", "Completed", "#10B981"),
            Triple("cancelled_tasks", "Cancelled", "#6B7280"),
        )
        TaskColumnsResponse(
            columns = columnSpec.map { (name, displayName, color) ->
                val items = grouped[name].orEmpty()
                TaskColumn(
                    name = name,
                    displayName = displayName,
                    buttonTypes = emptyList(),
                    icons = emptyMap(),
                    color = color,
                    tasks = items,
                    count = items.size,
                )
            },
            daysThreshold = 30,
            residenceId = "",
        )
    }

    // ==================== CONTRACTORS ====================

    val contractors: List<Contractor> = listOf(
        Contractor(
            id = 1,
            residenceId = primaryHome.id,
            createdById = 42,
            addedBy = 42,
            name = "Marisol Rivera",
            company = "Madison Plumbing Co",
            phone = "608-555-0101",
            email = "info@madisonplumbing.example",
            website = "https://madisonplumbing.example",
            notes = "Fast response on weekends. Preferred for emergency calls.",
            streetAddress = "4421 E Washington Ave",
            city = "Madison",
            stateProvince = "WI",
            postalCode = "53704",
            specialties = listOf(contractorSpecialties[0]),
            rating = 4.8,
            isFavorite = true,
            isActive = true,
            taskCount = 3,
            createdAt = FIXED_ISO_TIMESTAMP,
            updatedAt = FIXED_ISO_TIMESTAMP,
        ),
        Contractor(
            id = 2,
            residenceId = primaryHome.id,
            createdById = 42,
            addedBy = 42,
            name = "Eli Park",
            company = "Bright Electric",
            phone = "608-555-0202",
            email = "contact@brightelectric.example",
            website = "https://brightelectric.example",
            notes = "Did the panel upgrade in 2024.",
            streetAddress = "102 S Park St",
            city = "Madison",
            stateProvince = "WI",
            postalCode = "53715",
            specialties = listOf(contractorSpecialties[1]),
            rating = 4.5,
            isFavorite = false,
            isActive = true,
            taskCount = 1,
            createdAt = FIXED_ISO_TIMESTAMP,
            updatedAt = FIXED_ISO_TIMESTAMP,
        ),
        Contractor(
            id = 3,
            residenceId = primaryHome.id,
            createdById = 42,
            addedBy = 42,
            name = "Dana Thompson",
            company = "North Winds HVAC",
            phone = "608-555-0303",
            email = "service@northwinds.example",
            website = "https://northwinds.example",
            notes = "Annual service contract renews in October.",
            streetAddress = "88 Commerce Ln",
            city = "Madison",
            stateProvince = "WI",
            postalCode = "53719",
            specialties = listOf(contractorSpecialties[2]),
            rating = 4.7,
            isFavorite = true,
            isActive = true,
            taskCount = 2,
            createdAt = FIXED_ISO_TIMESTAMP,
            updatedAt = FIXED_ISO_TIMESTAMP,
        ),
    )

    val contractorSummaries: List<ContractorSummary> = contractors.map { it.toSummary() }

    // ==================== DOCUMENTS ====================

    val documents: List<Document> = listOf(
        Document(
            id = 1,
            title = "Furnace Warranty",
            documentType = "warranty",
            description = "Trane XR80 10-year parts warranty.",
            fileName = "trane-warranty.pdf",
            fileSize = 245_000,
            mimeType = "application/pdf",
            modelNumber = "XR80-2019",
            serialNumber = "TRN-998112",
            vendor = "Trane",
            purchaseDate = daysFromFixed(-365 * 7),
            purchasePrice = 3_200.0,
            expiryDate = daysFromFixed(200),
            residenceId = primaryHome.id,
            residence = primaryHome.id,
            createdById = 42,
            isActive = true,
            createdAt = FIXED_ISO_TIMESTAMP,
            updatedAt = FIXED_ISO_TIMESTAMP,
            category = "hvac",
            itemName = "Gas Furnace",
            provider = "Trane",
            daysUntilExpiration = 200,
        ),
        Document(
            id = 2,
            title = "Dishwasher Warranty (expired)",
            documentType = "warranty",
            description = "Bosch SHE3AR76UC — original 1-year warranty, lapsed.",
            fileName = "bosch-warranty.pdf",
            fileSize = 180_000,
            mimeType = "application/pdf",
            modelNumber = "SHE3AR76UC",
            serialNumber = "BSH-44120",
            vendor = "Bosch",
            purchaseDate = daysFromFixed(-365 * 2),
            purchasePrice = 799.0,
            expiryDate = daysFromFixed(-30),
            residenceId = primaryHome.id,
            residence = primaryHome.id,
            createdById = 42,
            isActive = true,
            createdAt = FIXED_ISO_TIMESTAMP,
            updatedAt = FIXED_ISO_TIMESTAMP,
            category = "appliance",
            itemName = "Dishwasher",
            provider = "Bosch",
            daysUntilExpiration = -30,
        ),
        Document(
            id = 3,
            title = "HVAC Manual",
            documentType = "manual",
            description = "Owner's manual for the furnace + condenser pair.",
            fileName = "trane-manual.pdf",
            fileSize = 1_450_000,
            mimeType = "application/pdf",
            residenceId = primaryHome.id,
            residence = primaryHome.id,
            createdById = 42,
            isActive = true,
            createdAt = FIXED_ISO_TIMESTAMP,
            updatedAt = FIXED_ISO_TIMESTAMP,
            category = "hvac",
            itemName = "Gas Furnace",
        ),
        Document(
            id = 4,
            title = "Microwave Manual",
            documentType = "manual",
            description = "Over-range microwave installation & user guide.",
            fileName = "microwave-manual.pdf",
            fileSize = 520_000,
            mimeType = "application/pdf",
            residenceId = primaryHome.id,
            residence = primaryHome.id,
            createdById = 42,
            isActive = true,
            createdAt = FIXED_ISO_TIMESTAMP,
            updatedAt = FIXED_ISO_TIMESTAMP,
            category = "appliance",
            itemName = "Microwave",
        ),
        Document(
            id = 5,
            title = "Well Pump Service Log",
            documentType = "manual",
            description = "Yearly inspection notes for the lake cabin's well pump.",
            fileName = "well-pump-log.pdf",
            fileSize = 95_000,
            mimeType = "application/pdf",
            residenceId = lakeCabin.id,
            residence = lakeCabin.id,
            createdById = 42,
            isActive = true,
            createdAt = FIXED_ISO_TIMESTAMP,
            updatedAt = FIXED_ISO_TIMESTAMP,
            category = "plumbing",
            itemName = "Well Pump",
        ),
    )

    val documentsByResidence: Map<Int, List<Document>> = documents.groupBy { it.residenceId ?: it.residence }

    // ==================== TOTAL SUMMARY ====================

    val totalSummary: TotalSummary = TotalSummary(
        totalResidences = residences.size,
        totalTasks = tasks.size,
        totalPending = tasks.count { !(it.kanbanColumn == "completed_tasks" || it.kanbanColumn == "cancelled_tasks") },
        totalOverdue = tasks.count { it.kanbanColumn == "overdue_tasks" },
        tasksDueNextWeek = tasks.count { it.kanbanColumn == "due_soon_tasks" },
        tasksDueNextMonth = tasks.count { it.kanbanColumn == "due_soon_tasks" },
    )

    // ==================== SUBSCRIPTION ====================

    private val tierLimits: Map<String, TierLimits> = mapOf(
        "free" to TierLimits(properties = 1, tasks = 10, contractors = 3, documents = 5),
        "pro" to TierLimits(properties = null, tasks = null, contractors = null, documents = null),
    )

    val freeSubscription: SubscriptionStatus = SubscriptionStatus(
        tier = "free",
        isActive = true,
        usage = UsageStats(
            propertiesCount = 0,
            tasksCount = 0,
            contractorsCount = 0,
            documentsCount = 0,
        ),
        limits = tierLimits,
        limitationsEnabled = true,
    )

    val premiumSubscription: SubscriptionStatus = SubscriptionStatus(
        tier = "pro",
        isActive = true,
        subscribedAt = daysFromFixed(-120),
        expiresAt = daysFromFixed(245),
        autoRenew = true,
        usage = UsageStats(
            propertiesCount = residences.size,
            tasksCount = tasks.size,
            contractorsCount = contractors.size,
            documentsCount = documents.size,
        ),
        limits = tierLimits,
        limitationsEnabled = false,
        trialActive = false,
        subscriptionSource = "apple",
    )

    // ==================== FEATURE BENEFITS ====================

    val featureBenefits: List<FeatureBenefit> = listOf(
        FeatureBenefit(
            featureName = "Residences",
            freeTierText = "Up to 1 property",
            proTierText = "Unlimited properties",
        ),
        FeatureBenefit(
            featureName = "Tasks",
            freeTierText = "10 active tasks",
            proTierText = "Unlimited tasks",
        ),
        FeatureBenefit(
            featureName = "Contractors",
            freeTierText = "3 contractors",
            proTierText = "Unlimited contractors",
        ),
        FeatureBenefit(
            featureName = "Documents",
            freeTierText = "5 documents",
            proTierText = "Unlimited documents",
        ),
    )

    // ==================== TASK TEMPLATES ====================

    val taskTemplates: List<TaskTemplate> = listOf(
        TaskTemplate(
            id = 1,
            title = "Replace HVAC filter",
            description = "Swap out furnace/AC air filter.",
            categoryId = 3,
            category = taskCategories[2],
            frequencyId = 3,
            frequency = taskFrequencies[2],
            iconIos = "air.purifier",
            iconAndroid = "hvac",
            tags = listOf("hvac", "seasonal"),
            displayOrder = 1,
        ),
        TaskTemplate(
            id = 2,
            title = "Clean gutters",
            description = "Clear leaves and debris from gutters and downspouts.",
            categoryId = 4,
            category = taskCategories[3],
            frequencyId = 3,
            frequency = taskFrequencies[2],
            iconIos = "house.fill",
            iconAndroid = "home",
            tags = listOf("exterior", "seasonal"),
            displayOrder = 2,
        ),
    )

    val taskTemplatesGrouped: TaskTemplatesGroupedResponse = TaskTemplatesGroupedResponse(
        categories = listOf(
            TaskTemplateCategoryGroup(
                categoryName = "HVAC",
                categoryId = 3,
                templates = taskTemplates.filter { it.categoryId == 3 },
                count = taskTemplates.count { it.categoryId == 3 },
            ),
            TaskTemplateCategoryGroup(
                categoryName = "Exterior",
                categoryId = 4,
                templates = taskTemplates.filter { it.categoryId == 4 },
                count = taskTemplates.count { it.categoryId == 4 },
            ),
        ),
        totalCount = taskTemplates.size,
    )
}
