sk_api_schema 0.9.5 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -3,9 +3,28 @@
3
3
  See [commit messages](https://github.com/salesking/sk_api_schema/commits/) for details.
4
4
  Also sign up to our [Developer Newsletter](http://www.salesking.eu/dev/newsletter/) to stay up-to-date !!!
5
5
 
6
+ ##2014-05
7
+
8
+ * add ability to create products from line items
9
+ * search account_entries by document_ids
10
+ * account_entries show related document and line item
11
+ * new Task resource
12
+
13
+ ##2014-04
14
+
15
+ * add account billing object - BETA
16
+ * add account default_price, default_unit, hide_fields
17
+ * filter accounts by balance range, contact_ids
18
+ * filter account entries by billing date, unbilled and billable
19
+
20
+ ##2014-03
21
+
22
+ * filter account entries by account ids
23
+
6
24
  ##2014-02
7
25
 
8
- * clarify team use: a team bubbles down from a contact to its documents and their related objects (comments, atms, emails). When the team changed for a contact all related objects are updated with the new team.
26
+ * clarify team use: a team bubbles down from a contact to its documents and their related objects (comments, attachments, emails). On team change for a contact all related objects are updated with the new team.
27
+ * Add accounts + account entries - BETA
9
28
 
10
29
  ##2014-01
11
30
 
@@ -0,0 +1,162 @@
1
+ { "type":"object",
2
+ "title": "account",
3
+ "name": "account",
4
+ "description": "BETA An account to track times, expenses, projects, usages, etc. Those are single entry accounts, opposed to double entry accounting in bookkeeping accounts.",
5
+ "properties":{
6
+ "id":{
7
+ "description":"Unique identifier - UUID",
8
+ "identity":true,
9
+ "readonly":true,
10
+ "type":"string",
11
+ "maxLength": 22,
12
+ "minLength":22
13
+ },
14
+ "number":{
15
+ "description": "Unique number assigned by you or if empty SK account number schema.",
16
+ "type":"string",
17
+ "maxLength": 50
18
+ },
19
+ "name":{
20
+ "description": "The name of the account",
21
+ "type":"string",
22
+ "required":true,
23
+ "maxLength": 100
24
+ },
25
+ "description":{
26
+ "description": "Account description",
27
+ "type":"string",
28
+ "format":"text",
29
+ "maxLength": 255
30
+ },
31
+ "balance":{
32
+ "description": "The account balance is the sum of all entries, also those from sub-accounts.",
33
+ "type":"number",
34
+ "readonly":true
35
+ },
36
+ "default_price":{
37
+ "description": "The default price single for new account entries. Is only used if price single is left empty on create.",
38
+ "type":"number"
39
+ },
40
+ "default_unit":{
41
+ "description": "The default quantity unit for new account entries. Is only used if unit is left empty on create.",
42
+ "type":"string",
43
+ "maxLength": 30
44
+ },
45
+ "hide_fields":{
46
+ "description": "A list of account entry field names. The fields are hidden on account entry lists and forms so one can focus on the important inputs. For example hide: tax,description,billed_at",
47
+ "type":"string",
48
+ "maxLength": 255
49
+ },
50
+ "contact_id":{
51
+ "description": "The contacts uuid to which the account is related.",
52
+ "type":"string",
53
+ "maxLength": 22,
54
+ "minLength":22
55
+ },
56
+ "created_at":{
57
+ "description": "Date the object was created in SK. Never changes afterwards",
58
+ "format":"date-time",
59
+ "readonly":true,
60
+ "type":"string"
61
+ },
62
+ "updated_at":{
63
+ "description": "Date the object was edited in SK.",
64
+ "format":"date-time",
65
+ "readonly":true,
66
+ "type":"string"
67
+ },
68
+ "team_id":{
69
+ "description": "A team uuid. If set only the team and its parent teams can see the record.",
70
+ "type":"string",
71
+ "maxLength": 22,
72
+ "minLength":22
73
+ },
74
+ "creator_id":{
75
+ "description": "The user uuid who created the record.",
76
+ "type":"string",
77
+ "maxLength": 22,
78
+ "minLength":22,
79
+ "readonly":true
80
+ }
81
+ },
82
+ "links":[
83
+ { "rel": "self",
84
+ "href": "accounts/{id}"
85
+ },
86
+ { "rel": "instances",
87
+ "href": "accounts",
88
+ "properties" : {
89
+ "filter[q]":{
90
+ "title" : "Search",
91
+ "description": "Wildcard search in number, name, description",
92
+ "type":"string"
93
+ },
94
+ "filter[number]":{
95
+ "title" : "By number",
96
+ "description": "Search by exact number",
97
+ "type":"string"
98
+ },
99
+ "filter[balance_from]":{
100
+ "title" : "By balance from",
101
+ "description": "Find account with a balance greater(>=) than given number.",
102
+ "type":"number"
103
+ },
104
+ "filter[balance_to]":{
105
+ "title" : "By balance to",
106
+ "description": "Find accounts with a balance smaller(<=) than given number.",
107
+ "type":"number"
108
+ },
109
+ "filter[contact_ids]":{
110
+ "title" : "Contacts",
111
+ "description": "Find objects belonging to a single or a list of contacts, use ids comma separated.",
112
+ "type" : "string"
113
+ },
114
+ "filter[parent_id]":{
115
+ "title" : "By parent",
116
+ "description": "Search children of the given account.",
117
+ "type":"string"
118
+ },
119
+ "page":{
120
+ "title" : "Page",
121
+ "description": "In paginated results set the page to look for",
122
+ "type":"number"
123
+ },
124
+ "per_page":{
125
+ "title" : "Per page",
126
+ "description": "Results per page. Default is 10, max is 100",
127
+ "type":"number"
128
+ },
129
+ "sort_by":{
130
+ "title" : "Sort by",
131
+ "description": "Sort the results by the given field => number",
132
+ "enum":["name","number","balance", "created_at", "updated_at"],
133
+ "type": "string"
134
+ },
135
+ "sort":{
136
+ "title" : "Sort",
137
+ "enum":["ASC","DESC"],
138
+ "description": "Sort the results in ASC or DESC",
139
+ "type": "string"
140
+ }
141
+ }
142
+ },
143
+ { "rel": "destroy",
144
+ "href": "accounts/{id}",
145
+ "method": "DELETE"
146
+ },
147
+ { "rel": "update",
148
+ "href": "accounts/{id}",
149
+ "method": "PUT"
150
+ },
151
+ { "rel": "create",
152
+ "href": "accounts",
153
+ "method": "POST"
154
+ },
155
+ { "rel": "account_entries",
156
+ "href": "accounts/{id}/account_entries"
157
+ },
158
+ { "rel": "account_billings",
159
+ "href": "accounts/{id}/account_billings"
160
+ }
161
+ ]
162
+ }
@@ -0,0 +1,130 @@
1
+ { "type":"object",
2
+ "title": "account_billing",
3
+ "name": "account_billing",
4
+ "description": "BETA An account billing serves as the glue between an account a document and their related account entries and line items. It also lets one keep track of who billed what and when. A billing is created from billable account entries, which are turned into line items for a document.",
5
+ "properties":{
6
+ "id":{
7
+ "description":"Unique identifier - UUID",
8
+ "identity":true,
9
+ "readonly":true,
10
+ "type":"string",
11
+ "maxLength": 22,
12
+ "minLength":22
13
+ },
14
+ "name":{
15
+ "description": "A note for the billing e.g. happyPDF usage April 2014. The field is wildcard searchable",
16
+ "type":"string",
17
+ "maxLength": 100
18
+ },
19
+ "account_id":{
20
+ "description": "The related account.",
21
+ "type":"string",
22
+ "required":true,
23
+ "maxLength": 22,
24
+ "minLength":22
25
+ },
26
+ "group_entries_by":{
27
+ "description": "Group multiple account entries into single line items, when creating a billing+document from entries. Account entries MUST have the SAME price_single and quantity unit, to land in a group. Date base groups also require the SAME entry name.",
28
+ "type":"string",
29
+ "enum": ["none", "name", "day", "week", "month", "year"]
30
+ },
31
+ "document_type":{
32
+ "description": "The document type to create. CamelCase document class name",
33
+ "type":"string",
34
+ "default" : "Invoice",
35
+ "enum": ["Invoice", "CreditNote", "Order", "Estimate"]
36
+ },
37
+ "set_billed_at":{
38
+ "description": "Set billed at date for related account entries.",
39
+ "type":"boolean",
40
+ "default" : false
41
+ },
42
+ "document_id":{
43
+ "description": "The document created by the billing.",
44
+ "type":"string",
45
+ "maxLength": 22,
46
+ "minLength":22
47
+ },
48
+ "created_at":{
49
+ "description": "Date the object was created in SK. Never changes afterwards",
50
+ "format":"date-time",
51
+ "readonly":true,
52
+ "type":"string"
53
+ },
54
+ "team_id":{
55
+ "description": "A team uuid. Is inferred from the accounts team id.",
56
+ "type":"string",
57
+ "maxLength": 22,
58
+ "minLength":22
59
+ },
60
+ "creator_id":{
61
+ "description": "The user uuid who created the record.",
62
+ "type":"string",
63
+ "maxLength": 22,
64
+ "minLength":22,
65
+ "readonly":true
66
+ }
67
+ },
68
+ "links":[
69
+ { "rel": "self",
70
+ "href": "account_billings/{id}"
71
+ },
72
+ { "rel": "instances",
73
+ "href": "account_billings",
74
+ "properties" : {
75
+ "filter[q]":{
76
+ "title" : "Search",
77
+ "description": "Wildcard search in name",
78
+ "type":"string"
79
+ },
80
+ "filter[account_ids]":{
81
+ "title" : "Accounts",
82
+ "description": "Find objects belonging to a single or a list of accounts, use ids comma separated.",
83
+ "type" : "string"
84
+ },
85
+ "filter[created_at_from]":{
86
+ "title" : "From creation date",
87
+ "description": "Objects with a date eq/after the date. YYYY-MM-DD",
88
+ "format" : "date",
89
+ "type" : "string"
90
+ },
91
+ "filter[created_at_to]":{
92
+ "title" : "To creation date",
93
+ "description": "Objects with a creation until the date(<=). ISO 8601 format YYY-MM-DDThh:mm:ss+z or just a date YYY-MM-DD. If date is given the time is set to the end of the day(23:59:59) so all objects created on that day are included. A time should be already utc time.",
94
+ "format" : "date",
95
+ "type" : "string"
96
+ },
97
+ "page":{
98
+ "title" : "Page",
99
+ "description": "In paginated results set the page to look for",
100
+ "type":"number"
101
+ },
102
+ "per_page":{
103
+ "title" : "Per page",
104
+ "description": "Results per page. Default is 10, max is 100",
105
+ "type":"number"
106
+ },
107
+ "sort_by":{
108
+ "title" : "Sort by",
109
+ "description": "Sort the results by the given field => number",
110
+ "enum":["name","number","balance", "created_at", "updated_at"],
111
+ "type": "string"
112
+ },
113
+ "sort":{
114
+ "title" : "Sort",
115
+ "enum":["ASC","DESC"],
116
+ "description": "Sort the results in ASC or DESC",
117
+ "type": "string"
118
+ }
119
+ }
120
+ },
121
+ { "rel": "destroy",
122
+ "href": "account_billings/{id}",
123
+ "method": "DELETE"
124
+ },
125
+ { "rel": "create",
126
+ "href": "account_billings",
127
+ "method": "POST"
128
+ }
129
+ ]
130
+ }
@@ -0,0 +1,212 @@
1
+ { "type":"object",
2
+ "title": "account_entry",
3
+ "name": "account_entry",
4
+ "description": "A entry for an account",
5
+ "properties":{
6
+ "id":{
7
+ "description":"Unique identifier - UUID",
8
+ "identity":true,
9
+ "readonly":true,
10
+ "type":"string",
11
+ "maxLength": 22,
12
+ "minLength":22
13
+ },
14
+ "account_id":{
15
+ "description":"Account the entry belongs to.",
16
+ "required":true,
17
+ "type":"string",
18
+ "maxLength": 22,
19
+ "minLength":22
20
+ },
21
+ "document_id":{
22
+ "description":"Document the entry is related to. This relation is set by an account billing.",
23
+ "readonly":true,
24
+ "type":"string",
25
+ "maxLength": 22,
26
+ "minLength":22
27
+ },
28
+ "item_id":{
29
+ "description":"Line item on the document the entry is related to. This relation is set by an account billing.",
30
+ "readonly":true,
31
+ "type":"string",
32
+ "maxLength": 22,
33
+ "minLength":22
34
+ },
35
+ "name":{
36
+ "description": "The name of an entry",
37
+ "type":"string",
38
+ "maxLength": 50
39
+ },
40
+ "description":{
41
+ "description": "Entry description",
42
+ "type":"string",
43
+ "format": "text"
44
+ },
45
+ "price_single":{
46
+ "description": "Net price of a single entry. If a product id is given, price_single is taken from the product if not set.",
47
+ "type":"number",
48
+ "required" : true
49
+ },
50
+ "net_total":{
51
+ "description": "Net price of a single entry. Calculated from price_single * quantity",
52
+ "readonly":true,
53
+ "type":"number"
54
+ },
55
+ "tax":{
56
+ "description": "Tax percentage",
57
+ "type":"number"
58
+ },
59
+ "quantity_unit":{
60
+ "description": "Quantity unit: kg, days, month.",
61
+ "type":"string",
62
+ "maxLength": 30
63
+ },
64
+ "quantity":{
65
+ "description": "Quantity of the entry.",
66
+ "type":"number",
67
+ "default": 1
68
+ },
69
+ "date":{
70
+ "description": "Date of the entry. Defaults to today. Entries are sorted by date per default.",
71
+ "format":"date-time",
72
+ "type":"string"
73
+ },
74
+ "billable":{
75
+ "description": "True if the entry can be billed.",
76
+ "type":"boolean",
77
+ "default": false
78
+ },
79
+ "billed_at":{
80
+ "description": "Date the object was billed. Is set when the entry is used on an invoice",
81
+ "format":"date-time",
82
+ "type":"string"
83
+ },
84
+ "created_at":{
85
+ "description": "Date the object was created in SK. Never changes afterwards",
86
+ "format":"date-time",
87
+ "readonly":true,
88
+ "type":"string"
89
+ },
90
+ "updated_at":{
91
+ "description": "Date the object was edited in SK.",
92
+ "format":"date-time",
93
+ "readonly":true,
94
+ "type":"string"
95
+ },
96
+ "_destroy":{
97
+ "description": "When set an existing entry will be deleted. This switch is used for entries passed during batch operations.",
98
+ "type":"boolean"
99
+ }
100
+ },
101
+ "links":[
102
+
103
+ { "rel": "self",
104
+ "href": "account_entries/{id}"
105
+ },
106
+ { "rel": "instances",
107
+ "href": "account_entries",
108
+ "properties" : {
109
+ "page":{
110
+ "title" : "Page",
111
+ "description": "In paginated results set the page to look for",
112
+ "type":"number"
113
+ },
114
+ "per_page":{
115
+ "title" : "Per page",
116
+ "description": "Results per page. Default is 10, max is 100",
117
+ "type":"number"
118
+ },
119
+ "filter[q]":{
120
+ "title" : "Search",
121
+ "description": "Wildcard search in name, description",
122
+ "type":"string"
123
+ },
124
+ "filter[account_ids]":{
125
+ "title" : "Search by related accounts",
126
+ "description": "Set multiple account ids comma separated or as array",
127
+ "type":"string"
128
+ },
129
+ "filter[document_ids]":{
130
+ "title" : "Search by related documents",
131
+ "description": "Set multiple document ids comma separated or as array",
132
+ "type":"string"
133
+ },
134
+ "filter[ids]":{
135
+ "title" : "Search by account entry ids",
136
+ "description": "Set multiple entry ids comma separated or as array",
137
+ "type":"string"
138
+ },
139
+ "filter[unbilled]":{
140
+ "title" : "Unbilled",
141
+ "description": "Entries available for billing: marked as billable without a billing date(billed_at) set. False values will skip this filter. To find billed entries simply use filter[billed_at_to] e.g with todays date.",
142
+ "type":"boolean"
143
+ },
144
+ "filter[billable]":{
145
+ "title" : "Billable",
146
+ "description": "Billable or not billable entries. Set false(string) or 0(Integer) to get not billable entries. For billable entries use true or 1. Also see filter[unbilled] to find not yet billed entries.",
147
+ "type":"boolean"
148
+ },
149
+ "filter[date_from]":{
150
+ "title" : "From date",
151
+ "description": "Objects with a date eq/after the date. YYYY-MM-DD",
152
+ "format" : "date",
153
+ "type" : "string"
154
+ },
155
+ "filter[date_to]":{
156
+ "title" : "To date",
157
+ "description": "Objects with date eq/before the date. YYYY-MM-DD",
158
+ "format" : "date",
159
+ "type" : "string"
160
+ },
161
+ "filter[billed_at_from]":{
162
+ "title" : "From billing date",
163
+ "description": "Objects with a billing date eq/after the date. YYYY-MM-DD",
164
+ "format" : "date",
165
+ "type" : "string"
166
+ },
167
+ "filter[billed_at_to]":{
168
+ "title" : "To billing date",
169
+ "description": "Objects with billing date eq/before the date. YYYY-MM-DD. A set billing date means the entry has been billed, so simply use this filter e.g with date today to find all billed entries.",
170
+ "format" : "date",
171
+ "type" : "string"
172
+ },
173
+ "filter[created_at_from]":{
174
+ "title" : "From creation date",
175
+ "description": "Objects with a date eq/after the date. YYYY-MM-DD",
176
+ "format" : "date",
177
+ "type" : "string"
178
+ },
179
+ "filter[created_at_to]":{
180
+ "title" : "To creation date",
181
+ "description": "Objects with a creation until the date(<=). ISO 8601 format YYY-MM-DDThh:mm:ss+z or just a date YYY-MM-DD. If date is given the time is set to the end of the day(23:59:59) so all objects created on that day are included. A time should be already utc time.",
182
+ "format" : "date",
183
+ "type" : "string"
184
+ },
185
+ "sort_by":{
186
+ "title" : "Sort by",
187
+ "description": "Sort the results by the given field => number",
188
+ "enum":["name","number","date","quantity","price_single","created_at", "updated_at"],
189
+ "type": "string"
190
+ },
191
+ "sort":{
192
+ "title" : "Sort",
193
+ "enum":["ASC","DESC"],
194
+ "description": "Sort the results in ASC or DESC",
195
+ "type": "string"
196
+ }
197
+ }
198
+ },
199
+ { "rel": "destroy",
200
+ "href": "account_entries/{id}",
201
+ "method": "DELETE"
202
+ },
203
+ { "rel": "update",
204
+ "href": "account_entries/{id}",
205
+ "method": "PUT"
206
+ },
207
+ { "rel": "create",
208
+ "href": "account_entries",
209
+ "method": "POST"
210
+ }
211
+ ]
212
+ }
@@ -222,13 +222,13 @@
222
222
  },
223
223
  "filter[created_at_from]":{
224
224
  "title" : "From date",
225
- "description": "Objects with a creation date after the date, including given datetime. ISO 8601 format YYY-MM-DDThh:mm:ss+z",
225
+ "description": "Objects with a creation on/after the date(>=). ISO 8601 format YYY-MM-DDThh:mm:ss+z or just a date YYY-MM-DD. If date is given the time is set to the start of the day(00:00:00) so all objects created on this day are included. A time should be already utc time",
226
226
  "format" : "date-time",
227
227
  "type" : "string"
228
228
  },
229
229
  "filter[created_at_to]":{
230
230
  "title" : "To date",
231
- "description": "Objects with a creation date before the date, including given datetime. ISO 8601 format YYY-MM-DDThh:mm:ss+z",
231
+ "description": "Objects with a creation until the date(<=). ISO 8601 format YYY-MM-DDThh:mm:ss+z or just a date YYY-MM-DD. If date is given the time is set to the end of the day(23:59:59) so all objects created on that day are included. A time should be already utc time.",
232
232
  "format" : "date-time",
233
233
  "type" : "string"
234
234
  },
@@ -70,6 +70,11 @@
70
70
  "description": "Search in text",
71
71
  "type":"string"
72
72
  },
