diff --git a/.jhipster/NewStockWallet.json b/.jhipster/NewStockWallet.json new file mode 100644 index 0000000..89f9e84 --- /dev/null +++ b/.jhipster/NewStockWallet.json @@ -0,0 +1,74 @@ +{ + "relationships": [ + { + "relationshipId": 1, + "relationshipName": "user", + "otherEntityName": "user", + "relationshipType": "many-to-one", + "otherEntityField": "login" + }, + { + "relationshipId": 2, + "relationshipName": "portfolioStore", + "otherEntityName": "portfolioStore", + "relationshipType": "one-to-many", + "otherEntityRelationshipName": "newStockWallet" + } + ], + "fields": [ + { + "fieldId": 1, + "fieldName": "name", + "fieldType": "String", + "fieldValidateRules": [ + "required" + ] + }, + { + "fieldId": 2, + "fieldName": "historicalDataDate", + "fieldType": "LocalDate", + "fieldValidateRules": [ + "required" + ] + }, + { + "fieldId": 3, + "fieldName": "calculatingsDate", + "fieldType": "LocalDate", + "fieldValidateRules": [ + "required" + ] + }, + { + "fieldId": 4, + "fieldName": "prognoseDate", + "fieldType": "LocalDate" + }, + { + "fieldId": 5, + "fieldName": "riskfreeRate", + "fieldType": "Double" + }, + { + "fieldId": 6, + "fieldName": "expectedReturn", + "fieldType": "Double" + }, + { + "fieldId": 7, + "fieldName": "expectedVariation", + "fieldType": "Double" + }, + { + "fieldId": 8, + "fieldName": "sharpRatio", + "fieldType": "Double" + } + + ], + "changelogDate": "20151209201934", + "dto": "no", + "service": "no", + "pagination": "no" +} diff --git a/.jhipster/PortfolioStore.json b/.jhipster/PortfolioStore.json new file mode 100644 index 0000000..709afc8 --- /dev/null +++ b/.jhipster/PortfolioStore.json @@ -0,0 +1,29 @@ +{ + "relationships": [ + { + "relationshipId": 1, + "relationshipName": "newStockWallet", + "otherEntityName": "newStockWallet", + "relationshipType": "many-to-one", + "otherEntityField": "name" + }, + { + "relationshipId": 2, + "relationshipName": "stockInfo", + "otherEntityName": "stockInfo", + "relationshipType": "many-to-one", + "otherEntityField": "name" + } + ], + "fields": [ + { + "fieldId": 1, + "fieldName": "percent", + "fieldType": "Double" + } + ], + "changelogDate": "20151209201934", + "dto": "no", + "service": "no", + "pagination": "no" +} diff --git a/.jhipster/StockInfo.json b/.jhipster/StockInfo.json new file mode 100644 index 0000000..50c1b11 --- /dev/null +++ b/.jhipster/StockInfo.json @@ -0,0 +1,53 @@ +{ + "relationships": [ + { + "relationshipId": 1, + "relationshipName": "stockQuotes", + "otherEntityName": "stockQuotes", + "relationshipType": "one-to-many", + "otherEntityRelationshipName": "stockInfo" + }, + { + "relationshipId": 2, + "relationshipName": "portfolioStore", + "otherEntityName": "portfolioStore", + "relationshipType": "one-to-many", + "otherEntityRelationshipName": "stockInfo" + } + ], + "fields": [ + { + "fieldId": 1, + "fieldName": "name", + "fieldType": "String", + "fieldValidateRules": [] + }, + { + "fieldId": 2, + "fieldName": "symbol", + "fieldType": "String", + "fieldValidateRules": [] + }, + { + "fieldId": 3, + "fieldName": "quotesStartDate", + "fieldType": "LocalDate", + "fieldValidateRules": [] + }, + { + "fieldId": 4, + "fieldName": "quotesEndDate", + "fieldType": "LocalDate", + "fieldValidateRules": [] + }, + { + "fieldId": 5, + "fieldName": "isInvestorModeAvaiable", + "fieldType": "Boolean" + } + ], + "changelogDate": "20151209210649", + "dto": "no", + "service": "no", + "pagination": "no" +} \ No newline at end of file diff --git a/.jhipster/StockQuotes.json b/.jhipster/StockQuotes.json new file mode 100644 index 0000000..00aec15 --- /dev/null +++ b/.jhipster/StockQuotes.json @@ -0,0 +1,39 @@ +{ + "relationships": [ + { + "relationshipId": 1, + "relationshipName": "stockInfo", + "otherEntityName": "stockInfo", + "relationshipType": "many-to-one", + "otherEntityField": "id" + } + ], + "fields": [ + { + "fieldId": 1, + "fieldName": "date", + "fieldType": "LocalDate", + "fieldValidateRules": [] + }, + { + "fieldId": 2, + "fieldName": "value", + "fieldType": "Double", + "fieldValidateRules": [] + }, + { + "fieldId": 3, + "fieldName": "splitRate", + "fieldType": "Double" + }, + { + "fieldId": 4, + "fieldName": "dividend", + "fieldType": "Double" + } + ], + "changelogDate": "20151209205511", + "dto": "no", + "service": "no", + "pagination": "no" +} \ No newline at end of file diff --git a/src/main/java/com/pri/cabzza/domain/NewStockWallet.java b/src/main/java/com/pri/cabzza/domain/NewStockWallet.java new file mode 100644 index 0000000..720eb15 --- /dev/null +++ b/src/main/java/com/pri/cabzza/domain/NewStockWallet.java @@ -0,0 +1,187 @@ +package com.pri.cabzza.domain; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.hibernate.annotations.Cache; +import org.hibernate.annotations.CacheConcurrencyStrategy; +import java.time.LocalDate; +import org.springframework.data.elasticsearch.annotations.Document; + +import javax.persistence.*; +import javax.validation.constraints.*; +import java.io.Serializable; +import java.util.HashSet; +import java.util.Set; +import java.util.Objects; + +/** + * A NewStockWallet. + */ +@Entity +@Table(name = "new_stock_wallet") +@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) +@Document(indexName = "newstockwallet") +public class NewStockWallet implements Serializable { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private Long id; + + @NotNull + @Column(name = "name", nullable = false) + private String name; + + @NotNull + @Column(name = "historical_data_date", nullable = false) + private LocalDate historicalDataDate; + + @NotNull + @Column(name = "calculatings_date", nullable = false) + private LocalDate calculatingsDate; + + @Column(name = "prognose_date", nullable = false) + private LocalDate prognoseDate; + + @Column(name = "riskfree_rate") + private Double riskfreeRate; + + @Column(name = "expected_return") + private Double expectedReturn; + + @Column(name = "expected_variation") + private Double expectedVariation; + + @Column(name = "sharp_ratio") + private Double sharpRatio; + + @ManyToOne + private User user; + + @OneToMany(mappedBy = "newStockWallet") + @JsonIgnore + @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) + private Set portfolioStores = new HashSet<>(); + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public LocalDate getHistoricalDataDate() { + return historicalDataDate; + } + + public void setHistoricalDataDate(LocalDate historicalDataDate) { + this.historicalDataDate = historicalDataDate; + } + + public LocalDate getCalculatingsDate() { + return calculatingsDate; + } + + public void setCalculatingsDate(LocalDate calculatingsDate) { + this.calculatingsDate = calculatingsDate; + } + + public LocalDate getPrognoseDate() { + return prognoseDate; + } + + public void setPrognoseDate(LocalDate prognoseDate) { + this.prognoseDate = prognoseDate; + } + + public Double getRiskfreeRate() { + return riskfreeRate; + } + + public void setRiskfreeRate(Double riskfreeRate) { + this.riskfreeRate = riskfreeRate; + } + + public Double getExpectedReturn() { + return expectedReturn; + } + + public void setExpectedReturn(Double expectedReturn) { + this.expectedReturn = expectedReturn; + } + + public Double getExpectedVariation() { + return expectedVariation; + } + + public void setExpectedVariation(Double expectedVariation) { + this.expectedVariation = expectedVariation; + } + + public Double getSharpRatio() { + return sharpRatio; + } + + public void setSharpRatio(Double sharpRatio) { + this.sharpRatio = sharpRatio; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + public Set getPortfolioStores() { + return portfolioStores; + } + + public void setPortfolioStores(Set portfolioStores) { + this.portfolioStores = portfolioStores; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + NewStockWallet newStockWallet = (NewStockWallet) o; + + if ( ! Objects.equals(id, newStockWallet.id)) return false; + + return true; + } + + @Override + public int hashCode() { + return Objects.hashCode(id); + } + + @Override + public String toString() { + return "NewStockWallet{" + + "id=" + id + + ", name='" + name + "'" + + ", historicalDataDate='" + historicalDataDate + "'" + + ", calculatingsDate='" + calculatingsDate + "'" + + ", prognoseDate='" + prognoseDate + "'" + + ", riskfreeRate='" + riskfreeRate + "'" + + ", expectedReturn='" + expectedReturn + "'" + + ", expectedVariation='" + expectedVariation + "'" + + ", sharpRatio='" + sharpRatio + "'" + + '}'; + } +} diff --git a/src/main/java/com/pri/cabzza/domain/PortfolioStore.java b/src/main/java/com/pri/cabzza/domain/PortfolioStore.java new file mode 100644 index 0000000..fa288aa --- /dev/null +++ b/src/main/java/com/pri/cabzza/domain/PortfolioStore.java @@ -0,0 +1,95 @@ +package com.pri.cabzza.domain; + +import org.hibernate.annotations.Cache; +import org.hibernate.annotations.CacheConcurrencyStrategy; +import org.springframework.data.elasticsearch.annotations.Document; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.HashSet; +import java.util.Set; +import java.util.Objects; + +/** + * A PortfolioStore. + */ +@Entity +@Table(name = "portfolio_store") +@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) +@Document(indexName = "portfoliostore") +public class PortfolioStore implements Serializable { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private Long id; + + @Column(name = "percent") + private Double percent; + + @ManyToOne + private NewStockWallet newStockWallet; + + @ManyToOne + private StockInfo stockInfo; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Double getPercent() { + return percent; + } + + public void setPercent(Double percent) { + this.percent = percent; + } + + public NewStockWallet getNewStockWallet() { + return newStockWallet; + } + + public void setNewStockWallet(NewStockWallet newStockWallet) { + this.newStockWallet = newStockWallet; + } + + public StockInfo getStockInfo() { + return stockInfo; + } + + public void setStockInfo(StockInfo stockInfo) { + this.stockInfo = stockInfo; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + PortfolioStore portfolioStore = (PortfolioStore) o; + + if ( ! Objects.equals(id, portfolioStore.id)) return false; + + return true; + } + + @Override + public int hashCode() { + return Objects.hashCode(id); + } + + @Override + public String toString() { + return "PortfolioStore{" + + "id=" + id + + ", percent='" + percent + "'" + + '}'; + } +} diff --git a/src/main/java/com/pri/cabzza/domain/StockInfo.java b/src/main/java/com/pri/cabzza/domain/StockInfo.java new file mode 100644 index 0000000..3a36a96 --- /dev/null +++ b/src/main/java/com/pri/cabzza/domain/StockInfo.java @@ -0,0 +1,149 @@ +package com.pri.cabzza.domain; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.hibernate.annotations.Cache; +import org.hibernate.annotations.CacheConcurrencyStrategy; +import java.time.LocalDate; +import org.springframework.data.elasticsearch.annotations.Document; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.HashSet; +import java.util.Set; +import java.util.Objects; + +/** + * A StockInfo. + */ +@Entity +@Table(name = "stock_info") +@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) +@Document(indexName = "stockinfo") +public class StockInfo implements Serializable { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private Long id; + + @Column(name = "name") + private String name; + + @Column(name = "symbol") + private String symbol; + + @Column(name = "quotes_start_date") + private LocalDate quotesStartDate; + + @Column(name = "quotes_end_date") + private LocalDate quotesEndDate; + + @Column(name = "is_investor_mode_avaiable") + private Boolean isInvestorModeAvaiable; + + @OneToMany(mappedBy = "stockInfo") + @JsonIgnore + @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) + private Set stockQuotess = new HashSet<>(); + + @OneToMany(mappedBy = "stockInfo") + @JsonIgnore + @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) + private Set portfolioStores = new HashSet<>(); + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getSymbol() { + return symbol; + } + + public void setSymbol(String symbol) { + this.symbol = symbol; + } + + public LocalDate getQuotesStartDate() { + return quotesStartDate; + } + + public void setQuotesStartDate(LocalDate quotesStartDate) { + this.quotesStartDate = quotesStartDate; + } + + public LocalDate getQuotesEndDate() { + return quotesEndDate; + } + + public void setQuotesEndDate(LocalDate quotesEndDate) { + this.quotesEndDate = quotesEndDate; + } + + public Boolean getIsInvestorModeAvaiable() { + return isInvestorModeAvaiable; + } + + public void setIsInvestorModeAvaiable(Boolean isInvestorModeAvaiable) { + this.isInvestorModeAvaiable = isInvestorModeAvaiable; + } + + public Set getStockQuotess() { + return stockQuotess; + } + + public void setStockQuotess(Set stockQuotess) { + this.stockQuotess = stockQuotess; + } + + public Set getPortfolioStores() { + return portfolioStores; + } + + public void setPortfolioStores(Set portfolioStores) { + this.portfolioStores = portfolioStores; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + StockInfo stockInfo = (StockInfo) o; + + if ( ! Objects.equals(id, stockInfo.id)) return false; + + return true; + } + + @Override + public int hashCode() { + return Objects.hashCode(id); + } + + @Override + public String toString() { + return "StockInfo{" + + "id=" + id + + ", name='" + name + "'" + + ", symbol='" + symbol + "'" + + ", quotesStartDate='" + quotesStartDate + "'" + + ", quotesEndDate='" + quotesEndDate + "'" + + ", isInvestorModeAvaiable='" + isInvestorModeAvaiable + "'" + + '}'; + } +} diff --git a/src/main/java/com/pri/cabzza/domain/StockQuotes.java b/src/main/java/com/pri/cabzza/domain/StockQuotes.java new file mode 100644 index 0000000..f1585cd --- /dev/null +++ b/src/main/java/com/pri/cabzza/domain/StockQuotes.java @@ -0,0 +1,121 @@ +package com.pri.cabzza.domain; + +import org.hibernate.annotations.Cache; +import org.hibernate.annotations.CacheConcurrencyStrategy; +import java.time.LocalDate; +import org.springframework.data.elasticsearch.annotations.Document; + +import javax.persistence.*; +import java.io.Serializable; +import java.util.HashSet; +import java.util.Set; +import java.util.Objects; + +/** + * A StockQuotes. + */ +@Entity +@Table(name = "stock_quotes") +@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) +@Document(indexName = "stockquotes") +public class StockQuotes implements Serializable { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private Long id; + + @Column(name = "date") + private LocalDate date; + + @Column(name = "value") + private Double value; + + @Column(name = "split_rate") + private Double splitRate; + + @Column(name = "dividend") + private Double dividend; + + @ManyToOne + private StockInfo stockInfo; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public LocalDate getDate() { + return date; + } + + public void setDate(LocalDate date) { + this.date = date; + } + + public Double getValue() { + return value; + } + + public void setValue(Double value) { + this.value = value; + } + + public Double getSplitRate() { + return splitRate; + } + + public void setSplitRate(Double splitRate) { + this.splitRate = splitRate; + } + + public Double getDividend() { + return dividend; + } + + public void setDividend(Double dividend) { + this.dividend = dividend; + } + + public StockInfo getStockInfo() { + return stockInfo; + } + + public void setStockInfo(StockInfo stockInfo) { + this.stockInfo = stockInfo; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + StockQuotes stockQuotes = (StockQuotes) o; + + if ( ! Objects.equals(id, stockQuotes.id)) return false; + + return true; + } + + @Override + public int hashCode() { + return Objects.hashCode(id); + } + + @Override + public String toString() { + return "StockQuotes{" + + "id=" + id + + ", date='" + date + "'" + + ", value='" + value + "'" + + ", splitRate='" + splitRate + "'" + + ", dividend='" + dividend + "'" + + '}'; + } +} diff --git a/src/main/java/com/pri/cabzza/repository/NewStockWalletRepository.java b/src/main/java/com/pri/cabzza/repository/NewStockWalletRepository.java new file mode 100644 index 0000000..ac81f41 --- /dev/null +++ b/src/main/java/com/pri/cabzza/repository/NewStockWalletRepository.java @@ -0,0 +1,17 @@ +package com.pri.cabzza.repository; + +import com.pri.cabzza.domain.NewStockWallet; + +import org.springframework.data.jpa.repository.*; + +import java.util.List; + +/** + * Spring Data JPA repository for the NewStockWallet entity. + */ +public interface NewStockWalletRepository extends JpaRepository { + + @Query("select newStockWallet from NewStockWallet newStockWallet where newStockWallet.user.login = ?#{principal.username}") + List findByUserIsCurrentUser(); + +} diff --git a/src/main/java/com/pri/cabzza/repository/PortfolioStoreRepository.java b/src/main/java/com/pri/cabzza/repository/PortfolioStoreRepository.java new file mode 100644 index 0000000..ef98db3 --- /dev/null +++ b/src/main/java/com/pri/cabzza/repository/PortfolioStoreRepository.java @@ -0,0 +1,14 @@ +package com.pri.cabzza.repository; + +import com.pri.cabzza.domain.PortfolioStore; + +import org.springframework.data.jpa.repository.*; + +import java.util.List; + +/** + * Spring Data JPA repository for the PortfolioStore entity. + */ +public interface PortfolioStoreRepository extends JpaRepository { + +} diff --git a/src/main/java/com/pri/cabzza/repository/StockInfoRepository.java b/src/main/java/com/pri/cabzza/repository/StockInfoRepository.java new file mode 100644 index 0000000..90d0bf8 --- /dev/null +++ b/src/main/java/com/pri/cabzza/repository/StockInfoRepository.java @@ -0,0 +1,14 @@ +package com.pri.cabzza.repository; + +import com.pri.cabzza.domain.StockInfo; + +import org.springframework.data.jpa.repository.*; + +import java.util.List; + +/** + * Spring Data JPA repository for the StockInfo entity. + */ +public interface StockInfoRepository extends JpaRepository { + +} diff --git a/src/main/java/com/pri/cabzza/repository/StockQuotesRepository.java b/src/main/java/com/pri/cabzza/repository/StockQuotesRepository.java new file mode 100644 index 0000000..cb24c29 --- /dev/null +++ b/src/main/java/com/pri/cabzza/repository/StockQuotesRepository.java @@ -0,0 +1,14 @@ +package com.pri.cabzza.repository; + +import com.pri.cabzza.domain.StockQuotes; + +import org.springframework.data.jpa.repository.*; + +import java.util.List; + +/** + * Spring Data JPA repository for the StockQuotes entity. + */ +public interface StockQuotesRepository extends JpaRepository { + +} diff --git a/src/main/java/com/pri/cabzza/repository/search/NewStockWalletSearchRepository.java b/src/main/java/com/pri/cabzza/repository/search/NewStockWalletSearchRepository.java new file mode 100644 index 0000000..cf72d7a --- /dev/null +++ b/src/main/java/com/pri/cabzza/repository/search/NewStockWalletSearchRepository.java @@ -0,0 +1,10 @@ +package com.pri.cabzza.repository.search; + +import com.pri.cabzza.domain.NewStockWallet; +import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; + +/** + * Spring Data ElasticSearch repository for the NewStockWallet entity. + */ +public interface NewStockWalletSearchRepository extends ElasticsearchRepository { +} diff --git a/src/main/java/com/pri/cabzza/repository/search/PortfolioStoreSearchRepository.java b/src/main/java/com/pri/cabzza/repository/search/PortfolioStoreSearchRepository.java new file mode 100644 index 0000000..6cd0b23 --- /dev/null +++ b/src/main/java/com/pri/cabzza/repository/search/PortfolioStoreSearchRepository.java @@ -0,0 +1,10 @@ +package com.pri.cabzza.repository.search; + +import com.pri.cabzza.domain.PortfolioStore; +import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; + +/** + * Spring Data ElasticSearch repository for the PortfolioStore entity. + */ +public interface PortfolioStoreSearchRepository extends ElasticsearchRepository { +} diff --git a/src/main/java/com/pri/cabzza/repository/search/StockInfoSearchRepository.java b/src/main/java/com/pri/cabzza/repository/search/StockInfoSearchRepository.java new file mode 100644 index 0000000..326af94 --- /dev/null +++ b/src/main/java/com/pri/cabzza/repository/search/StockInfoSearchRepository.java @@ -0,0 +1,10 @@ +package com.pri.cabzza.repository.search; + +import com.pri.cabzza.domain.StockInfo; +import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; + +/** + * Spring Data ElasticSearch repository for the StockInfo entity. + */ +public interface StockInfoSearchRepository extends ElasticsearchRepository { +} diff --git a/src/main/java/com/pri/cabzza/repository/search/StockQuotesSearchRepository.java b/src/main/java/com/pri/cabzza/repository/search/StockQuotesSearchRepository.java new file mode 100644 index 0000000..5df85ca --- /dev/null +++ b/src/main/java/com/pri/cabzza/repository/search/StockQuotesSearchRepository.java @@ -0,0 +1,10 @@ +package com.pri.cabzza.repository.search; + +import com.pri.cabzza.domain.StockQuotes; +import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; + +/** + * Spring Data ElasticSearch repository for the StockQuotes entity. + */ +public interface StockQuotesSearchRepository extends ElasticsearchRepository { +} diff --git a/src/main/java/com/pri/cabzza/web/rest/NewStockWalletResource.java b/src/main/java/com/pri/cabzza/web/rest/NewStockWalletResource.java new file mode 100644 index 0000000..bcb0826 --- /dev/null +++ b/src/main/java/com/pri/cabzza/web/rest/NewStockWalletResource.java @@ -0,0 +1,135 @@ +package com.pri.cabzza.web.rest; + +import com.codahale.metrics.annotation.Timed; +import com.pri.cabzza.domain.NewStockWallet; +import com.pri.cabzza.repository.NewStockWalletRepository; +import com.pri.cabzza.repository.search.NewStockWalletSearchRepository; +import com.pri.cabzza.web.rest.util.HeaderUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import javax.inject.Inject; +import javax.validation.Valid; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; +import java.util.stream.StreamSupport; + +import static org.elasticsearch.index.query.QueryBuilders.*; + +/** + * REST controller for managing NewStockWallet. + */ +@RestController +@RequestMapping("/api") +public class NewStockWalletResource { + + private final Logger log = LoggerFactory.getLogger(NewStockWalletResource.class); + + @Inject + private NewStockWalletRepository newStockWalletRepository; + + @Inject + private NewStockWalletSearchRepository newStockWalletSearchRepository; + + /** + * POST /newStockWallets -> Create a new newStockWallet. + */ + @RequestMapping(value = "/newStockWallets", + method = RequestMethod.POST, + produces = MediaType.APPLICATION_JSON_VALUE) + @Timed + public ResponseEntity createNewStockWallet(@Valid @RequestBody NewStockWallet newStockWallet) throws URISyntaxException { + log.debug("REST request to save NewStockWallet : {}", newStockWallet); + if (newStockWallet.getId() != null) { + return ResponseEntity.badRequest().header("Failure", "A new newStockWallet cannot already have an ID").body(null); + } + NewStockWallet result = newStockWalletRepository.save(newStockWallet); + newStockWalletSearchRepository.save(result); + return ResponseEntity.created(new URI("/api/newStockWallets/" + result.getId())) + .headers(HeaderUtil.createEntityCreationAlert("newStockWallet", result.getId().toString())) + .body(result); + } + + /** + * PUT /newStockWallets -> Updates an existing newStockWallet. + */ + @RequestMapping(value = "/newStockWallets", + method = RequestMethod.PUT, + produces = MediaType.APPLICATION_JSON_VALUE) + @Timed + public ResponseEntity updateNewStockWallet(@Valid @RequestBody NewStockWallet newStockWallet) throws URISyntaxException { + log.debug("REST request to update NewStockWallet : {}", newStockWallet); + if (newStockWallet.getId() == null) { + return createNewStockWallet(newStockWallet); + } + NewStockWallet result = newStockWalletRepository.save(newStockWallet); + newStockWalletSearchRepository.save(newStockWallet); + return ResponseEntity.ok() + .headers(HeaderUtil.createEntityUpdateAlert("newStockWallet", newStockWallet.getId().toString())) + .body(result); + } + + /** + * GET /newStockWallets -> get all the newStockWallets. + */ + @RequestMapping(value = "/newStockWallets", + method = RequestMethod.GET, + produces = MediaType.APPLICATION_JSON_VALUE) + @Timed + public List getAllNewStockWallets() { + log.debug("REST request to get all NewStockWallets"); + return newStockWalletRepository.findAll(); + } + + /** + * GET /newStockWallets/:id -> get the "id" newStockWallet. + */ + @RequestMapping(value = "/newStockWallets/{id}", + method = RequestMethod.GET, + produces = MediaType.APPLICATION_JSON_VALUE) + @Timed + public ResponseEntity getNewStockWallet(@PathVariable Long id) { + log.debug("REST request to get NewStockWallet : {}", id); + return Optional.ofNullable(newStockWalletRepository.findOne(id)) + .map(newStockWallet -> new ResponseEntity<>( + newStockWallet, + HttpStatus.OK)) + .orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND)); + } + + /** + * DELETE /newStockWallets/:id -> delete the "id" newStockWallet. + */ + @RequestMapping(value = "/newStockWallets/{id}", + method = RequestMethod.DELETE, + produces = MediaType.APPLICATION_JSON_VALUE) + @Timed + public ResponseEntity deleteNewStockWallet(@PathVariable Long id) { + log.debug("REST request to delete NewStockWallet : {}", id); + newStockWalletRepository.delete(id); + newStockWalletSearchRepository.delete(id); + return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert("newStockWallet", id.toString())).build(); + } + + /** + * SEARCH /_search/newStockWallets/:query -> search for the newStockWallet corresponding + * to the query. + */ + @RequestMapping(value = "/_search/newStockWallets/{query}", + method = RequestMethod.GET, + produces = MediaType.APPLICATION_JSON_VALUE) + @Timed + public List searchNewStockWallets(@PathVariable String query) { + return StreamSupport + .stream(newStockWalletSearchRepository.search(queryStringQuery(query)).spliterator(), false) + .collect(Collectors.toList()); + } +} diff --git a/src/main/java/com/pri/cabzza/web/rest/PortfolioStoreResource.java b/src/main/java/com/pri/cabzza/web/rest/PortfolioStoreResource.java new file mode 100644 index 0000000..94c91ef --- /dev/null +++ b/src/main/java/com/pri/cabzza/web/rest/PortfolioStoreResource.java @@ -0,0 +1,134 @@ +package com.pri.cabzza.web.rest; + +import com.codahale.metrics.annotation.Timed; +import com.pri.cabzza.domain.PortfolioStore; +import com.pri.cabzza.repository.PortfolioStoreRepository; +import com.pri.cabzza.repository.search.PortfolioStoreSearchRepository; +import com.pri.cabzza.web.rest.util.HeaderUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import javax.inject.Inject; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; +import java.util.stream.StreamSupport; + +import static org.elasticsearch.index.query.QueryBuilders.*; + +/** + * REST controller for managing PortfolioStore. + */ +@RestController +@RequestMapping("/api") +public class PortfolioStoreResource { + + private final Logger log = LoggerFactory.getLogger(PortfolioStoreResource.class); + + @Inject + private PortfolioStoreRepository portfolioStoreRepository; + + @Inject + private PortfolioStoreSearchRepository portfolioStoreSearchRepository; + + /** + * POST /portfolioStores -> Create a new portfolioStore. + */ + @RequestMapping(value = "/portfolioStores", + method = RequestMethod.POST, + produces = MediaType.APPLICATION_JSON_VALUE) + @Timed + public ResponseEntity createPortfolioStore(@RequestBody PortfolioStore portfolioStore) throws URISyntaxException { + log.debug("REST request to save PortfolioStore : {}", portfolioStore); + if (portfolioStore.getId() != null) { + return ResponseEntity.badRequest().header("Failure", "A new portfolioStore cannot already have an ID").body(null); + } + PortfolioStore result = portfolioStoreRepository.save(portfolioStore); + portfolioStoreSearchRepository.save(result); + return ResponseEntity.created(new URI("/api/portfolioStores/" + result.getId())) + .headers(HeaderUtil.createEntityCreationAlert("portfolioStore", result.getId().toString())) + .body(result); + } + + /** + * PUT /portfolioStores -> Updates an existing portfolioStore. + */ + @RequestMapping(value = "/portfolioStores", + method = RequestMethod.PUT, + produces = MediaType.APPLICATION_JSON_VALUE) + @Timed + public ResponseEntity updatePortfolioStore(@RequestBody PortfolioStore portfolioStore) throws URISyntaxException { + log.debug("REST request to update PortfolioStore : {}", portfolioStore); + if (portfolioStore.getId() == null) { + return createPortfolioStore(portfolioStore); + } + PortfolioStore result = portfolioStoreRepository.save(portfolioStore); + portfolioStoreSearchRepository.save(portfolioStore); + return ResponseEntity.ok() + .headers(HeaderUtil.createEntityUpdateAlert("portfolioStore", portfolioStore.getId().toString())) + .body(result); + } + + /** + * GET /portfolioStores -> get all the portfolioStores. + */ + @RequestMapping(value = "/portfolioStores", + method = RequestMethod.GET, + produces = MediaType.APPLICATION_JSON_VALUE) + @Timed + public List getAllPortfolioStores() { + log.debug("REST request to get all PortfolioStores"); + return portfolioStoreRepository.findAll(); + } + + /** + * GET /portfolioStores/:id -> get the "id" portfolioStore. + */ + @RequestMapping(value = "/portfolioStores/{id}", + method = RequestMethod.GET, + produces = MediaType.APPLICATION_JSON_VALUE) + @Timed + public ResponseEntity getPortfolioStore(@PathVariable Long id) { + log.debug("REST request to get PortfolioStore : {}", id); + return Optional.ofNullable(portfolioStoreRepository.findOne(id)) + .map(portfolioStore -> new ResponseEntity<>( + portfolioStore, + HttpStatus.OK)) + .orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND)); + } + + /** + * DELETE /portfolioStores/:id -> delete the "id" portfolioStore. + */ + @RequestMapping(value = "/portfolioStores/{id}", + method = RequestMethod.DELETE, + produces = MediaType.APPLICATION_JSON_VALUE) + @Timed + public ResponseEntity deletePortfolioStore(@PathVariable Long id) { + log.debug("REST request to delete PortfolioStore : {}", id); + portfolioStoreRepository.delete(id); + portfolioStoreSearchRepository.delete(id); + return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert("portfolioStore", id.toString())).build(); + } + + /** + * SEARCH /_search/portfolioStores/:query -> search for the portfolioStore corresponding + * to the query. + */ + @RequestMapping(value = "/_search/portfolioStores/{query}", + method = RequestMethod.GET, + produces = MediaType.APPLICATION_JSON_VALUE) + @Timed + public List searchPortfolioStores(@PathVariable String query) { + return StreamSupport + .stream(portfolioStoreSearchRepository.search(queryStringQuery(query)).spliterator(), false) + .collect(Collectors.toList()); + } +} diff --git a/src/main/java/com/pri/cabzza/web/rest/StockInfoResource.java b/src/main/java/com/pri/cabzza/web/rest/StockInfoResource.java new file mode 100644 index 0000000..444d0cb --- /dev/null +++ b/src/main/java/com/pri/cabzza/web/rest/StockInfoResource.java @@ -0,0 +1,134 @@ +package com.pri.cabzza.web.rest; + +import com.codahale.metrics.annotation.Timed; +import com.pri.cabzza.domain.StockInfo; +import com.pri.cabzza.repository.StockInfoRepository; +import com.pri.cabzza.repository.search.StockInfoSearchRepository; +import com.pri.cabzza.web.rest.util.HeaderUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import javax.inject.Inject; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; +import java.util.stream.StreamSupport; + +import static org.elasticsearch.index.query.QueryBuilders.*; + +/** + * REST controller for managing StockInfo. + */ +@RestController +@RequestMapping("/api") +public class StockInfoResource { + + private final Logger log = LoggerFactory.getLogger(StockInfoResource.class); + + @Inject + private StockInfoRepository stockInfoRepository; + + @Inject + private StockInfoSearchRepository stockInfoSearchRepository; + + /** + * POST /stockInfos -> Create a new stockInfo. + */ + @RequestMapping(value = "/stockInfos", + method = RequestMethod.POST, + produces = MediaType.APPLICATION_JSON_VALUE) + @Timed + public ResponseEntity createStockInfo(@RequestBody StockInfo stockInfo) throws URISyntaxException { + log.debug("REST request to save StockInfo : {}", stockInfo); + if (stockInfo.getId() != null) { + return ResponseEntity.badRequest().header("Failure", "A new stockInfo cannot already have an ID").body(null); + } + StockInfo result = stockInfoRepository.save(stockInfo); + stockInfoSearchRepository.save(result); + return ResponseEntity.created(new URI("/api/stockInfos/" + result.getId())) + .headers(HeaderUtil.createEntityCreationAlert("stockInfo", result.getId().toString())) + .body(result); + } + + /** + * PUT /stockInfos -> Updates an existing stockInfo. + */ + @RequestMapping(value = "/stockInfos", + method = RequestMethod.PUT, + produces = MediaType.APPLICATION_JSON_VALUE) + @Timed + public ResponseEntity updateStockInfo(@RequestBody StockInfo stockInfo) throws URISyntaxException { + log.debug("REST request to update StockInfo : {}", stockInfo); + if (stockInfo.getId() == null) { + return createStockInfo(stockInfo); + } + StockInfo result = stockInfoRepository.save(stockInfo); + stockInfoSearchRepository.save(stockInfo); + return ResponseEntity.ok() + .headers(HeaderUtil.createEntityUpdateAlert("stockInfo", stockInfo.getId().toString())) + .body(result); + } + + /** + * GET /stockInfos -> get all the stockInfos. + */ + @RequestMapping(value = "/stockInfos", + method = RequestMethod.GET, + produces = MediaType.APPLICATION_JSON_VALUE) + @Timed + public List getAllStockInfos() { + log.debug("REST request to get all StockInfos"); + return stockInfoRepository.findAll(); + } + + /** + * GET /stockInfos/:id -> get the "id" stockInfo. + */ + @RequestMapping(value = "/stockInfos/{id}", + method = RequestMethod.GET, + produces = MediaType.APPLICATION_JSON_VALUE) + @Timed + public ResponseEntity getStockInfo(@PathVariable Long id) { + log.debug("REST request to get StockInfo : {}", id); + return Optional.ofNullable(stockInfoRepository.findOne(id)) + .map(stockInfo -> new ResponseEntity<>( + stockInfo, + HttpStatus.OK)) + .orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND)); + } + + /** + * DELETE /stockInfos/:id -> delete the "id" stockInfo. + */ + @RequestMapping(value = "/stockInfos/{id}", + method = RequestMethod.DELETE, + produces = MediaType.APPLICATION_JSON_VALUE) + @Timed + public ResponseEntity deleteStockInfo(@PathVariable Long id) { + log.debug("REST request to delete StockInfo : {}", id); + stockInfoRepository.delete(id); + stockInfoSearchRepository.delete(id); + return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert("stockInfo", id.toString())).build(); + } + + /** + * SEARCH /_search/stockInfos/:query -> search for the stockInfo corresponding + * to the query. + */ + @RequestMapping(value = "/_search/stockInfos/{query}", + method = RequestMethod.GET, + produces = MediaType.APPLICATION_JSON_VALUE) + @Timed + public List searchStockInfos(@PathVariable String query) { + return StreamSupport + .stream(stockInfoSearchRepository.search(queryStringQuery(query)).spliterator(), false) + .collect(Collectors.toList()); + } +} diff --git a/src/main/java/com/pri/cabzza/web/rest/StockQuotesResource.java b/src/main/java/com/pri/cabzza/web/rest/StockQuotesResource.java new file mode 100644 index 0000000..c849047 --- /dev/null +++ b/src/main/java/com/pri/cabzza/web/rest/StockQuotesResource.java @@ -0,0 +1,134 @@ +package com.pri.cabzza.web.rest; + +import com.codahale.metrics.annotation.Timed; +import com.pri.cabzza.domain.StockQuotes; +import com.pri.cabzza.repository.StockQuotesRepository; +import com.pri.cabzza.repository.search.StockQuotesSearchRepository; +import com.pri.cabzza.web.rest.util.HeaderUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import javax.inject.Inject; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; +import java.util.stream.StreamSupport; + +import static org.elasticsearch.index.query.QueryBuilders.*; + +/** + * REST controller for managing StockQuotes. + */ +@RestController +@RequestMapping("/api") +public class StockQuotesResource { + + private final Logger log = LoggerFactory.getLogger(StockQuotesResource.class); + + @Inject + private StockQuotesRepository stockQuotesRepository; + + @Inject + private StockQuotesSearchRepository stockQuotesSearchRepository; + + /** + * POST /stockQuotess -> Create a new stockQuotes. + */ + @RequestMapping(value = "/stockQuotess", + method = RequestMethod.POST, + produces = MediaType.APPLICATION_JSON_VALUE) + @Timed + public ResponseEntity createStockQuotes(@RequestBody StockQuotes stockQuotes) throws URISyntaxException { + log.debug("REST request to save StockQuotes : {}", stockQuotes); + if (stockQuotes.getId() != null) { + return ResponseEntity.badRequest().header("Failure", "A new stockQuotes cannot already have an ID").body(null); + } + StockQuotes result = stockQuotesRepository.save(stockQuotes); + stockQuotesSearchRepository.save(result); + return ResponseEntity.created(new URI("/api/stockQuotess/" + result.getId())) + .headers(HeaderUtil.createEntityCreationAlert("stockQuotes", result.getId().toString())) + .body(result); + } + + /** + * PUT /stockQuotess -> Updates an existing stockQuotes. + */ + @RequestMapping(value = "/stockQuotess", + method = RequestMethod.PUT, + produces = MediaType.APPLICATION_JSON_VALUE) + @Timed + public ResponseEntity updateStockQuotes(@RequestBody StockQuotes stockQuotes) throws URISyntaxException { + log.debug("REST request to update StockQuotes : {}", stockQuotes); + if (stockQuotes.getId() == null) { + return createStockQuotes(stockQuotes); + } + StockQuotes result = stockQuotesRepository.save(stockQuotes); + stockQuotesSearchRepository.save(stockQuotes); + return ResponseEntity.ok() + .headers(HeaderUtil.createEntityUpdateAlert("stockQuotes", stockQuotes.getId().toString())) + .body(result); + } + + /** + * GET /stockQuotess -> get all the stockQuotess. + */ + @RequestMapping(value = "/stockQuotess", + method = RequestMethod.GET, + produces = MediaType.APPLICATION_JSON_VALUE) + @Timed + public List getAllStockQuotess() { + log.debug("REST request to get all StockQuotess"); + return stockQuotesRepository.findAll(); + } + + /** + * GET /stockQuotess/:id -> get the "id" stockQuotes. + */ + @RequestMapping(value = "/stockQuotess/{id}", + method = RequestMethod.GET, + produces = MediaType.APPLICATION_JSON_VALUE) + @Timed + public ResponseEntity getStockQuotes(@PathVariable Long id) { + log.debug("REST request to get StockQuotes : {}", id); + return Optional.ofNullable(stockQuotesRepository.findOne(id)) + .map(stockQuotes -> new ResponseEntity<>( + stockQuotes, + HttpStatus.OK)) + .orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND)); + } + + /** + * DELETE /stockQuotess/:id -> delete the "id" stockQuotes. + */ + @RequestMapping(value = "/stockQuotess/{id}", + method = RequestMethod.DELETE, + produces = MediaType.APPLICATION_JSON_VALUE) + @Timed + public ResponseEntity deleteStockQuotes(@PathVariable Long id) { + log.debug("REST request to delete StockQuotes : {}", id); + stockQuotesRepository.delete(id); + stockQuotesSearchRepository.delete(id); + return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert("stockQuotes", id.toString())).build(); + } + + /** + * SEARCH /_search/stockQuotess/:query -> search for the stockQuotes corresponding + * to the query. + */ + @RequestMapping(value = "/_search/stockQuotess/{query}", + method = RequestMethod.GET, + produces = MediaType.APPLICATION_JSON_VALUE) + @Timed + public List searchStockQuotess(@PathVariable String query) { + return StreamSupport + .stream(stockQuotesSearchRepository.search(queryStringQuery(query)).spliterator(), false) + .collect(Collectors.toList()); + } +} diff --git a/src/main/resources/config/application-dev.yml b/src/main/resources/config/application-dev.yml index 2817e9f..b79995e 100755 --- a/src/main/resources/config/application-dev.yml +++ b/src/main/resources/config/application-dev.yml @@ -22,8 +22,8 @@ spring: driver-class-name: org.postgresql.ds.PGSimpleDataSource url: jdbc:postgresql://localhost:5432/Cabzza name: - username: postgres - password: + username: postgres + password: michal.9damyrade jpa: database-platform: com.pri.cabzza.domain.util.FixedPostgreSQL82Dialect database: POSTGRESQL diff --git a/src/main/resources/config/liquibase/changelog/20151209201934_added_entity_NewStockWallet.xml b/src/main/resources/config/liquibase/changelog/20151209201934_added_entity_NewStockWallet.xml new file mode 100644 index 0000000..8ad152d --- /dev/null +++ b/src/main/resources/config/liquibase/changelog/20151209201934_added_entity_NewStockWallet.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/config/liquibase/changelog/20151209201934_added_entity_PortfolioStore.xml b/src/main/resources/config/liquibase/changelog/20151209201934_added_entity_PortfolioStore.xml new file mode 100644 index 0000000..601e909 --- /dev/null +++ b/src/main/resources/config/liquibase/changelog/20151209201934_added_entity_PortfolioStore.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/config/liquibase/changelog/20151209205511_added_entity_StockQuotes.xml b/src/main/resources/config/liquibase/changelog/20151209205511_added_entity_StockQuotes.xml new file mode 100644 index 0000000..4ae3cc9 --- /dev/null +++ b/src/main/resources/config/liquibase/changelog/20151209205511_added_entity_StockQuotes.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/config/liquibase/changelog/20151209210649_added_entity_StockInfo.xml b/src/main/resources/config/liquibase/changelog/20151209210649_added_entity_StockInfo.xml new file mode 100644 index 0000000..2c16a05 --- /dev/null +++ b/src/main/resources/config/liquibase/changelog/20151209210649_added_entity_StockInfo.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/config/liquibase/master.xml b/src/main/resources/config/liquibase/master.xml index f979b90..b0cf7c0 100755 --- a/src/main/resources/config/liquibase/master.xml +++ b/src/main/resources/config/liquibase/master.xml @@ -7,5 +7,11 @@ + + + + + + diff --git a/src/main/webapp/i18n/en/global.json b/src/main/webapp/i18n/en/global.json index 24a68e8..fe0d4d1 100755 --- a/src/main/webapp/i18n/en/global.json +++ b/src/main/webapp/i18n/en/global.json @@ -1,3 +1,4 @@ + { "global": { "title": "Cabzza", @@ -8,6 +9,10 @@ "main": "Entities", "stockWallet": "StockWallet", "stockWallet1": "StockWallet1", + "stockQuotes": "StockQuotes", + "stockInfo": "StockInfo", + "portfolioStore": "PortfolioStore", + "newStockWallet": "NewStockWallet", "additionalEntity": "JHipster will add additional entities here (do not translate!)" }, "account": { diff --git a/src/main/webapp/i18n/en/newStockWallet.json b/src/main/webapp/i18n/en/newStockWallet.json new file mode 100644 index 0000000..24f5da1 --- /dev/null +++ b/src/main/webapp/i18n/en/newStockWallet.json @@ -0,0 +1,30 @@ +{ + "cabzzaApp": { + "newStockWallet" : { + "home": { + "title": "NewStockWallets", + "createLabel": "Create a new NewStockWallet", + "createOrEditLabel": "Create or edit a NewStockWallet" + }, + "created": "A new NewStockWallet is created with identifier {{ param }}", + "updated": "A NewStockWallet is updated with identifier {{ param }}", + "deleted": "A NewStockWallet is deleted with identifier {{ param }}", + "delete": { + "question": "Are you sure you want to delete NewStockWallet {{ id }}?" + }, + "detail": { + "title": "NewStockWallet" + }, + "name": "Name", + "historicalDataDate": "HistoricalDataDate", + "calculatingsDate": "CalculatingsDate", + "prognoseDate": "PrognoseDate", + "riskfreeRate": "RiskfreeRate", + "expectedReturn": "ExpectedReturn", + "expectedVariation": "ExpectedVariation", + "sharpRatio": "SharpRatio", + "user": "User", + "portfolioStore": "PortfolioStore" + } + } +} diff --git a/src/main/webapp/i18n/en/portfolioStore.json b/src/main/webapp/i18n/en/portfolioStore.json new file mode 100644 index 0000000..da1102f --- /dev/null +++ b/src/main/webapp/i18n/en/portfolioStore.json @@ -0,0 +1,23 @@ +{ + "cabzzaApp": { + "portfolioStore" : { + "home": { + "title": "PortfolioStores", + "createLabel": "Create a new PortfolioStore", + "createOrEditLabel": "Create or edit a PortfolioStore" + }, + "created": "A new PortfolioStore is created with identifier {{ param }}", + "updated": "A PortfolioStore is updated with identifier {{ param }}", + "deleted": "A PortfolioStore is deleted with identifier {{ param }}", + "delete": { + "question": "Are you sure you want to delete PortfolioStore {{ id }}?" + }, + "detail": { + "title": "PortfolioStore" + }, + "percent": "Percent", + "newStockWallet": "NewStockWallet", + "stockInfo": "StockInfo" + } + } +} diff --git a/src/main/webapp/i18n/en/stockInfo.json b/src/main/webapp/i18n/en/stockInfo.json new file mode 100644 index 0000000..49984c9 --- /dev/null +++ b/src/main/webapp/i18n/en/stockInfo.json @@ -0,0 +1,27 @@ +{ + "cabzzaApp": { + "stockInfo" : { + "home": { + "title": "StockInfos", + "createLabel": "Create a new StockInfo", + "createOrEditLabel": "Create or edit a StockInfo" + }, + "created": "A new StockInfo is created with identifier {{ param }}", + "updated": "A StockInfo is updated with identifier {{ param }}", + "deleted": "A StockInfo is deleted with identifier {{ param }}", + "delete": { + "question": "Are you sure you want to delete StockInfo {{ id }}?" + }, + "detail": { + "title": "StockInfo" + }, + "name": "Name", + "symbol": "Symbol", + "quotesStartDate": "QuotesStartDate", + "quotesEndDate": "QuotesEndDate", + "isInvestorModeAvaiable": "IsInvestorModeAvaiable", + "stockQuotes": "StockQuotes", + "portfolioStore": "PortfolioStore" + } + } +} diff --git a/src/main/webapp/i18n/en/stockQuotes.json b/src/main/webapp/i18n/en/stockQuotes.json new file mode 100644 index 0000000..c72f508 --- /dev/null +++ b/src/main/webapp/i18n/en/stockQuotes.json @@ -0,0 +1,25 @@ +{ + "cabzzaApp": { + "stockQuotes" : { + "home": { + "title": "StockQuotess", + "createLabel": "Create a new StockQuotes", + "createOrEditLabel": "Create or edit a StockQuotes" + }, + "created": "A new StockQuotes is created with identifier {{ param }}", + "updated": "A StockQuotes is updated with identifier {{ param }}", + "deleted": "A StockQuotes is deleted with identifier {{ param }}", + "delete": { + "question": "Are you sure you want to delete StockQuotes {{ id }}?" + }, + "detail": { + "title": "StockQuotes" + }, + "date": "Date", + "value": "Value", + "splitRate": "SplitRate", + "dividend": "Dividend", + "stockInfo": "StockInfo" + } + } +} diff --git a/src/main/webapp/i18n/fr/newStockWallet.json b/src/main/webapp/i18n/fr/newStockWallet.json new file mode 100644 index 0000000..9f0a3db --- /dev/null +++ b/src/main/webapp/i18n/fr/newStockWallet.json @@ -0,0 +1,28 @@ +{ + "cabzzaApp": { + "newStockWallet" : { + "home": { + "title": "NewStockWallets", + "createLabel": "Créer un nouveau NewStockWallet", + "createOrEditLabel": "Créer ou éditer un NewStockWallet" + }, + "delete": { + "question": "Etes-vous certain de vouloir supprimer le NewStockWallet {{ id }} ?" + }, + "detail": { + "title": "NewStockWallet" + }, + "name": "Name", + "historicalDataDate": "HistoricalDataDate", + "calculatingsDate": "CalculatingsDate", + "prognoseDate": "PrognoseDate", + "riskfreeRate": "RiskfreeRate", + "expectedReturn": "ExpectedReturn", + "expectedVariation": "ExpectedVariation", + "sharpRatio": "SharpRatio", + "user": "User", + "portfolioStore": "PortfolioStore" + } + } +} + diff --git a/src/main/webapp/i18n/fr/portfolioStore.json b/src/main/webapp/i18n/fr/portfolioStore.json new file mode 100644 index 0000000..2fe4b6e --- /dev/null +++ b/src/main/webapp/i18n/fr/portfolioStore.json @@ -0,0 +1,21 @@ +{ + "cabzzaApp": { + "portfolioStore" : { + "home": { + "title": "PortfolioStores", + "createLabel": "Créer un nouveau PortfolioStore", + "createOrEditLabel": "Créer ou éditer un PortfolioStore" + }, + "delete": { + "question": "Etes-vous certain de vouloir supprimer le PortfolioStore {{ id }} ?" + }, + "detail": { + "title": "PortfolioStore" + }, + "percent": "Percent", + "newStockWallet": "NewStockWallet", + "stockInfo": "StockInfo" + } + } +} + diff --git a/src/main/webapp/i18n/fr/stockInfo.json b/src/main/webapp/i18n/fr/stockInfo.json new file mode 100644 index 0000000..95e3b70 --- /dev/null +++ b/src/main/webapp/i18n/fr/stockInfo.json @@ -0,0 +1,25 @@ +{ + "cabzzaApp": { + "stockInfo" : { + "home": { + "title": "StockInfos", + "createLabel": "Créer un nouveau StockInfo", + "createOrEditLabel": "Créer ou éditer un StockInfo" + }, + "delete": { + "question": "Etes-vous certain de vouloir supprimer le StockInfo {{ id }} ?" + }, + "detail": { + "title": "StockInfo" + }, + "name": "Name", + "symbol": "Symbol", + "quotesStartDate": "QuotesStartDate", + "quotesEndDate": "QuotesEndDate", + "isInvestorModeAvaiable": "IsInvestorModeAvaiable", + "stockQuotes": "StockQuotes", + "portfolioStore": "PortfolioStore" + } + } +} + diff --git a/src/main/webapp/i18n/fr/stockQuotes.json b/src/main/webapp/i18n/fr/stockQuotes.json new file mode 100644 index 0000000..3ca012a --- /dev/null +++ b/src/main/webapp/i18n/fr/stockQuotes.json @@ -0,0 +1,23 @@ +{ + "cabzzaApp": { + "stockQuotes" : { + "home": { + "title": "StockQuotess", + "createLabel": "Créer un nouveau StockQuotes", + "createOrEditLabel": "Créer ou éditer un StockQuotes" + }, + "delete": { + "question": "Etes-vous certain de vouloir supprimer le StockQuotes {{ id }} ?" + }, + "detail": { + "title": "StockQuotes" + }, + "date": "Date", + "value": "Value", + "splitRate": "SplitRate", + "dividend": "Dividend", + "stockInfo": "StockInfo" + } + } +} + diff --git a/src/main/webapp/i18n/pl/global.json b/src/main/webapp/i18n/pl/global.json index d2d99ab..ccda69b 100644 --- a/src/main/webapp/i18n/pl/global.json +++ b/src/main/webapp/i18n/pl/global.json @@ -1,3 +1,4 @@ + { "global": { "title": "Cabzza", @@ -7,6 +8,10 @@ "entities": { "main": "Encje", "stockWallet": "Portfele", + "stockQuotes": "StockQuotes", + "stockInfo": "StockInfo", + "portfolioStore": "PortfolioStore", + "newStockWallet": "NewStockWallet", "additionalEntity": "JHipster will add additional entities here (do not translate!)" }, "account": { diff --git a/src/main/webapp/i18n/pl/newStockWallet.json b/src/main/webapp/i18n/pl/newStockWallet.json new file mode 100644 index 0000000..1ab908e --- /dev/null +++ b/src/main/webapp/i18n/pl/newStockWallet.json @@ -0,0 +1,27 @@ +{ + "cabzzaApp": { + "newStockWallet" : { + "home": { + "title": "NewStockWallet", + "createLabel": "Dodaj NewStockWallet", + "createOrEditLabel": "Dodaj lub edytuj: NewStockWallet" + }, + "delete": { + "question": "Czy na pewno chcesz usunąć NewStockWallet {{ id }}?" + }, + "detail": { + "title": "NewStockWallet" + }, + "name": "Name", + "historicalDataDate": "HistoricalDataDate", + "calculatingsDate": "CalculatingsDate", + "prognoseDate": "PrognoseDate", + "riskfreeRate": "RiskfreeRate", + "expectedReturn": "ExpectedReturn", + "expectedVariation": "ExpectedVariation", + "sharpRatio": "SharpRatio", + "user": "User", + "portfolioStore": "PortfolioStore" + } + } +} diff --git a/src/main/webapp/i18n/pl/portfolioStore.json b/src/main/webapp/i18n/pl/portfolioStore.json new file mode 100644 index 0000000..175ca81 --- /dev/null +++ b/src/main/webapp/i18n/pl/portfolioStore.json @@ -0,0 +1,20 @@ +{ + "cabzzaApp": { + "portfolioStore" : { + "home": { + "title": "PortfolioStore", + "createLabel": "Dodaj PortfolioStore", + "createOrEditLabel": "Dodaj lub edytuj: PortfolioStore" + }, + "delete": { + "question": "Czy na pewno chcesz usunąć PortfolioStore {{ id }}?" + }, + "detail": { + "title": "PortfolioStore" + }, + "percent": "Percent", + "newStockWallet": "NewStockWallet", + "stockInfo": "StockInfo" + } + } +} diff --git a/src/main/webapp/i18n/pl/stockInfo.json b/src/main/webapp/i18n/pl/stockInfo.json new file mode 100644 index 0000000..8f57aec --- /dev/null +++ b/src/main/webapp/i18n/pl/stockInfo.json @@ -0,0 +1,24 @@ +{ + "cabzzaApp": { + "stockInfo" : { + "home": { + "title": "StockInfo", + "createLabel": "Dodaj StockInfo", + "createOrEditLabel": "Dodaj lub edytuj: StockInfo" + }, + "delete": { + "question": "Czy na pewno chcesz usunąć StockInfo {{ id }}?" + }, + "detail": { + "title": "StockInfo" + }, + "name": "Name", + "symbol": "Symbol", + "quotesStartDate": "QuotesStartDate", + "quotesEndDate": "QuotesEndDate", + "isInvestorModeAvaiable": "IsInvestorModeAvaiable", + "stockQuotes": "StockQuotes", + "portfolioStore": "PortfolioStore" + } + } +} diff --git a/src/main/webapp/i18n/pl/stockQuotes.json b/src/main/webapp/i18n/pl/stockQuotes.json new file mode 100644 index 0000000..fbcb012 --- /dev/null +++ b/src/main/webapp/i18n/pl/stockQuotes.json @@ -0,0 +1,22 @@ +{ + "cabzzaApp": { + "stockQuotes" : { + "home": { + "title": "StockQuotes", + "createLabel": "Dodaj StockQuotes", + "createOrEditLabel": "Dodaj lub edytuj: StockQuotes" + }, + "delete": { + "question": "Czy na pewno chcesz usunąć StockQuotes {{ id }}?" + }, + "detail": { + "title": "StockQuotes" + }, + "date": "Date", + "value": "Value", + "splitRate": "SplitRate", + "dividend": "Dividend", + "stockInfo": "StockInfo" + } + } +} diff --git a/src/main/webapp/index.html b/src/main/webapp/index.html index 7eaf853..4fffa54 100755 --- a/src/main/webapp/index.html +++ b/src/main/webapp/index.html @@ -197,6 +197,34 @@

