Skip to content

Commit

Permalink
feat(client_accounts): add client account demo data schema
Browse files Browse the repository at this point in the history
  • Loading branch information
barbarafarias committed Aug 14, 2019
1 parent 7886b43 commit 6884de8
Show file tree
Hide file tree
Showing 6 changed files with 142 additions and 0 deletions.
52 changes: 52 additions & 0 deletions lib/v0/client_accounts/base.js
@@ -0,0 +1,52 @@
const demoData = require('../demoData')

module.exports = {
name: {
type: 'string'
},
display_name: {
type: 'string',
pattern: '^[a-z0-9_-]*$'
},
email: {
type: 'string',
format: 'email'
},
email_confirmed: {
type: 'boolean'
},
password: {
type: 'string',
minLength: 5,
maxLength: 36
},
test_account: {
type: 'boolean'
},
template: {
type: 'string',
'enum': [
'tillhub_init',
'tillhub_init_legacy'
],
'default': 'tillhub_init'
},
dashboard: {
type: 'string',
'enum': [
'tillhub',
'shore',
'localsearch'
],
'default': 'tillhub'
},
demo_data: {
anyOf: [
{
...demoData
},
{
type: 'null'
}
]
}}
13 changes: 13 additions & 0 deletions lib/v0/client_accounts/create.js
@@ -0,0 +1,13 @@
const base = require('./base')

module.exports.request = {
$id: 'https://schemas.tillhub.com/v0/client_accounts.create.request.schema.json',
$schema: 'http://json-schema.org/draft-07/schema#',
additionalProperties: false,
required: [
'email',
'password'
],
properties: base,
type: 'object'
}
64 changes: 64 additions & 0 deletions lib/v0/client_accounts/demoData.js
@@ -0,0 +1,64 @@
module.exports = {
type: 'object',
required: [
'accounts',
'expenses',
'taxes',
'payment_options',
'branches_registers',
'staff'
],
properties: {
accounts: {
type: 'string',
'enum': [
'de_skr_03',
'de_skr_04',
'ch'
]
},
expenses: {
type: 'string',
'enum': [
'standard_german',
'standard_english',
'fleurop'
]
},
taxes: {
type: 'string',
'enum': [
'de',
'ch'
]
},
payment_options: {
'type': 'array',
'items': {
'type': 'string',
'enum': [
'voucher',
'ccvfly',
'rechnung',
'amex',
'concardis',
'bar',
'card_circuits'
]
}
}
},
branches_registers: {
type: 'string',
'enum': [
'basic',
'basic_v1'
]
},
staff: {
type: 'string',
'enum': [
'default'
]
}
}
2 changes: 2 additions & 0 deletions lib/v0/client_accounts/index.js
@@ -0,0 +1,2 @@
module.exports.create = require('./create')
module.exports.update = require('./update')
10 changes: 10 additions & 0 deletions lib/v0/client_accounts/update.js
@@ -0,0 +1,10 @@
const base = require('./base')

module.exports.request = {
$id: 'https://schemas.tillhub.com/v0/client_accounts.update.request.schema.json',
$schema: 'http://json-schema.org/draft-07/schema#',
additionalProperties: false,
type: 'object',
required: [],
properties: base
}
1 change: 1 addition & 0 deletions lib/v0/index.js
Expand Up @@ -38,3 +38,4 @@ module.exports.voucher_systems = require('./voucher_systems')
module.exports.manufacturers = require('./manufacturers')
module.exports.custom_hooks = require('./custom_hooks')
module.exports.analytics = require('./analytics')
module.exports.analytics = require('./client_accounts')

0 comments on commit 6884de8

Please sign in to comment.