refactor to adapters
This commit is contained in:
9
testing/factories/racing/PointsTableFactory.ts
Normal file
9
testing/factories/racing/PointsTableFactory.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { PointsTable } from '@gridpilot/racing/domain/value-objects/PointsTable';
|
||||
|
||||
export const makePointsTable = (points: number[]): PointsTable => {
|
||||
const pointsByPosition: Record<number, number> = {};
|
||||
points.forEach((value, index) => {
|
||||
pointsByPosition[index + 1] = value;
|
||||
});
|
||||
return new PointsTable(pointsByPosition);
|
||||
};
|
||||
Reference in New Issue
Block a user