Files
angular-challenges/libs/power-of-effect/model/src/lib/school.model.ts
2024-05-13 16:24:11 +02:00

22 lines
468 B
TypeScript

import { incrementalNumber, randCompanyName } from '@ngneat/falso';
import { Push } from './push.model';
export interface School extends Push {
id: number;
name: string;
version: number;
}
const factorySchool = incrementalNumber();
export const randSchool = (): School => ({
id: factorySchool(),
name: randCompanyName(),
version: 0,
type: 'school',
});
export const isSchool = (notif: Push): notif is School => {
return notif.type === 'school';
};