Title 4

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/webapp/scripts/app/entities/newStockWallet/newStockWallet-detail.controller.js b/src/main/webapp/scripts/app/entities/newStockWallet/newStockWallet-detail.controller.js new file mode 100644 index 0000000..274a4ae --- /dev/null +++ b/src/main/webapp/scripts/app/entities/newStockWallet/newStockWallet-detail.controller.js @@ -0,0 +1,16 @@ +'use strict'; + +angular.module('cabzzaApp') + .controller('NewStockWalletDetailController', function ($scope, $rootScope, $stateParams, entity, NewStockWallet, User, PortfolioStore) { + $scope.newStockWallet = entity; + $scope.load = function (id) { + NewStockWallet.get({id: id}, function(result) { + $scope.newStockWallet = result; + }); + }; + var unsubscribe = $rootScope.$on('cabzzaApp:newStockWalletUpdate', function(event, result) { + $scope.newStockWallet = result; + }); + $scope.$on('$destroy', unsubscribe); + + }); diff --git a/src/main/webapp/scripts/app/entities/newStockWallet/newStockWallet-detail.html b/src/main/webapp/scripts/app/entities/newStockWallet/newStockWallet-detail.html new file mode 100644 index 0000000..2aa9b3f --- /dev/null +++ b/src/main/webapp/scripts/app/entities/newStockWallet/newStockWallet-detail.html @@ -0,0 +1,94 @@ + +
+

