import pytz
import datetime
from fixture import DataSet, NamedDataStyle, SQLAlchemyFixture

from pmg.models import db, House, Committee, CommitteeMeeting  # noqa

THIS_YEAR = datetime.datetime.today().year


class HouseData(DataSet):
    class joint:
        name = 'Joint (NA + NCOP)'
        name_short = 'Joint'
        sphere = 'national'

    class ncop:
        name = 'National Council of Provinces'
        name_short = 'NCOP'
        sphere = 'national'

    class na:
        name = 'National Assembly'
        name_short = 'NA'
        sphere = 'national'

    class president:
        name = 'The President\'s Office',
        name_short = 'President'
        sphere = 'national'


class CommitteeData(DataSet):
    class communications:
        name = 'Communications'
        house = HouseData.na
        premium = True

    class arts:
        name = 'Arts and Culture'
        house = HouseData.na


class CommitteeMeetingData(DataSet):
    class public:
        date = datetime.datetime(2016, 11, 5, 0, 0, 0, tzinfo=pytz.utc)
        title = 'Public meeting'
        committee = CommitteeData.arts

    class premium_recent:
        date = datetime.datetime(THIS_YEAR, 11, 5, 0, 0, 0, tzinfo=pytz.utc)
        title = 'Premium meeting recent'
        committee = CommitteeData.communications

    class premium_old:
        date = datetime.datetime(THIS_YEAR - 2, 11, 5, 0, 0, 0, tzinfo=pytz.utc)
        title = 'Premium meeting old'
        committee = CommitteeData.communications


dbfixture = SQLAlchemyFixture(
    env=globals(),
    style=NamedDataStyle(),
    engine=db.engine,
    scoped_session=db.Session)

@@ -146,16 +146,32 @@
 eMeeting
+, Bill, BillType
   # noqa
@@ -1367,32 +1367,45 @@
 tetime.datetime(
+%0A            
 THIS_YEAR - 2, 1
@@ -1525,16 +1525,1170 @@
 tions%0A%0A%0A
+class BillTypeData(DataSet):%0A    class section_74:%0A        name = %22Section 74%22%0A        prefix = %22B%22%0A        description = %22Section 74%22%0A%0A    class section_77:%0A        name = %22Section 77%22%0A        prefix = %22B%22%0A        description = %22Section 77%22%0A%0A    class private_member_bill_74:%0A        name = %22Private Member Bill: S74%22%0A        prefix = 'PMB'%0A        description = 'Private Member Bill: Section 74'%0A%0A    class private_member_bill_77:%0A        name = 'Private Member Bill: S77'%0A        prefix = 'PMB'%0A        description = 'Private Member Bill: Section 77'%0A%0A%0Aclass BillData(DataSet):%0A    %22%22%22%0A    Enter various types of bills%0A    %22%22%22%0A%0A    class food:%0A        year = 2019%0A        title = %22Food and Health Bill%22%0A        type = BillTypeData.section_74%0A%0A    class farm:%0A        year = 2019%0A        title = 'Farm and Agricultural Bill'%0A        type = BillTypeData.section_77%0A%0A    class public:%0A        year = 2019%0A        title = 'Public Investment Corporation Amendment Bill'%0A        type = BillTypeData.private_member_bill_74%0A%0A    class child:%0A        year = 2019%0A        title = %22Children's Amendment Bill%22%0A        type = BillTypeData.private_member_bill_77%0A%0A%0A
 dbfixtur

add some data for bills