openc_bot 0.0.18 → 0.0.26

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +15 -0
  2. data/lib/openc_bot/exceptions.rb +3 -0
  3. data/lib/openc_bot/helpers/incremental_search.rb +1 -1
  4. data/lib/openc_bot/helpers/register_methods.rb +28 -9
  5. data/lib/openc_bot/version.rb +1 -1
  6. data/publish.sh +2 -0
  7. data/schemas/Gemfile +1 -1
  8. data/schemas/schemas/company-schema.json +62 -3
  9. data/schemas/schemas/includes/address.json +1 -1
  10. data/schemas/schemas/includes/alternative_name.json +2 -2
  11. data/schemas/schemas/includes/filing.json +1 -1
  12. data/schemas/schemas/includes/industry_code.json +6 -3
  13. data/schemas/schemas/includes/officer.json +40 -4
  14. data/schemas/schemas/includes/previous_name.json +5 -2
  15. data/schemas/schemas/includes/share-parcel.json +3 -0
  16. data/schemas/schemas/simple-licence-schema.json +10 -5
  17. data/schemas/schemas/simple-subsidiary-schema.json +12 -6
  18. data/schemas/spec/sample-data/invalid/company-19.json +1 -1
  19. data/schemas/spec/sample-data/invalid/company-56.json +7 -0
  20. data/schemas/spec/sample-data/invalid/company-57.json +7 -0
  21. data/schemas/spec/sample-data/invalid/company-58.json +7 -0
  22. data/schemas/spec/sample-data/invalid/company-59.json +13 -0
  23. data/schemas/spec/sample-data/invalid/company-60.json +7 -0
  24. data/schemas/spec/sample-data/invalid/company-61.json +7 -0
  25. data/schemas/spec/sample-data/invalid/company-62.json +9 -0
  26. data/schemas/spec/sample-data/invalid/company-63.json +12 -0
  27. data/schemas/spec/sample-data/invalid/company-64.json +14 -0
  28. data/schemas/spec/sample-data/invalid/company-65.json +14 -0
  29. data/schemas/spec/sample-data/invalid/company-66.json +13 -0
  30. data/schemas/spec/sample-data/invalid/company-67.json +14 -0
  31. data/schemas/spec/sample-data/invalid/company-68.json +12 -0
  32. data/schemas/spec/sample-data/invalid/company-69.json +12 -0
  33. data/schemas/spec/sample-data/invalid/company-70.json +14 -0
  34. data/schemas/spec/sample-data/invalid/simple-licence-04.json +10 -0
  35. data/schemas/spec/sample-data/invalid/simple-licence-05.json +10 -0
  36. data/schemas/spec/sample-data/invalid/simple-licence-06.json +10 -0
  37. data/schemas/spec/sample-data/invalid/simple-subsidiary-02.json +13 -0
  38. data/schemas/spec/sample-data/valid/company-19.json +13 -2
  39. data/schemas/spec/sample-data/valid/company-33.json +5 -0
  40. data/schemas/spec/sample-data/valid/company-43.json +7 -0
  41. data/schemas/spec/sample-data/valid/company-44.json +7 -0
  42. data/schemas/spec/sample-data/valid/company-45.json +23 -0
  43. data/schemas/spec/sample-data/valid/company-46.json +7 -0
  44. data/schemas/spec/sample-data/valid/company-47.json +12 -0
  45. data/schemas/spec/sample-data/valid/company-48.json +7 -0
  46. data/schemas/spec/sample-data/valid/company-49.json +14 -0
  47. data/schemas/spec/sample-data/valid/company-50.json +13 -0
  48. data/schemas/spec/sample-data/valid/company-51.json +14 -0
  49. data/schemas/spec/sample-data/valid/company-52.json +12 -0
  50. data/schemas/spec/sample-data/valid/company-53.json +9 -0
  51. data/schemas/spec/validation_spec.rb +1 -1
  52. data/spec/lib/exceptions_spec.rb +25 -2
  53. data/spec/lib/helpers/incremental_search_spec.rb +13 -1
  54. data/spec/lib/helpers/register_methods_spec.rb +31 -2
  55. data/spec/schemas/company-schema_spec.rb +9 -9
  56. metadata +51 -44
@@ -4,6 +4,6 @@
4
4
  "company_number": "12345",