NewStockWallet {{newStockWallet.id}}

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldValue
+ Name + + {{newStockWallet.name}} +
+ HistoricalDataDate + + {{newStockWallet.historicalDataDate | date:'mediumDate'}} +
+ CalculatingsDate + + {{newStockWallet.calculatingsDate | date:'mediumDate'}} +
+ PrognoseDate + + {{newStockWallet.prognoseDate | date:'mediumDate'}} +
+ RiskfreeRate + + {{newStockWallet.riskfreeRate}} +
+ ExpectedReturn + + {{newStockWallet.expectedReturn}} +
+ ExpectedVariation + + {{newStockWallet.expectedVariation}} +
+ SharpRatio + + {{newStockWallet.sharpRatio}} +
+ user + + {{newStockWallet.user.login}} +
+
+ + +
diff --git a/src/main/webapp/scripts/app/entities/newStockWallet/newStockWallet-dialog.controller.js b/src/main/webapp/scripts/app/entities/newStockWallet/newStockWallet-dialog.controller.js new file mode 100644 index 0000000..73f735a --- /dev/null +++ b/src/main/webapp/scripts/app/entities/newStockWallet/newStockWallet-dialog.controller.js @@ -0,0 +1,32 @@ +'use strict'; + +angular.module('cabzzaApp').controller('NewStockWalletDialogController', + ['$scope', '$stateParams', '$modalInstance', 'entity', 'NewStockWallet', 'User', 'PortfolioStore', + function($scope, $stateParams, $modalInstance, entity, NewStockWallet, User, PortfolioStore) { + + $scope.newStockWallet = entity; + $scope.users = User.query(); + $scope.portfoliostores = PortfolioStore.query(); + $scope.load = function(id) { + NewStockWallet.get({id : id}, function(result) { + $scope.newStockWallet = result; + }); + }; + + var onSaveFinished = function (result) { + $scope.$emit('cabzzaApp:newStockWalletUpdate', result); + $modalInstance.close(result); + }; + + $scope.save = function () { + if ($scope.newStockWallet.id != null) { + NewStockWallet.update($scope.newStockWallet, onSaveFinished); + } else { + NewStockWallet.save($scope.newStockWallet, onSaveFinished); + } + }; + + $scope.clear = function() { + $modalInstance.dismiss('cancel'); + }; +}]); diff --git a/src/main/webapp/scripts/app/entities/newStockWallet/newStockWallet-dialog.html b/src/main/webapp/scripts/app/entities/newStockWallet/newStockWallet-dialog.html new file mode 100644 index 0000000..91820ed --- /dev/null +++ b/src/main/webapp/scripts/app/entities/newStockWallet/newStockWallet-dialog.html @@ -0,0 +1,98 @@ + +
+ + + + +
diff --git a/src/main/webapp/scripts/app/entities/newStockWallet/newStockWallet.controller.js b/src/main/webapp/scripts/app/entities/newStockWallet/newStockWallet.controller.js new file mode 100644 index 0000000..faa4ed0 --- /dev/null +++ b/src/main/webapp/scripts/app/entities/newStockWallet/newStockWallet.controller.js @@ -0,0 +1,57 @@ +'use strict'; + +angular.module('cabzzaApp') + .controller('NewStockWalletController', function ($scope, NewStockWallet, NewStockWalletSearch) { + $scope.newStockWallets = []; + $scope.loadAll = function() { + NewStockWallet.query(function(result) { + $scope.newStockWallets = result; + }); + }; + $scope.loadAll(); + + $scope.delete = function (id) { + NewStockWallet.get({id: id}, function(result) { + $scope.newStockWallet = result; + $('#deleteNewStockWalletConfirmation').modal('show'); + }); + }; + + $scope.confirmDelete = function (id) { + NewStockWallet.delete({id: id}, + function () { + $scope.loadAll(); + $('#deleteNewStockWalletConfirmation').modal('hide'); + $scope.clear(); + }); + }; + + $scope.search = function () { + NewStockWalletSearch.query({query: $scope.searchQuery}, function(result) { + $scope.newStockWallets = result; + }, function(response) { + if(response.status === 404) { + $scope.loadAll(); + } + }); + }; + + $scope.refresh = function () { + $scope.loadAll(); + $scope.clear(); + }; + + $scope.clear = function () { + $scope.newStockWallet = { + name: null, + historicalDataDate: null, + calculatingsDate: null, + prognoseDate: null, + riskfreeRate: null, + expectedReturn: null, + expectedVariation: null, + sharpRatio: null, + id: null + }; + }; + }); diff --git a/src/main/webapp/scripts/app/entities/newStockWallet/newStockWallet.js b/src/main/webapp/scripts/app/entities/newStockWallet/newStockWallet.js new file mode 100644 index 0000000..62b25db --- /dev/null +++ b/src/main/webapp/scripts/app/entities/newStockWallet/newStockWallet.js @@ -0,0 +1,106 @@ +'use strict'; + +angular.module('cabzzaApp') + .config(function ($stateProvider) { + $stateProvider + .state('newStockWallet', { + parent: 'entity', + url: '/newStockWallets', + data: { + authorities: ['ROLE_USER'], + pageTitle: 'cabzzaApp.newStockWallet.home.title' + }, + views: { + 'content@': { + templateUrl: 'scripts/app/entities/newStockWallet/newStockWallets.html', + controller: 'NewStockWalletController' + } + }, + resolve: { + translatePartialLoader: ['$translate', '$translatePartialLoader', function ($translate, $translatePartialLoader) { + $translatePartialLoader.addPart('newStockWallet'); + $translatePartialLoader.addPart('global'); + return $translate.refresh(); + }] + } + }) + .state('newStockWallet.detail', { + parent: 'entity', + url: '/newStockWallet/{id}', + data: { + authorities: ['ROLE_USER'], + pageTitle: 'cabzzaApp.newStockWallet.detail.title' + }, + views: { + 'content@': { + templateUrl: 'scripts/app/entities/newStockWallet/newStockWallet-detail.html', + controller: 'NewStockWalletDetailController' + } + }, + resolve: { + translatePartialLoader: ['$translate', '$translatePartialLoader', function ($translate, $translatePartialLoader) { + $translatePartialLoader.addPart('newStockWallet'); + return $translate.refresh(); + }], + entity: ['$stateParams', 'NewStockWallet', function($stateParams, NewStockWallet) { + return NewStockWallet.get({id : $stateParams.id}); + }] + } + }) + .state('newStockWallet.new', { + parent: 'newStockWallet', + url: '/new', + data: { + authorities: ['ROLE_USER'], + }, + onEnter: ['$stateParams', '$state', '$modal', function($stateParams, $state, $modal) { + $modal.open({ + templateUrl: 'scripts/app/entities/newStockWallet/newStockWallet-dialog.html', + controller: 'NewStockWalletDialogController', + size: 'lg', + resolve: { + entity: function () { + return { + name: null, + historicalDataDate: null, + calculatingsDate: null, + prognoseDate: null, + riskfreeRate: null, + expectedReturn: null, + expectedVariation: null, + sharpRatio: null, + id: null + }; + } + } + }).result.then(function(result) { + $state.go('newStockWallet', null, { reload: true }); + }, function() { + $state.go('newStockWallet'); + }) + }] + }) + .state('newStockWallet.edit', { + parent: 'newStockWallet', + url: '/{id}/edit', + data: { + authorities: ['ROLE_USER'], + }, + onEnter: ['$stateParams', '$state', '$modal', function($stateParams, $state, $modal) { + $modal.open({ + templateUrl: 'scripts/app/entities/newStockWallet/newStockWallet-dialog.html', + controller: 'NewStockWalletDialogController', + size: 'lg', + resolve: { + entity: ['NewStockWallet', function(NewStockWallet) { + return NewStockWallet.get({id : $stateParams.id}); + }] + } + }).result.then(function(result) { + $state.go('newStockWallet', null, { reload: true }); + }, function() { + $state.go('^'); + }) + }] + }); + }); diff --git a/src/main/webapp/scripts/app/entities/newStockWallet/newStockWallets.html b/src/main/webapp/scripts/app/entities/newStockWallet/newStockWallets.html new file mode 100644 index 0000000..d5e07ce --- /dev/null +++ b/src/main/webapp/scripts/app/entities/newStockWallet/newStockWallets.html @@ -0,0 +1,100 @@ +
+