73
+ "filter[contact_ids]":{
74
+ "title" : "Contact IDs",
75
+ "description": "Comma-separated list of contact IDs. While present, it will return comments related to the contact and all its documents.",
76
+ "type" : "string"
77
+ },
73
78
  "filter[from]":{
74
79
  "title" : "From date",
75
80
  "description": "All objects with a date after the date. YYYY-MM-DD",
@@ -109,4 +114,4 @@
109
114
  "method": "POST"
110
115
  }
111
116
  ]
112
- }
117
+ }
@@ -263,13 +263,13 @@
263
263
  },
264
264
  "filter[created_at_from]":{
265
265
  "title" : "From date",
266
- "description": "Objects with a creation date after the date, including given datetime. ISO 8601 format YYY-MM-DDThh:mm:ss+z",
266
+ "description": "Objects with a creation on/after the date(>=). ISO 8601 format YYY-MM-DDThh:mm:ss+z or just a date YYY-MM-DD. If date is given the time is set to the start of the day(00:00:00) so all objects created on this day are included. A time should be already utc time",
267
267
  "format" : "date-time",
268
268
  "type" : "string"
269
269
  },
270
270
  "filter[created_at_to]":{
271
271
  "title" : "To date",
272
- "description": "Objects with a creation date before the date, including given datetime. ISO 8601 format YYY-MM-DDThh:mm:ss+z",
272
+ "description": "Objects with a creation until the date(<=). ISO 8601 format YYY-MM-DDThh:mm:ss+z or just a date YYY-MM-DD. If date is given the time is set to the end of the day(23:59:59) so all objects created on that day are included. A time should be already utc time.",
273
273
  "format" : "date-time",
274
274
  "type" : "string"
275
275
  },
