Skip to content

Commit

Permalink
added descriptions for attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Alino committed Jul 25, 2018
1 parent b0ec15f commit 075233c
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 18 deletions.
19 changes: 15 additions & 4 deletions api/models/Asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,35 @@ module.exports = {
},

file: {
type: 'binary'
type: 'binary',
description: 'an actual file (asset)'
},

isReference: {
type: 'boolean'
type: 'boolean',
description: 'if is set to true, then the Asset is not suppossed to be actionable.'
},

sourceLanguage: {
type: 'string'
type: 'string',
description: 'language code of the source'
},

encoding: {
type: 'string'
type: 'string',
description: 'encoding code'
},

jobId: {
model: 'job'
}
},

// custom validation functions
types: {
// This is a workaround for having description in the attributes.
// Otherwise there would be an error.
description: () => true
}
};

25 changes: 19 additions & 6 deletions api/models/Job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,32 @@ module.exports = {

name: {
type: 'string',
required: true
required: true,
description: 'name of a Job'
},

description: {
type: 'string'
},

submitDate: {
type: 'datetime'
type: 'datetime',
description: 'a date when the Job was submit'
},

dueDate: {
type: 'datetime'
type: 'datetime',
description: 'a date with a deadline'
},

closedDate: {
type: 'datetime'
type: 'datetime',
description: 'a date when the Job was closed'
},

submitter: {
type: 'integer'
type: 'integer',
description: 'id of the user who did submit the Job'
},

assets: {
Expand All @@ -51,9 +56,17 @@ module.exports = {
},

externalId: {
type: 'string'
type: 'string',
description: 'external project id, as is defined on the external system'
}

},

// custom validation functions
types: {
// This is a workaround for having description in the attributes.
// Otherwise there would be an error.
description: () => true
}
};

18 changes: 13 additions & 5 deletions api/models/Task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ export = {
},

targetLanguage: {
type: 'string'
type: 'string',
description: 'language code of the target'
},

assetId: {
Expand All @@ -34,18 +35,25 @@ export = {
},

assignedTo: {
// user Id
type: 'integer'
type: 'integer',
description: 'id of the user who it is assigned to'
},

file: {
// deliverable
type: 'binary'
type: 'binary',
description: 'an actual file (deliverable)'
},

jobId: {
model: 'job'
}
},

// custom validation functions
types: {
// This is a workaround for having description in the attributes.
// Otherwise there would be an error.
description: () => true
}
};

7 changes: 7 additions & 0 deletions api/models/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ module.exports = {

attributes: {

},

// custom validation functions
types: {
// This is a workaround for having description in the attributes.
// Otherwise there would be an error.
description: () => true
}
};

16 changes: 13 additions & 3 deletions api/models/Webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@ module.exports = {
},

name: {
type: 'string'
type: 'string',
description: 'name of the Webhook'
},

description: {
type: 'string'
},

url: {
type: 'string'
type: 'string',
description: 'url which the server will make a request to when an event occurs'
},

eventType: {
Expand All @@ -39,8 +41,16 @@ module.exports = {
'assetCreated',
'assetUpdated',
'assetDeleted'
]
],
description: 'type of event - if this event occurs, then the "url" will be requested by the TAPICC server'
}
},

// custom validation functions
types: {
// This is a workaround for having description in the attributes.
// Otherwise there would be an error.
description: () => true
}
};

0 comments on commit 075233c

Please sign in to comment.