Files
planka/server/api/models/TaskList.js

111 lines
3.2 KiB
JavaScript
Raw Normal View History

/*!
* Copyright (c) 2024 PLANKA Software GmbH
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
*/
2019-08-31 04:07:25 +05:00
/**
* TaskList.js
2019-08-31 04:07:25 +05:00
*
* @description :: A model definition represents a database table/collection.
* @docs :: https://sailsjs.com/docs/concepts/models-and-orm/models
*/
2025-09-08 16:20:27 +02:00
/**
* @swagger
* components:
* schemas:
* TaskList:
* type: object
* required:
2025-09-08 23:40:36 +02:00
* - id
2025-09-08 16:20:27 +02:00
* - cardId
* - position
* - name
2025-09-12 12:17:01 +02:00
* - showOnFrontOfCard
* - hideCompletedTasks
* - createdAt
* - updatedAt
2025-09-08 16:20:27 +02:00
* properties:
* id:
* type: string
* description: Unique identifier for the task list
2025-09-08 19:14:31 +02:00
* example: "1357158568008091264"
2025-09-08 16:20:27 +02:00
* cardId:
* type: string
* description: ID of the card the task list belongs to
2025-09-08 19:14:31 +02:00
* example: "1357158568008091265"
2025-09-08 16:20:27 +02:00
* position:
* type: number
* description: Position of the task list within the card
* example: 65536
* name:
* type: string
* description: Name/title of the task list
* example: Development Tasks
* showOnFrontOfCard:
* type: boolean
* default: true
* description: Whether to show the task list on the front of the card
* example: true
* hideCompletedTasks:
* type: boolean
* default: false
* description: Whether to hide completed tasks
* example: false
* createdAt:
* type: string
* format: date-time
* nullable: true
* description: When the task list was created
* example: 2024-01-01T00:00:00.000Z
* updatedAt:
* type: string
* format: date-time
* nullable: true
* description: When the task list was last updated
* example: 2024-01-01T00:00:00.000Z
*/
2019-08-31 04:07:25 +05:00
module.exports = {
attributes: {
// ╔═╗╦═╗╦╔╦╗╦╔╦╗╦╦ ╦╔═╗╔═╗
// ╠═╝╠╦╝║║║║║ ║ ║╚╗╔╝║╣ ╚═╗
// ╩ ╩╚═╩╩ ╩╩ ╩ ╩ ╚╝ ╚═╝╚═╝
position: {
type: 'number',
2019-08-31 04:07:25 +05:00
required: true,
},
name: {
type: 'string',
2019-08-31 04:07:25 +05:00
required: true,
},
showOnFrontOfCard: {
type: 'boolean',
defaultsTo: true,
columnName: 'show_on_front_of_card',
},
hideCompletedTasks: {
type: 'boolean',
defaultsTo: false,
columnName: 'hide_completed_tasks',
},
2019-08-31 04:07:25 +05:00
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
// ║╣ ║║║╠╩╗║╣ ║║╚═╗
// ╚═╝╩ ╩╚═╝╚═╝═╩╝╚═╝
// ╔═╗╔═╗╔═╗╔═╗╔═╗╦╔═╗╔╦╗╦╔═╗╔╗╔╔═╗
// ╠═╣╚═╗╚═╗║ ║║ ║╠═╣ ║ ║║ ║║║║╚═╗
// ╩ ╩╚═╝╚═╝╚═╝╚═╝╩╩ ╩ ╩ ╩╚═╝╝╚╝╚═╝
cardId: {
model: 'Card',
required: true,
columnName: 'card_id',
},
2019-08-31 04:07:25 +05:00
},
tableName: 'task_list',
2019-08-31 04:07:25 +05:00
};