from datetime import date

from . import base
from . import mixins


class TransformedRecord(mixins.GenericCompensationMixin, mixins.GenericDepartmentMixin,
                        mixins.GenericIdentifierMixin, mixins.GenericPersonMixin,
                        mixins.GenericJobTitleMixin,
                        mixins.MembershipMixin, mixins.OrganizationMixin, mixins.PostMixin,
                        mixins.RaceMixin, mixins.LinkMixin, base.BaseTransformedRecord):
    # They included people without compensation and have clarified they do not consider them employees
    REJECT_ALL_IF_INVALID_RECORD_EXISTS = False

    MAP = {
        'last_name': 'Last',
        'first_name': 'First Name',
        'id_number': 'ID',
        'job_title': 'Job Title',
        'department': 'Dept',
        'race': 'Ethnic Grp',
        'gender': 'Sex',
        'compensation_type': 'Full/Part',
        'hire_date': 'Start Date',
        'compensation': 'Total Comp Rate',
    }

    COMPENSATION_MAP = {
        'F': 'FT',
        'P': 'PT'
    }

    description = 'Total compensation rate'

    NAME_FIELDS = ('first_name', 'last_name', )

    ORGANIZATION_NAME = 'The University of Texas Health Science Center at Houston'

    # TODO current app uses University Hospital
    ORGANIZATION_CLASSIFICATION = 'University Hospital'

    DATE_PROVIDED = date(2015, 8, 10)

    is_valid = True

    URL = 'http://raw.texastribune.org.s3.amazonaws.com/ut_health_houston/salaries/2015-08/ut_health_science_center_houston.xlsx'

    @property
    def compensation_type(self):
        return self.COMPENSATION_MAP[self.get_mapped_value('compensation_type')]

transform = base.transform_factory(TransformedRecord)

@@ -86,16 +86,21 @@
 dRecord(
+%0A    
 mixins.G
@@ -115,32 +115,36 @@
 mpensationMixin,
+%0A   
  mixins.GenericD
@@ -159,36 +159,16 @@
 tMixin,%0A
-                    
     mixi
@@ -221,36 +221,16 @@
 nMixin,%0A
-                    
     mixi
@@ -254,36 +254,16 @@
 eMixin,%0A
-                    
     mixi
@@ -326,32 +326,16 @@
 tMixin,%0A
-                
         
@@ -399,16 +399,17 @@
 ecord):%0A
+%0A
     # Th
@@ -456,16 +456,22 @@
 and have
+%0A    #
  clarifi
@@ -1094,16 +1094,26 @@
 N_NAME =
+ (%0A       
  'The Un
@@ -1163,16 +1163,17 @@
 Houston'
+)
 %0A%0A    # 
@@ -1344,17 +1344,45 @@
 RL =
+ (%0A       
  'http
+s
 ://
+s3.amazonaws.com/
 raw.
@@ -1401,25 +1401,8 @@
 .org
-.s3.amazonaws.com
 /ut_
@@ -1416,16 +1416,27 @@
 houston/
+'%0A        '
 salaries
@@ -1443,51 +1443,54 @@
 /201
-5-08/ut_
+6-10/ut-
 health
-_
+-
 science
-_center_houston
+-houston-10-14-16
 .xlsx'
+)
 %0A%0A  
@@ -1571,16 +1571,29 @@
 ION_MAP%5B
+%0A            
 self.get

Add new URL, pep fixes