NewStockWallets

+ +
+
+
+ +
+
+
+
+ +
+ +
+
+
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IDNameHistoricalDataDateCalculatingsDatePrognoseDateRiskfreeRateExpectedReturnExpectedVariationSharpRatiouser
{{newStockWallet.id}}{{newStockWallet.name}}{{newStockWallet.historicalDataDate | date:'mediumDate'}}{{newStockWallet.calculatingsDate | date:'mediumDate'}}{{newStockWallet.prognoseDate | date:'mediumDate'}}{{newStockWallet.riskfreeRate}}{{newStockWallet.expectedReturn}}{{newStockWallet.expectedVariation}}{{newStockWallet.sharpRatio}} + {{newStockWallet.user.login}} + + + + +
+
+
diff --git a/src/main/webapp/scripts/app/entities/portfolioStore/portfolioStore-detail.controller.js b/src/main/webapp/scripts/app/entities/portfolioStore/portfolioStore-detail.controller.js new file mode 100644 index 0000000..791b222 --- /dev/null +++ b/src/main/webapp/scripts/app/entities/portfolioStore/portfolioStore-detail.controller.js @@ -0,0 +1,16 @@ +'use strict'; + +angular.module('cabzzaApp') + .controller('PortfolioStoreDetailController', function ($scope, $rootScope, $stateParams, entity, PortfolioStore, NewStockWallet, StockInfo) { + $scope.portfolioStore = entity; + $scope.load = function (id) { + PortfolioStore.get({id: id}, function(result) { + $scope.portfolioStore = result; + }); + }; + var unsubscribe = $rootScope.$on('cabzzaApp:portfolioStoreUpdate', function(event, result) { + $scope.portfolioStore = result; + }); + $scope.$on('$destroy', unsubscribe); + + }); diff --git a/src/main/webapp/scripts/app/entities/portfolioStore/portfolioStore-detail.html b/src/main/webapp/scripts/app/entities/portfolioStore/portfolioStore-detail.html new file mode 100644 index 0000000..e0eeda4 --- /dev/null +++ b/src/main/webapp/scripts/app/entities/portfolioStore/portfolioStore-detail.html @@ -0,0 +1,46 @@ + +
+