@@ -252,13 +252,13 @@
252
252
  },
253
253
  "filter[created_at_from]":{
254
254
  "title" : "From date",
255
- "description": "Objects with a creation date after the date, including given datetime. ISO 8601 format YYY-MM-DDThh:mm:ss+z",
255
+ "description": "Objects with a creation on/after the date(>=). ISO 8601 format YYY-MM-DDThh:mm:ss+z or just a date YYY-MM-DD. If date is given the time is set to the start of the day(00:00:00) so all objects created on this day are included. A time should be already utc time",
256
256
  "format" : "date-time",
257
257
  "type" : "string"
258
258
  },
259
259
  "filter[created_at_to]":{
260
260
  "title" : "To date",
261
- "description": "Objects with a creation date before the date, including given datetime. ISO 8601 format YYY-MM-DDThh:mm:ss+z",
261
+ "description": "Objects with a creation until the date(<=). ISO 8601 format YYY-MM-DDThh:mm:ss+z or just a date YYY-MM-DD. If date is given the time is set to the end of the day(23:59:59) so all objects created on that day are included. A time should be already utc time.",
262
262
  "format" : "date-time",
263
263
  "type" : "string"
264
264
  },
@@ -187,13 +187,13 @@
187
187
  },
188
188
  "filter[created_at_from]":{
189
189
  "title" : "From date",
190
- "description": "Objects with a creation date after the date, including given datetime. ISO 8601 format YYY-MM-DDThh:mm:ss+z",
190
+ "description": "Objects with a creation on/after the date(>=). ISO 8601 format YYY-MM-DDThh:mm:ss+z or just a date YYY-MM-DD. If date is given the time is set to the start of the day(00:00:00) so all objects created on this day are included. A time should be already utc time",
191
191
  "format" : "date-time",
192
192
  "type" : "string"
193
193
  },
