import { ProjectionResult , UUID } from '@boostercloud/framework-types' ; import { Projects , ReadModel } from '@boostercloud/framework-core' ; import { Admin } from '../roles' ; import { Stock } from '../entities/stock' ; @ ReadModel ( { authorize : [ Admin ] } ) export class StockReadModel { public constructor ( readonly id , readonly warehouses ) { } @ Projects ( Stock , 'id' ) public static projectStock ( entity ) { return new StockReadModel ( entity . id , entity . warehouses ) ; } }