PortfolioStore {{portfolioStore.id}}

+
+ + + + + + + + + + + + + + + + + + + + + +
FieldValue
+ Percent + + {{portfolioStore.percent}} +
+ newStockWallet + + {{portfolioStore.newStockWallet.name}} +
+ stockInfo + + {{portfolioStore.stockInfo.name}} +
+
+ + +
diff --git a/src/main/webapp/scripts/app/entities/portfolioStore/portfolioStore-dialog.controller.js b/src/main/webapp/scripts/app/entities/portfolioStore/portfolioStore-dialog.controller.js new file mode 100644 index 0000000..57b4a70 --- /dev/null +++ b/src/main/webapp/scripts/app/entities/portfolioStore/portfolioStore-dialog.controller.js @@ -0,0 +1,32 @@ +'use strict'; + +angular.module('cabzzaApp').controller('PortfolioStoreDialogController', + ['$scope', '$stateParams', '$modalInstance', 'entity', 'PortfolioStore', 'NewStockWallet', 'StockInfo', + function($scope, $stateParams, $modalInstance, entity, PortfolioStore, NewStockWallet, StockInfo) { + + $scope.portfolioStore = entity; + $scope.newstockwallets = NewStockWallet.query(); + $scope.stockinfos = StockInfo.query(); + $scope.load = function(id) { + PortfolioStore.get({id : id}, function(result) { + $scope.portfolioStore = result; + }); + }; + + var onSaveFinished = function (result) { + $scope.$emit('cabzzaApp:portfolioStoreUpdate', result); + $modalInstance.close(result); + }; + + $scope.save = function () { + if ($scope.portfolioStore.id != null) { + PortfolioStore.update($scope.portfolioStore, onSaveFinished); + } else { + PortfolioStore.save($scope.portfolioStore, onSaveFinished); + } + }; + + $scope.clear = function() { + $modalInstance.dismiss('cancel'); + }; +}]); diff --git a/src/main/webapp/scripts/app/entities/portfolioStore/portfolioStore-dialog.html b/src/main/webapp/scripts/app/entities/portfolioStore/portfolioStore-dialog.html new file mode 100644 index 0000000..c9d8290 --- /dev/null +++ b/src/main/webapp/scripts/app/entities/portfolioStore/portfolioStore-dialog.html @@ -0,0 +1,44 @@ + +
+ + + + +
diff --git a/src/main/webapp/scripts/app/entities/portfolioStore/portfolioStore.controller.js b/src/main/webapp/scripts/app/entities/portfolioStore/portfolioStore.controller.js new file mode 100644 index 0000000..4f8c11d --- /dev/null +++ b/src/main/webapp/scripts/app/entities/portfolioStore/portfolioStore.controller.js @@ -0,0 +1,50 @@ +'use strict'; + +angular.module('cabzzaApp') + .controller('PortfolioStoreController', function ($scope, PortfolioStore, PortfolioStoreSearch) { + $scope.portfolioStores = []; + $scope.loadAll = function() { + PortfolioStore.query(function(result) { + $scope.portfolioStores = result; + }); + }; + $scope.loadAll(); + + $scope.delete = function (id) { + PortfolioStore.get({id: id}, function(result) { + $scope.portfolioStore = result; + $('#deletePortfolioStoreConfirmation').modal('show'); + }); + }; + + $scope.confirmDelete = function (id) { + PortfolioStore.delete({id: id}, + function () { + $scope.loadAll(); + $('#deletePortfolioStoreConfirmation').modal('hide'); + $scope.clear(); + }); + }; + + $scope.search = function () { + PortfolioStoreSearch.query({query: $scope.searchQuery}, function(result) { + $scope.portfolioStores = result; + }, function(response) { + if(response.status === 404) { + $scope.loadAll(); + } + }); + }; + + $scope.refresh = function () { + $scope.loadAll(); + $scope.clear(); + }; + + $scope.clear = function () { + $scope.portfolioStore = { + percent: null, + id: null + }; + }; + }); diff --git a/src/main/webapp/scripts/app/entities/portfolioStore/portfolioStore.js b/src/main/webapp/scripts/app/entities/portfolioStore/portfolioStore.js new file mode 100644 index 0000000..18b5252 --- /dev/null +++ b/src/main/webapp/scripts/app/entities/portfolioStore/portfolioStore.js @@ -0,0 +1,99 @@ +'use strict'; + +angular.module('cabzzaApp') + .config(function ($stateProvider) { + $stateProvider + .state('portfolioStore', { + parent: 'entity', + url: '/portfolioStores', + data: { + authorities: ['ROLE_USER'], + pageTitle: 'cabzzaApp.portfolioStore.home.title' + }, + views: { + 'content@': { + templateUrl: 'scripts/app/entities/portfolioStore/portfolioStores.html', + controller: 'PortfolioStoreController' + } + }, + resolve: { + translatePartialLoader: ['$translate', '$translatePartialLoader', function ($translate, $translatePartialLoader) { + $translatePartialLoader.addPart('portfolioStore'); + $translatePartialLoader.addPart('global'); + return $translate.refresh(); + }] + } + }) + .state('portfolioStore.detail', { + parent: 'entity', + url: '/portfolioStore/{id}', + data: { + authorities: ['ROLE_USER'], + pageTitle: 'cabzzaApp.portfolioStore.detail.title' + }, + views: { + 'content@': { + templateUrl: 'scripts/app/entities/portfolioStore/portfolioStore-detail.html', + controller: 'PortfolioStoreDetailController' + } + }, + resolve: { + translatePartialLoader: ['$translate', '$translatePartialLoader', function ($translate, $translatePartialLoader) { + $translatePartialLoader.addPart('portfolioStore'); + return $translate.refresh(); + }], + entity: ['$stateParams', 'PortfolioStore', function($stateParams, PortfolioStore) { + return PortfolioStore.get({id : $stateParams.id}); + }] + } + }) + .state('portfolioStore.new', { + parent: 'portfolioStore', + url: '/new', + data: { + authorities: ['ROLE_USER'], + }, + onEnter: ['$stateParams', '$state', '$modal', function($stateParams, $state, $modal) { + $modal.open({ + templateUrl: 'scripts/app/entities/portfolioStore/portfolioStore-dialog.html', + controller: 'PortfolioStoreDialogController', + size: 'lg', + resolve: { + entity: function () { + return { + percent: null, + id: null + }; + } + } + }).result.then(function(result) { + $state.go('portfolioStore', null, { reload: true }); + }, function() { + $state.go('portfolioStore'); + }) + }] + }) + .state('portfolioStore.edit', { + parent: 'portfolioStore', + url: '/{id}/edit', + data: { + authorities: ['ROLE_USER'], + }, + onEnter: ['$stateParams', '$state', '$modal', function($stateParams, $state, $modal) { + $modal.open({ + templateUrl: 'scripts/app/entities/portfolioStore/portfolioStore-dialog.html', + controller: 'PortfolioStoreDialogController', + size: 'lg', + resolve: { + entity: ['PortfolioStore', function(PortfolioStore) { + return PortfolioStore.get({id : $stateParams.id}); + }] + } + }).result.then(function(result) { + $state.go('portfolioStore', null, { reload: true }); + }, function() { + $state.go('^'); + }) + }] + }); + }); diff --git a/src/main/webapp/scripts/app/entities/portfolioStore/portfolioStores.html b/src/main/webapp/scripts/app/entities/portfolioStore/portfolioStores.html new file mode 100644 index 0000000..4ac6a2a --- /dev/null +++ b/src/main/webapp/scripts/app/entities/portfolioStore/portfolioStores.html @@ -0,0 +1,90 @@ +
+