194
194
  "filter[created_at_to]":{
195
195
  "title" : "To date",
196
- "description": "Objects with a creation date before the date, including given datetime. ISO 8601 format YYY-MM-DDThh:mm:ss+z",
196
+ "description": "Objects with a creation until the date(<=). ISO 8601 format YYY-MM-DDThh:mm:ss+z or just a date YYY-MM-DD. If date is given the time is set to the end of the day(23:59:59) so all objects created on that day are included. A time should be already utc time.",
197
197
  "format" : "date-time",
198
198
  "type" : "string"
199
199
  },
@@ -209,7 +209,7 @@
209
209
  },
210
210
  "filter[contact_ids]":{
211
211
  "title" : "Contacts",
212
- "description": "A single or a list of contact uuids, comma separated",
212
+ "description": "Find objects belonging to a single or a list of contacts, use ids comma separated.",
213
213
  "type" : "string"
214
214
  },
215
215
  "filter[ids]":{
@@ -239,13 +239,13 @@
239
239
  },
240
240
  "filter[created_at_from]":{
241
241
  "title" : "From date",
242
- "description": "Objects with a creation date after the date, including given datetime. ISO 8601 format YYY-MM-DDThh:mm:ss+z",
242
+ "description": "Objects with a creation on/after the date(>=). ISO 8601 format YYY-MM-DDThh:mm:ss+z or just a date YYY-MM-DD. If date is given the time is set to the start of the day(00:00:00) so all objects created on this day are included. A time should be already utc time",
243
243
  "format" : "date-time",
244
244
  "type" : "string"
245
245
  },
