import {model, property} from '@loopback/repository'; import {UserModifiableEntity} from '@sourcefuse-npm/alivio-lib'; import {CheckInContentCardTypes} from './check-in-content-card-types.enum'; import {DailyCheckInLogStatus} from './daily-check-ins-log.enum'; const dailyCheckinLogStatus = [ DailyCheckInLogStatus.CREATED, DailyCheckInLogStatus.DONE, ]; @model() export class DailyCheckinLog extends UserModifiableEntity { @property({ type: 'number', id: true, jsonSchema: { nullable: true, }, }) id?: number; @property({ type: 'number', required: true, name: 'user_id', description: 'userId is only for refrence', jsonSchema: { nullable: true, }, }) userId?: number; @property({ type: 'date', name: 'check_in_time', description: 'time when medicine will be taken.', required: true, jsonSchema: { nullable: true, }, }) checkinTime: Date; @property() patientId: number; @property({ type: 'number', description: ` CREATED = 1 DONE = 2 `, jsonSchema: { enum: dailyCheckinLogStatus, nullable: true, }, }) status?: DailyCheckInLogStatus; @property({ type: 'number', jsonSchema: { enum: [ CheckInContentCardTypes.DAILY_CHECK_IN.toString(), CheckInContentCardTypes.LATEST_SELFIE.toString(), CheckInContentCardTypes.DAILY_QUOTE.toString(), CheckInContentCardTypes.SELFIE_LIST.toString(), ], nullable: true, }, }) type?: number; @property({ type: 'date', name: 'last_log_date', }) lastLoggedDate: Date; constructor(data?: Partial) { super(data); } } export type DailyCheckinLogWithRelations = DailyCheckinLog;