Skip to content

Commit

Permalink
feat: adds pdfs
Browse files Browse the repository at this point in the history
  • Loading branch information
eljefedelrodeodeljefe committed Aug 23, 2018
1 parent 5eea8b5 commit 9c28569
Show file tree
Hide file tree
Showing 3 changed files with 156 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/v0/index.js
Expand Up @@ -5,3 +5,4 @@ module.exports.deliveries = require('./deliveries')
module.exports.orders = require('./orders')
module.exports.branches = require('./branches')
module.exports.clients = require('./clients')
module.exports.pdfs = require('./pdfs')
9 changes: 9 additions & 0 deletions lib/v0/pdfs/index.js
@@ -0,0 +1,9 @@
module.exports = {
templates: {
deliveries: {
create: {
request: require('./templates.deliveries.create.request')
}
}
}
}
146 changes: 146 additions & 0 deletions lib/v0/pdfs/templates.deliveries.create.request.js
@@ -0,0 +1,146 @@
const address = require('../../common/address')

module.exports = {
$id: 'https://schemas.tillhub.com/v0/pdfs.templates.deliveries.create.schema.json',
$schema: 'http://json-schema.org/draft-07/schema#',
additionalProperties: false,
type: 'object',
properties: {
delivery: {
additionalProperties: false,
type: 'object',
properties: {
id: {
type: 'string'
},
created_at: {
additionalProperties: false,
type: 'string',
format: 'date-time'
},
received_token: {
type: 'string'
},
dispatched_token: {
type: 'string'
}
},
required: [
'id'
]
},
img_url: {
anyof: [
{
type: 'string'
},
{
type: 'null'
}
]
},
sender: {
type: 'object',
additionalProperties: false,
properties: {
firstname: {
oneOf: [
{
type: 'string',
minLength: 1
},
{
type: 'null'
}
]
},
lastname: {
oneOf: [
{
type: 'string',
minLength: 1
},
{
type: 'null'
}
]
}
}
},
addressee: {
type: 'object',
additionalProperties: false,
properties: {
firstname: {
oneOf: [
{
type: 'string',
minLength: 1
},
{
type: 'null'
}
]
},
lastname: {
oneOf: [
{
type: 'string',
minLength: 1
},
{
type: 'null'
}
]
}
}
},
recipient: {
...address
},
items: {
type: 'array',
minItems: 1,
items: {
type: 'object'
}
},
text: {
oneOf: [
{
type: 'string',
minLength: 1
},
{
type: 'null'
}
]
},
from: {
oneOf: [
{
type: 'string',
format: 'uuid'
},
{
type: 'null'
}
]
},
to: {
oneOf: [
{
type: 'string',
format: 'uuid'
},
{
type: 'null'
}
]
}
},
required: [
'items',
'delivery'
]
}

0 comments on commit 9c28569

Please sign in to comment.