2019-08-31 04:07:25 +05:00
|
|
|
/**
|
|
|
|
* List.js
|
|
|
|
*
|
|
|
|
* @description :: A model definition represents a database table/collection.
|
|
|
|
* @docs :: https://sailsjs.com/docs/concepts/models-and-orm/models
|
|
|
|
*/
|
|
|
|
|
2024-04-22 21:56:07 +02:00
|
|
|
const SortTypes = {
|
|
|
|
NAME_ASC: 'name_asc',
|
|
|
|
DUE_DATE_ASC: 'dueDate_asc',
|
|
|
|
CREATED_AT_ASC: 'createdAt_asc',
|
|
|
|
CREATED_AT_DESC: 'createdAt_desc',
|
|
|
|
};
|
|
|
|
|
2019-08-31 04:07:25 +05:00
|
|
|
module.exports = {
|
2024-04-22 21:56:07 +02:00
|
|
|
SortTypes,
|
|
|
|
|
2019-08-31 04:07:25 +05:00
|
|
|
attributes: {
|
|
|
|
// ╔═╗╦═╗╦╔╦╗╦╔╦╗╦╦ ╦╔═╗╔═╗
|
|
|
|
// ╠═╝╠╦╝║║║║║ ║ ║╚╗╔╝║╣ ╚═╗
|
|
|
|
// ╩ ╩╚═╩╩ ╩╩ ╩ ╩ ╚╝ ╚═╝╚═╝
|
|
|
|
|
|
|
|
position: {
|
|
|
|
type: 'number',
|
2019-11-05 18:01:42 +05:00
|
|
|
required: true,
|
2019-08-31 04:07:25 +05:00
|
|
|
},
|
|
|
|
name: {
|
|
|
|
type: 'string',
|
2019-11-05 18:01:42 +05:00
|
|
|
required: true,
|
2019-08-31 04:07:25 +05:00
|
|
|
},
|
|
|
|
|
|
|
|
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
|
|
|
|
// ║╣ ║║║╠╩╗║╣ ║║╚═╗
|
|
|
|
// ╚═╝╩ ╩╚═╝╚═╝═╩╝╚═╝
|
|
|
|
|
|
|
|
// ╔═╗╔═╗╔═╗╔═╗╔═╗╦╔═╗╔╦╗╦╔═╗╔╗╔╔═╗
|
|
|
|
// ╠═╣╚═╗╚═╗║ ║║ ║╠═╣ ║ ║║ ║║║║╚═╗
|
|
|
|
// ╩ ╩╚═╝╚═╝╚═╝╚═╝╩╩ ╩ ╩ ╩╚═╝╝╚╝╚═╝
|
|
|
|
|
|
|
|
boardId: {
|
|
|
|
model: 'Board',
|
|
|
|
required: true,
|
2019-11-05 18:01:42 +05:00
|
|
|
columnName: 'board_id',
|
2019-08-31 04:07:25 +05:00
|
|
|
},
|
|
|
|
cards: {
|
|
|
|
collection: 'Card',
|
2019-11-05 18:01:42 +05:00
|
|
|
via: 'listId',
|
|
|
|
},
|
|
|
|
},
|
2019-08-31 04:07:25 +05:00
|
|
|
};
|