import { OrderRepository } from '@cupcake/services' ; import { Order } from '@cupcake/domain' ; export class OrderRepositoryMemory implements OrderRepository { private orders : Map < string , Order > = new Map ( ) ; async connect ( ) { return ; } async save ( order ) { this . orders . set ( order . id , order ) ; } async load ( id ) { return this . orders . get ( id ) ; } async all ( ) { return Array . from ( this . orders . values ( ) ) ; } }