openc_bot 0.0.27 → 0.0.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. checksums.yaml +5 -13
  2. data/.travis.yml +1 -0
  3. data/Gemfile +2 -0
  4. data/lib/openc_bot.rb +16 -1
  5. data/lib/openc_bot/company_fetcher_bot.rb +50 -0
  6. data/lib/openc_bot/helpers/register_methods.rb +59 -15
  7. data/lib/openc_bot/tasks.rb +15 -2
  8. data/lib/openc_bot/templates/spec/spec_helper.rb +4 -0
  9. data/lib/openc_bot/version.rb +1 -1
  10. data/openc_bot.gemspec +6 -3
  11. data/spec/lib/company_fetcher_bot_spec.rb +23 -0
  12. data/spec/lib/helpers/register_methods_spec.rb +120 -2
  13. data/spec/lib/openc_bot_spec.rb +14 -1
  14. data/spec/simple_openc_bot_spec.rb +1 -0
  15. data/spec/spec_helper.rb +3 -1
  16. metadata +43 -220
  17. data/schemas/.gitignore +0 -13
  18. data/schemas/.travis.yml +0 -5
  19. data/schemas/Gemfile +0 -9
  20. data/schemas/README.md +0 -2
  21. data/schemas/Rakefile +0 -46
  22. data/schemas/lib/base-statement.json +0 -22
  23. data/schemas/lib/snippets/financial-payment-base.json +0 -4
  24. data/schemas/lib/snippets/licence-base.json +0 -4
  25. data/schemas/schemas/company-schema.json +0 -183
  26. data/schemas/schemas/financial-payment-schema.json +0 -27
  27. data/schemas/schemas/includes/address.json +0 -23
  28. data/schemas/schemas/includes/alternative_name.json +0 -13
  29. data/schemas/schemas/includes/company.json +0 -16
  30. data/schemas/schemas/includes/filing.json +0 -20
  31. data/schemas/schemas/includes/financial-payment-data-object.json +0 -60
  32. data/schemas/schemas/includes/industry_code.json +0 -16
  33. data/schemas/schemas/includes/licence-data-object.json +0 -36
  34. data/schemas/schemas/includes/officer.json +0 -50
  35. data/schemas/schemas/includes/previous_name.json +0 -14
  36. data/schemas/schemas/includes/share-parcel-data.json +0 -67
  37. data/schemas/schemas/includes/share-parcel.json +0 -63
  38. data/schemas/schemas/includes/subsidiary-relationship-data.json +0 -47
  39. data/schemas/schemas/includes/total-shares.json +0 -10
  40. data/schemas/schemas/licence-schema.json +0 -27
  41. data/schemas/schemas/primary-data-schema.json +0 -17
  42. data/schemas/schemas/share-parcel-schema.json +0 -21
  43. data/schemas/schemas/simple-financial-payment-schema.json +0 -85
  44. data/schemas/schemas/simple-licence-schema.json +0 -59
  45. data/schemas/schemas/simple-subsidiary-schema.json +0 -68
  46. data/schemas/schemas/subsidiary-relationship-schema.json +0 -27
  47. data/schemas/spec/sample-data/invalid/company-01.json +0 -4
  48. data/schemas/spec/sample-data/invalid/company-02.json +0 -5
  49. data/schemas/spec/sample-data/invalid/company-03.json +0 -5
  50. data/schemas/spec/sample-data/invalid/company-04.json +0 -5
  51. data/schemas/spec/sample-data/invalid/company-05.json +0 -5
  52. data/schemas/spec/sample-data/invalid/company-06.json +0 -6
  53. data/schemas/spec/sample-data/invalid/company-07.json +0 -8
  54. data/schemas/spec/sample-data/invalid/company-08.json +0 -7
  55. data/schemas/spec/sample-data/invalid/company-09.json +0 -9
  56. data/schemas/spec/sample-data/invalid/company-10.json +0 -7
  57. data/schemas/spec/sample-data/invalid/company-11.json +0 -9
  58. data/schemas/spec/sample-data/invalid/company-12.json +0 -11
  59. data/schemas/spec/sample-data/invalid/company-13.json +0 -11
  60. data/schemas/spec/sample-data/invalid/company-14.json +0 -7
  61. data/schemas/spec/sample-data/invalid/company-15.json +0 -7
  62. data/schemas/spec/sample-data/invalid/company-16.json +0 -7
  63. data/schemas/spec/sample-data/invalid/company-17.json +0 -9
  64. data/schemas/spec/sample-data/invalid/company-18.json +0 -9
  65. data/schemas/spec/sample-data/invalid/company-19.json +0 -9
  66. data/schemas/spec/sample-data/invalid/company-20.json +0 -9
  67. data/schemas/spec/sample-data/invalid/company-21.json +0 -11
  68. data/schemas/spec/sample-data/invalid/company-22.json +0 -11
  69. data/schemas/spec/sample-data/invalid/company-23.json +0 -7
  70. data/schemas/spec/sample-data/invalid/company-24.json +0 -12
  71. data/schemas/spec/sample-data/invalid/company-25.json +0 -9
  72. data/schemas/spec/sample-data/invalid/company-26.json +0 -11
  73. data/schemas/spec/sample-data/invalid/company-27.json +0 -7
  74. data/schemas/spec/sample-data/invalid/company-28.json +0 -9
  75. data/schemas/spec/sample-data/invalid/company-29.json +0 -12
  76. data/schemas/spec/sample-data/invalid/company-30.json +0 -16
  77. data/schemas/spec/sample-data/invalid/company-31.json +0 -14
  78. data/schemas/spec/sample-data/invalid/company-32.json +0 -11
  79. data/schemas/spec/sample-data/invalid/company-33.json +0 -7
  80. data/schemas/spec/sample-data/invalid/company-34.json +0 -9
  81. data/schemas/spec/sample-data/invalid/company-35.json +0 -9
  82. data/schemas/spec/sample-data/invalid/company-36.json +0 -10
  83. data/schemas/spec/sample-data/invalid/company-37.json +0 -7
  84. data/schemas/spec/sample-data/invalid/company-38.json +0 -9
  85. data/schemas/spec/sample-data/invalid/company-39.json +0 -11
  86. data/schemas/spec/sample-data/invalid/company-40.json +0 -12
  87. data/schemas/spec/sample-data/invalid/company-41.json +0 -12
  88. data/schemas/spec/sample-data/invalid/company-42.json +0 -7
  89. data/schemas/spec/sample-data/invalid/company-43.json +0 -9
  90. data/schemas/spec/sample-data/invalid/company-44.json +0 -11
  91. data/schemas/spec/sample-data/invalid/company-45.json +0 -11
  92. data/schemas/spec/sample-data/invalid/company-46.json +0 -7
  93. data/schemas/spec/sample-data/invalid/company-47.json +0 -9
  94. data/schemas/spec/sample-data/invalid/company-48.json +0 -9
  95. data/schemas/spec/sample-data/invalid/company-49.json +0 -9
  96. data/schemas/spec/sample-data/invalid/company-50.json +0 -9
  97. data/schemas/spec/sample-data/invalid/company-51.json +0 -9
  98. data/schemas/spec/sample-data/invalid/company-52.json +0 -9
  99. data/schemas/spec/sample-data/invalid/company-53.json +0 -10
  100. data/schemas/spec/sample-data/invalid/company-54.json +0 -9
  101. data/schemas/spec/sample-data/invalid/company-55.json +0 -9
  102. data/schemas/spec/sample-data/invalid/company-56.json +0 -7
  103. data/schemas/spec/sample-data/invalid/company-57.json +0 -7
  104. data/schemas/spec/sample-data/invalid/company-58.json +0 -7
  105. data/schemas/spec/sample-data/invalid/company-59.json +0 -13
  106. data/schemas/spec/sample-data/invalid/company-60.json +0 -7
  107. data/schemas/spec/sample-data/invalid/company-61.json +0 -7
  108. data/schemas/spec/sample-data/invalid/company-62.json +0 -9
  109. data/schemas/spec/sample-data/invalid/company-63.json +0 -12
  110. data/schemas/spec/sample-data/invalid/company-64.json +0 -14
  111. data/schemas/spec/sample-data/invalid/company-65.json +0 -14
  112. data/schemas/spec/sample-data/invalid/company-66.json +0 -13
  113. data/schemas/spec/sample-data/invalid/company-67.json +0 -14
  114. data/schemas/spec/sample-data/invalid/company-68.json +0 -12
  115. data/schemas/spec/sample-data/invalid/company-69.json +0 -12
  116. data/schemas/spec/sample-data/invalid/company-70.json +0 -14
  117. data/schemas/spec/sample-data/invalid/financial-payment-01.json +0 -24
  118. data/schemas/spec/sample-data/invalid/licence-01.json +0 -18
  119. data/schemas/spec/sample-data/invalid/licence-02.json +0 -18
  120. data/schemas/spec/sample-data/invalid/licence-03.json +0 -12
  121. data/schemas/spec/sample-data/invalid/licence-04.json +0 -18
  122. data/schemas/spec/sample-data/invalid/licence-05.json +0 -18
  123. data/schemas/spec/sample-data/invalid/licence-06.json +0 -18
  124. data/schemas/spec/sample-data/invalid/licence-07.json +0 -20
  125. data/schemas/spec/sample-data/invalid/licence-08.json +0 -21
  126. data/schemas/spec/sample-data/invalid/primary-data-01.json +0 -4
  127. data/schemas/spec/sample-data/invalid/primary-data-02.json +0 -4
  128. data/schemas/spec/sample-data/invalid/simple-licence-01.json +0 -9
  129. data/schemas/spec/sample-data/invalid/simple-licence-02.json +0 -8
  130. data/schemas/spec/sample-data/invalid/simple-licence-03.json +0 -9
  131. data/schemas/spec/sample-data/invalid/simple-licence-04.json +0 -10
  132. data/schemas/spec/sample-data/invalid/simple-licence-05.json +0 -10
  133. data/schemas/spec/sample-data/invalid/simple-licence-06.json +0 -10
  134. data/schemas/spec/sample-data/invalid/simple-subsidiary-01.json +0 -13
  135. data/schemas/spec/sample-data/invalid/simple-subsidiary-02.json +0 -13
  136. data/schemas/spec/sample-data/licence-schema.json.old +0 -21
  137. data/schemas/spec/sample-data/valid/company-01.json +0 -6
  138. data/schemas/spec/sample-data/valid/company-02.json +0 -7
  139. data/schemas/spec/sample-data/valid/company-03.json +0 -8
  140. data/schemas/spec/sample-data/valid/company-04.json +0 -7
  141. data/schemas/spec/sample-data/valid/company-05.json +0 -7
  142. data/schemas/spec/sample-data/valid/company-06.json +0 -12
  143. data/schemas/spec/sample-data/valid/company-07.json +0 -9
  144. data/schemas/spec/sample-data/valid/company-08.json +0 -9
  145. data/schemas/spec/sample-data/valid/company-09.json +0 -20
  146. data/schemas/spec/sample-data/valid/company-10.json +0 -9
  147. data/schemas/spec/sample-data/valid/company-11.json +0 -7
  148. data/schemas/spec/sample-data/valid/company-12.json +0 -7
  149. data/schemas/spec/sample-data/valid/company-13.json +0 -7
  150. data/schemas/spec/sample-data/valid/company-14.json +0 -15
  151. data/schemas/spec/sample-data/valid/company-15.json +0 -8
  152. data/schemas/spec/sample-data/valid/company-16.json +0 -9
  153. data/schemas/spec/sample-data/valid/company-17.json +0 -9
  154. data/schemas/spec/sample-data/valid/company-18.json +0 -9
  155. data/schemas/spec/sample-data/valid/company-19.json +0 -37
  156. data/schemas/spec/sample-data/valid/company-20.json +0 -9
  157. data/schemas/spec/sample-data/valid/company-21.json +0 -26
  158. data/schemas/spec/sample-data/valid/company-22.json +0 -20
  159. data/schemas/spec/sample-data/valid/company-23.json +0 -9
  160. data/schemas/spec/sample-data/valid/company-24.json +0 -12
  161. data/schemas/spec/sample-data/valid/company-25.json +0 -12
  162. data/schemas/spec/sample-data/valid/company-26.json +0 -12
  163. data/schemas/spec/sample-data/valid/company-27.json +0 -28
  164. data/schemas/spec/sample-data/valid/company-28.json +0 -9
  165. data/schemas/spec/sample-data/valid/company-29.json +0 -10
  166. data/schemas/spec/sample-data/valid/company-30.json +0 -9
  167. data/schemas/spec/sample-data/valid/company-31.json +0 -17
  168. data/schemas/spec/sample-data/valid/company-32.json +0 -9
  169. data/schemas/spec/sample-data/valid/company-33.json +0 -29
  170. data/schemas/spec/sample-data/valid/company-34.json +0 -9
  171. data/schemas/spec/sample-data/valid/company-35.json +0 -9
  172. data/schemas/spec/sample-data/valid/company-36.json +0 -9
  173. data/schemas/spec/sample-data/valid/company-37.json +0 -9
  174. data/schemas/spec/sample-data/valid/company-38.json +0 -9
  175. data/schemas/spec/sample-data/valid/company-39.json +0 -9
  176. data/schemas/spec/sample-data/valid/company-40.json +0 -9
  177. data/schemas/spec/sample-data/valid/company-41.json +0 -9
  178. data/schemas/spec/sample-data/valid/company-42.json +0 -10
  179. data/schemas/spec/sample-data/valid/company-43.json +0 -7
  180. data/schemas/spec/sample-data/valid/company-44.json +0 -7
  181. data/schemas/spec/sample-data/valid/company-45.json +0 -23
  182. data/schemas/spec/sample-data/valid/company-46.json +0 -7
  183. data/schemas/spec/sample-data/valid/company-47.json +0 -12
  184. data/schemas/spec/sample-data/valid/company-48.json +0 -7
  185. data/schemas/spec/sample-data/valid/company-49.json +0 -14
  186. data/schemas/spec/sample-data/valid/company-50.json +0 -13
  187. data/schemas/spec/sample-data/valid/company-51.json +0 -14
  188. data/schemas/spec/sample-data/valid/company-52.json +0 -12
  189. data/schemas/spec/sample-data/valid/company-53.json +0 -9
  190. data/schemas/spec/sample-data/valid/financial-payment-01.json +0 -25
  191. data/schemas/spec/sample-data/valid/financial-payment-02.json +0 -29
  192. data/schemas/spec/sample-data/valid/licence-01.json +0 -19
  193. data/schemas/spec/sample-data/valid/licence-02.json +0 -21
  194. data/schemas/spec/sample-data/valid/licence-03.json +0 -21
  195. data/schemas/spec/sample-data/valid/licence-04.json +0 -26
  196. data/schemas/spec/sample-data/valid/primary-data-01.json +0 -4
  197. data/schemas/spec/sample-data/valid/primary-data-02.json +0 -5
  198. data/schemas/spec/sample-data/valid/simple-licence-01.json +0 -10
  199. data/schemas/spec/sample-data/valid/simple-licence-02.json +0 -10
  200. data/schemas/spec/sample-data/valid/simple-licence-03.json +0 -12
  201. data/schemas/spec/sample-data/valid/simple-subsidiary-01.json +0 -13
  202. data/schemas/spec/sample-data/valid/simple-subsidiary-02.json +0 -13
  203. data/schemas/spec/sample-data/valid/subsidiary-relationship-01.json +0 -23
  204. data/schemas/spec/spec_helper.rb +0 -78
  205. data/schemas/spec/validation_spec.rb +0 -39
