feat(challenge7): reorganisation

This commit is contained in:
thomas
2022-11-23 09:51:59 +01:00
parent cc1c6e8b26
commit ca86f5558b
29 changed files with 355 additions and 32 deletions

View File

@@ -0,0 +1,28 @@
import {
incrementalNumber,
randFirstName,
randLastName,
randWord,
} from '@ngneat/falso';
import { Push } from './push.model';
export interface Student extends Push {
id: number;
firstname: string;
lastname: string;
school: string;
}
const factoryStudent = incrementalNumber();
export const randStudent = (): Student => ({
id: factoryStudent(),
firstname: randFirstName(),
lastname: randLastName(),
school: randWord(),
type: 'student',
});
export const isStudent = (notif: Push): notif is Student => {
return notif.type === 'student';
};