# Project name
PROJECT_NAME = "claims-processing-dev"

# Attributes not required from specialized parser raw json
NOT_REQUIRED_ATTRIBUTES_FROM_SPECIALIZED_PARSER_RESPONSE = ["textStyles", "textChanges", "revisions",
                                                            "pages.image"]

# GCS temp folder to store async form parser output
GCS_OP_URI = "gs://async_form_parser"
FORM_PARSER_OP_TEMP_FOLDER = "temp"

"""

This is Document and state mapping dict
Default entities sections have entities that are coming from parser
Derived section have information of entities which are not extracted from parser and need to extract them by using pattern
Create state wise mapping if it form parser, and one doc type mapping if it is specialized parser

"""

MAPPING_DICT = {
    "arizona": {
        "default_entities": {
            "Social Security Number:": ["Social Security Number"],
            "Date:": ["Date"],
            "Primary Phone: ": ["Employee Primary Phone"],
            "First Name": ["Employee First Name"],
            "Last Name": ["Employee Last Name"],
            "Mailing Address (No., Street, Apt., P.O. Box) ": ["Employee Mailing Address (No., Street, Apt., P.O.Box)"],
            "E-MAIL Address (Optional but Encouraged) ": ["Employee E-MAIL Address (Optional but Encouraged)"],
            "Gender": ["Employee Gender"],
            "Race": ["Employee Race"],
            "Ethnicity": ["Employee Ethnicity"],
            "Language": ["Employee Language"],
            "Mailing Address (No., Street, Apt., P.O. Box, City)": [
                "Employer Mailing Address (No., Street, Apt., P.O.Box, City)"],
            "Date": ["Date"],
            "City": ["Employee Residence City", "Employee City"],
            "State": ["Employee State", "Employee Residence State"],
            "State": ["Employer State"],
            "Employer's Phone No.": ["Employer's Phone No."],
            "Claimant's Signature": ["Claimant's Signature"],
            "Company's Name ": ["Company's Name"],
            "ZIP": ["Employee Residence ZIP", "Employee ZIP", "Employer ZIP"],
            "Month": ["Employee DOB Month", "Month (Last Day of Work)"],
            "Day": ["Employee DOB Day", "Day (Last Day of Work)"],
            "Year": ["Employee DOB Year", "Year (Last Day of Work)"]
        }
    },
    "arkansas": {
        "default_entities": {
            "TODAY'S DATE": ["TODAY'S DATE"],
            "SOCIAL SECURITY NUMBER": ["SOCIAL SECURITY NUMBER"],
            "EFFECTIVE DATE: (Local Office Only)": ["EFFECTIVE DATE: (Local Office Only)"],
            "FIRST NAME": ["EMPLOYEE FIRST NAME"],
            "MIDDLE INITIAL": ["EMPLOYEE MIDDLE INITIAL"],
            "LAST NAME": ["EMPLOYEE LAST NAME"],
            "Mailing Address": ["EMPLOYEE Mailing Address"],
            "ZIP CODE": ["EMPLOYER ZIP CODE", "Current zip", "EMPLOYEE ZIP CODE"],
            "CITY": ["EMPLOYER CITY"],
            "State of Residence": ["Employee State of Residence"],
            "County of Residence": ["Employee County of Residence"],
            "DATE OF BIRTH": ["EMPLOYEE DATE OF BIRTH"],
            "EMPLOYER NAME": ["EMPLOYER NAME"],
            "STREET NAME": ["EMPLOYER STREET NAME"],
            "STATE": ["EMPLOYER STATE"],
            "COUNTY": ["EMPLOYER COUNTY"],
            "EMPLOYER PHONE": ["EMPLOYER PHONE"],
            "FIRST DATE WORKED AT YOUR LAST JOB": ["FIRST DATE WORKED AT YOUR LAST JOB"],
            "DATE LAST WORK ENDED": ["DATE LAST WORK ENDED"],
            "What kind of work did you do on your last job": ["What kind of work did you do on your last job?"],
            "Date": ["Date"],
            "Signature": ["Signature"]
        }
    },
    "driver_license": {
        "default_entities": {
            "Document Id": ["DLN"],
            "Expiration Date": ["EXP"],
            "Date Of Birth": ["DOB"],
            "Family Name": ["LN"],
            "Given Names": ["FN"],
            "Issue Date": ["ISS"],
            "Address": ["Address"],
        },
        "derived_entities": {"SEX": {"rule": "SEX.*?(?<!\w)(F|M)(?!\w)"}}
    },
    "payslip": {
        "default_entities": {
            "employee_address": ["EMPLOYER ADDRESS"],
            "employee_name": ["EMPLOYEE NAME"],
            "employer_name": ["EMPLOYER NAME"],
            "end_date": ["PAY PERIOD(TO)"],
            "gross_earnings_ytd": ["YTD Gross"],
            "pay_date": ["PAY DATE"],
            "ssn": ["SSN"],
            "start_date": ["PAY PERIOD(FROM)"],
            "rate": ["RATE"],
            "hours": ["HOURS"]

        }
    }
}

@@ -1132,24 +1132,41 @@
 O. Box) %22: %5B
+%0A                
 %22Employee Ma
@@ -1265,24 +1265,41 @@
 uraged) %22: %5B
+%0A                
 %22Employee E-
@@ -3589,16 +3589,33 @@
  job%22: %5B
+%0A                
 %22What ki
@@ -4297,56 +4297,8 @@
 %22%5D,%0A
-            %22employer_name%22: %5B%22EMPLOYER NAME%22%5D,%0A
     
@@ -4498,25 +4498,25 @@
 (FROM)%22%5D
-,
+%0A
 %0A       
      %22ra
@@ -4511,71 +4511,207 @@
     
+ %7D,%0A
      
-%22rate%22: %5B%22RATE%22%5D,%0A            %22hours%22: %5B%22HOURS%22%5D%0A%0A        
+   %22derived_entities%22:%0A            %7B%22EMPLOYER NAME%22: %7B%22rule%22: %22(%5Ba-zA-Z %5D*)%5Cd*.*%22%7D,%0A             %22RATE%22: %7B%22rule%22: %22Regular%5Cn(.*?)%5Cn%22%7D,%0A             %22HOURS%22: %7B%22rule%22: %22Regular%5Cn.*?%5Cn(.*?)%5Cn%22%7D
 %7D%0A  

update config.py for derived entities in paystubs