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

84 lines
2.5 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
/**
* Comment.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:
* Comment:
* type: object
* required:
* - cardId
* - text
* properties:
* id:
* type: string
* description: Unique identifier for the comment
* example: 1357158568008091264
* cardId:
* type: string
* description: ID of the card the comment belongs to
* example: 1357158568008091265
* userId:
* type: string
* nullable: true
* description: ID of the user who created the comment
* example: 1357158568008091266
* text:
* type: string
* description: Content of the comment
* example: This task is almost complete...
* createdAt:
* type: string
* format: date-time
* nullable: true
* description: When the comment was created
* example: 2024-01-01T00:00:00.000Z
* updatedAt:
* type: string
* format: date-time
* nullable: true
* description: When the comment was last updated
* example: 2024-01-01T00:00:00.000Z
*/
2019-08-31 04:07:25 +05:00
module.exports = {
attributes: {
// ╔═╗╦═╗╦╔╦╗╦╔╦╗╦╦ ╦╔═╗╔═╗
// ╠═╝╠╦╝║║║║║ ║ ║╚╗╔╝║╣ ╚═╗
// ╩ ╩╚═╩╩ ╩╩ ╩ ╩ ╚╝ ╚═╝╚═╝
text: {
type: 'string',
2019-08-31 04:07:25 +05:00
required: true,
},
2019-08-31 04:07:25 +05:00
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
// ║╣ ║║║╠╩╗║╣ ║║╚═╗
// ╚═╝╩ ╩╚═╝╚═╝═╩╝╚═╝
// ╔═╗╔═╗╔═╗╔═╗╔═╗╦╔═╗╔╦╗╦╔═╗╔╗╔╔═╗
// ╠═╣╚═╗╚═╗║ ║║ ║╠═╣ ║ ║║ ║║║║╚═╗
// ╩ ╩╚═╝╚═╝╚═╝╚═╝╩╩ ╩ ╩ ╩╚═╝╝╚╝╚═╝
cardId: {
model: 'Card',
required: true,
columnName: 'card_id',
},
userId: {
model: 'User',
columnName: 'user_id',
},
},
2019-08-31 04:07:25 +05:00
};