Skip to content

Commit

Permalink
Added language, timezone and description attributes to the agent
Browse files Browse the repository at this point in the history
  • Loading branch information
dcalvom committed Dec 11, 2017
1 parent 88f806b commit 5723ba6
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/models/agent.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ class AgentModel {
return {
id: Joi.number(),
agentName: Joi.string(),
description: Joi.string(),
language: Joi.string(),
timezone: Joi.string(),
webhookUrl: Joi.string(),
domainClassifierThreshold: Joi.number(),
fallbackResponses: Joi.array().items(Joi.string()),
Expand Down
9 changes: 9 additions & 0 deletions api/modules/agent/config/agent.validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ class AgentValidate {

return {
agentName: AgentSchema.agentName.required(),
description: AgentSchema.description,
language: AgentSchema.language.required(),
timezone: AgentSchema.timezone.required(),
webhookUrl: AgentSchema.webhookUrl,
domainClassifierThreshold: AgentSchema.domainClassifierThreshold.required(),
fallbackResponses: AgentSchema.fallbackResponses.required(),
Expand All @@ -151,6 +154,9 @@ class AgentValidate {

return {
agentName: AgentSchema.agentName,
description: AgentSchema.description,
language: AgentSchema.language,
timezone: AgentSchema.timezone,
webhookUrl: AgentSchema.webhookUrl,
domainClassifierThreshold: AgentSchema.domainClassifierThreshold,
fallbackResponses: AgentSchema.fallbackResponses,
Expand Down Expand Up @@ -248,6 +254,9 @@ class AgentValidate {

return {
agentName: AgentSchema.agentName.required(),
description: AgentSchema.description,
language: AgentSchema.language.required(),
timezone: AgentSchema.timezone.required(),
webhookUrl: AgentSchema.webhookUrl,
domainClassifierThreshold: AgentSchema.domainClassifierThreshold.required(),
fallbackResponses: AgentSchema.fallbackResponses.required(),
Expand Down
12 changes: 12 additions & 0 deletions api/test/modules/agent/agent.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ const createAgent = (callback) => {

const data = {
agentName: 'Test Agent',
description: 'This is test agent',
language: 'en',
timezone: 'America/Kentucky/Louisville',
webhookUrl: 'string',
domainClassifierThreshold: 0.6,
fallbackResponses: [
Expand Down Expand Up @@ -269,6 +272,9 @@ suite('/agent', () => {

const data = {
agentName: 'Test Agent 2',
description: 'This is test agent',
language: 'en',
timezone: 'America/Kentucky/Louisville',
webhookUrl: 'http://localhost:8000',
domainClassifierThreshold: 0.9,
fallbackResponses: [
Expand Down Expand Up @@ -354,6 +360,9 @@ suite('/agent/{id}', () => {
const data = {
id: agentId.toString(),
agentName: 'Test Agent Updated',
description: 'This is test agent',
language: 'en',
timezone: 'America/Kentucky/Louisville',
webhookUrl: 'http://localhost:8000',
domainClassifierThreshold: 0.5,
fallbackResponses: [
Expand All @@ -364,6 +373,9 @@ suite('/agent/{id}', () => {

const updatedData = {
agentName: 'Test Agent Updated',
description: 'This is test agent',
language: 'en',
timezone: 'America/Kentucky/Louisville',
domainClassifierThreshold: 0.5,
fallbackResponses: [
'updated'
Expand Down
3 changes: 3 additions & 0 deletions api/test/modules/domain/domain.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ const createAgent = (callback) => {

const data = {
agentName: 'Test Agent',
description: 'This is test agent',
language: 'en',
timezone: 'America/Kentucky/Louisville',
webhookUrl: 'string',
domainClassifierThreshold: 0.6,
fallbackResponses: [
Expand Down
3 changes: 3 additions & 0 deletions api/test/modules/entity/entity.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ const createAgent = (callback) => {

const data = {
agentName: 'Test Agent',
description: 'This is test agent',
language: 'en',
timezone: 'America/Kentucky/Louisville',
webhookUrl: 'string',
domainClassifierThreshold: 0.6,
fallbackResponses: [
Expand Down
3 changes: 3 additions & 0 deletions api/test/modules/intent/intent.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ const createAgent = (callback) => {

const data = {
agentName: 'Test Agent',
description: 'This is test agent',
language: 'en',
timezone: 'America/Kentucky/Louisville',
webhookUrl: 'string',
domainClassifierThreshold: 0.6,
fallbackResponses: [
Expand Down
3 changes: 3 additions & 0 deletions api/test/modules/scenario/scenario.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ const createAgent = (callback) => {

const data = {
agentName: 'Test Agent',
description: 'This is test agent',
language: 'en',
timezone: 'America/Kentucky/Louisville',
webhookUrl: 'string',
domainClassifierThreshold: 0.6,
fallbackResponses: [
Expand Down

0 comments on commit 5723ba6

Please sign in to comment.