PortfolioStores

+ +
+
+
+ +
+
+
+
+ +
+ +
+
+
+
+ + + +
+ + + + + + + + + + + + + + + + + + + +
IDPercentnewStockWalletstockInfo
{{portfolioStore.id}}{{portfolioStore.percent}} + {{portfolioStore.newStockWallet.name}} + + {{portfolioStore.stockInfo.name}} + + + + +
+
+
diff --git a/src/main/webapp/scripts/app/entities/stockInfo/stockInfo-detail.controller.js b/src/main/webapp/scripts/app/entities/stockInfo/stockInfo-detail.controller.js new file mode 100644 index 0000000..5a2d1d0 --- /dev/null +++ b/src/main/webapp/scripts/app/entities/stockInfo/stockInfo-detail.controller.js @@ -0,0 +1,16 @@ +'use strict'; + +angular.module('cabzzaApp') + .controller('StockInfoDetailController', function ($scope, $rootScope, $stateParams, entity, StockInfo, StockQuotes, PortfolioStore) { + $scope.stockInfo = entity; + $scope.load = function (id) { + StockInfo.get({id: id}, function(result) { + $scope.stockInfo = result; + }); + }; + var unsubscribe = $rootScope.$on('cabzzaApp:stockInfoUpdate', function(event, result) { + $scope.stockInfo = result; + }); + $scope.$on('$destroy', unsubscribe); + + }); diff --git a/src/main/webapp/scripts/app/entities/stockInfo/stockInfo-detail.html b/src/main/webapp/scripts/app/entities/stockInfo/stockInfo-detail.html new file mode 100644 index 0000000..14dcc58 --- /dev/null +++ b/src/main/webapp/scripts/app/entities/stockInfo/stockInfo-detail.html @@ -0,0 +1,62 @@ + +
+

