feat(challenge7): add all mecanism

This commit is contained in:
thomas
2022-11-24 14:44:34 +01:00
parent e8ffed31ec
commit b76ff2b624
34 changed files with 604 additions and 142 deletions

View File

@@ -1,25 +1,11 @@
import {
incrementalNumber,
rand,
randFirstName,
randLastName,
} from '@ngneat/falso';
import { incrementalNumber, randFirstName, randLastName } from '@ngneat/falso';
import { Push } from './push.model';
export const subject = [
'Sciences',
'History',
'English',
'Maths',
'Sport',
] as const;
export type Subject = typeof subject[number];
export interface Teacher extends Push {
id: number;
firstname: string;
lastname: string;
subject: Subject;
version: number;
}
const factoryTeacher = incrementalNumber();
@@ -28,7 +14,7 @@ export const randTeacher = (): Teacher => ({
id: factoryTeacher(),
firstname: randFirstName(),
lastname: randLastName(),
subject: rand(subject),
version: 0,
type: 'teacher',
});