246
246
  "filter[created_at_to]":{
247
247
  "title" : "To date",
248
- "description": "Objects with a creation date before the date, including given datetime. ISO 8601 format YYY-MM-DDThh:mm:ss+z",
248
+ "description": "Objects with a creation until the date(<=). ISO 8601 format YYY-MM-DDThh:mm:ss+z or just a date YYY-MM-DD. If date is given the time is set to the end of the day(23:59:59) so all objects created on that day are included. A time should be already utc time.",
249
249
  "format" : "date-time",
250
250
  "type" : "string"
251
251
  },
@@ -261,7 +261,7 @@
261
261
  },
262
262
  "filter[contact_ids]":{
263
263
  "title" : "Contacts",
264
- "description": "A single or a list of contact uuids, comma separated",
264
+ "description": "Find objects belonging to a single or a list of contacts, use ids comma separated.",
265
265
  "type" : "string"
266
266
  },
267
267
  "filter[ids]":{
@@ -286,7 +286,7 @@
286
286
  },
287
287
  "filter[contact_ids]":{
288
288
  "title" : "Contacts",
289
- "description": "A single or a list of contact uuids, comma separated",
289
+ "description": "Find objects belonging to a single or a list of contacts, use ids comma separated.",
290
290
  "type" : "string"
291
291
  },
292
292
  "filter[ids]":{
@@ -95,6 +95,11 @@
95
95
  "maxLength": 22,
96
96
  "minLength":22
97
97
  },
98
+ "product_from_line_item":{
99
+ "description": "Saves and associates an instance of a Product from LineItem fields (name, description, quantity, unit, price, cost price), if no Product association is found. Accepted values to trigger this behaviour: 1, true",
100
+ "type":"boolean",
101
+ "default": false
102
+ },
98
103
  "created_at":{
99
104
  "description": "Date the object was created in SK. Never changes afterwards",
100
105
  "format":"date-time",
data/json/v1.0/order.json CHANGED
@@ -244,13 +244,13 @@
244
244
  },
