harden business rules
This commit is contained in:
@@ -65,8 +65,9 @@ export class RacingRaceFactory {
|
||||
Race.create({
|
||||
...base,
|
||||
status: 'running',
|
||||
strengthOfField: 1400 + (i * 10), // Varying SOF
|
||||
strengthOfField: 45 + (i % 50), // Valid SOF: 0-100
|
||||
registeredCount: 12 + (i % 5), // Varying registration counts
|
||||
maxParticipants: 24, // Ensure max is set
|
||||
}),
|
||||
);
|
||||
continue;
|
||||
@@ -78,8 +79,9 @@ export class RacingRaceFactory {
|
||||
Race.create({
|
||||
...base,
|
||||
status: 'completed',
|
||||
strengthOfField: 1200 + (i * 15),
|
||||
strengthOfField: 35 + (i % 60), // Valid SOF: 0-100
|
||||
registeredCount: 8 + (i % 8),
|
||||
maxParticipants: 20, // Ensure max is set
|
||||
}),
|
||||
);
|
||||
continue;
|
||||
@@ -93,8 +95,9 @@ export class RacingRaceFactory {
|
||||
...base,
|
||||
status: 'scheduled',
|
||||
...(hasRegistrations && {
|
||||
strengthOfField: 1300 + (i * 8),
|
||||
strengthOfField: 40 + (i % 55), // Valid SOF: 0-100
|
||||
registeredCount: 5 + (i % 10),
|
||||
maxParticipants: 16 + (i % 10), // Ensure max is set and reasonable
|
||||
}),
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user