import { Entity , model , property } from '@loopback/repository' ; @ model ( ) export class CoffeeShop extends Entity { @ property ( { type : 'string' , id : true , generated : true , } ) shopId ? : string ; @ property ( { type : 'string' , required : true , jsonSchema : { maxLength : 10 , minLength : 5 , errorMessage : 'City name must be between 5 and 10 characters' , } , } ) city : string ; @ property ( { type : 'string' , required : true , jsonSchema : { pattern : '\\d{3}-\\d{3}-\\d{4}' , errorMessage : 'Invalid phone number' , } , } ) phoneNum : string ; @ property ( { type : 'number' , required : true , jsonSchema : { maximum : 100 , minimum : 10 , errorMessage : { maximum : 'Capacity cannot exceed 100' , minimum : 'Capacity cannot be less than 1' , } , } , } ) capacity : number ; @ property ( { type : 'number' , jsonSchema : { range : [ 1 , 5 ] , errorMessage : 'Rating must be between 1 and 5' , } , } ) rating : string ; constructor ( data ? ) { super ( data ) ; } } export interface CoffeeShopRelations { } export type CoffeeShopWithRelations = CoffeeShop & CoffeeShopRelations ;