245
245
  "filter[created_at_from]":{
246
246
  "title" : "From date",
247
- "description": "Objects with a creation date after the date, including given datetime. ISO 8601 format YYY-MM-DDThh:mm:ss+z",
247
+ "description": "Objects with a creation on/after the date(>=). ISO 8601 format YYY-MM-DDThh:mm:ss+z or just a date YYY-MM-DD. If date is given the time is set to the start of the day(00:00:00) so all objects created on this day are included. A time should be already utc time",
248
248
  "format" : "date-time",
249
249
  "type" : "string"
250
250
  },
251
251
  "filter[created_at_to]":{
252
252
  "title" : "To date",
253
- "description": "Objects with a creation date before the date, including given datetime. ISO 8601 format YYY-MM-DDThh:mm:ss+z",
253
+ "description": "Objects with a creation until the date(<=). ISO 8601 format YYY-MM-DDThh:mm:ss+z or just a date YYY-MM-DD. If date is given the time is set to the end of the day(23:59:59) so all objects created on that day are included. A time should be already utc time.",
254
254
  "format" : "date-time",
255
255
  "type" : "string"
256
256
  },
@@ -266,7 +266,7 @@
266
266
  },
267
267
  "filter[contact_ids]":{
268
268
  "title" : "Contacts",
269
- "description": "A single or a list of contact uuids, comma separated",
269
+ "description": "Find objects belonging to a single or a list of contacts, use ids comma separated.",
270
270
  "type" : "string"
271
271
  },
272
272
  "filter[ids]":{
@@ -216,7 +216,7 @@
216
216
  },
217
217
  "filter[contact_ids]":{
218
218
  "title" : "Contacts",
219
- "description": "A single or a list of contact uuids, comma separated",
219
+ "description": "Find objects belonging to a single or a list of contacts, use ids comma separated.",
220
220
  "type" : "string"
221
221
  },
222
222
  "filter[ids]":{
@@ -99,6 +99,11 @@
99
99
  "description": "Wildcard search in number, name, description, price",
100
100
  "type":["string", "number"]
101
101
  },
102
+ "filter[contact_ids]":{
103
+ "title" : "Contact IDs",
104
+ "description": "Comma-separated list of contact IDs. While present, it will return payments related to all contacts' documents.",
105
+ "type" : "string"
106
+ },
102
107
  "filter[number]":{
103
108
  "title" : "By number",
104
109
  "description": "Search by exact number",
@@ -254,13 +254,13 @@
254
254
  },
255
255
  "filter[created_at_from]":{
256
256
  "title" : "From date",
257
- "description": "Objects with a creation date after the date, including given datetime. ISO 8601 format YYY-MM-DDThh:mm:ss+z",
257
+ "description": "Objects with a creation on/after the date(>=). ISO 8601 format YYY-MM-DDThh:mm:ss+z or just a date YYY-MM-DD. If date is given the time is set to the start of the day(00:00:00) so all objects created on this day are included. A time should be already utc time",
258
258
  "format" : "date-time",
259
259
  "type" : "string"
260
260
  },
261
261
  "filter[created_at_to]":{
262
262
  "title" : "To date",
263
- "description": "Objects with a creation date before the date, including given datetime. ISO 8601 format YYY-MM-DDThh:mm:ss+z",
263
+ "description": "Objects with a creation until the date(<=). ISO 8601 format YYY-MM-DDThh:mm:ss+z or just a date YYY-MM-DD. If date is given the time is set to the end of the day(23:59:59) so all objects created on that day are included. A time should be already utc time.",
264
264
  "format" : "date-time",
265
265
  "type" : "string"
266
266
  },
@@ -276,7 +276,7 @@
276
276
  },
277
277
  "filter[contact_ids]":{
278
278
  "title" : "Contacts",
279
- "description": "A single or a list of contact uuids, comma separated",
279
+ "description": "Find objects belonging to a single or a list of contacts, use ids comma separated.",
280
280
  "type" : "string"
281
281
  },
