Tasks: able to get and print tasks

This commit is contained in:
2023-12-31 01:39:42 +01:00
parent cf20935e01
commit 4c9765b4a3
10 changed files with 103 additions and 24 deletions

43
api/src/models/Task.ts Normal file
View File

@@ -0,0 +1,43 @@
import { DataTypes, Model } from 'sequelize'
import path from 'path'
import db from '../config/sequelize.config'
class Instance extends Model {}
Instance.init(
{
_id: {
type: DataTypes.UUID,
defaultValue: DataTypes.UUIDV4,
primaryKey: true,
allowNull: false,
unique: true
},
title: {
type: DataTypes.STRING,
allowNull: false
},
client: {
type: DataTypes.STRING,
allowNull: true
},
project: {
type: DataTypes.STRING,
allowNull: true
},
timeStart: {
type: DataTypes.BIGINT,
allowNull: false
},
timeEnd: {
type: DataTypes.BIGINT,
allowNull: true
}
},
{
sequelize: db,
tableName: path.basename(__filename).split('.')[0].toLowerCase()
}
)
export default Instance

View File

@@ -1,6 +1,6 @@
import { DataTypes, Model } from 'sequelize'
import path from 'path'
import db from '../config/sequelize.config.ts'
import db from '../config/sequelize.config'
class Instance extends Model {}