f4e0617fc7
Full period tracking system for the fitness measure page: - Period logging with start/end dates, edit/delete support - EMA-based cycle and period length predictions (α=0.3, 12 future cycles) - Calendar view with connected range strips, overflow days, today marker - Fertility window, peak fertility, ovulation, and luteal phase visualization - Period sharing between users with profile picture avatars - Cycle/period stats with 95% CI below calendar - Redesigned profile card as inline header metadata with Venus/Mars icons - Collapsible weight and period history sections - Full DE/EN i18n support
24 lines
552 B
TypeScript
24 lines
552 B
TypeScript
import mongoose from 'mongoose';
|
|
|
|
export interface IPeriodEntry {
|
|
_id?: string;
|
|
startDate: Date;
|
|
endDate?: Date;
|
|
createdBy: string;
|
|
createdAt?: Date;
|
|
updatedAt?: Date;
|
|
}
|
|
|
|
const PeriodEntrySchema = new mongoose.Schema(
|
|
{
|
|
startDate: { type: Date, required: true },
|
|
endDate: { type: Date, default: null },
|
|
createdBy: { type: String, required: true, trim: true }
|
|
},
|
|
{ timestamps: true }
|
|
);
|
|
|
|
PeriodEntrySchema.index({ createdBy: 1, startDate: -1 });
|
|
|
|
export const PeriodEntry = mongoose.model<IPeriodEntry>('PeriodEntry', PeriodEntrySchema);
|