282
282
  "filter[ids]":{
@@ -0,0 +1,229 @@
1
+ { "type":"object",
2
+ "title": "task",
3
+ "name": "task",
4
+ "description":"An Task in SK.",
5
+ "properties":{
6
+ "id":{
7
+ "description":"Unique identifier - UUID",
8
+ "identity":true,
9
+ "readonly":true,
10
+ "type":"string",
11
+ "maxLength": 22,
12
+ "minLength":22
13
+ },
14
+ "name":{
15
+ "description": "The task title.",
16
+ "required":true,
17
+ "type":"string"
18
+ },
19
+ "description":{
20
+ "description": "Notes, explanations for the task.",
21
+ "required":true,
22
+ "type":"string"
23
+ },
24
+ "status":{
25
+ "description": "New tasks are open by default, unless otherwise stated.",
26
+ "default":"open",
27
+ "enum":["open","closed","overdue"],
28
+ "type":"string"
29
+ },
30
+ "contact_id":{
31
+ "description": "Related contact of the tasks.",
32
+ "type":"string",
33
+ "maxLength": 22,
34
+ "minLength":22
35
+ },
36
+ "contact":{
37
+ "description": "The contact for the task. Use contact_id field to set a contact.",
38
+ "readonly":true,
39
+ "type":"object",
40
+ "properties":{"$ref":"./contact.json#properties"}
41
+ },
42
+ "documents":{
43
+ "description": "A tasks can have many related documents.",
44
+ "type":"array",
45
+ "properties" : {"$ref":"./document.json#properties"}
46
+ },
47
+ "attachments":{
48
+ "description": "Attached files, uploads.",
49
+ "readonly":true,
50
+ "type":"array",
51
+ "properties":{"$ref":"./attachment.json#properties"}
52
+ },
53
+ "assignee_id":{
54
+ "description": "User who should do the tasks.",
55
+ "type":"string",
56
+ "maxLength": 22,
57
+ "minLength":22
58
+ },
59
+ "creator_id":{
60
+ "description": "User who created the tasks.",
61
+ "type":"string",
62
+ "maxLength": 22,
63
+ "minLength":22
64
+ },
65
+ "closed_at":{
66
+ "description": "Date the task was completed.",
67
+ "format":"date",
68
+ "readonly":true,
69
+ "type":"string"
70
+ },
71
+ "created_at":{
72
+ "description": "Date the object was created in SK. Never changes afterwards",
73
+ "format":"date-time",
74
+ "readonly":true,
75
+ "type":"string"
76
+ },
77
+ "updated_at":{
78
+ "description": "Date the object was edited in SK.",
79
+ "format":"date-time",
80
+ "readonly":true,
81
+ "type":"string"
82
+ }
83
+ },
84
+ "links":[
85
+ { "rel": "self",
86
+ "href": "tasks/{id}"
87
+ },
88
+ { "rel": "instances",
89
+ "href": "tasks",
90
+ "properties" : {
91
+ "filter[q]":{
92
+ "title" : "Search",
93
+ "description": "Search in name, description",
94
+ "type":"string"
95
+ },
96
+ "filter[status]":{
97
+ "title" : "Status",
98
+ "description": "A single or a list of status, comma separated: open,closed,overdue",
99
+ "type" : "string"
100
+ },
101
+ "filter[ids]":{
102
+ "title" : "Task IDs",
103
+ "description": "Only find tasks with given ids. Comma-separated list of task IDs.",
104
+ "type" : "string"
105
+ },
106
+ "filter[contact_ids]":{
107
+ "title" : "Contact IDs",
108
+ "description": "Tasks related to given contacts. Comma-separated list of contact IDs.",
109
+ "type" : "string"
110
+ },
111
+ "filter[creator_ids]":{
112
+ "title" : "Creator IDs",
113
+ "description": "Tasks created by given users. Comma-separated list of user IDs.",
114
+ "type" : "string"
115
+ },
116
+ "filter[assignee_ids]":{
117
+ "title" : "Assignee IDs",
118
+ "description": "Tasks assigned to given users. Comma-separated list of user IDs.",
119
+ "type" : "string"
120
+ },
121
+ "filter[due_at_from]":{
122
+ "title" : "From date",
123
+ "description": "Tasks due after the date(>=). YYYY-MM-DD",
124
+ "format" : "date",
125
+ "type" : "string"
126
+ },
127
+ "filter[due_at_to]":{
128
+ "title" : "To date",
129
+ "description": "Tasks due before the date(<=). YYYY-MM-DD",
130
+ "format" : "date",
131
+ "type" : "string"
132
+ },
133
+ "filter[closed_at_from]":{
134
+ "title" : "From date",
135
+ "description": "Tasks closed after the date(>=). YYYY-MM-DD",
136
+ "format" : "date",
137
+ "type" : "string"
138
+ },
139
+ "filter[closed_at_to]":{
140
+ "title" : "To date",
141
+ "description": "Tasks closed before the date(<=). YYYY-MM-DD",
142
+ "format" : "date",
143
+ "type" : "string"
144
+ },
145
+ "filter[updated_at_from]":{
146
+ "title" : "From date",
147
+ "description": "Tasks updated after the date(>=). YYYY-MM-DD",
148
+ "format" : "date",
149
+ "type" : "string"
150
+ },
151
+ "filter[updated_at_to]":{
152
+ "title" : "To date",
153
+ "description": "Tasks updated before the date(<=). YYYY-MM-DD",
154
+ "format" : "date",
155
+ "type" : "string"
156
+ },
157
+ "filter[created_at_from]":{
158
+ "title" : "From date",
159
+ "description": "Tasks created after the date(>=). YYYY-MM-DD",
160
+ "format" : "date",
161
+ "type" : "string"
162
+ },
163
+ "filter[created_at_to]":{
164
+ "title" : "To date",
165
+ "description": "Tasks created before the date(<=). YYYY-MM-DD",
166
+ "format" : "date",
167
+ "type" : "string"
168
+ },
169
+ "page":{
170
+ "title" : "Page",
171
+ "description": "In paginated results set the page to look for",
172
+ "type":"number"
173
+ },
174
+ "per_page":{
175
+ "title" : "Per page",
176
+ "description": "Results per page. Default is 10, max is 100",
177
+ "type":"number"
178
+ },
179
+ "sort_by":{
180
+ "title" : "Sort by",
181
+ "description": "Sort the results by the given field => number",
182
+ "enum":["created_at", "updated_at"],
183
+ "type": "string"
184
+ },
185
+ "sort":{
186
+ "title" : "Sort",
187
+ "enum":["ASC","DESC"],
188
+ "description": "Sort the results in ASC or DESC",
189
+ "type": "string"
190
+ }
191
+ }
192
+ },
193
+ { "rel": "destroy",
194
+ "href": "tasks/{id}",
195
+ "method": "DELETE"
196
+ },
197
+ { "rel": "update",
198
+ "href": "tasks/{id}",
199
+ "method": "PUT"
200
+ },
201
+ { "rel": "create",
202
+ "href": "tasks",
203
+ "method": "POST",
204
+ "properties" : {
205
+ "template_id":{
206
+ "title" : "Task Template",
207
+ "description": "Task template(id) to use. If set template fields like name, description, attachments are used for the new task.",
208
+ "type":"string",
209
+ "maxLength": 22,
210
+ "minLength":22
211
+ },
212
+ "document_id":{
213
+ "title" : "Create a task for the document.",
214
+ "description": "If set: the document, its contact and due date are used for the task. Dont forget to set a task.name though. Useful if you want to create a reminder when the document is due e.g call contact.",
215
+ "type":"string",
216
+ "maxLength": 22,
217
+ "minLength":22
218
+ },
219
+ "source":{
220
+ "title" : "Copy a task.",
221
+ "description": "Uses name, description, contact, documents from given given source task.",
222
+ "type":"string",
223
+ "maxLength": 22,
224
+ "minLength":22
225
+ }
226
+ }
227
+ }
228
+ ]
229
+ }
@@ -1,7 +1,7 @@
1
1
  module SK
2
2
  module Api
3
3
  class Schema
4
- VERSION='0.9.5'
4
+ VERSION='0.10.0'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sk_api_schema
3
3
  version: !ruby/object:Gem::Version
4
- hash: 49
4
+ hash: 55
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 9
9
- - 5
10
- version: 0.9.5
8
+ - 10
9
+ - 0
10
+ version: 0.10.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Georg Leciejewski
@@ -15,12 +15,10 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2014-02-11 00:00:00 Z
18
+ date: 2014-05-16 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
- name: activesupport
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
21
+ version_requirements: &id001 !ruby/object:Gem::Requirement
24
22
  none: false
25
23
  requirements:
26
24
  - - ">="
@@ -29,12 +27,12 @@ dependencies:
29
27
  segments:
30
28
  - 0
31
29
  version: "0"
30
+ requirement: *id001
31
+ prerelease: false
32
32
  type: :runtime
33
- version_requirements: *id001
33
+ name: activesupport
34
34
  - !ruby/object:Gem::Dependency
35
- name: rdoc
36
- prerelease: false
37
- requirement: &id002 !ruby/object:Gem::Requirement
35
+ version_requirements: &id002 !ruby/object:Gem::Requirement
38
36
  none: false
39
37
  requirements:
40
38
  - - ">="
@@ -43,12 +41,12 @@ dependencies:
43
41
  segments:
44
42
  - 0
45
43
  version: "0"
44
+ requirement: *id002
45
+ prerelease: false
46
46
  type: :development
47
- version_requirements: *id002
47
+ name: rdoc
48
48
  - !ruby/object:Gem::Dependency
49
- name: rspec
50
- prerelease: false
51
- requirement: &id003 !ruby/object:Gem::Requirement
49
+ version_requirements: &id003 !ruby/object:Gem::Requirement
52
50
  none: false
53
51
  requirements:
54
52
  - - ">="
@@ -57,12 +55,12 @@ dependencies:
57
55
  segments:
58
56
  - 0
59
57
  version: "0"
58
+ requirement: *id003
59
+ prerelease: false
60
60
  type: :development
61
- version_requirements: *id003
61
+ name: rspec
62
62
  - !ruby/object:Gem::Dependency
63
- name: simplecov
64
- prerelease: false
65
- requirement: &id004 !ruby/object:Gem::Requirement
63
+ version_requirements: &id004 !ruby/object:Gem::Requirement
66
64
  none: false
67
65
  requirements:
68
66
  - - ">="
@@ -71,12 +69,12 @@ dependencies:
71
69
  segments:
72
70
  - 0
73
71
  version: "0"
72
+ requirement: *id004
73
+ prerelease: false
74
74
  type: :development
75
- version_requirements: *id004
75
+ name: simplecov
76
76
  - !ruby/object:Gem::Dependency
77
- name: rake
78
- prerelease: false
79
- requirement: &id005 !ruby/object:Gem::Requirement
77
+ version_requirements: &id005 !ruby/object:Gem::Requirement
80
78
  none: false
81
79
  requirements:
82
80
  - - ">="
@@ -87,8 +85,10 @@ dependencies:
87
85
  - 9
88
86
  - 2
89
87
  version: 0.9.2
88
+ requirement: *id005
89
+ prerelease: false
90
90
  type: :development
91
- version_requirements: *id005
91
+ name: rake
92
92
  description: |-
93
93
  The SalesKing JSON Schema describes our business API in terms of available objects, their fields and links to url endpoints with related objects.
94
94
  Besides ruby users can use a small lib with utility methods to load and test the schema files.
@@ -106,6 +106,9 @@ files:
106
106
  - Gemfile
107
107
  - README.rdoc
108
108
  - Rakefile
109
+ - json/v1.0/account.json
110
+ - json/v1.0/account_billing.json
111
+ - json/v1.0/account_entry.json
109
112
  - json/v1.0/address.json
110
113
  - json/v1.0/attachment.json
111
114
  - json/v1.0/auth_permission.json
@@ -133,6 +136,7 @@ files:
133
136
  - json/v1.0/sub.json
134
137
  - json/v1.0/sub_total_item.json
135
138
  - json/v1.0/tag.json
139
+ - json/v1.0/task.json
136
140
  - json/v1.0/text_template.json
137
141
  - json/v1.0/user.json
138
142
  - lib/sk_api_schema.rb