fidor_schema 0.1.18

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,158 @@
1
+ {
2
+ "type" : "object",
3
+ "title" : "Sepa Mandate",
4
+ "name" : "sepa_mandate",
5
+ "description" : "A mandate object authorizing debits from an account.",
6
+ "properties" : {
7
+ "id" : {
8
+ "$ref" : "./base_types/base_types.json#definitions/id"
9
+ },
10
+ "external_uid" : {
11
+ "$ref" : "./base_types/base_types.json#definitions/external_uid",
12
+ "required" : true
13
+ },
14
+ "customer_id" : {
15
+ "description" : "Customer for which this mandate is valid.",
16
+ "type" : "integer",
17
+ "required" : true
18
+ },
19
+ "user_id" : {
20
+ "$ref" : "./base_types/base_types.json#definitions/user_id"
21
+ },
22
+ "mandate_reference" : {
23
+ "description" : "Unique reference of the mandate.",
24
+ "type" : "string",
25
+ "required" : true,
26
+ "maxLength" : 35
27
+ },
28
+ "sequence" : {
29
+ "description" : "Recurring or One-Time",
30
+ "type" : "string",
31
+ "default" : "RCUR",
32
+ "enum" : [
33
+ "RCUR",
34
+ "OOFF"
35
+ ]
36
+ },
37
+ "cor1_option" : {
38
+ "description" : "COR-1 option",
39
+ "type" : "string",
40
+ "default" : "1",
41
+ "enum" : [
42
+ "0",
43
+ "1"
44
+ ]
45
+ },
46
+ "remote_title" : {
47
+ "description" : "Title of the debtor e.g Dr. Prof.",
48
+ "type" : "string",
49
+ "required" : true,
50
+ "maxLength" : 35
51
+ },
52
+ "remote_name" : {
53
+ "description" : "Full name of debtor",
54
+ "type" : "string",
55
+ "required" : true,
56
+ "maxLength" : 70
57
+ },
58
+ "remote_email" : {
59
+ "description" : "Debtor's email",
60
+ "type" : "string",
61
+ "required" : true,
62
+ "maxLength" : 70
63
+ },
64
+ "remote_address_line1" : {
65
+ "description" : "Address street.",
66
+ "type" : "string",
67
+ "required" : true,
68
+ "maxLength" : 35
69
+ },
70
+ "remote_address_line2" : {
71
+ "description" : "ZIP and City",
72
+ "type" : "string",
73
+ "required" : true,
74
+ "maxLength" : 70
75
+ },
76
+ "remote_country" : {
77
+ "description" : "2 digit country code, ISO 3166",
78
+ "type" : "string",
79
+ "required" : true,
80
+ "maxLength" : 2
81
+ },
82
+ "remote_iban" : {
83
+ "$ref" : "./base_types/base_types.json#definitions/iban",
84
+ "required" : true
85
+ },
86
+ "remote_bic" : {
87
+ "$ref" : "./base_types/base_types.json#definitions/bic",
88
+ "required" : true
89
+ },
90
+ "remote_ultimate_name" : {
91
+ "description" : "Ultimate name",
92
+ "type" : "string",
93
+ "maxLength" : 70
94
+ },
95
+ "remote_signature_location" : {
96
+ "description" : "Location where debtor signed the mandate.",
97
+ "type" : "string",
98
+ "maxLength" : 70
99
+ },
100
+ "signature_date" : {
101
+ "description" : "Date the mandate was signed of by the debtor.",
102
+ "format" : "date",
103
+ "required" : true,
104
+ "type" : "string"
105
+ },
106
+ "valid_from_date" : {
107
+ "description" : "Date the mandate started to be valid.",
108
+ "format" : "date",
109
+ "type" : "string"
110
+ }
111
+ },
112
+ "links" : [
113
+ {
114
+ "rel" : "self",
115
+ "href" : "sepa_mandates/{id}"
116
+ },
117
+ {
118
+ "rel" : "instances",
119
+ "href" : "sepa_mandates",
120
+ "properties" : {
121
+ "filter[mandate_reference]" : {
122
+ "title" : "Search",
123
+ "description" : "Search by mandate reference",
124
+ "type" : "string"
125
+ },
126
+ "filter[remote_iban]" : {
127
+ "title" : "Search",
128
+ "description" : "Search by remote iban",
129
+ "type" : "string"
130
+ },
131
+ "page" : {
132
+ "title" : "Page",
133
+ "description" : "In paginated results set the page to look for",
134
+ "type" : "number"
135
+ },
136
+ "per_page" : {
137
+ "title" : "Per page",
138
+ "description" : "Results per page. Default is 10, max is 100",
139
+ "type" : "number"
140
+ },
141
+ "sort" : {
142
+ "title" : "Sort",
143
+ "enum" : [
144
+ "ASC",
145
+ "DESC"
146
+ ],
147
+ "description" : "Sort the results in ASC or DESC",
148
+ "type" : "string"
149
+ }
150
+ }
151
+ },
152
+ {
153
+ "rel" : "create",
154
+ "href" : "sepa_mandates",
155
+ "method" : "POST"
156
+ }
157
+ ]
158
+ }
@@ -0,0 +1,134 @@
1
+ {
2
+ "type" : "object",
3
+ "title" : "Transaction",
4
+ "name" : "transaction",
5
+ "description" : "A transaction is the result of a successful transfer or debit.",
6
+ "properties" : {
7
+ "id" : {
8
+ "$ref" : "./base_types/base_types.json#definitions/id"
9
+ },
10
+ "account_id" : {
11
+ "$ref" : "./base_types/base_types.json#definitions/account_id",
12
+ "readonly" : true
13
+ },
14
+ "transaction_type" : {
15
+ "$ref" : "./base_types/base_types.json#definitions/transaction_type",
16
+ "readonly" : true
17
+ },
18
+ "transaction_type_details" : {
19
+ "description" : "Details specific to this transaction type are collected here.",
20
+ "readonly" : true,
21
+ "type" : "object",
22
+ "oneOf" : [
23
+ {
24
+ "$ref" : "./transaction_type_details/credit_card_details.json#properties"
25
+ },
26
+ {
27
+ "$ref" : "./transaction_type_details/internal_transfer_details.json#properties"
28
+ },
29
+ {
30
+ "$ref" : "./transaction_type_details/sepa_credit_transfer_details.json#properties"
31
+ },
32
+ {
33
+ "$ref" : "./transaction_type_details/sepa_direct_debit_details.json#properties"
34
+ }
35
+ ]
36
+ },
37
+ "subject" : {
38
+ "$ref" : "./base_types/base_types.json#definitions/subject",
39
+ "readonly" : true
40
+ },
41
+ "amount" : {
42
+ "$ref" : "./base_types/base_types.json#definitions/amount",
43
+ "readonly" : true
44
+ },
45
+ "booking_date" : {
46
+ "description" : "Date the transaction was booked.",
47
+ "format" : "date-time",
48
+ "readonly" : true,
49
+ "type" : "string"
50
+ },
51
+ "value_date" : {
52
+ "description" : "Date the amount was credited to the account (Wertstellung).",
53
+ "format" : "date",
54
+ "readonly" : true,
55
+ "type" : "string"
56
+ },
57
+ "booking_code" : {
58
+ "description" : "Accounting transaction code in the central banking system",
59
+ "readonly" : true,
60
+ "type" : "string"
61
+ },
62
+ "return_transaction_id" : {
63
+ "description" : "If the transaction was marked for return, this references the new return transaction.",
64
+ "readonly" : true,
65
+ "type" : "integer"
66
+ },
67
+ "created_at" : {
68
+ "$ref" : "./base_types/base_types.json#definitions/created_at"
69
+ },
70
+ "updated_at" : {
71
+ "$ref" : "./base_types/base_types.json#definitions/updated_at"
72
+ }
73
+ },
74
+ "links" : [
75
+ {
76
+ "rel" : "self",
77
+ "href" : "transactions/{id}"
78
+ },
79
+ {
80
+ "rel" : "instances",
81
+ "href" : "transactions",
82
+ "properties" : {
83
+ "filter[account_ids]" : {
84
+ "title" : "Find transactions belonging to the given account ids. Single id or multiple ids comma-separated.",
85
+ "format" : "date",
86
+ "type" : "string"
87
+ },
88
+ "filter[id_from]" : {
89
+ "title" : "Find transactions with an id greater than given one.",
90
+ "format" : "integer",
91
+ "type" : "string"
92
+ },
93
+ "filter[id_to]" : {
94
+ "title" : "Find transactions with an id smaller than given one.",
95
+ "format" : "integer",
96
+ "type" : "string"
97
+ },
98
+ "filter[booking_date_from]" : {
99
+ "title" : "Date filter from >= date",
100
+ "format" : "date-time",
101
+ "type" : "string"
102
+ },
103
+ "filter[booking_date_to]" : {
104
+ "title" : "Date filter to <= date",
105
+ "format" : "date-time",
106
+ "type" : "string"
107
+ },
108
+ "filter[kinds]" : {
109
+ "$ref" : "./base_types/base_types.json#definitions/transaction_type",
110
+ "title" : "By transaction types"
111
+ },
112
+ "page" : {
113
+ "title" : "Page",
114
+ "description" : "In paginated results set the page to look for",
115
+ "type" : "number"
116
+ },
117
+ "per_page" : {
118
+ "title" : "Per page",
119
+ "description" : "Results per page. Default is 10, max is 100",
120
+ "type" : "number"
121
+ },
122
+ "sort" : {
123
+ "title" : "Sort",
124
+ "enum" : [
125
+ "ASC",
126
+ "DESC"
127
+ ],
128
+ "description" : "Sort the results in ASC or DESC",
129
+ "type" : "string"
130
+ }
131
+ }
132
+ }
133
+ ]
134
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "type" : "object",
3
+ "title" : "Credit Card Details",
4
+ "name" : "credit_card_details",
5
+ "description" : "Credit card information available in a CreditCard transaction",
6
+ "properties" : {
7
+ "cc_merchant_name" : {
8
+ "description" : "CreditCard merchant initiating the transaction",
9
+ "type" : "string",
10
+ "maxLength" : 255,
11
+ "readonly" : true
12
+ },
13
+ "cc_merchant_category" : {
14
+ "description" : "Category given by the merchant",
15
+ "type" : "string",
16
+ "maxLength" : 255,
17
+ "readonly" : true
18
+ },
19
+ "cc_type" : {
20
+ "description" : "CreditCard type",
21
+ "type" : "string",
22
+ "maxLength" : 255,
23
+ "readonly" : true
24
+ },
25
+ "cc_category" : {
26
+ "description" : "CreditCard category",
27
+ "type" : "string",
28
+ "maxLength" : 255,
29
+ "readonly" : true
30
+ }
31
+ }
32
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "type" : "object",
3
+ "title" : "Internal Transfer Details",
4
+ "name" : "internal_transfer_details",
5
+ "description" : "Remote account for a Fidor internal transfer",
6
+ "properties" : {
7
+ "remote_account_id" : {
8
+ "$ref" : "./base_types/base_types.json#definitions/account_id",
9
+ "readonly" : true
10
+ },
11
+ "internal_transfer_id" : {
12
+ "description" : "Id of transfer if transaction was created by a transfer. Refunded transactions have no id",
13
+ "readonly" : true,
14
+ "type" : "integer"
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "type" : "object",
3
+ "title" : "Sepa Credit Transfer Details",
4
+ "name" : "sepa_credit_transfer_details",
5
+ "description" : "Remote account information available in a SEPA credit transfer",
6
+ "properties" : {
7
+ "sepa_credit_transfer_id" : {
8
+ "description" : "Id of transfer if transaction was created by a transfer. Refunded transactions have no id",
9
+ "readonly" : true,
10
+ "type" : "integer"
11
+ },
12
+ "remote_name" : {
13
+ "description" : "Receiving/Sending account holder name",
14
+ "type" : "string",
15
+ "readonly" : true,
16
+ "maxLength" : 70
17
+ },
18
+ "remote_iban" : {
19
+ "$ref" : "./base_types/base_types.json#definitions/iban",
20
+ "readonly" : true
21
+ },
22
+ "remote_bic" : {
23
+ "$ref" : "./base_types/base_types.json#definitions/bic",
24
+ "readonly" : true
25
+ }
26
+ }
27
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "type" : "object",
3
+ "title" : "Sepa Direct Debit Details",
4
+ "name" : "sepa_direct_debit_details",
5
+ "description" : "Remote account information for a SEPA direct debit",
6
+ "properties" : {
7
+ "remote_iban" : {
8
+ "$ref" : "./base_types/base_types.json#definitions/iban",
9
+ "readonly" : true
10
+ },
11
+ "remote_bic" : {
12
+ "$ref" : "./base_types/base_types.json#definitions/bic",
13
+ "readonly" : true
14
+ },
15
+ "mandate_id" : {
16
+ "description" : "The sepa mandate used by the debit",
17
+ "type" : "number",
18
+ "readonly" : true
19
+ },
20
+ "eref" : {
21
+ "$ref" : "./base_types/base_types.json#definitions/eref",
22
+ "readonly" : true
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "type" : "object",
3
+ "title" : "User",
4
+ "name" : "user",
5
+ "description" : "",
6
+ "properties" : {
7
+ "id" : {
8
+ "$ref" : "./base_types/base_types.json#definitions/id"
9
+ },
10
+ "email" : {
11
+ "$ref" : "./base_types/base_types.json#definitions/email",
12
+ "required" : true,
13
+ "readonly" : true
14
+ },
15
+ "last_sign_in_at" : {
16
+ "description" : "Last time the user accessed fidor.",
17
+ "format" : "date-time",
18
+ "readonly" : true,
19
+ "type" : "string"
20
+ },
21
+ "created_at" : {
22
+ "$ref" : "./base_types/base_types.json#definitions/created_at"
23
+ },
24
+ "updated_at" : {
25
+ "$ref" : "./base_types/base_types.json#definitions/updated_at"
26
+ }
27
+ },
28
+ "links" : [
29
+ {
30
+ "rel" : "self",
31
+ "href" : "users/current"
32
+ }
33
+ ]
34
+ }
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+
3
+ describe Fidor::Schema do
4
+
5
+ context 'path' do
6
+ it 'should provide path to schema files' do
7
+ expect(Fidor::Schema.path).to eq(File.expand_path( File.join('../schema/v1.0'), File.dirname(__FILE__)))
8
+ end
9
+ end
10
+
11
+ context 'read schemata' do
12
+
13
+ it 'should read all json files' do
14
+ SchemaTools.schema_path = Fidor::Schema.path
15
+ SchemaTools::Reader.read_all
16
+ expect(SchemaTools::Reader.registry).to_not be_empty
17
+ end
18
+
19
+ end
20
+ end
@@ -0,0 +1,10 @@
1
+ # encoding: utf-8
2
+ $:.unshift(File.dirname(__FILE__))
3
+ $:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
4
+
5
+ require 'rspec'
6
+ require 'json_schema_tools'
7
+ require 'fidor_schema'
8
+
9
+ RSpec.configure do |config|
10
+ end
metadata ADDED
@@ -0,0 +1,157 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fidor_schema
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.18
5
+ platform: ruby
6
+ authors:
7
+ - Georg Leciejewski
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-10-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.5'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.5'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: activesupport
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: json_schema_tools
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: 0.2.6
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: 0.2.6
69
+ - !ruby/object:Gem::Dependency
70
+ name: activemodel
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rake
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ description: Fidor API description. Using JSON Schema to describe the available objects,
98
+ their fields and resource links.
99
+ email: dev@fidor.de
100
+ executables: []
101
+ extensions: []
102
+ extra_rdoc_files: []
103
+ files:
104
+ - ".gitignore"
105
+ - CHANGELOG.md
106
+ - Gemfile
107
+ - README.md
108
+ - Rakefile
109
+ - fidor_schema.gemspec
110
+ - lib/fidor/schema.rb
111
+ - lib/fidor_schema.rb
112
+ - lib/fidor_schema_version.rb
113
+ - schema/v1.0/account.json
114
+ - schema/v1.0/base_types/base_types.json
115
+ - schema/v1.0/batch_direct_debit.json
116
+ - schema/v1.0/batch_transfer.json
117
+ - schema/v1.0/customer.json
118
+ - schema/v1.0/error.json
119
+ - schema/v1.0/internal_transfer.json
120
+ - schema/v1.0/sepa_credit_transfer.json
121
+ - schema/v1.0/sepa_direct_debit.json
122
+ - schema/v1.0/sepa_mandate.json
123
+ - schema/v1.0/transaction.json
124
+ - schema/v1.0/transaction_type_details/credit_card_details.json
125
+ - schema/v1.0/transaction_type_details/internal_transfer_details.json
126
+ - schema/v1.0/transaction_type_details/sepa_credit_transfer_details.json
127
+ - schema/v1.0/transaction_type_details/sepa_direct_debit_details.json
128
+ - schema/v1.0/user.json
129
+ - spec/fidor_schema_spec.rb
130
+ - spec/spec_helper.rb
131
+ homepage: https://www.fidor.de
132
+ licenses:
133
+ - MIT
134
+ metadata: {}
135
+ post_install_message:
136
+ rdoc_options: []
137
+ require_paths:
138
+ - lib
139
+ required_ruby_version: !ruby/object:Gem::Requirement
140
+ requirements:
141
+ - - ">="
142
+ - !ruby/object:Gem::Version
143
+ version: '0'
144
+ required_rubygems_version: !ruby/object:Gem::Requirement
145
+ requirements:
146
+ - - ">="
147
+ - !ruby/object:Gem::Version
148
+ version: '0'
149
+ requirements: []
150
+ rubyforge_project:
151
+ rubygems_version: 2.2.2
152
+ signing_key:
153
+ specification_version: 4
154
+ summary: Fidor API - JSON Schema
155
+ test_files:
156
+ - spec/fidor_schema_spec.rb
157
+ - spec/spec_helper.rb