StockInfo {{stockInfo.id}}

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldValue
+ Name + + {{stockInfo.name}} +
+ Symbol + + {{stockInfo.symbol}} +
+ QuotesStartDate + + {{stockInfo.quotesStartDate | date:'mediumDate'}} +
+ QuotesEndDate + + {{stockInfo.quotesEndDate | date:'mediumDate'}} +
+ IsInvestorModeAvaiable + + {{stockInfo.isInvestorModeAvaiable}} +
+
+ + +
diff --git a/src/main/webapp/scripts/app/entities/stockInfo/stockInfo-dialog.controller.js b/src/main/webapp/scripts/app/entities/stockInfo/stockInfo-dialog.controller.js new file mode 100644 index 0000000..ed47f3d --- /dev/null +++ b/src/main/webapp/scripts/app/entities/stockInfo/stockInfo-dialog.controller.js @@ -0,0 +1,32 @@ +'use strict'; + +angular.module('cabzzaApp').controller('StockInfoDialogController', + ['$scope', '$stateParams', '$modalInstance', 'entity', 'StockInfo', 'StockQuotes', 'PortfolioStore', + function($scope, $stateParams, $modalInstance, entity, StockInfo, StockQuotes, PortfolioStore) { + + $scope.stockInfo = entity; + $scope.stockquotess = StockQuotes.query(); + $scope.portfoliostores = PortfolioStore.query(); + $scope.load = function(id) { + StockInfo.get({id : id}, function(result) { + $scope.stockInfo = result; + }); + }; + + var onSaveFinished = function (result) { + $scope.$emit('cabzzaApp:stockInfoUpdate', result); + $modalInstance.close(result); + }; + + $scope.save = function () { + if ($scope.stockInfo.id != null) { + StockInfo.update($scope.stockInfo, onSaveFinished); + } else { + StockInfo.save($scope.stockInfo, onSaveFinished); + } + }; + + $scope.clear = function() { + $modalInstance.dismiss('cancel'); + }; +}]); diff --git a/src/main/webapp/scripts/app/entities/stockInfo/stockInfo-dialog.html b/src/main/webapp/scripts/app/entities/stockInfo/stockInfo-dialog.html new file mode 100644 index 0000000..21432bc --- /dev/null +++ b/src/main/webapp/scripts/app/entities/stockInfo/stockInfo-dialog.html @@ -0,0 +1,56 @@ + +
+ + + + +
diff --git a/src/main/webapp/scripts/app/entities/stockInfo/stockInfo.controller.js b/src/main/webapp/scripts/app/entities/stockInfo/stockInfo.controller.js new file mode 100644 index 0000000..f34ea52 --- /dev/null +++ b/src/main/webapp/scripts/app/entities/stockInfo/stockInfo.controller.js @@ -0,0 +1,54 @@ +'use strict'; + +angular.module('cabzzaApp') + .controller('StockInfoController', function ($scope, StockInfo, StockInfoSearch) { + $scope.stockInfos = []; + $scope.loadAll = function() { + StockInfo.query(function(result) { + $scope.stockInfos = result; + }); + }; + $scope.loadAll(); + + $scope.delete = function (id) { + StockInfo.get({id: id}, function(result) { + $scope.stockInfo = result; + $('#deleteStockInfoConfirmation').modal('show'); + }); + }; + + $scope.confirmDelete = function (id) { + StockInfo.delete({id: id}, + function () { + $scope.loadAll(); + $('#deleteStockInfoConfirmation').modal('hide'); + $scope.clear(); + }); + }; + + $scope.search = function () { + StockInfoSearch.query({query: $scope.searchQuery}, function(result) { + $scope.stockInfos = result; + }, function(response) { + if(response.status === 404) { + $scope.loadAll(); + } + }); + }; + + $scope.refresh = function () { + $scope.loadAll(); + $scope.clear(); + }; + + $scope.clear = function () { + $scope.stockInfo = { + name: null, + symbol: null, + quotesStartDate: null, + quotesEndDate: null, + isInvestorModeAvaiable: null, + id: null + }; + }; + }); diff --git a/src/main/webapp/scripts/app/entities/stockInfo/stockInfo.js b/src/main/webapp/scripts/app/entities/stockInfo/stockInfo.js new file mode 100644 index 0000000..7c73a55 --- /dev/null +++ b/src/main/webapp/scripts/app/entities/stockInfo/stockInfo.js @@ -0,0 +1,103 @@ +'use strict'; + +angular.module('cabzzaApp') + .config(function ($stateProvider) { + $stateProvider + .state('stockInfo', { + parent: 'entity', + url: '/stockInfos', + data: { + authorities: ['ROLE_USER'], + pageTitle: 'cabzzaApp.stockInfo.home.title' + }, + views: { + 'content@': { + templateUrl: 'scripts/app/entities/stockInfo/stockInfos.html', + controller: 'StockInfoController' + } + }, + resolve: { + translatePartialLoader: ['$translate', '$translatePartialLoader', function ($translate, $translatePartialLoader) { + $translatePartialLoader.addPart('stockInfo'); + $translatePartialLoader.addPart('global'); + return $translate.refresh(); + }] + } + }) + .state('stockInfo.detail', { + parent: 'entity', + url: '/stockInfo/{id}', + data: { + authorities: ['ROLE_USER'], + pageTitle: 'cabzzaApp.stockInfo.detail.title' + }, + views: { + 'content@': { + templateUrl: 'scripts/app/entities/stockInfo/stockInfo-detail.html', + controller: 'StockInfoDetailController' + } + }, + resolve: { + translatePartialLoader: ['$translate', '$translatePartialLoader', function ($translate, $translatePartialLoader) { + $translatePartialLoader.addPart('stockInfo'); + return $translate.refresh(); + }], + entity: ['$stateParams', 'StockInfo', function($stateParams, StockInfo) { + return StockInfo.get({id : $stateParams.id}); + }] + } + }) + .state('stockInfo.new', { + parent: 'stockInfo', + url: '/new', + data: { + authorities: ['ROLE_USER'], + }, + onEnter: ['$stateParams', '$state', '$modal', function($stateParams, $state, $modal) { + $modal.open({ + templateUrl: 'scripts/app/entities/stockInfo/stockInfo-dialog.html', + controller: 'StockInfoDialogController', + size: 'lg', + resolve: { + entity: function () { + return { + name: null, + symbol: null, + quotesStartDate: null, + quotesEndDate: null, + isInvestorModeAvaiable: null, + id: null + }; + } + } + }).result.then(function(result) { + $state.go('stockInfo', null, { reload: true }); + }, function() { + $state.go('stockInfo'); + }) + }] + }) + .state('stockInfo.edit', { + parent: 'stockInfo', + url: '/{id}/edit', + data: { + authorities: ['ROLE_USER'], + }, + onEnter: ['$stateParams', '$state', '$modal', function($stateParams, $state, $modal) { + $modal.open({ + templateUrl: 'scripts/app/entities/stockInfo/stockInfo-dialog.html', + controller: 'StockInfoDialogController', + size: 'lg', + resolve: { + entity: ['StockInfo', function(StockInfo) { + return StockInfo.get({id : $stateParams.id}); + }] + } + }).result.then(function(result) { + $state.go('stockInfo', null, { reload: true }); + }, function() { + $state.go('^'); + }) + }] + }); + }); diff --git a/src/main/webapp/scripts/app/entities/stockInfo/stockInfos.html b/src/main/webapp/scripts/app/entities/stockInfo/stockInfos.html new file mode 100644 index 0000000..58c3f0f --- /dev/null +++ b/src/main/webapp/scripts/app/entities/stockInfo/stockInfos.html @@ -0,0 +1,90 @@ +
+

StockInfos

+ +
+
+
+ +
+
+
+
+ +
+ +
+
+
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
IDNameSymbolQuotesStartDateQuotesEndDateIsInvestorModeAvaiable
{{stockInfo.id}}{{stockInfo.name}}{{stockInfo.symbol}}{{stockInfo.quotesStartDate | date:'mediumDate'}}{{stockInfo.quotesEndDate | date:'mediumDate'}}{{stockInfo.isInvestorModeAvaiable}} + + + +
+
+
diff --git a/src/main/webapp/scripts/app/entities/stockQuotes/stockQuotes-detail.controller.js b/src/main/webapp/scripts/app/entities/stockQuotes/stockQuotes-detail.controller.js new file mode 100644 index 0000000..28201d0 --- /dev/null +++ b/src/main/webapp/scripts/app/entities/stockQuotes/stockQuotes-detail.controller.js @@ -0,0 +1,16 @@ +'use strict'; + +angular.module('cabzzaApp') + .controller('StockQuotesDetailController', function ($scope, $rootScope, $stateParams, entity, StockQuotes, StockInfo) { + $scope.stockQuotes = entity; + $scope.load = function (id) { + StockQuotes.get({id: id}, function(result) { + $scope.stockQuotes = result; + }); + }; + var unsubscribe = $rootScope.$on('cabzzaApp:stockQuotesUpdate', function(event, result) { + $scope.stockQuotes = result; + }); + $scope.$on('$destroy', unsubscribe); + + }); diff --git a/src/main/webapp/scripts/app/entities/stockQuotes/stockQuotes-detail.html b/src/main/webapp/scripts/app/entities/stockQuotes/stockQuotes-detail.html new file mode 100644 index 0000000..a120fde --- /dev/null +++ b/src/main/webapp/scripts/app/entities/stockQuotes/stockQuotes-detail.html @@ -0,0 +1,62 @@ + +
+

