1- import { IStock } from './IStock' ;
1+ import { v4 as uuid } from 'uuid' ;
2+ import { IStock , StockMarket } from './' ;
23
34export class Stock implements IStock {
45
@@ -14,21 +15,21 @@ export class Stock implements IStock {
1415 public updatedAt : Date ;
1516 public value : number ;
1617
17- constructor ( response : IHttpResponse ) {
18- this . id = ( response . id )
19- ? response . id
18+ constructor ( stock : IStock ) {
19+ this . id = ( stock . id )
20+ ? stock . id
2021 :uuid ( ) ;
2122
22- this . bloombergTerminalUrl = response . bloombergTerminalUrl ;
23- this . companyName = response . companyName ;
24- this . companyUrl = response . companyUrl ;
25- this . hasElonMuskTweetedAboutIt = response . hasElonMuskTweetedAboutIt ;
26- this . isHot = response . isHot ;
27- this . marketSymbol = response . marketSymbol ;
28- this . redditMentions = response . redditMentions ;
29- this . stockMarket = response . stockMarket ;
30- this . updatedAt = response . updatedAt ;
31- this . value = response . value ;
23+ this . bloombergTerminalUrl = stock . bloombergTerminalUrl ;
24+ this . companyName = stock . companyName ;
25+ this . companyUrl = stock . companyUrl ;
26+ this . hasElonMuskTweetedAboutIt = stock . hasElonMuskTweetedAboutIt ;
27+ this . isHot = stock . isHot ;
28+ this . marketSymbol = stock . marketSymbol ;
29+ this . redditMentions = stock . redditMentions ;
30+ this . stockMarket = stock . stockMarket ;
31+ this . updatedAt = stock . updatedAt ;
32+ this . value = stock . value ;
3233 }
3334
3435}
0 commit comments