chore: lint

This commit is contained in:
karishmas6
2024-10-09 03:27:28 +05:30
parent 9d268c3e7f
commit 49f6193b37

View File

@@ -2,66 +2,66 @@ import { Model, DataTypes, Optional } from 'sequelize';
import sequelize from '../db/config'; import sequelize from '../db/config';
interface RobotAttributes { interface RobotAttributes {
id: string; id: string;
name: string; name: string;
createdAt: Date; createdAt: Date;
updatedAt: Date; updatedAt: Date;
pairs: number; pairs: number;
params: object; params: object;
workflow: object; // Store workflow details as JSONB workflow: object; // Store workflow details as JSONB
} }
interface RobotCreationAttributes extends Optional<RobotAttributes, 'id'> {} interface RobotCreationAttributes extends Optional<RobotAttributes, 'id'> { }
class Robot extends Model<RobotAttributes, RobotCreationAttributes> implements RobotAttributes { class Robot extends Model<RobotAttributes, RobotCreationAttributes> implements RobotAttributes {
public id!: string; public id!: string;
public name!: string; public name!: string;
public createdAt!: Date; public createdAt!: Date;
public updatedAt!: Date; public updatedAt!: Date;
public pairs!: number; public pairs!: number;
public params!: object; public params!: object;
public workflow!: object; public workflow!: object;
} }
Robot.init( Robot.init(
{ {
id: { id: {
type: DataTypes.UUID, type: DataTypes.UUID,
defaultValue: DataTypes.UUIDV4, defaultValue: DataTypes.UUIDV4,
primaryKey: true, primaryKey: true,
},
name: {
type: DataTypes.STRING(255),
allowNull: false,
},
createdAt: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: DataTypes.NOW,
},
updatedAt: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: DataTypes.NOW,
},
pairs: {
type: DataTypes.INTEGER,
allowNull: false,
},
params: {
type: DataTypes.JSONB,
allowNull: true,
},
workflow: {
type: DataTypes.JSONB,
allowNull: true,
},
}, },
name: { {
type: DataTypes.STRING(255), sequelize,
allowNull: false, tableName: 'robot',
}, timestamps: true,
createdAt: { }
type: DataTypes.DATE,
allowNull: false,
defaultValue: DataTypes.NOW,
},
updatedAt: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: DataTypes.NOW,
},
pairs: {
type: DataTypes.INTEGER,
allowNull: false,
},
params: {
type: DataTypes.JSONB,
allowNull: true,
},
workflow: {
type: DataTypes.JSONB,
allowNull: true,
},
},
{
sequelize,
tableName: 'robot',
timestamps: true,
}
); );
export default Robot; export default Robot;