mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-13 14:23:02 -05:00
refactor: notification
This commit is contained in:
21
libs/power-of-effect/model/src/lib/school.model.ts
Normal file
21
libs/power-of-effect/model/src/lib/school.model.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
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';
|
||||
};
|
||||
Reference in New Issue
Block a user