data/schemas/.gitignore DELETED
@@ -1,13 +0,0 @@
1
- /.bundle
2
- /.rvmrc
3
- /coverage
4
- /pkg
5
- /rdoc
6
- /tags
7
- /vendor
8
- /.rbenv-version
9
- .rspec
10
- .DS_Store
11
- *~
12
- .#*
13
- #*#
data/schemas/.travis.yml DELETED
@@ -1,5 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - "1.9.3"
4
- - "2.0.0"
5
- - "2.1.0"
data/schemas/Gemfile DELETED
@@ -1,9 +0,0 @@
1
- # A sample Gemfile
2
- source "https://rubygems.org"
3
-
4
- group :test do
5
- gem "rspec"
6
- gem 'json-schema'
7
- # gem 'debugger'
8
- gem 'rake'
9
- end
data/schemas/README.md DELETED
@@ -1,2 +0,0 @@
1
- These are JSON schemas for validating data before it is sent to
2
- OpenCorporates.
data/schemas/Rakefile DELETED
@@ -1,46 +0,0 @@
1
- require "rubygems"
2
-
3
- PROJECT_ROOT = File.expand_path("..", __FILE__)
4
-
5
- require "rspec/core/rake_task"
6
- # require 'debugger'
7
-
8
- desc "Run all specs"
9
- RSpec::Core::RakeTask.new(:spec) do |t|
10
- t.verbose = true
11
- end
12
-
13
- task :default => :spec
14
-
15
- ## dist
16
-
17
- require "json"
18
-
19
- desc "Regenerate schema files from snippets and reference files"
20
- task :regenerate_data_object_schemas do
21
- spacers = '='*20
22
- puts "Regenerating OpenCorporates DataObject schemas"
23
- puts spacers
24
- base_object = JSON.parse(File.new(File.join(PROJECT_ROOT,'lib','base-statement.json')).read)
25
- snippets = Dir.glob(File.join(PROJECT_ROOT,'lib','snippets','*base.json'))
26
- snippets.each do |snippet|
27
- object_name = snippet[/\/([^\/]+)-base.json/,1]
28
- snippet_data = JSON.parse(File.new(snippet).read)
29
- combined_data = {}.merge(snippet_data).merge(base_object)
30
- combined_data['properties']['data']['items'] = {
31
- "$ref" => "includes/#{object_name}-data-object.json"
32
- }
33
- File.open(File.join(PROJECT_ROOT,'schemas',"#{object_name}-schema.json"),'w') { |file| file.puts JSON.pretty_generate(combined_data) }
34
- puts "Generated schema: '#{object_name}-schema.json'"
35
- end
36
- puts spacers
37
- puts "Finished regenerating schemas.\nNow running validation specs"
38
- puts spacers
39
- Rake::Task['run_validation_specs'].invoke
40
- end
41
-
42
- task :run_validation_specs do
43
- Rake::Task['default'].invoke
44
- end
45
-
46
-
@@ -1,22 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-04/schema#",
3
- "type": "object",
4
- "properties": {
5
- "source_jurisdiction": {
6
- "description": "Jurisdiction of the source of the data",
7
- "type": "string"
8
- },
9
- "company": {
10
- "$ref" : "includes/company.json"
11
- },
12
- "data": {
13
- "type": "array",
14
- "description": "This is an array of data objects, that is the objects which actually contain the data about the datum. Generally there will only be one element in this, although in for some types of data_types there may naturally be several releated to the same company, e.g. shareholders",
15
- "items": {
16
- "$ref": "includes/financial-payment-data-object.json"
17
- },
18
- "additionalItems": false
19
- }
20
- },
21
- "required": ["company", "data"]
22
- }
@@ -1,4 +0,0 @@
1
- {
2
- "title": "Financial-Payment",
3
- "description": "A Financial-Payment is a payment from government to a recipient"
4
- }
@@ -1,4 +0,0 @@
1
- {
2
- "title": "Licence Schema",
3
- "description": "A Licence is a permission for an entity to do something that would otherwise not be permitted. An example is a 'Financial' licence to operate as a bank, or an financial advisor, for example, or a 'Business' Licence to sell alcohol, or operate an amusement arcade. Future licence types (extractives, pollution) will be added later"
4
- }
@@ -1,183 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-04/schema#",
3
- "title": "Company Schema",
4
- "type": "object",
5
- "description": "A company in OpenCorporates",
6
- "properties": {
7
- "company_number": {
8
- "type": "string",
9
- "description": "unique identifier given by the corporate register with which it is incorporated",
10
- "minLength": 1
11
- },
12
- "name": {
13
- "type": "string",
14
- "description": "Legal name of the company",
15
- "minLength": 1
16
- },
17
- "jurisdiction_code": {
18
- "type": "string",
19
- "description": "Code representing the jurisdiction/company register which is the canonical record of the company’s existence. Uses underscored ISO 3166-2 to represent it, e.g. es for Spain, us_de for Delaware",
20
- "minLength": 2,
21
- "maxLength": 5
22
- },
23
- "incorporation_date": {
24
- "type": "date"
25
- },
26
- "dissolution_date": {
27
- "type": "date"
28
- },
29
- "retrieved_at": {
30
- "type": "date-time"
31
- },
32
- "current_status": {
33
- "type": "string"
34
- },
35
- "company_type": {
36
- "type": "string"
37
- },
38
- "registry_url": {
39
- "type": "string"
40
- },
41
- "website": {
42
- "type": "string",
43
- "minLength": 5
44
- },
45
- "telephone_number": {
46
- "type": "string",
47
- "minLength": 4
48
- },
49
- "fax_number": {
50
- "type": "string",
51
- "minLength": 4
52
- },
53
- "registered_address": {
54
- "$ref": "includes/address.json"
55
- },
56
- "headquarters_address": {
57
- "$ref": "includes/address.json"
58
- },
59
- "mailing_address": {
60
- "$ref": "includes/address.json"
61
- },
62
- "officers": {
63
- "type": "array",
64
- "items": {
65
- "$ref": "includes/officer.json"
66
- }
67
- },
68
- "share_parcels": {
69
- "type": "array",
70
- "items": {
71
- "$ref": "includes/share-parcel.json"
72
- }
73
- },
74
- "total_shares": {
75
- "$ref": "includes/total-shares.json"
76
- },
77
- "filings": {
78
- "type": "array",
79
- "items": {
80
- "$ref": "includes/filing.json"
81
- }
82
- },
83
- "industry_codes": {
84
- "type": "array",
85
- "items": {
86
- "$ref": "includes/industry_code.json"
87
- }
88
- },
89
- "previous_names": {
90
- "type": "array",
91
- "items": {
92
- "$ref": "includes/previous_name.json"
93
- }
94
- },
95
- "alternative_names": {
96
- "type": "array",
97
- "items": {
98
- "$ref": "includes/alternative_name.json"
99
- }
100
- },
101
- "branch": {
102
- "type": ["string","null"],
103
- "description": "A flag to denote whether a company is a branch entity. This should only be set if the company is a type of branch (otherwise should be null). In general the only option here is 'F' for a 'Foreign' branch, i.e. an out-of-jurisdiction entity that has registered as having a presence in the jurisdiction. In the US this is sometimes called a Foreign Corporation",
104
- "enum": ["F", "L",null]
105
- },
106
- "all_attributes": {
107
- "type": "object",
108
- "description": "Other arbitrary attributes for a given company",
109
- "properties": {
110
- "jurisdiction_of_origin": {
111
- "type": ["string","null"],
112
- "description": "The jurisdiction of the 'home' company if this is a branch",
113
- "minLength": 1
114
- },
115
- "home_company_number": {
116
- "type": ["string","null"],
117
- "description": "If the entity is a 'branch', this is the company_number of the 'home' company in the home company's jurisdiction",
118
- "minLength": 1
119
- },
120
- "home_legal_name": {
121
- "type": ["string","null"],
122
- "description": "The legal name of the 'home' company in its jurisdiction if this is a branch, and the name is different from the legal name of the branch",
123
- "minLength": 1
124
- },
125
- "registered_agent_address": {
126
- "type": ["string","null"],
127
- "description": "The address of the 'Agent', a public address to which legal papers can be served",
128
- "minLength": 1
129
- },
130
- "registered_agent_name": {
131
- "type": ["string","null"],
132
- "description": "The 'Agent' of the company \u2013 a person or entity that is empowered to accept service for the company",
133
- "minLength": 1
134
- },
135
- "number_of_employees": {
136
- "anyOf": [
137
- {"type":"string","minLength": 1},
138
- {"type":"number","minimum": 0}
139
- ],
140
- "description": "The number of employees"
141
- },
142
- "merged_into": {
143
- "type": "object",
144
- "description": "Information on the merger of this company into a 'survivor' company",
145
- "properties": {
146
- "surviving_company": {
147
- "type": ["object"],
148
- "description": "the surviving_company that this has been merged into",
149
- "properties": {
150
- "name": {
151
- "type": "string",
152
- "description": "The legal name of the surviving company",
153
- "minLength": 1
154
- },
155
- "company_number": {
156
- "type": "string",
157
- "description": "The company_number of the surviving company, if known",
158
- "minLength": 1
159
- },
160
- "jurisdiction": {
161
- "type": "string",
162
- "description": "The jurisdiction of incorporation of the surviving company",
163
- "minLength": 2
164
- }
165
- },
166
- "anyOf": [{"required": ["name"]},
167
- {"required": ["company_number"]}]
168
- },
169
- "effective_date": {
170
- "type": "string",
171
- "format": "date",
172
- "description": "The date of the merger"
173
- }
174
- },
175
- "additionalProperties": false,
176
- "required": ["surviving_company"]
177
- }
178
- }
179
- }
180
- },
181
- "additionalProperties": false,
182
- "required": ["company_number", "name", "jurisdiction_code"]
183
- }
@@ -1,27 +0,0 @@
1
- {
2
- "title": "Financial-Payment",
3
- "description": "A Financial-Payment is a payment from government to a recipient",
4
- "$schema": "http://json-schema.org/draft-04/schema#",
5
- "type": "object",
6
- "properties": {
7
- "source_jurisdiction": {
8
- "description": "Jurisdiction of the source of the data",
9
- "type": "string"
10
- },
11
- "company": {
12
- "$ref": "includes/company.json"
13
- },
14
- "data": {
15
- "type": "array",
16
- "description": "This is an array of data objects, that is the objects which actually contain the data about the datum. Generally there will only be one element in this, although in for some types of data_types there may naturally be several releated to the same company, e.g. shareholders",
17
- "items": {
18
- "$ref": "includes/financial-payment-data-object.json"
19
- },
20
- "additionalItems": false
21
- }
22
- },
23
- "required": [
24
- "company",
25
- "data"
26
- ]
27
- }
@@ -1,23 +0,0 @@
1
- { "oneOf":
2
- [
3
- {
4
- "type": ["string","null"],
5
- "minLength": 2
6
- },
7
- {
8
- "name": "Address",
9
- "description": "An address object",
10
- "type": "object",
11
- "properties": { "street_address": { "type": "string" },
12
- "locality": {"type":"string"},
13
- "region": { "type": "string" },
14
- "postal_code": { "type": "string" },
15
- "country": { "type": "string" }
16
- },
17
- "anyOf": [ { "required": ["street_address"] },
18
- { "required": ["postal_code"] }
19
- ]
20
- }
21
- ]
22
- }
23
-
@@ -1,13 +0,0 @@
1
- {
2
- "name": "AlternativeName",
3
- "description": "An alternative name of a company, e.g. abbreviation, trading (including dba or doing business as), legal. As well as trading names etc, it can be used for storing alternative language representations of the legal name, in which case the language should be represented as two-letter ISO-639 code",
4
- "type": "object",
5
- "properties": { "company_name": { "type": "string", "minLength": 1 },
6
- "start_date": {"type":"string","format": "date"},
7
- "end_date": {"type":"string","format": "date"},
8
- "language": { "type": "string", "minLength": 2, "maxLength": 2 },
9
- "type": { "type": "string", "enum": ["trading", "abbreviation", "legal"] }
10
- },
11
- "required": [ "company_name", "type" ]
12
- }
13
-
@@ -1,16 +0,0 @@
1
- {
2
- "name": "Company",
3
- "description": "A company which is the subject of a statement",
4
- "type": "object",
5
- "properties": {
6
- "name": { "type": "string" },
7
- "jurisdiction": { "type": "string" },
8
- "company_number": { "type": "string" },
9
- "identifier": {
10
- "type": "string",
11
- "description": "An official identifier paired with a code for the issuer of the identifier, e.g sec/12345",
12
- "pattern": "^[^/]+/[^/]+$"
13
- }
14
- },
15
- "required": [ "name", "jurisdiction" ]
16
- }
@@ -1,20 +0,0 @@
1
- {
2
- "name": "Filing",
3
- "description": "A statutory filing",
4
- "type": "object",
5
- "properties": { "title": { "type": "string" },
6
- "date": {"type":"string","format": "date"},
7
- "description": { "type": "string" },
8
- "uid": { "type": "string" },
9
- "url": { "type": "string" },
10
- "filing_type_code": { "type": "string" },
11
- "filing_type_name": { "type": "string" },
12
- "other_attributes": { "type": "object" }
13
- },
14
- "required": [ "date" ],
15
- "anyOf": [ { "required": ["title"] },
16
- { "required": ["description"] },
17
- { "required": ["filing_type_name"] }
18
- ]
19
- }
20
-
@@ -1,60 +0,0 @@
1
- {
2
- "name": "Financial Payment Datum",
3
- "type": "object",
4
- "properties": {
5
- "data_type": { "enum": [ "financial_payment" ] },
6
- "source_url": {
7
- "type": "string"},
8
- "confidence": {
9
- "type": "string"},
10
- "properties": {
11
- "type": "object",
12
- "properties": {
13
- "value": {
14
- "description": "The amount transacted (e.g. 19.95)",
15
- "type": "string"},
16
- "payee_name": {
17
- "description": "The name of the payee (the entity that received the money)",
18
- "type": "string"},
19
- "currency": {
20
- "description": "The currency of the payment (three letter symbol, e.g. USD, GBP, EUR)",
21
- "type": "string"},
22
- "date": {
23
- "description": "The date on which the payment was made",
24
- "type": "date"},
25
- "transaction_number": {
26
- "description": "The unique identifier for the transaction, scoped to this bot",
27
- "type": "string"},
28
- "jurisdiction": {
29
- "description": "The jurisdiction of the body that made the payment, eg. UK, France, Delaware, Manchester",
30
- "type": "string"},
31
- "more_details_url": {
32
- "description": "A url from which more details can be seen (may be the same as the source_url)",
33
- "type": ["string",null]},
34
- "description": {
35
- "description": "The description of the transaction as given in the raw data",
36
- "type": ["string",null]},
37
- "expense_type": {
38
- "description": "The type of expense -- can be either capital, revenue (i.e. current expenditure) or null",
39
- "enum": ["capital","revenue",null]},
40
- "expense_area": {
41
- "description": "category (in words) of the expenditure",
42
- "type": ["string",null]},
43
- "entity_name": {
44
- "description": "The name of the government entity that made the payment, e.g. Environment Agency",
45
- "type": "string"},
46
- "entity_uri": {
47
- "description": "A unique URL (ideally a dereferencable URI) for the government entity",
48
- "type": ["string",null]},
49
- "department_name": {
50
- "description": "The name of the government department which the entity belongs to (if relevant), e.g. Department of Health",
51
- "type": ["string",null]},
52
- "csv_line_number": {
53
- "description": "If the source for the data is a CSV file, you can optionally include the line number of the CSV from which this data was retrieved",
54
- "type": ["string",null]}
55
- },
56
- "required": [ "value", "payee_name", "date","currency" ]
57
- }
58
- },
59
- "required": [ "data_type", "properties","source_url","confidence" ]
60
- }