diff --git a/src/main/java/nl/andrewl/coyotecredit/ctl/ExchangeController.java b/src/main/java/nl/andrewl/coyotecredit/ctl/ExchangeController.java index 49838ea..c934ce8 100644 --- a/src/main/java/nl/andrewl/coyotecredit/ctl/ExchangeController.java +++ b/src/main/java/nl/andrewl/coyotecredit/ctl/ExchangeController.java @@ -1,7 +1,6 @@ package nl.andrewl.coyotecredit.ctl; import lombok.RequiredArgsConstructor; -import nl.andrewl.coyotecredit.ctl.dto.AddAccountPayload; import nl.andrewl.coyotecredit.ctl.dto.EditExchangePayload; import nl.andrewl.coyotecredit.ctl.dto.InviteUserPayload; import nl.andrewl.coyotecredit.model.User; diff --git a/src/main/java/nl/andrewl/coyotecredit/ctl/dto/ExchangeData.java b/src/main/java/nl/andrewl/coyotecredit/ctl/dto/ExchangeData.java index 5410917..0eba809 100644 --- a/src/main/java/nl/andrewl/coyotecredit/ctl/dto/ExchangeData.java +++ b/src/main/java/nl/andrewl/coyotecredit/ctl/dto/ExchangeData.java @@ -3,6 +3,8 @@ package nl.andrewl.coyotecredit.ctl.dto; public record ExchangeData( long id, String name, - String primaryTradeable + String description, + String primaryTradeable, + long primaryTradeableId ) { } diff --git a/src/main/java/nl/andrewl/coyotecredit/service/AccountService.java b/src/main/java/nl/andrewl/coyotecredit/service/AccountService.java index 62ac103..2509c0f 100644 --- a/src/main/java/nl/andrewl/coyotecredit/service/AccountService.java +++ b/src/main/java/nl/andrewl/coyotecredit/service/AccountService.java @@ -127,7 +127,9 @@ public class AccountService { new ExchangeData( account.getExchange().getId(), account.getExchange().getName(), - account.getExchange().getPrimaryTradeable().getSymbol() + account.getExchange().getDescription(), + account.getExchange().getPrimaryTradeable().getSymbol(), + account.getExchange().getPrimaryTradeable().getId() ), account.getBalances().stream() .map(b -> new BalanceData( diff --git a/src/main/java/nl/andrewl/coyotecredit/service/ExchangeService.java b/src/main/java/nl/andrewl/coyotecredit/service/ExchangeService.java index af3e007..95ea989 100644 --- a/src/main/java/nl/andrewl/coyotecredit/service/ExchangeService.java +++ b/src/main/java/nl/andrewl/coyotecredit/service/ExchangeService.java @@ -106,29 +106,6 @@ public class ExchangeService { } } - @Transactional - public long addAccount(long exchangeId, User user, AddAccountPayload payload) { - Exchange exchange = exchangeRepository.findById(exchangeId) - .orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND)); - Account account = accountRepository.findByUserAndExchange(user, exchange) - .orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND)); - if (!account.isAdmin()) { - throw new ResponseStatusException(HttpStatus.NOT_FOUND); - } - User u = userRepository.save(new User(payload.username(), passwordEncoder.encode(payload.password()), payload.email())); - Account a = accountRepository.save(new Account( - AccountNumberUtils.generate(), - u, - payload.name(), - exchange - )); - for (var t : exchange.getAllTradeables()) { - a.getBalances().add(new Balance(a, t, BigDecimal.ZERO)); - } - a = accountRepository.save(a); - return a.getId(); - } - @Transactional public void removeAccount(long exchangeId, long accountId, User user) { Exchange exchange = exchangeRepository.findById(exchangeId) @@ -217,7 +194,13 @@ public class ExchangeService { public List getExchanges(User user) { return accountRepository.findAllByUser(user).stream() .map(a -> new ExchangeAccountData( - new ExchangeData(a.getExchange().getId(), a.getExchange().getName(), a.getExchange().getPrimaryTradeable().getSymbol()), + new ExchangeData( + a.getExchange().getId(), + a.getExchange().getName(), + a.getExchange().getDescription(), + a.getExchange().getPrimaryTradeable().getSymbol(), + a.getExchange().getPrimaryTradeable().getId() + ), new SimpleAccountData( a.getId(), user.getId(), diff --git a/src/main/resources/static/css/style.css b/src/main/resources/static/css/style.css index 8fe1573..82aaf08 100644 --- a/src/main/resources/static/css/style.css +++ b/src/main/resources/static/css/style.css @@ -1,29 +1,38 @@ @font-face { font-family: SpaceMono; - src: url("/static/font/SpaceMono-Regular.ttf"); + src: url("/static/font/spacemono/SpaceMono-Regular.ttf"); + font-style: normal; + font-weight: normal; +} +@font-face { + font-family: SpaceMono; + src: url("/static/font/spacemono/SpaceMono-Italic.ttf"); + font-style: italic; + font-weight: normal; +} +@font-face { + font-family: SpaceMono; + src: url("/static/font/spacemono/SpaceMono-Bold.ttf"); + font-style: normal; + font-weight: bold; +} +@font-face { + font-family: SpaceMono; + src: url("/static/font/spacemono/SpaceMono-BoldItalic.ttf"); + font-style: italic; + font-weight: bold; +} + +@font-face { + font-family: Pacifico; + src: url("/static/font/pacifico/Pacifico-Regular.ttf"); font-style: normal; font-weight: normal; } @font-face { - font-family: SpaceMono; - src: url("/static/font/SpaceMono-Italic.ttf"); - font-style: italic; - font-weight: normal; -} - -@font-face { - font-family: SpaceMono; - src: url("/static/font/SpaceMono-Bold.ttf"); - font-style: normal; - font-weight: bold; -} - -@font-face { - font-family: SpaceMono; - src: url("/static/font/SpaceMono-BoldItalic.ttf"); - font-style: italic; - font-weight: bold; + font-family: Josefin Sans; + src: url("/static/font/josefin-sans/JosefinSans-VariableFont_wght.ttf") format("truetype-variations"); } :root { @@ -37,12 +46,17 @@ body{ background-color: black; color: white; + font-family: "Josefin Sans", sans-serif; } .monospace { font-family: SpaceMono, monospace; } +.font-pacifico { + font-family: Pacifico, serif; +} + .header-bar { --bs-bg-opacity: 1; background-color: var(--color-faded-blue); diff --git a/src/main/resources/static/font/josefin-sans/JosefinSans-Italic-VariableFont_wght.ttf b/src/main/resources/static/font/josefin-sans/JosefinSans-Italic-VariableFont_wght.ttf new file mode 100644 index 0000000..bd0aa1a Binary files /dev/null and b/src/main/resources/static/font/josefin-sans/JosefinSans-Italic-VariableFont_wght.ttf differ diff --git a/src/main/resources/static/font/josefin-sans/JosefinSans-VariableFont_wght.ttf b/src/main/resources/static/font/josefin-sans/JosefinSans-VariableFont_wght.ttf new file mode 100644 index 0000000..70e1d82 Binary files /dev/null and b/src/main/resources/static/font/josefin-sans/JosefinSans-VariableFont_wght.ttf differ diff --git a/src/main/resources/static/font/pacifico/Pacifico-Regular.ttf b/src/main/resources/static/font/pacifico/Pacifico-Regular.ttf new file mode 100644 index 0000000..e7def95 Binary files /dev/null and b/src/main/resources/static/font/pacifico/Pacifico-Regular.ttf differ diff --git a/src/main/resources/static/font/SpaceMono-Bold.ttf b/src/main/resources/static/font/spacemono/SpaceMono-Bold.ttf similarity index 100% rename from src/main/resources/static/font/SpaceMono-Bold.ttf rename to src/main/resources/static/font/spacemono/SpaceMono-Bold.ttf diff --git a/src/main/resources/static/font/SpaceMono-BoldItalic.ttf b/src/main/resources/static/font/spacemono/SpaceMono-BoldItalic.ttf similarity index 100% rename from src/main/resources/static/font/SpaceMono-BoldItalic.ttf rename to src/main/resources/static/font/spacemono/SpaceMono-BoldItalic.ttf diff --git a/src/main/resources/static/font/SpaceMono-Italic.ttf b/src/main/resources/static/font/spacemono/SpaceMono-Italic.ttf similarity index 100% rename from src/main/resources/static/font/SpaceMono-Italic.ttf rename to src/main/resources/static/font/spacemono/SpaceMono-Italic.ttf diff --git a/src/main/resources/static/font/SpaceMono-Regular.ttf b/src/main/resources/static/font/spacemono/SpaceMono-Regular.ttf similarity index 100% rename from src/main/resources/static/font/SpaceMono-Regular.ttf rename to src/main/resources/static/font/spacemono/SpaceMono-Regular.ttf diff --git a/src/main/resources/templates/account.html b/src/main/resources/templates/account.html index f36ecfa..6c23e5f 100644 --- a/src/main/resources/templates/account.html +++ b/src/main/resources/templates/account.html @@ -8,50 +8,53 @@

Account

-
-
-
Overview
-
-
Number
-
-
Account Holder Name
-
-
Exchange
-
- -
-
Total Value
-
-   -
-
- Trade - Transfer - Edit Balances +
+
+
+
Overview
+
+
Number
+
+
Account Holder Name
+
+
Exchange
+
+ +
+
Total Value
+
+   +
+
+
+
-
- -
-
-
Tradeable Assets
- - - - - - - - - - - - - - - -
AssetTypeBalance
- -
+
+
+
Tradeable Assets
+ + + + + + + + + + + + + + + +
AssetTypeBalance
+ +
+
diff --git a/src/main/resources/templates/exchange/exchanges.html b/src/main/resources/templates/exchange/exchanges.html index 5111648..f628b73 100644 --- a/src/main/resources/templates/exchange/exchanges.html +++ b/src/main/resources/templates/exchange/exchanges.html @@ -6,29 +6,28 @@ >

Exchanges

- - - - - - - - - - - - - - - - - -
NamePrimary AssetAccountEstimated Balance
- - - -
-

+ +

+
+
+
+
+ +
+
+ Est. Account Balance: + +   + + +
+

+
+
+
+
+ +

Use this page to view a list of all exchanges you're participating in. Click on the name of the exchange to view its page, and click on your account number to view your account information for a given exchange. The estimated balance shown in this overview may not be completely accurate. Navigate to your account page for a complete overview of your current account balances for stocks, fiat currencies, and more.

\ No newline at end of file diff --git a/src/main/resources/templates/fragment/header.html b/src/main/resources/templates/fragment/header.html index b0a304c..2a487ce 100644 --- a/src/main/resources/templates/fragment/header.html +++ b/src/main/resources/templates/fragment/header.html @@ -9,11 +9,11 @@ -