// Copyright IBM Corp. and LoopBack contributors 2018,2020. All Rights Reserved. // Node module: @loopback/example-todo-list // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT import {belongsTo, Entity, model, property} from '@loopback/repository'; import {TodoList, TodoListWithRelations} from './todo-list.model'; @model() export class Todo extends Entity { @property({ type: 'number', id: true, generated: false, }) id?: number; @property({ type: 'string', required: true, }) title: string; @property({ type: 'string', }) desc?: string; @property({ type: 'boolean', }) isComplete?: boolean; @belongsTo(() => TodoList) todoListId: number; constructor(data?: Partial) { super(data); } } export interface TodoRelations { todoList?: TodoListWithRelations; } export type TodoWithRelations = Todo & TodoRelations;