- Symbol or ISIN
-
-
-
-
- {{ lookupItem.symbol | gfSymbol }}{{ lookupItem.name }}
-
-
-
-
+ Name
+
Type
-
- BUY
- SELL
-
-
-
-
-
- Currency
-
- {{ currency }}
-
-
-
-
-
- Data Source
-
-
-
-
-
- Date
-
-
-
-
-
-
-
- Fee
-
-
-
-
-
- Quantity
-
-
-
-
-
- Unit Price
-
-
-
-
-
- Account
-
- {{ account.name }}
+
+ SECURITIES
Platform
-
+
{{ platform.name }}
Save
diff --git a/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.module.ts b/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.module.ts
index f0990f4a7..4d7b0da77 100644
--- a/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.module.ts
+++ b/apps/client/src/app/pages/accounts/create-or-update-account-dialog/create-or-update-account-dialog.module.ts
@@ -1,15 +1,11 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
-import { MatAutocompleteModule } from '@angular/material/autocomplete';
import { MatButtonModule } from '@angular/material/button';
-import { MatDatepickerModule } from '@angular/material/datepicker';
import { MatDialogModule } from '@angular/material/dialog';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
-import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
import { MatSelectModule } from '@angular/material/select';
-import { GfSymbolModule } from '@ghostfolio/client/pipes/symbol/symbol.module';
import { CreateOrUpdateAccountDialog } from './create-or-update-account-dialog.component';
@@ -18,15 +14,11 @@ import { CreateOrUpdateAccountDialog } from './create-or-update-account-dialog.c
exports: [],
imports: [
CommonModule,
- GfSymbolModule,
FormsModule,
- MatAutocompleteModule,
MatButtonModule,
- MatDatepickerModule,
MatDialogModule,
MatFormFieldModule,
MatInputModule,
- MatProgressSpinnerModule,
MatSelectModule,
ReactiveFormsModule
],
diff --git a/apps/client/src/app/pages/accounts/create-or-update-account-dialog/interfaces/interfaces.ts b/apps/client/src/app/pages/accounts/create-or-update-account-dialog/interfaces/interfaces.ts
index 51cb3bdda..ffe4f14f6 100644
--- a/apps/client/src/app/pages/accounts/create-or-update-account-dialog/interfaces/interfaces.ts
+++ b/apps/client/src/app/pages/accounts/create-or-update-account-dialog/interfaces/interfaces.ts
@@ -1,9 +1,5 @@
import { Account } from '@prisma/client';
-import { Order } from '../../interfaces/order.interface';
-
export interface CreateOrUpdateAccountDialogParams {
- accountId: string;
- accounts: Account[];
- transaction: Order;
+ account: Account;
}
diff --git a/apps/client/src/app/pages/accounts/interfaces/order.interface.ts b/apps/client/src/app/pages/accounts/interfaces/order.interface.ts
deleted file mode 100644
index 12f6626a2..000000000
--- a/apps/client/src/app/pages/accounts/interfaces/order.interface.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { Currency, DataSource } from '@prisma/client';
-
-export interface Order {
- accountId: string;
- currency: Currency;
- dataSource: DataSource;
- date: Date;
- fee: number;
- id: string;
- quantity: number;
- platformId: string;
- symbol: string;
- type: string;
- unitPrice: number;
-}
diff --git a/apps/client/src/app/pages/transactions/create-or-update-transaction-dialog/interfaces/interfaces.ts b/apps/client/src/app/pages/transactions/create-or-update-transaction-dialog/interfaces/interfaces.ts
index 66a62eecc..89223e404 100644
--- a/apps/client/src/app/pages/transactions/create-or-update-transaction-dialog/interfaces/interfaces.ts
+++ b/apps/client/src/app/pages/transactions/create-or-update-transaction-dialog/interfaces/interfaces.ts
@@ -1,6 +1,4 @@
-import { Account } from '@prisma/client';
-
-import { Order } from '../../interfaces/order.interface';
+import { Account, Order } from '@prisma/client';
export interface CreateOrUpdateTransactionDialogParams {
accountId: string;
diff --git a/apps/client/src/app/pages/transactions/interfaces/order.interface.ts b/apps/client/src/app/pages/transactions/interfaces/order.interface.ts
deleted file mode 100644
index 12f6626a2..000000000
--- a/apps/client/src/app/pages/transactions/interfaces/order.interface.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { Currency, DataSource } from '@prisma/client';
-
-export interface Order {
- accountId: string;
- currency: Currency;
- dataSource: DataSource;
- date: Date;
- fee: number;
- id: string;
- quantity: number;
- platformId: string;
- symbol: string;
- type: string;
- unitPrice: number;
-}
diff --git a/apps/client/src/app/pages/transactions/transactions-page.component.ts b/apps/client/src/app/pages/transactions/transactions-page.component.ts
index 10b522316..7e9304d2b 100644
--- a/apps/client/src/app/pages/transactions/transactions-page.component.ts
+++ b/apps/client/src/app/pages/transactions/transactions-page.component.ts
@@ -1,6 +1,7 @@
import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute, Router } from '@angular/router';
+import { CreateOrderDto } from '@ghostfolio/api/app/order/create-order.dto';
import { UpdateOrderDto } from '@ghostfolio/api/app/order/update-order.dto';
import { User } from '@ghostfolio/api/app/user/interfaces/user.interface';
import { DataService } from '@ghostfolio/client/services/data.service';
@@ -199,7 +200,7 @@ export class TransactionsPageComponent implements OnInit {
});
dialogRef.afterClosed().subscribe((data: any) => {
- const transaction: UpdateOrderDto = data?.transaction;
+ const transaction: CreateOrderDto = data?.transaction;
if (transaction) {
this.dataService.postOrder(transaction).subscribe({
diff --git a/apps/client/src/app/services/data.service.ts b/apps/client/src/app/services/data.service.ts
index fec978c49..d7232227d 100644
--- a/apps/client/src/app/services/data.service.ts
+++ b/apps/client/src/app/services/data.service.ts
@@ -1,9 +1,11 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Access } from '@ghostfolio/api/app/access/interfaces/access.interface';
+import { CreateAccountDto } from '@ghostfolio/api/app/account/create-account.dto';
import { UpdateAccountDto } from '@ghostfolio/api/app/account/update-account.dto';
import { AdminData } from '@ghostfolio/api/app/admin/interfaces/admin-data.interface';
import { InfoItem } from '@ghostfolio/api/app/info/interfaces/info-item.interface';
+import { CreateOrderDto } from '@ghostfolio/api/app/order/create-order.dto';
import { UpdateOrderDto } from '@ghostfolio/api/app/order/update-order.dto';
import { PortfolioItem } from '@ghostfolio/api/app/portfolio/interfaces/portfolio-item.interface';
import { PortfolioOverview } from '@ghostfolio/api/app/portfolio/interfaces/portfolio-overview.interface';
@@ -20,6 +22,7 @@ import { UserItem } from '@ghostfolio/api/app/user/interfaces/user-item.interfac
import { User } from '@ghostfolio/api/app/user/interfaces/user.interface';
import { UpdateUserSettingsDto } from '@ghostfolio/api/app/user/update-user-settings.dto';
import { Order as OrderModel } from '@prisma/client';
+import { Account as AccountModel } from '@prisma/client';
@Injectable({
providedIn: 'root'
@@ -30,7 +33,7 @@ export class DataService {
public constructor(private http: HttpClient) {}
public fetchAccounts() {
- return this.http.get('/api/account');
+ return this.http.get('/api/account');
}
public fetchAdminData() {
@@ -117,11 +120,11 @@ export class DataService {
return this.http.get(`/api/auth/anonymous/${accessToken}`);
}
- public postAccount(aAccount: UpdateAccountDto) {
+ public postAccount(aAccount: CreateAccountDto) {
return this.http.post(`/api/account`, aAccount);
}
- public postOrder(aOrder: UpdateOrderDto) {
+ public postOrder(aOrder: CreateOrderDto) {
return this.http.post(`/api/order`, aOrder);
}
diff --git a/libs/helper/src/lib/permissions.ts b/libs/helper/src/lib/permissions.ts
index 5a2eb313f..8964d770d 100644
--- a/libs/helper/src/lib/permissions.ts
+++ b/libs/helper/src/lib/permissions.ts
@@ -32,9 +32,12 @@ export function getPermissions(aRole: Role): string[] {
case 'ADMIN':
return [
permissions.accessAdminControl,
+ permissions.createAccount,
permissions.createOrder,
+ permissions.deleteAccount,
permissions.deleteOrder,
permissions.readForeignPortfolio,
+ permissions.updateAccount,
permissions.updateOrder,
permissions.updateUserSettings
];
@@ -44,8 +47,11 @@ export function getPermissions(aRole: Role): string[] {
case 'USER':
return [
+ permissions.createAccount,
permissions.createOrder,
+ permissions.deleteAccount,
permissions.deleteOrder,
+ permissions.updateAccount,
permissions.updateOrder,
permissions.updateUserSettings
];