import datetime

from QA.AppDatabaseTester import AppDatabaseTester


class AppMergeTest(AppDatabaseTester):
    def __init__(self, config):
        end_date = datetime.datetime.strptime(config['DATES']['END_DATE'], '%Y%m%d')
        super().__init__(config, 'DATABASE', datetime.date(year=1976, month=1, day=1), end_date)
        self.table_config = {"application": {"id": {"null_allowed": False, "data_type": "varchar"},
                                             "document_number": {"null_allowed": False, "data_type": "bigint"},
                                             "type": {"null_allowed": True, "data_type": "varchar"},
                                             "application_number": {"null_allowed": True, "data_type": "varchar"},
                                             "date": {"null_allowed": True, "data_type": "date"},
                                             "country": {"null_allowed": True, "data_type": "varchar"},
                                             "kind": {"null_allowed": True, "data_type": "varchar"},
                                             "series_code": {"null_allowed": True, "data_type": "int"},
                                             "invention_title": {"null_allowed": True, "data_type": "mediumtext"},
                                             "invention_abstract": {"null_allowed": True, "data_type": "mediumtext"},
                                             "rule_47_flag": {"null_allowed": True, "data_type": "varchar"},
                                             "filename": {"null_allowed": True, "data_type": "varchar"},
                                             "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                             "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "botanic": {"id": {"null_allowed": False, "data_type": "varchar"},
                                         "document_number": {"null_allowed": False, "data_type": "bigint"},
                                         "latin_name": {"null_allowed": True, "data_type": "varchar"},
                                         "variety": {"null_allowed": True, "data_type": "varchar"},
                                         "filename": {"null_allowed": True, "data_type": "varchar"},
                                         "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                         "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                            "brf_sum_text": {"id": {"null_allowed": False, "data_type": "varchar"},
                                             "document_number": {"null_allowed": False, "data_type": "bigint"},
                                             "text": {"null_allowed": False, "data_type": "mediumtext"},
                                             "filename": {"null_allowed": True, "data_type": "varchar"},
                                             "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                             "updated_date": {"null_allowed": True, "data_type": "timestamp"}},


                             "claim": {"id": {"null_allowed": False, "data_type": "varchar"},
                                       "document_number": {"null_allowed": False, "data_type": "bigint"},
                                       "text": {"null_allowed": False, "data_type": "mediumtext"},
                                       "sequence": {"null_allowed": False, "data_type": "int"},
                                       "dependent": {"null_allowed": True, "data_type": "varchar"},
                                       "filename": {"null_allowed": True, "data_type": "varchar"},
                                       "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                       "updated_date": {"null_allowed": True, "data_type": "timestamp"},
                                       "num": {"null_allowed": True, "data_type": "varchar"}},

                             "cpa": {"id": {"null_allowed": False, "data_type": "varchar"},
                                     "document_number": {"null_allowed": False, "data_type": "bigint"},
                                     "data": {"null_allowed": False, "data_type": "varchar"},
                                     "filename": {"null_allowed": True, "data_type": "varchar"},
                                     "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                     "updated_date": {"null_allowed": True, "data_type": "timestamp"},
                                     "num": {"null_allowed": True, "data_type": "varchar"}},

                             "cpc": {"id": {"null_allowed": False, "data_type": "varchar"},
                                     "document_number": {"null_allowed": False, "data_type": "bigint"},
                                     "sequence": {"null_allowed": False, "data_type": "int"},
                                     "version": {"null_allowed": True, "data_type": "date"},
                                     "section": {"null_allowed": True, "data_type": "varchar"},
                                     "class": {"null_allowed": True, "data_type": "varchar"},
                                     "subclass": {"null_allowed": True, "data_type": "varchar"},
                                     "main_group": {"null_allowed": True, "data_type": "varchar"},
                                     "subgroup": {"null_allowed": True, "data_type": "varchar"},
                                     "symbol_position": {"null_allowed": True, "data_type": "varchar"},
                                     "value": {"null_allowed": True, "data_type": "varchar"},
                                     "category": {"null_allowed": True, "data_type": "varchar"},
                                     "action_date": {"null_allowed": True, "data_type": "date"},
                                     "filename": {"null_allowed": True, "data_type": "varchar"},
                                     "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                     "updated_date": {"null_allowed": True, "data_type": "timestamp"},
                                     "num": {"null_allowed": True, "data_type": "varchar"}},

                             "detail_desc_text": {"id": {"null_allowed": False, "data_type": "varchar"},
                                                  "document_number": {"null_allowed": False, "data_type": "bigint"},
                                                  "text": {"null_allowed": False, "data_type": "mediumtext"},
                                                  "length": {"null_allowed": False, "data_type": "bigint"},
                                                  "filename": {"null_allowed": True, "data_type": "varchar"},
                                                  "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                                  "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "draw_desc_text": {"id": {"null_allowed": False, "data_type": "varchar"},
                                                "document_number": {"null_allowed": False, "data_type": "bigint"},
                                                "text": {"null_allowed": False, "data_type": "mediumtext"},
                                                "filename": {"null_allowed": True, "data_type": "varchar"},
                                                "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                                "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "foreign_priority": {"id": {"null_allowed": False, "data_type": "varchar"},
                                                  "document_number": {"null_allowed": False, "data_type": "bigint"},
                                                  "country": {"null_allowed": True, "data_type": "varchar"},
                                                  "date": {"null_allowed": True, "data_type": "date"},
                                                  "foreign_doc_number": {"null_allowed": True, "data_type": "varchar"},
                                                  "filename": {"null_allowed": True, "data_type": "varchar"},
                                                  "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                                  "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "further_cpc": {"id": {"null_allowed": False, "data_type": "varchar"},
                                             "document_number": {"null_allowed": False, "data_type": "bigint"},
                                             "sequence": {"null_allowed": False, "data_type": "int"},
                                             "version": {"null_allowed": True, "data_type": "date"},
                                             "section": {"null_allowed": True, "data_type": "varchar"},
                                             "class": {"null_allowed": True, "data_type": "varchar"},
                                             "subclass": {"null_allowed": True, "data_type": "varchar"},
                                             "main_group": {"null_allowed": True, "data_type": "varchar"},
                                             "subgroup": {"null_allowed": True, "data_type": "varchar"},
                                             "symbol_position": {"null_allowed": True, "data_type": "varchar"},
                                             "value": {"null_allowed": True, "data_type": "varchar"},
                                             "category": {"null_allowed": True, "data_type": "varchar"},
                                             "action_date": {"null_allowed": True, "data_type": "date"},
                                             "filename": {"null_allowed": True, "data_type": "varchar"},
                                             "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                             "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "ipcr": {"id": {"null_allowed": False, "data_type": "varchar"},
                                      "document_number": {"null_allowed": False, "data_type": "bigint"},
                                      "sequence": {"null_allowed": False, "data_type": "int"},
                                      "version": {"null_allowed": True, "data_type": "date"},
                                      "class_level": {"null_allowed": True, "data_type": "varchar"},
                                      "section": {"null_allowed": True, "data_type": "varchar"},
                                      "class": {"null_allowed": True, "data_type": "varchar"},
                                      "subclass": {"null_allowed": True, "data_type": "varchar"},
                                      "main_group": {"null_allowed": True, "data_type": "varchar"},
                                      "subgroup": {"null_allowed": True, "data_type": "varchar"},
                                      "symbol_position": {"null_allowed": True, "data_type": "varchar"},
                                      "class_value": {"null_allowed": True, "data_type": "varchar"},
                                      "category": {"null_allowed": True, "data_type": "varchar"},
                                      "action_date": {"null_allowed": True, "data_type": "date"},
                                      "class_status": {"null_allowed": True, "data_type": "varchar"},
                                      "class_data_source": {"null_allowed": True, "data_type": "varchar"},
                                      "filename": {"null_allowed": True, "data_type": "varchar"},
                                      "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                      "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "lawyer": {"id": {"null_allowed": False, "data_type": "varchar"},
                                        "document_number": {"null_allowed": False, "data_type": "bigint"},
                                        "name_first": {"null_allowed": False, "data_type": "varchar"},
                                        "name_last": {"null_allowed": False, "data_type": "varchar"},
                                        "organization": {"null_allowed": False, "data_type": "varchar"},
                                        "sequence": {"null_allowed": False, "data_type": "int"},
                                        "rawlocation_id": {"null_allowed": False, "data_type": "varchar"},
                                        "city": {"null_allowed": False, "data_type": "varchar"},
                                        "state": {"null_allowed": False, "data_type": "varchar"},
                                        "country": {"null_allowed": False, "data_type": "varchar"},
                                        "filename": {"null_allowed": True, "data_type": "varchar"},
                                        "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                        "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "main_cpc": {"id": {"null_allowed": False, "data_type": "varchar"},
                                          "document_number": {"null_allowed": False, "data_type": "bigint"},
                                          "sequence": {"null_allowed": False, "data_type": "int"},
                                          "version": {"null_allowed": True, "data_type": "date"},
                                          "section": {"null_allowed": True, "data_type": "varchar"},
                                          "class": {"null_allowed": True, "data_type": "varchar"},
                                          "subclass": {"null_allowed": True, "data_type": "varchar"},
                                          "main_group": {"null_allowed": True, "data_type": "varchar"},
                                          "subgroup": {"null_allowed": True, "data_type": "varchar"},
                                          "symbol_position": {"null_allowed": True, "data_type": "varchar"},
                                          "value": {"null_allowed": True, "data_type": "varchar"},
                                          "category": {"null_allowed": True, "data_type": "varchar"},
                                          "action_date": {"null_allowed": True, "data_type": "date"},
                                          "filename": {"null_allowed": True, "data_type": "varchar"},
                                          "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                          "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "pct_data": {"id": {"null_allowed": False, "data_type": "varchar"},
                                          "document_number": {"null_allowed": False, "data_type": "bigint"},
                                          "pct_doc_number": {"null_allowed": True, "data_type": "varchar"},
                                          "country": {"null_allowed": True, "data_type": "varchar"},
                                          "date": {"null_allowed": True, "data_type": "date"},
                                          "us_371c124_date": {"null_allowed": True, "data_type": "date"},
                                          "us_371c12_date": {"null_allowed": True, "data_type": "date"},
                                          "kind": {"null_allowed": True, "data_type": "varchar"},
                                          "doc_type": {"null_allowed": True, "data_type": "varchar"},
                                          "filename": {"null_allowed": True, "data_type": "varchar"},
                                          "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                          "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "publication": {"id": {"null_allowed": False, "data_type": "varchar"},
                                             "document_number": {"null_allowed": False, "data_type": "bigint"},
                                             "date": {"null_allowed": True, "data_type": "date"},
                                             "country": {"null_allowed": True, "data_type": "varchar"},
                                             "kind": {"null_allowed": True, "data_type": "varchar"},
                                             "filing_type": {"null_allowed": True, "data_type": "varchar"},
                                             "filename": {"null_allowed": True, "data_type": "varchar"},
                                             "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                             "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "rawassignee": {"id": {"null_allowed": False, "data_type": "varchar"},
                                             "document_number": {"null_allowed": False, "data_type": "bigint"},
                                             "sequence": {"null_allowed": False, "data_type": "int"},
                                             "name_first": {"null_allowed": False, "data_type": "varchar"},
                                             "name_last": {"null_allowed": False, "data_type": "varchar"},
                                             "organization": {"null_allowed": False, "data_type": "varchar"},
                                             "type": {"null_allowed": False, "data_type": "int"},
                                             "rawlocation_id": {"null_allowed": False, "data_type": "varchar"},
                                             "city": {"null_allowed": False, "data_type": "varchar"},
                                             "state": {"null_allowed": False, "data_type": "varchar"},
                                             "country": {"null_allowed": False, "data_type": "varchar"},
                                             "filename": {"null_allowed": True, "data_type": "varchar"},
                                             "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                             "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "rawinventor" :  {"id": {"null_allowed": False, "data_type": "varchar"},
                                               "document_number": {"null_allowed": False, "data_type": "bigint"},
                                               "name_first": {"null_allowed": False, "data_type": "varchar"},
                                               "name_last": {"null_allowed": False, "data_type": "varchar"},
                                               "sequence": {"null_allowed": False, "data_type": "int"},
                                               "designation": {"null_allowed": False, "data_type": "varchar"},
                                               "deceased": {"null_allowed": False, "data_type": "varchar"},
                                               "rawlocation_id": {"null_allowed": False, "data_type": "varchar"},
                                               "city": {"null_allowed": False, "data_type": "varchar"},
                                               "state": {"null_allowed": False, "data_type": "varchar"},
                                               "country": {"null_allowed": False, "data_type": "varchar"},
                                               "filename": {"null_allowed": True, "data_type": "varchar"},
                                               "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                               "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "rawlocation": {"id": {"null_allowed": False, "data_type": "varchar"},
                                             "city": {"null_allowed": False, "data_type": "varchar"},
                                             "state": {"null_allowed": False, "data_type": "varchar"},
                                             "country": {"null_allowed": False, "data_type": "varchar"},
                                             "latitude": {"null_allowed": True, "data_type": "float"},
                                             "longitude": {"null_allowed": True, "data_type": "float"},
                                             "filename": {"null_allowed": True, "data_type": "varchar"},
                                             "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                             "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "rawuspc": {"id": {"null_allowed": False, "data_type": "varchar"},
                                         "document_number": {"null_allowed": False, "data_type": "bigint"},
                                         "classification": {"null_allowed": False, "data_type": "varchar"},
                                         "sequence": {"null_allowed": False, "data_type": "int"},
                                         "filename": {"null_allowed": True, "data_type": "varchar"},
                                         "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                         "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "rel_app_text": {"id": {"null_allowed": False, "data_type": "varchar"},
                                              "document_number": {"null_allowed": False, "data_type": "bigint"},
                                              "text": {"null_allowed": False, "data_type": "mediumtext"},
                                              "filename": {"null_allowed": True, "data_type": "varchar"},
                                              "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                              "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "us_parties": {"id": {"null_allowed": False, "data_type": "varchar"},
                                            "document_number": {"null_allowed": False, "data_type": "bigint"},
                                            "name_first": {"null_allowed": False, "data_type": "varchar"},
                                            "name_last": {"null_allowed": False, "data_type": "varchar"},
                                            "sequence": {"null_allowed": False, "data_type": "int"},
                                            "rawlocation_id": {"null_allowed": False, "data_type": "varchar"},
                                            "city": {"null_allowed": False, "data_type": "varchar"},
                                            "state": {"null_allowed": False, "data_type": "varchar"},
                                            "country": {"null_allowed": False, "data_type": "varchar"},
                                            "filename": {"null_allowed": True, "data_type": "varchar"},
                                            "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                            "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "uspc": {"id": {"null_allowed": False, "data_type": "varchar"},
                                      "document_number": {"null_allowed": False, "data_type": "bigint"},
                                      "mainclass_id": {"null_allowed": False, "data_type": "varchar"},
                                      "subclass_id": {"null_allowed": False, "data_type": "varchar"},
                                      "sequence": {"null_allowed": False, "data_type": "int"},
                                      "filename": {"null_allowed": True, "data_type": "varchar"},
                                      "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                      "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "usreldoc": {"id": {"null_allowed": False, "data_type": "varchar"},
                                          "document_number": {"null_allowed": False, "data_type": "bigint"},
                                          "related_doc_number": {"null_allowed": False, "data_type": "varchar"},
                                          "country": {"null_allowed": False, "data_type": "varchar"},
                                          "doc_type": {"null_allowed": False, "data_type": "varchar"},
                                          "date": {"null_allowed": False, "data_type": "date"},
                                          "filename": {"null_allowed": True, "data_type": "varchar"},
                                          "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                          "updated_date": {"null_allowed": True, "data_type": "timestamp"}}
                             }


        self.count_data = []
        self.floating_entities = []
        self.floating_patent = []

    def test_yearly_count(self):
        pass


class AppUploadTest(AppDatabaseTester):
    def __init__(self, config):
        start_date = datetime.datetime.strptime(config['DATES']['END_DATE'], '%Y%m%d')
        end_date = datetime.datetime.strptime(config['DATES']['END_DATE'], '%Y%m%d')
        super().__init__(config, 'TEMP_UPLOAD_DB', start_date, end_date)
        self.table_config = {"application": {"id": {"null_allowed": False, "data_type": "varchar"},
                                             "document_number": {"null_allowed": False, "data_type": "bigint"},
                                             "type": {"null_allowed": True, "data_type": "varchar"},
                                             "application_number": {"null_allowed": True, "data_type": "varchar"},
                                             "date": {"null_allowed": True, "data_type": "date"},
                                             "country": {"null_allowed": True, "data_type": "varchar"},
                                             "kind": {"null_allowed": True, "data_type": "varchar"},
                                             "series_code": {"null_allowed": True, "data_type": "int"},
                                             "invention_title": {"null_allowed": True, "data_type": "mediumtext"},
                                             "invention_abstract": {"null_allowed": True, "data_type": "mediumtext"},
                                             "rule_47_flag": {"null_allowed": True, "data_type": "varchar"},
                                             "filename": {"null_allowed": True, "data_type": "varchar"},
                                             "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                             "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "botanic": {"id": {"null_allowed": False, "data_type": "varchar"},
                                         "document_number": {"null_allowed": False, "data_type": "bigint"},
                                         "latin_name": {"null_allowed": True, "data_type": "varchar"},
                                         "variety": {"null_allowed": True, "data_type": "varchar"},
                                         "filename": {"null_allowed": True, "data_type": "varchar"},
                                         "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                         "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                            "brf_sum_text": {"id": {"null_allowed": False, "data_type": "varchar"},
                                             "document_number": {"null_allowed": False, "data_type": "bigint"},
                                             "text": {"null_allowed": False, "data_type": "mediumtext"},
                                             "filename": {"null_allowed": True, "data_type": "varchar"},
                                             "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                             "updated_date": {"null_allowed": True, "data_type": "timestamp"}},


                             "claim": {"id": {"null_allowed": False, "data_type": "varchar"},
                                       "document_number": {"null_allowed": False, "data_type": "bigint"},
                                       "text": {"null_allowed": False, "data_type": "mediumtext"},
                                       "sequence": {"null_allowed": False, "data_type": "int"},
                                       "dependent": {"null_allowed": True, "data_type": "varchar"},
                                       "filename": {"null_allowed": True, "data_type": "varchar"},
                                       "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                       "updated_date": {"null_allowed": True, "data_type": "timestamp"},
                                       "num": {"null_allowed": True, "data_type": "varchar"}},

                             "cpa": {"id": {"null_allowed": False, "data_type": "varchar"},
                                     "document_number": {"null_allowed": False, "data_type": "bigint"},
                                     "data": {"null_allowed": False, "data_type": "varchar"},
                                     "filename": {"null_allowed": True, "data_type": "varchar"},
                                     "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                     "updated_date": {"null_allowed": True, "data_type": "timestamp"},
                                     "num": {"null_allowed": True, "data_type": "varchar"}},

                             "cpc": {"id": {"null_allowed": False, "data_type": "varchar"},
                                     "document_number": {"null_allowed": False, "data_type": "bigint"},
                                     "sequence": {"null_allowed": False, "data_type": "int"},
                                     "version": {"null_allowed": True, "data_type": "date"},
                                     "section": {"null_allowed": True, "data_type": "varchar"},
                                     "class": {"null_allowed": True, "data_type": "varchar"},
                                     "subclass": {"null_allowed": True, "data_type": "varchar"},
                                     "main_group": {"null_allowed": True, "data_type": "varchar"},
                                     "subgroup": {"null_allowed": True, "data_type": "varchar"},
                                     "symbol_position": {"null_allowed": True, "data_type": "varchar"},
                                     "value": {"null_allowed": True, "data_type": "varchar"},
                                     "category": {"null_allowed": True, "data_type": "varchar"},
                                     "action_date": {"null_allowed": True, "data_type": "date"},
                                     "filename": {"null_allowed": True, "data_type": "varchar"},
                                     "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                     "updated_date": {"null_allowed": True, "data_type": "timestamp"},
                                     "num": {"null_allowed": True, "data_type": "varchar"}},

                             "detail_desc_text": {"id": {"null_allowed": False, "data_type": "varchar"},
                                                  "document_number": {"null_allowed": False, "data_type": "bigint"},
                                                  "text": {"null_allowed": False, "data_type": "mediumtext"},
                                                  "length": {"null_allowed": False, "data_type": "bigint"},
                                                  "filename": {"null_allowed": True, "data_type": "varchar"},
                                                  "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                                  "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "draw_desc_text": {"id": {"null_allowed": False, "data_type": "varchar"},
                                                "document_number": {"null_allowed": False, "data_type": "bigint"},
                                                "text": {"null_allowed": False, "data_type": "mediumtext"},
                                                "filename": {"null_allowed": True, "data_type": "varchar"},
                                                "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                                "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "foreign_priority": {"id": {"null_allowed": False, "data_type": "varchar"},
                                                  "document_number": {"null_allowed": False, "data_type": "bigint"},
                                                  "country": {"null_allowed": True, "data_type": "varchar"},
                                                  "date": {"null_allowed": True, "data_type": "date"},
                                                  "foreign_doc_number": {"null_allowed": True, "data_type": "varchar"},
                                                  "filename": {"null_allowed": True, "data_type": "varchar"},
                                                  "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                                  "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "further_cpc": {"id": {"null_allowed": False, "data_type": "varchar"},
                                             "document_number": {"null_allowed": False, "data_type": "bigint"},
                                             "sequence": {"null_allowed": False, "data_type": "int"},
                                             "version": {"null_allowed": True, "data_type": "date"},
                                             "section": {"null_allowed": True, "data_type": "varchar"},
                                             "class": {"null_allowed": True, "data_type": "varchar"},
                                             "subclass": {"null_allowed": True, "data_type": "varchar"},
                                             "main_group": {"null_allowed": True, "data_type": "varchar"},
                                             "subgroup": {"null_allowed": True, "data_type": "varchar"},
                                             "symbol_position": {"null_allowed": True, "data_type": "varchar"},
                                             "value": {"null_allowed": True, "data_type": "varchar"},
                                             "category": {"null_allowed": True, "data_type": "varchar"},
                                             "action_date": {"null_allowed": True, "data_type": "date"},
                                             "filename": {"null_allowed": True, "data_type": "varchar"},
                                             "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                             "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "ipcr": {"id": {"null_allowed": False, "data_type": "varchar"},
                                      "document_number": {"null_allowed": False, "data_type": "bigint"},
                                      "sequence": {"null_allowed": False, "data_type": "int"},
                                      "version": {"null_allowed": True, "data_type": "date"},
                                      "class_level": {"null_allowed": True, "data_type": "varchar"},
                                      "section": {"null_allowed": True, "data_type": "varchar"},
                                      "class": {"null_allowed": True, "data_type": "varchar"},
                                      "subclass": {"null_allowed": True, "data_type": "varchar"},
                                      "main_group": {"null_allowed": True, "data_type": "varchar"},
                                      "subgroup": {"null_allowed": True, "data_type": "varchar"},
                                      "symbol_position": {"null_allowed": True, "data_type": "varchar"},
                                      "class_value": {"null_allowed": True, "data_type": "varchar"},
                                      "category": {"null_allowed": True, "data_type": "varchar"},
                                      "action_date": {"null_allowed": True, "data_type": "date"},
                                      "class_status": {"null_allowed": True, "data_type": "varchar"},
                                      "class_data_source": {"null_allowed": True, "data_type": "varchar"},
                                      "filename": {"null_allowed": True, "data_type": "varchar"},
                                      "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                      "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "lawyer": {"id": {"null_allowed": False, "data_type": "varchar"},
                                        "document_number": {"null_allowed": False, "data_type": "bigint"},
                                        "name_first": {"null_allowed": False, "data_type": "varchar"},
                                        "name_last": {"null_allowed": False, "data_type": "varchar"},
                                        "organization": {"null_allowed": False, "data_type": "varchar"},
                                        "sequence": {"null_allowed": False, "data_type": "int"},
                                        "rawlocation_id": {"null_allowed": False, "data_type": "varchar"},
                                        "city": {"null_allowed": False, "data_type": "varchar"},
                                        "state": {"null_allowed": False, "data_type": "varchar"},
                                        "country": {"null_allowed": False, "data_type": "varchar"},
                                        "filename": {"null_allowed": True, "data_type": "varchar"},
                                        "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                        "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "main_cpc": {"id": {"null_allowed": False, "data_type": "varchar"},
                                          "document_number": {"null_allowed": False, "data_type": "bigint"},
                                          "sequence": {"null_allowed": False, "data_type": "int"},
                                          "version": {"null_allowed": True, "data_type": "date"},
                                          "section": {"null_allowed": True, "data_type": "varchar"},
                                          "class": {"null_allowed": True, "data_type": "varchar"},
                                          "subclass": {"null_allowed": True, "data_type": "varchar"},
                                          "main_group": {"null_allowed": True, "data_type": "varchar"},
                                          "subgroup": {"null_allowed": True, "data_type": "varchar"},
                                          "symbol_position": {"null_allowed": True, "data_type": "varchar"},
                                          "value": {"null_allowed": True, "data_type": "varchar"},
                                          "category": {"null_allowed": True, "data_type": "varchar"},
                                          "action_date": {"null_allowed": True, "data_type": "date"},
                                          "filename": {"null_allowed": True, "data_type": "varchar"},
                                          "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                          "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "pct_data": {"id": {"null_allowed": False, "data_type": "varchar"},
                                          "document_number": {"null_allowed": False, "data_type": "bigint"},
                                          "pct_doc_number": {"null_allowed": True, "data_type": "varchar"},
                                          "country": {"null_allowed": True, "data_type": "varchar"},
                                          "date": {"null_allowed": True, "data_type": "date"},
                                          "us_371c124_date": {"null_allowed": True, "data_type": "date"},
                                          "us_371c12_date": {"null_allowed": True, "data_type": "date"},
                                          "kind": {"null_allowed": True, "data_type": "varchar"},
                                          "doc_type": {"null_allowed": True, "data_type": "varchar"},
                                          "filename": {"null_allowed": True, "data_type": "varchar"},
                                          "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                          "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "publication": {"id": {"null_allowed": False, "data_type": "varchar"},
                                             "document_number": {"null_allowed": False, "data_type": "bigint"},
                                             "date": {"null_allowed": True, "data_type": "date"},
                                             "country": {"null_allowed": True, "data_type": "varchar"},
                                             "kind": {"null_allowed": True, "data_type": "varchar"},
                                             "filing_type": {"null_allowed": True, "data_type": "varchar"},
                                             "filename": {"null_allowed": True, "data_type": "varchar"},
                                             "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                             "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "rawassignee": {"id": {"null_allowed": False, "data_type": "varchar"},
                                             "document_number": {"null_allowed": False, "data_type": "bigint"},
                                             "sequence": {"null_allowed": False, "data_type": "int"},
                                             "name_first": {"null_allowed": False, "data_type": "varchar"},
                                             "name_last": {"null_allowed": False, "data_type": "varchar"},
                                             "organization": {"null_allowed": False, "data_type": "varchar"},
                                             "type": {"null_allowed": False, "data_type": "int"},
                                             "rawlocation_id": {"null_allowed": False, "data_type": "varchar"},
                                             "city": {"null_allowed": False, "data_type": "varchar"},
                                             "state": {"null_allowed": False, "data_type": "varchar"},
                                             "country": {"null_allowed": False, "data_type": "varchar"},
                                             "filename": {"null_allowed": True, "data_type": "varchar"},
                                             "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                             "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "rawinventor" :  {"id": {"null_allowed": False, "data_type": "varchar"},
                                               "document_number": {"null_allowed": False, "data_type": "bigint"},
                                               "name_first": {"null_allowed": False, "data_type": "varchar"},
                                               "name_last": {"null_allowed": False, "data_type": "varchar"},
                                               "sequence": {"null_allowed": False, "data_type": "int"},
                                               "designation": {"null_allowed": False, "data_type": "varchar"},
                                               "deceased": {"null_allowed": False, "data_type": "varchar"},
                                               "rawlocation_id": {"null_allowed": False, "data_type": "varchar"},
                                               "city": {"null_allowed": False, "data_type": "varchar"},
                                               "state": {"null_allowed": False, "data_type": "varchar"},
                                               "country": {"null_allowed": False, "data_type": "varchar"},
                                               "filename": {"null_allowed": True, "data_type": "varchar"},
                                               "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                               "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "rawlocation": {"id": {"null_allowed": False, "data_type": "varchar"},
                                             "city": {"null_allowed": False, "data_type": "varchar"},
                                             "state": {"null_allowed": False, "data_type": "varchar"},
                                             "country": {"null_allowed": False, "data_type": "varchar"},
                                             "latitude": {"null_allowed": True, "data_type": "float"},
                                             "longitude": {"null_allowed": True, "data_type": "float"},
                                             "filename": {"null_allowed": True, "data_type": "varchar"},
                                             "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                             "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "rawuspc": {"id": {"null_allowed": False, "data_type": "varchar"},
                                         "document_number": {"null_allowed": False, "data_type": "bigint"},
                                         "classification": {"null_allowed": False, "data_type": "varchar"},
                                         "sequence": {"null_allowed": False, "data_type": "int"},
                                         "filename": {"null_allowed": True, "data_type": "varchar"},
                                         "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                         "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "rel_app_text": {"id": {"null_allowed": False, "data_type": "varchar"},
                                              "document_number": {"null_allowed": False, "data_type": "bigint"},
                                              "text": {"null_allowed": False, "data_type": "mediumtext"},
                                              "filename": {"null_allowed": True, "data_type": "varchar"},
                                              "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                              "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "us_parties": {"id": {"null_allowed": False, "data_type": "varchar"},
                                            "document_number": {"null_allowed": False, "data_type": "bigint"},
                                            "name_first": {"null_allowed": False, "data_type": "varchar"},
                                            "name_last": {"null_allowed": False, "data_type": "varchar"},
                                            "sequence": {"null_allowed": False, "data_type": "int"},
                                            "rawlocation_id": {"null_allowed": False, "data_type": "varchar"},
                                            "city": {"null_allowed": False, "data_type": "varchar"},
                                            "state": {"null_allowed": False, "data_type": "varchar"},
                                            "country": {"null_allowed": False, "data_type": "varchar"},
                                            "filename": {"null_allowed": True, "data_type": "varchar"},
                                            "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                            "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "uspc": {"id": {"null_allowed": False, "data_type": "varchar"},
                                      "document_number": {"null_allowed": False, "data_type": "bigint"},
                                      "mainclass_id": {"null_allowed": False, "data_type": "varchar"},
                                      "subclass_id": {"null_allowed": False, "data_type": "varchar"},
                                      "sequence": {"null_allowed": False, "data_type": "int"},
                                      "filename": {"null_allowed": True, "data_type": "varchar"},
                                      "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                      "updated_date": {"null_allowed": True, "data_type": "timestamp"}},

                             "usreldoc": {"id": {"null_allowed": False, "data_type": "varchar"},
                                          "document_number": {"null_allowed": False, "data_type": "bigint"},
                                          "related_doc_number": {"null_allowed": False, "data_type": "varchar"},
                                          "country": {"null_allowed": False, "data_type": "varchar"},
                                          "doc_type": {"null_allowed": False, "data_type": "varchar"},
                                          "date": {"null_allowed": False, "data_type": "date"},
                                          "filename": {"null_allowed": True, "data_type": "varchar"},
                                          "created_date": {"null_allowed": True, "data_type": "timestamp"},
                                          "updated_date": {"null_allowed": True, "data_type": "timestamp"}}
                             }

        self.count_data = []
        self.floating_entities = []
        self.floating_patent = []

    def test_yearly_count(self):
        pass
