refactor
This commit is contained in:
17
core/racing/domain/entities/CarClass.ts
Normal file
17
core/racing/domain/entities/CarClass.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
export type CarClassType = 'formula' | 'gt' | 'prototype' | 'touring' | 'sports' | 'oval' | 'dirt';
|
||||
|
||||
export class CarClass {
|
||||
private constructor(private readonly value: CarClassType) {}
|
||||
|
||||
static create(value: CarClassType): CarClass {
|
||||
return new CarClass(value);
|
||||
}
|
||||
|
||||
toString(): CarClassType {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
equals(other: CarClass): boolean {
|
||||
return this.value === other.value;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user