28 lines
984 B
JavaScript
28 lines
984 B
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.TodoItemSchema = exports.TodoItem = void 0;
|
|
const core_1 = require("@mikro-orm/core");
|
|
const base_entity_1 = require("../../core/entities/base.entity");
|
|
class TodoItem extends base_entity_1.BaseEntity {
|
|
constructor() {
|
|
super(...arguments);
|
|
this.completed = false;
|
|
}
|
|
}
|
|
exports.TodoItem = TodoItem;
|
|
exports.TodoItemSchema = new core_1.EntitySchema({
|
|
class: TodoItem,
|
|
tableName: 'todo_items',
|
|
properties: {
|
|
id: { type: 'uuid', primary: true },
|
|
tenantId: { type: 'string' },
|
|
metadata: { type: 'json', nullable: true },
|
|
createdAt: { type: 'date', defaultRaw: 'now()' },
|
|
updatedAt: { type: 'date', defaultRaw: 'now()' },
|
|
title: { type: 'string' },
|
|
description: { type: 'text', nullable: true },
|
|
completed: { type: 'boolean', default: false },
|
|
dueDate: { type: 'date', nullable: true },
|
|
},
|
|
});
|