from web.models import ProductLegislation

PRODUCT_LEGISLATION_FIELDS = [
    "name",
    "is_active",
    "is_biocidal",
    "is_eu_cosmetics_regulation",
    "is_biocidal_claim",
    "gb_legislation",
    "ni_legislation",
]

PRODUCT_LEGISLATION_DATA = [
    (
        "Aerosol Dispensers Regulations 2009/ 2824 as retained in UK law",
        True,
        False,
        False,
        False,
        True,
        True,
    ),
    ("Biocide Products Regulation 528/2012 (EU BPR)", True, True, False, False, False, True),
    (
        "Biocide Products Regulation 528/2012 as retained in UK law",
        True,
        True,
        False,
        False,
        True,
        False,
    ),
    (
        "Chemicals (Hazard Information and Packaging for Supply) Regulations 2009",
        True,
        False,
        False,
        False,
        True,
        True,
    ),
    (
        "Commission Directive 2011/8/EU amending Directive 2002/72/EC as regards the restriction of use of Bisphenol A in plastic infant feeding bottles",
        True,
        False,
        False,
        False,
        True,
        True,
    ),
    (
        "Commission Regulation (EU) No 10/2011 on plastic materials and articles intended to come into contact with food",
        True,
        False,
        False,
        False,
        True,
        True,
    ),
    (
        "Commission Regulation (EU) No 284/2011 laying down specific conditions and detailed procedures for the import of polyamide and melamine plastic kitchenware originating in or consigned from the People’s Republic of China and Hong Kong Special Administrative Region, China",
        True,
        False,
        False,
        False,
        True,
        True,
    ),
    (
        "Council Directive 75/324/EEC of 20 May 1975 on the approximation of the laws of the Member States relating to aerosol dispensers and Aerosol Dispensers Regulations 2009/ 2824 as amended from time to time.",
        True,
        False,
        False,
        False,
        False,
        True,
    ),
    (
        "Council Directive 84/500/EEC on the approximation of the laws of the Member States relating to ceramic articles intended to come into contact with foodstuffs",
        True,
        False,
        False,
        False,
        True,
        True,
    ),
    (
        "Council Directive 89/686/EEC on the approximation of the laws of the Member States relating to personal protective equipment",
        True,
        False,
        False,
        False,
        True,
        True,
    ),
    (
        "Council Directive 93/42/EEC concerning medical devices",
        True,
        False,
        False,
        False,
        True,
        True,
    ),
    (
        "Directive 2011/65/EU on the restriction of the use of certain hazardous substances in electrical and electronic equipment",
        True,
        False,
        False,
        False,
        True,
        True,
    ),
    ("Electromagnetic Compatibility Directive 2006", True, False, False, False, True, True),
    (
        "EN 301 489-1 V1.9.2 - Electromagnetic compatibility and Radio spectrum Matters (ERM); Electromagnetic Compatibility (EMC) standard for radio equipment and services; Part 1: Common technical requirements",
        True,
        False,
        False,
        False,
        True,
        True,
    ),
    (
        "EN 301 489-6 V1.3.1 - Electromagnetic compatibility and Radio spectrum Matters (ERM); Electromagnetic Compatibility (EMC) standard for radio equipment and services; Part 6: Specific conditions for Digital Enhanced Cordless Telecommunications (DECT) equipment",
        True,
        False,
        False,
        False,
        True,
        True,
    ),
    (
        "EU Cosmetics Regulation 1223/2009 as amended from time to time",
        True,
        False,
        False,
        True,
        False,
        True,
    ),
    (
        "EU Cosmetics Regulation 1223/2009 as retained in UK law",
        True,
        False,
        False,
        True,
        True,
        True,
    ),
    ("General Product Safety Directive 2001/95/EC", True, False, False, False, True, True),
    ("IVD Directive 98/79/EC", True, False, False, False, True, True),
    ("Low Voltage Directive 2006/95/EEC", True, False, False, False, True, True),
    ("Pressure Equipment Directive 97/23/EC", True, False, False, False, True, True),
    ("Regulation (EC) 648/2004 on Detergents", True, False, False, False, True, True),
    (
        "Regulation (EC) No 1272/2008 on classification, labelling and packaging of substances and mixtures (CLP)",
        True,
        False,
        False,
        False,
        True,
        True,
    ),
    (
        "Regulation (EC) No 1907/2006 concerning the Registration, Evaluation, Authorisation and Restriction of Chemicals (REACH)",
        True,
        False,
        False,
        False,
        True,
        True,
    ),
    (
        "Regulation (EC) No 1935/2004 on materials and articles intended to come into contact with food",
        True,
        False,
        False,
        False,
        True,
        True,
    ),
    ("Toy Safety Directive 2009/48/EC", True, False, False, False, True, True),
]


def add_product_legislation_data():
    ProductLegislation.objects.bulk_create(
        [
            ProductLegislation(**dict(zip(PRODUCT_LEGISLATION_FIELDS, pl_data)))
            for pl_data in PRODUCT_LEGISLATION_DATA
        ]
    )
