GALAglobal / TAPICC-API-implementation

TAPICC API implementation using node.js framework sails.js
Other
6 stars 1 forks source link

Asset References - proposal #32

Closed Alino closed 5 years ago

Alino commented 6 years ago

I propose to create new data model called Reference

{
  id: {
    type: 'integer'
  },
  assetId: {
    model: 'asset'
  },
  description: {
    type: 'string',
    example: 'Translation Memory'
  },
  file: {
     type: 'binary'
  },
  url: {
    type: 'string'
  }
}

endpoints: POST /asset/{parentId}/reference/uploadfile GET, PUT, DELETE /reference/{id}


example - seeing an Asset and being able to view it's References:

GET /job/1/asset/5

response:

{
  id: 5,
  sourceLanguage: 'en'
  jobId: 1,
  tasks: [{ id: 14, targetLanguage: 'sk', type: 'translation' }],
  references: [
    { id: 23, assetId: 5, description: 'Translation Memory' },
    { id: 24, assetId: 5, description: 'Termbase' }
  ]
}

Note:

Questions:

  1. Do we want many to many relationship between Assets and References? Therefore one Reference could be used in multiple Assets.
assembledStarDust commented 6 years ago

There may also be benefit in adding to the asset itself -

Asset.type

here may be benefit in seperating out source file types, downloadableDeliverables, uploadableDeliverables, Devliverables, reference when creating assets.

Asset.Description

I see in the proposal for reference there is description - this should also be applied to the parent asset itself.

Alino commented 6 years ago

If we implement this References proposal, then Asset.type won't make much sense to me.

Asset.file = the source file of the Asset (an Asset is always an Asset) Reference.file = the reference file (the Reference is always a Reference) Task.file = the deliverable (Task is always Task)


I agree with Asset.description addition.

assembledStarDust commented 6 years ago

So if I'm understanding this right, any file uploaded or downloaded is not an asset. Asset is a term for source files. Separation of file type as I propose is already done in the structure. Do I have that right?

Alino commented 6 years ago

yes that is correct.

Alino commented 5 years ago

closing in favour of https://github.com/GALAglobal/TAPICC-API-implementation/issues/58