StockQuotes {{stockQuotes.id}}

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldValue
+ Date + + {{stockQuotes.date | date:'mediumDate'}} +
+ Value + + {{stockQuotes.value}} +
+ SplitRate + + {{stockQuotes.splitRate}} +
+ Dividend + + {{stockQuotes.dividend}} +
+ stockInfo + + {{stockQuotes.stockInfo.id}} +
+
+ + +
diff --git a/src/main/webapp/scripts/app/entities/stockQuotes/stockQuotes-dialog.controller.js b/src/main/webapp/scripts/app/entities/stockQuotes/stockQuotes-dialog.controller.js new file mode 100644 index 0000000..dd3ce1f --- /dev/null +++ b/src/main/webapp/scripts/app/entities/stockQuotes/stockQuotes-dialog.controller.js @@ -0,0 +1,31 @@ +'use strict'; + +angular.module('cabzzaApp').controller('StockQuotesDialogController', + ['$scope', '$stateParams', '$modalInstance', 'entity', 'StockQuotes', 'StockInfo', + function($scope, $stateParams, $modalInstance, entity, StockQuotes, StockInfo) { + + $scope.stockQuotes = entity; + $scope.stockinfos = StockInfo.query(); + $scope.load = function(id) { + StockQuotes.get({id : id}, function(result) { + $scope.stockQuotes = result; + }); + }; + + var onSaveFinished = function (result) { + $scope.$emit('cabzzaApp:stockQuotesUpdate', result); + $modalInstance.close(result); + }; + + $scope.save = function () { + if ($scope.stockQuotes.id != null) { + StockQuotes.update($scope.stockQuotes, onSaveFinished); + } else { + StockQuotes.save($scope.stockQuotes, onSaveFinished); + } + }; + + $scope.clear = function() { + $modalInstance.dismiss('cancel'); + }; +}]); diff --git a/src/main/webapp/scripts/app/entities/stockQuotes/stockQuotes-dialog.html b/src/main/webapp/scripts/app/entities/stockQuotes/stockQuotes-dialog.html new file mode 100644 index 0000000..939dc2d --- /dev/null +++ b/src/main/webapp/scripts/app/entities/stockQuotes/stockQuotes-dialog.html @@ -0,0 +1,56 @@ + +
+ + + + +
diff --git a/src/main/webapp/scripts/app/entities/stockQuotes/stockQuotes.controller.js b/src/main/webapp/scripts/app/entities/stockQuotes/stockQuotes.controller.js new file mode 100644 index 0000000..2a45fc8 --- /dev/null +++ b/src/main/webapp/scripts/app/entities/stockQuotes/stockQuotes.controller.js @@ -0,0 +1,53 @@ +'use strict'; + +angular.module('cabzzaApp') + .controller('StockQuotesController', function ($scope, StockQuotes, StockQuotesSearch) { + $scope.stockQuotess = []; + $scope.loadAll = function() { + StockQuotes.query(function(result) { + $scope.stockQuotess = result; + }); + }; + $scope.loadAll(); + + $scope.delete = function (id) { + StockQuotes.get({id: id}, function(result) { + $scope.stockQuotes = result; + $('#deleteStockQuotesConfirmation').modal('show'); + }); + }; + + $scope.confirmDelete = function (id) { + StockQuotes.delete({id: id}, + function () { + $scope.loadAll(); + $('#deleteStockQuotesConfirmation').modal('hide'); + $scope.clear(); + }); + }; + + $scope.search = function () { + StockQuotesSearch.query({query: $scope.searchQuery}, function(result) { + $scope.stockQuotess = result; + }, function(response) { + if(response.status === 404) { + $scope.loadAll(); + } + }); + }; + + $scope.refresh = function () { + $scope.loadAll(); + $scope.clear(); + }; + + $scope.clear = function () { + $scope.stockQuotes = { + date: null, + value: null, + splitRate: null, + dividend: null, + id: null + }; + }; + }); diff --git a/src/main/webapp/scripts/app/entities/stockQuotes/stockQuotes.js b/src/main/webapp/scripts/app/entities/stockQuotes/stockQuotes.js new file mode 100644 index 0000000..6e02cf1 --- /dev/null +++ b/src/main/webapp/scripts/app/entities/stockQuotes/stockQuotes.js @@ -0,0 +1,102 @@ +'use strict'; + +angular.module('cabzzaApp') + .config(function ($stateProvider) { + $stateProvider + .state('stockQuotes', { + parent: 'entity', + url: '/stockQuotess', + data: { + authorities: ['ROLE_USER'], + pageTitle: 'cabzzaApp.stockQuotes.home.title' + }, + views: { + 'content@': { + templateUrl: 'scripts/app/entities/stockQuotes/stockQuotess.html', + controller: 'StockQuotesController' + } + }, + resolve: { + translatePartialLoader: ['$translate', '$translatePartialLoader', function ($translate, $translatePartialLoader) { + $translatePartialLoader.addPart('stockQuotes'); + $translatePartialLoader.addPart('global'); + return $translate.refresh(); + }] + } + }) + .state('stockQuotes.detail', { + parent: 'entity', + url: '/stockQuotes/{id}', + data: { + authorities: ['ROLE_USER'], + pageTitle: 'cabzzaApp.stockQuotes.detail.title' + }, + views: { + 'content@': { + templateUrl: 'scripts/app/entities/stockQuotes/stockQuotes-detail.html', + controller: 'StockQuotesDetailController' + } + }, + resolve: { + translatePartialLoader: ['$translate', '$translatePartialLoader', function ($translate, $translatePartialLoader) { + $translatePartialLoader.addPart('stockQuotes'); + return $translate.refresh(); + }], + entity: ['$stateParams', 'StockQuotes', function($stateParams, StockQuotes) { + return StockQuotes.get({id : $stateParams.id}); + }] + } + }) + .state('stockQuotes.new', { + parent: 'stockQuotes', + url: '/new', + data: { + authorities: ['ROLE_USER'], + }, + onEnter: ['$stateParams', '$state', '$modal', function($stateParams, $state, $modal) { + $modal.open({ + templateUrl: 'scripts/app/entities/stockQuotes/stockQuotes-dialog.html', + controller: 'StockQuotesDialogController', + size: 'lg', + resolve: { + entity: function () { + return { + date: null, + value: null, + splitRate: null, + dividend: null, + id: null + }; + } + } + }).result.then(function(result) { + $state.go('stockQuotes', null, { reload: true }); + }, function() { + $state.go('stockQuotes'); + }) + }] + }) + .state('stockQuotes.edit', { + parent: 'stockQuotes', + url: '/{id}/edit', + data: { + authorities: ['ROLE_USER'], + }, + onEnter: ['$stateParams', '$state', '$modal', function($stateParams, $state, $modal) { + $modal.open({ + templateUrl: 'scripts/app/entities/stockQuotes/stockQuotes-dialog.html', + controller: 'StockQuotesDialogController', + size: 'lg', + resolve: { + entity: ['StockQuotes', function(StockQuotes) { + return StockQuotes.get({id : $stateParams.id}); + }] + } + }).result.then(function(result) { + $state.go('stockQuotes', null, { reload: true }); + }, function() { + $state.go('^'); + }) + }] + }); + }); diff --git a/src/main/webapp/scripts/app/entities/stockQuotes/stockQuotess.html b/src/main/webapp/scripts/app/entities/stockQuotes/stockQuotess.html new file mode 100644 index 0000000..c3cf553 --- /dev/null +++ b/src/main/webapp/scripts/app/entities/stockQuotes/stockQuotess.html @@ -0,0 +1,92 @@ +
+

StockQuotess

+ +
+
+
+ +
+
+
+
+ +
+ +
+
+
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
IDDateValueSplitRateDividendstockInfo
{{stockQuotes.id}}{{stockQuotes.date | date:'mediumDate'}}{{stockQuotes.value}}{{stockQuotes.splitRate}}{{stockQuotes.dividend}} + {{stockQuotes.stockInfo.id}} + + + + +
+
+
diff --git a/src/main/webapp/scripts/components/entities/newStockWallet/newStockWallet.search.service.js b/src/main/webapp/scripts/components/entities/newStockWallet/newStockWallet.search.service.js new file mode 100644 index 0000000..0c4e713 --- /dev/null +++ b/src/main/webapp/scripts/components/entities/newStockWallet/newStockWallet.search.service.js @@ -0,0 +1,8 @@ +'use strict'; + +angular.module('cabzzaApp') + .factory('NewStockWalletSearch', function ($resource) { + return $resource('api/_search/newStockWallets/:query', {}, { + 'query': { method: 'GET', isArray: true} + }); + }); diff --git a/src/main/webapp/scripts/components/entities/newStockWallet/newStockWallet.service.js b/src/main/webapp/scripts/components/entities/newStockWallet/newStockWallet.service.js new file mode 100644 index 0000000..bf419ff --- /dev/null +++ b/src/main/webapp/scripts/components/entities/newStockWallet/newStockWallet.service.js @@ -0,0 +1,36 @@ +'use strict'; + +angular.module('cabzzaApp') + .factory('NewStockWallet', function ($resource, DateUtils) { + return $resource('api/newStockWallets/:id', {}, { + 'query': { method: 'GET', isArray: true}, + 'get': { + method: 'GET', + transformResponse: function (data) { + data = angular.fromJson(data); + data.historicalDataDate = DateUtils.convertLocaleDateFromServer(data.historicalDataDate); + data.calculatingsDate = DateUtils.convertLocaleDateFromServer(data.calculatingsDate); + data.prognoseDate = DateUtils.convertLocaleDateFromServer(data.prognoseDate); + return data; + } + }, + 'update': { + method: 'PUT', + transformRequest: function (data) { + data.historicalDataDate = DateUtils.convertLocaleDateToServer(data.historicalDataDate); + data.calculatingsDate = DateUtils.convertLocaleDateToServer(data.calculatingsDate); + data.prognoseDate = DateUtils.convertLocaleDateToServer(data.prognoseDate); + return angular.toJson(data); + } + }, + 'save': { + method: 'POST', + transformRequest: function (data) { + data.historicalDataDate = DateUtils.convertLocaleDateToServer(data.historicalDataDate); + data.calculatingsDate = DateUtils.convertLocaleDateToServer(data.calculatingsDate); + data.prognoseDate = DateUtils.convertLocaleDateToServer(data.prognoseDate); + return angular.toJson(data); + } + } + }); + }); diff --git a/src/main/webapp/scripts/components/entities/portfolioStore/portfolioStore.search.service.js b/src/main/webapp/scripts/components/entities/portfolioStore/portfolioStore.search.service.js new file mode 100644 index 0000000..3059afd --- /dev/null +++ b/src/main/webapp/scripts/components/entities/portfolioStore/portfolioStore.search.service.js @@ -0,0 +1,8 @@ +'use strict'; + +angular.module('cabzzaApp') + .factory('PortfolioStoreSearch', function ($resource) { + return $resource('api/_search/portfolioStores/:query', {}, { + 'query': { method: 'GET', isArray: true} + }); + }); diff --git a/src/main/webapp/scripts/components/entities/portfolioStore/portfolioStore.service.js b/src/main/webapp/scripts/components/entities/portfolioStore/portfolioStore.service.js new file mode 100644 index 0000000..371d25f --- /dev/null +++ b/src/main/webapp/scripts/components/entities/portfolioStore/portfolioStore.service.js @@ -0,0 +1,16 @@ +'use strict'; + +angular.module('cabzzaApp') + .factory('PortfolioStore', function ($resource, DateUtils) { + return $resource('api/portfolioStores/:id', {}, { + 'query': { method: 'GET', isArray: true}, + 'get': { + method: 'GET', + transformResponse: function (data) { + data = angular.fromJson(data); + return data; + } + }, + 'update': { method:'PUT' } + }); + }); diff --git a/src/main/webapp/scripts/components/entities/stockInfo/stockInfo.search.service.js b/src/main/webapp/scripts/components/entities/stockInfo/stockInfo.search.service.js new file mode 100644 index 0000000..7bdab80 --- /dev/null +++ b/src/main/webapp/scripts/components/entities/stockInfo/stockInfo.search.service.js @@ -0,0 +1,8 @@ +'use strict'; + +angular.module('cabzzaApp') + .factory('StockInfoSearch', function ($resource) { + return $resource('api/_search/stockInfos/:query', {}, { + 'query': { method: 'GET', isArray: true} + }); + }); diff --git a/src/main/webapp/scripts/components/entities/stockInfo/stockInfo.service.js b/src/main/webapp/scripts/components/entities/stockInfo/stockInfo.service.js new file mode 100644 index 0000000..1df0e7c --- /dev/null +++ b/src/main/webapp/scripts/components/entities/stockInfo/stockInfo.service.js @@ -0,0 +1,33 @@ +'use strict'; + +angular.module('cabzzaApp') + .factory('StockInfo', function ($resource, DateUtils) { + return $resource('api/stockInfos/:id', {}, { + 'query': { method: 'GET', isArray: true}, + 'get': { + method: 'GET', + transformResponse: function (data) { + data = angular.fromJson(data); + data.quotesStartDate = DateUtils.convertLocaleDateFromServer(data.quotesStartDate); + data.quotesEndDate = DateUtils.convertLocaleDateFromServer(data.quotesEndDate); + return data; + } + }, + 'update': { + method: 'PUT', + transformRequest: function (data) { + data.quotesStartDate = DateUtils.convertLocaleDateToServer(data.quotesStartDate); + data.quotesEndDate = DateUtils.convertLocaleDateToServer(data.quotesEndDate); + return angular.toJson(data); + } + }, + 'save': { + method: 'POST', + transformRequest: function (data) { + data.quotesStartDate = DateUtils.convertLocaleDateToServer(data.quotesStartDate); + data.quotesEndDate = DateUtils.convertLocaleDateToServer(data.quotesEndDate); + return angular.toJson(data); + } + } + }); + }); diff --git a/src/main/webapp/scripts/components/entities/stockQuotes/stockQuotes.search.service.js b/src/main/webapp/scripts/components/entities/stockQuotes/stockQuotes.search.service.js new file mode 100644 index 0000000..35c71b2 --- /dev/null +++ b/src/main/webapp/scripts/components/entities/stockQuotes/stockQuotes.search.service.js @@ -0,0 +1,8 @@ +'use strict'; + +angular.module('cabzzaApp') + .factory('StockQuotesSearch', function ($resource) { + return $resource('api/_search/stockQuotess/:query', {}, { + 'query': { method: 'GET', isArray: true} + }); + }); diff --git a/src/main/webapp/scripts/components/entities/stockQuotes/stockQuotes.service.js b/src/main/webapp/scripts/components/entities/stockQuotes/stockQuotes.service.js new file mode 100644 index 0000000..11ed816 --- /dev/null +++ b/src/main/webapp/scripts/components/entities/stockQuotes/stockQuotes.service.js @@ -0,0 +1,30 @@ +'use strict'; + +angular.module('cabzzaApp') + .factory('StockQuotes', function ($resource, DateUtils) { + return $resource('api/stockQuotess/:id', {}, { + 'query': { method: 'GET', isArray: true}, + 'get': { + method: 'GET', + transformResponse: function (data) { + data = angular.fromJson(data); + data.date = DateUtils.convertLocaleDateFromServer(data.date); + return data; + } + }, + 'update': { + method: 'PUT', + transformRequest: function (data) { + data.date = DateUtils.convertLocaleDateToServer(data.date); + return angular.toJson(data); + } + }, + 'save': { + method: 'POST', + transformRequest: function (data) { + data.date = DateUtils.convertLocaleDateToServer(data.date); + return angular.toJson(data); + } + } + }); + }); diff --git a/src/main/webapp/scripts/components/navbar/navbar.html b/src/main/webapp/scripts/components/navbar/navbar.html index f455486..b4ee5c8 100755 --- a/src/main/webapp/scripts/components/navbar/navbar.html +++ b/src/main/webapp/scripts/components/navbar/navbar.html @@ -30,7 +30,17 @@