5
5
  "jurisdiction_code": "ie",
6
6
  "all_attributes": {
7
- "number_of_employees": "foo"
7
+ "number_of_employees": ""
8
8
  }
9
9
  }
@@ -0,0 +1,7 @@
1
+ /*invalid website*/
2
+ {
3
+ "name": "Foo Inc",
4
+ "company_number": "12345",
5
+ "jurisdiction_code": "us_de",
6
+ "website": ""
7
+ }
@@ -0,0 +1,7 @@
1
+ /*invalid telephone_number*/
2
+ {
3
+ "name": "Foo Inc",
4
+ "company_number": "12345",
5
+ "jurisdiction_code": "us_de",
6
+ "telephone_number": "0"
7
+ }
@@ -0,0 +1,7 @@
1
+ /*invalid fax_number*/
2
+ {
3
+ "name": "Foo Inc",
4
+ "company_number": "12345",
5
+ "jurisdiction_code": "us_de",
6
+ "fax_number": "0"
7
+ }
@@ -0,0 +1,13 @@
1
+ /*invalid alternative_names*/
2
+ {
3
+ "name": "Foo Inc",
4
+ "company_number": "12345",
5
+ "jurisdiction_code": "ie",
6
+ "alternative_names": [
7
+ {
8
+ "company_name": "",
9
+ "type": "legal",
10
+ "language": "fr"
11
+ }
12
+ ]
13
+ }
@@ -0,0 +1,7 @@
1
+ /*invalid headquarters_address*/
2
+ {
3
+ "name": "Foo Inc",
4
+ "company_number": "12345",
5
+ "jurisdiction_code": "us_de",
6
+ "headquarters_address": ""
7
+ }
@@ -0,0 +1,7 @@
1
+ /*invalid mailing_address*/
2
+ {
3
+ "name": "Foo Inc",
4
+ "company_number": "12345",
5
+ "jurisdiction_code": "us_de",
6
+ "mailing_address": ""
7
+ }
@@ -0,0 +1,9 @@
1
+ /*invalid merged_into*/
2
+ {
3
+ "name": "Foo Inc",
4
+ "company_number": "12345",
5
+ "jurisdiction_code": "ie",
6
+ "all_attributes": {
7
+ "merged_into": ""
8
+ }
9
+ }
@@ -0,0 +1,12 @@
1
+ /*invalid merged_into*/
2
+ {
3
+ "name": "Foo Inc",
4
+ "company_number": "12345",
5
+ "jurisdiction_code": "ie",
6
+ "all_attributes": {
7
+ "merged_into": {
8
+ "name": "Foo Inc"
9
+ }
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,14 @@
1
+ /*invalid merged_into*/
2
+ {
3
+ "name": "Foo Inc",
4
+ "company_number": "12345",
5
+ "jurisdiction_code": "ie",
6
+ "all_attributes": {
7
+ "merged_into": {
8
+ "effective_date": "foo",
9
+ "surviving_company": {
10
+ "name": "Foo Inc"
11
+ }
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,14 @@
1
+ /*invalid merged_into*/
2
+ {
3
+ "name": "Foo Inc",
4
+ "company_number": "12345",
5
+ "jurisdiction_code": "ie",
6
+ "all_attributes": {
7
+ "merged_into": {
8
+ "foo": "bar",
9
+ "surviving_company": {
10
+ "name": "Foo Inc"
11
+ }
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,13 @@
1
+ /*invalid merged_into*/
2
+ {
3
+ "name": "Foo Inc",
4
+ "company_number": "12345",
5
+ "jurisdiction_code": "ie",
6
+ "all_attributes": {
7
+ "merged_into": {
8
+ "surviving_company": {
9
+ "jurisdiction": "Michigan"
10
+ }
11
+ }
12
+ }
13
+ }
@@ -0,0 +1,14 @@
1
+ /*invalid officers*/
2
+ {
3
+ "name": "Foo Inc",
4
+ "company_number": "12345",
5
+ "jurisdiction_code": "ie",
6
+ "officers": [
7
+ {
8
+ "name": "Fred",
9
+ "other_attributes": {
10
+ "date_of_birth": "invalid date"
11
+ }
12
+ }
13
+ ]
14
+ }
@@ -0,0 +1,12 @@
1
+ /*invalid officers*/
2
+ {
3
+ "name": "Foo Inc",
4
+ "company_number": "12345",
5
+ "jurisdiction_code": "ie",
6
+ "officers": [
7
+ {
8
+ "name": "Fred Flintstone",
9
+ "start_date": "invalid_date"
10
+ }
11
+ ]
12
+ }
@@ -0,0 +1,12 @@
1
+ /*invalid officers*/
2
+ {
3
+ "name": "Foo Inc",
4
+ "company_number": "12345",
5
+ "jurisdiction_code": "ie",
6
+ "officers": [
7
+ {
8
+ "name": "Fred Flintstone",
9
+ "end_date": "invalid_date"
10
+ }
11
+ ]
12
+ }
@@ -0,0 +1,14 @@
1
+ /*invalid officers*/
2
+ {
3
+ "name": "Foo Inc",
4
+ "company_number": "12345",
5
+ "jurisdiction_code": "ie",
6
+ "officers": [
7
+ {
8
+ "name": "Fred",
9
+ "other_attributes": {
10
+ "type": "Alien"
11
+ }
12
+ }
13
+ ]
14
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "company_name": "",
3
+ "company_jurisdiction": "gb",
4
+ "licence_number": "ABC123",
5
+ "jurisdiction_classification": "Bank",
6
+ "licence_jurisdiction": "fr",
7
+ "source_url": "http://example.com/abc123",
8
+ "sample_date": "2014-06-01",
9
+ "confidence": "MEDIUM"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "company_name": "Foo",
3
+ "company_jurisdiction": "",
4
+ "licence_number": "ABC123",
5
+ "jurisdiction_classification": "Bank",
6
+ "licence_jurisdiction": "fr",
7
+ "source_url": "http://example.com/abc123",
8
+ "sample_date": "2014-06-01",
9
+ "confidence": "MEDIUM"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "company_name": "Foo",
3
+ "company_jurisdiction": "gb",
4
+ "licence_number": "ABC123",
5
+ "jurisdiction_classification": "Bank",
6
+ "licence_jurisdiction": "fr",
7
+ "source_url": "http://example.com/abc123",
8
+ "sample_date": "",
9
+ "confidence": "MEDIUM"
10
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "source_url": "http://somewhere.com/a",
3
+ "sample_date": "2014/02/01",
4
+ "start_date": "2014/01/01",
5
+ "end_date": "2015/02/01",
6
+ "confidence": "HIGH",
7
+ "parent_name": "Widgets R US",
8
+ "parent_jurisdiction": "us_de",
9
+ "direct": true,
10
+ "percentage_controlled": "56.124",
11
+ "subsidiary_name": "",
12
+ "subsidiary_jurisdiction": "us_de"
13
+ }
@@ -13,14 +13,25 @@
13
13
  },
14
14
  {
15
15
  "name": "Barney Rubble",
16
+ "start_date": null,
17
+ "end_date": null,
16
18
  "other_attributes": {
17
19
  "foo": "bar"
18
20
  }
19
21
  },
20
22
  {
21
- "name": "Pebbles",
23
+ "name": "Wilman Rubble",
22
24
  "start_date": "2010-12-22",
23
- "end_date": "2011-01-03"
25
+ "end_date": "2011-01-03",
26
+ "uid": "ABC1234",
27
+ "other_attributes": {
28
+ "address": "32 Rubble St, Bedrock",
29
+ "nationality": "United States",
30
+ "date_of_birth": "1970-04-22",
31
+ "occupation": "Caveman",
32
+ "type": "Person",
33
+ "person_uid": "CD444"
34
+ }
24
35
  }
25
36
  ]
26
37
  }
@@ -9,6 +9,11 @@
9
9
  "code_scheme_id": "eu_nace_2",
10
10
  "name": "Some Industry"
11
11
  },
12
+ {
13
+ "code": "1234",
14
+ "code_scheme_id": "unknown_code_scheme",
15
+ "name": "Some Industry"
16
+ },
12
17
  {
13
18
  "code": "22.11",
14
19
  "code_scheme_id": "uk_sic_2007"
@@ -0,0 +1,7 @@
1
+ /*telephone_number*/
2
+ {
3
+ "name": "Foo Inc",
4
+ "company_number": "12345",
5
+ "jurisdiction_code": "us_de",
6
+ "telephone_number": "0123 456 789"
7
+ }
@@ -0,0 +1,7 @@
1
+ /*fax_number*/
2
+ {
3
+ "name": "Foo Inc",
4
+ "company_number": "12345",
5
+ "jurisdiction_code": "us_de",
6
+ "fax_number": "0123 456 789"
7
+ }
@@ -0,0 +1,23 @@
1
+ /*valid share_parcels*/
2
+ {
3
+ "name": "Foo Inc",
4
+ "company_number": "12345",
5
+ "jurisdiction_code": "ie",
6
+ "share_parcels": [
7
+ {
8
+ "number_of_shares": 1234,
9
+ "start_date": "2008-11-22",
10
+ "start_date_type": "=",
11
+ "shareholders": [
12
+ {
13
+ "name": "Megacorp Inc",
14
+ "type": "Company",
15
+ "jurisdiction": "Bermuda",
16
+ "company_number": "12345",
17
+ "address": "1 Global Ave, Bermuda"
18
+ }
19
+ ],
20
+ "confidence": 42
21
+ }
22
+ ]
23
+ }
@@ -0,0 +1,7 @@
1
+ /*valid headquarters_address*/
2
+ {
3
+ "name": "Foo Inc",
4
+ "company_number": "12345",
5
+ "jurisdiction_code": "us_de",
6
+ "headquarters_address": "32 Foo St, Footown"
7
+ }
@@ -0,0 +1,12 @@
1
+ /*valid mailing_address object*/
2
+ {
3
+ "name": "Foo Inc",
4
+ "company_number": "12345",
5
+ "jurisdiction_code": "us_de",
6
+ "mailing_address": {
7
+ "street_address": "32 Foo St",
8
+ "locality": "Footown",
9
+ "region": "Fooshire",
10
+ "postal_code": "FO1 2BA"
11
+ }
12
+ }
@@ -0,0 +1,7 @@
1
+ /*valid mailing_address*/
2
+ {
3
+ "name": "Foo Inc",
4
+ "company_number": "12345",
5
+ "jurisdiction_code": "us_de",
6
+ "mailing_address": "32 Foo St, Footown"
7
+ }
@@ -0,0 +1,14 @@
1
+ /*valid merged_into*/
2
+ {
3
+ "name": "Foo Inc",
4
+ "company_number": "12345",
5
+ "jurisdiction_code": "ie",
6
+ "all_attributes": {
7
+ "merged_into": {
8
+ "effective_date": "2010-10-22",
9
+ "surviving_company": {
10
+ "name": "Foo Inc"
11
+ }
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,13 @@
1
+ /*valid merged_into*/
2
+ {
3
+ "name": "Foo Inc",
4
+ "company_number": "12345",
5
+ "jurisdiction_code": "ie",
6
+ "all_attributes": {
7
+ "merged_into": {
8
+ "surviving_company": {
9
+ "jurisdiction": "us_mi", "name": "Foo Inc"
10
+ }
11
+ }
12
+ }
13
+ }
@@ -0,0 +1,14 @@
1
+ /*valid merged_into*/
2
+ {
3
+ "name": "Foo Inc",
4
+ "company_number": "12345",
5
+ "jurisdiction_code": "ie",
6
+ "all_attributes": {
7
+ "merged_into": {
8
+ "surviving_company": {
9
+ "jurisdiction": "us_mi",
10
+ "company_number": "12345"
11
+ }
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,12 @@
1
+ /*valid headquarters_address object*/
2
+ {
3
+ "name": "Foo Inc",
4
+ "company_number": "12345",
5
+ "jurisdiction_code": "us_de",
6
+ "headquarters_address": {
7
+ "street_address": "32 Foo St",
8
+ "locality": "Footown",
9
+ "region": "Fooshire",
10
+ "postal_code": "FO1 2BA"
11
+ }
12
+ }
@@ -0,0 +1,9 @@
1
+ /*valid number_of_employees*/
2
+ {
3
+ "name": "Foo Inc",
4
+ "company_number": "12345",
5
+ "jurisdiction_code": "ie",
6
+ "all_attributes": {
7
+ "number_of_employees": "35-42"
8
+ }
9
+ }