import { ActivityInfoEntity } from '../../../../activity/domain/entities/activity_info_entity';
import { StateDataSource } from '../../../domain/datasources/state_datasource';
import { StateEntity } from '../../../domain/entities/state_entity';
import { TownEntity } from '../../../domain/entities/town_entity';

export class StateDataSourceDev implements StateDataSource {
    getTowns(stateId: number): Promise<TownEntity[]> {
        return new Promise((resolve) => {
            resolve(towns.filter(town => town.stateId === stateId));
        });
    }
    getStates(): Promise<StateEntity[]> {
        return new Promise((resolve) => {
            resolve(states);
        });
    }
    getTownActivities(townId: number): Promise<ActivityInfoEntity[]> {
        return new Promise((resolve) => {
            resolve(activities.filter(activity => activity.townId === townId));
        });
    }
    getActivityInfo(activityId: number): Promise<ActivityInfoEntity | undefined> {
        return new Promise((resolve) => {
            resolve(activities.find(activity => activity.id === activityId));
        });
    }
}

const states: StateEntity[] = [
    {
        id: 1, 
        name: 'Zacatecas',
        imageUri: 'https://www.mexicodesconocido.com.mx/wp-content/uploads/2010/07/Catedral-_Plaza-de-armas-scaled.jpg'
    },
    {
        id: 2, 
        name: 'Aguascalientes',
        imageUri: 'https://www.gob.mx/cms/uploads/article/main_image/103003/fundacion-ags.jpg'
    },
    {
        id: 3, 
        name: 'Durango',
        imageUri: 'https://upload.wikimedia.org/wikipedia/commons/thumb/7/78/Panoramica_plaza_de_armas_Durango.jpg/288px-Panoramica_plaza_de_armas_Durango.jpg'
    }
];

// Towns es una lista de pueblos mágicos de cada estado
const towns: TownEntity[] = [
    {
        id: 1,
        name: 'Jerez',
        imageUri: 'https://www.lugaresturisticosenmexico.com/wp-content/uploads/2022/04/Jerez-Zacatecas-Pueblo-Magico-2.jpg',
        description: 'Jerez es un municipio del estado de Zacatecas, México. Es uno de los 58 municipios del estado y su cabecera es la ciudad de Jerez de García Salinas. Jerez es conocido por su arquitectura colonial y su gastronomía.',
        stateId: 1,
    },
    {
        id: 2,
        name: 'Calvillo',
        imageUri: 'https://www.mexicodesconocido.com.mx/wp-content/uploads/2014/04/aguascalientes_pueblo_magico_calvillo_plaza_principal_ig.jpg',
        stateId: 2,
    },
    {
        id: 3,
        name: 'Mapimí',
        imageUri: 'https://www.debate.com.mx/__export/1689796560699/sites/debate/img/2023/07/19/mapimx.jpg_759710130.jpg',
        stateId: 3,
    },
    {
        id: 4,
        name: 'Jalpa',
        imageUri: 'https://www.liderempresarial.com/wp-content/uploads/2022/12/Jalpa-1140x570.jpg',
        stateId: 1,
    }
];

// Activities es una lista de actividades turísticas de cada pueblo mágico

const activities: ActivityInfoEntity[] = [
    {
        id: 1,
        name: 'Santuario de Nuestra Señora de la Soledad',
        description: 'Santuario de Nuestra Señora de la Soledad en Jerez',
        townId: 1,
        available: 'Todo el año',
        location: 'Jerez, Zacatecas',
        imageUri: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSAOt4JS0AzrMsxDp0caz26vuanMq692g17nbI6-_nycw&s'
    },
    {
        id: 2,
        name: 'Feria de la tostada',
        description: 'Feria de la tostada en Jerez',
        townId: 1,
        available: 'Septiembre',
        location: 'Jerez, Zacatecas',
        imageUri: 'https://www.liderempresarial.com/wp-content/uploads/2022/08/WhatsApp-Image-2022-08-03-at-4.14.35-PM-856x570.jpeg'
    }
]