fitness: shorter strings for main activity buttons, add missing pages
All checks were successful
CI / update (push) Successful in 2m12s

This commit is contained in:
2026-03-26 15:04:42 +01:00
parent 7f6dcd83a8
commit 5b3b2e5e80
5 changed files with 236 additions and 5 deletions

View File

@@ -0,0 +1,70 @@
import mongoose from 'mongoose';
export interface IIntervalStep {
label: string;
durationType: 'distance' | 'time';
durationValue: number; // meters (distance) or seconds (time)
}
export interface IIntervalTemplate {
_id?: string;
name: string;
steps: IIntervalStep[];
createdBy: string;
createdAt?: Date;
updatedAt?: Date;
}
const IntervalStepSchema = new mongoose.Schema({
label: {
type: String,
required: true,
trim: true,
maxlength: 50
},
durationType: {
type: String,
required: true,
enum: ['distance', 'time']
},
durationValue: {
type: Number,
required: true,
min: 1
}
});
const IntervalTemplateSchema = new mongoose.Schema(
{
name: {
type: String,
required: true,
trim: true,
maxlength: 100
},
steps: {
type: [IntervalStepSchema],
required: true,
validate: {
validator: function(steps: IIntervalStep[]) {
return steps.length > 0;
},
message: 'An interval template must have at least one step'
}
},
createdBy: {
type: String,
required: true,
trim: true
}
},
{
timestamps: true,
toJSON: { virtuals: true },
toObject: { virtuals: true }
}
);
IntervalTemplateSchema.index({ createdBy: 1 });
export const IntervalTemplate = mongoose.model<IIntervalTemplate>("IntervalTemplate", IntervalTemplateSchema);