Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 272fe70d0f | |||
| 34223960f8 | |||
| 5f583de857 | |||
| bb0a0ef928 | |||
| 2d4c7002a7 |
@@ -33,7 +33,24 @@ class DailyChangesSheet implements FromCollection, WithHeadings, WithTitle
|
|||||||
*/
|
*/
|
||||||
public function collection()
|
public function collection()
|
||||||
{
|
{
|
||||||
return $this->empty ? collect() : DailyChange::myDailyChanges()->withDailyPerformance()->get();
|
if ($this->empty) {
|
||||||
|
return collect();
|
||||||
|
}
|
||||||
|
|
||||||
|
return DailyChange::myDailyChanges()
|
||||||
|
->withDailyPerformance()
|
||||||
|
->get()
|
||||||
|
->map(function ($daily_change) {
|
||||||
|
return [
|
||||||
|
'date' => date_format($daily_change->date, 'Y-m-d'),
|
||||||
|
'portfolio_id' => $daily_change->portfolio_id,
|
||||||
|
'total_market_value' => $daily_change->total_market_value,
|
||||||
|
'total_cost_basis' => $daily_change->total_cost_basis,
|
||||||
|
'realized_gains' => $daily_change->realized_gain_dollars,
|
||||||
|
'total_dividends_earned' => $daily_change->total_dividends_earned,
|
||||||
|
'annotation' => $daily_change->annotation,
|
||||||
|
];
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function title(): string
|
public function title(): string
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ class TransactionsSheet implements FromCollection, WithHeadings, WithTitle
|
|||||||
'currency' => $transaction->market_data_currency,
|
'currency' => $transaction->market_data_currency,
|
||||||
'split' => $transaction->split,
|
'split' => $transaction->split,
|
||||||
'reinvested_dividend' => $transaction->reinvested_dividend,
|
'reinvested_dividend' => $transaction->reinvested_dividend,
|
||||||
'date' => $transaction->date,
|
'date' => date_format($transaction->date, 'Y-m-d'),
|
||||||
'created_at' => $transaction->created_at,
|
'created_at' => $transaction->created_at,
|
||||||
'updated_at' => $transaction->updated_at,
|
'updated_at' => $transaction->updated_at,
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class TransactionResource extends JsonResource
|
|||||||
'sale_price' => $this->sale_price,
|
'sale_price' => $this->sale_price,
|
||||||
'split' => $this->split,
|
'split' => $this->split,
|
||||||
'reinvested_dividend' => $this->reinvested_dividend,
|
'reinvested_dividend' => $this->reinvested_dividend,
|
||||||
'date' => $this->date,
|
'date' => date_format($this->date, 'Y-m-d'),
|
||||||
'created_at' => $this->created_at,
|
'created_at' => $this->created_at,
|
||||||
'updated_at' => $this->updated_at,
|
'updated_at' => $this->updated_at,
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ class DailyChange extends Model
|
|||||||
->groupBy('portfolio_id', 'date');
|
->groupBy('portfolio_id', 'date');
|
||||||
|
|
||||||
return $query
|
return $query
|
||||||
->select(['daily_change.portfolio_id', 'daily_change.date'])
|
->select(['daily_change.date', 'daily_change.portfolio_id'])
|
||||||
->selectRaw('daily_change.total_market_value * COALESCE(cr.rate, 1) AS total_market_value')
|
->selectRaw('daily_change.total_market_value * COALESCE(cr.rate, 1) AS total_market_value')
|
||||||
->selectRaw('SUM(COALESCE(ccb.cumulative_cost_basis, 0)) AS total_cost_basis')
|
->selectRaw('SUM(COALESCE(ccb.cumulative_cost_basis, 0)) AS total_cost_basis')
|
||||||
->selectRaw('daily_change.total_market_value * COALESCE(cr.rate, 1)
|
->selectRaw('daily_change.total_market_value * COALESCE(cr.rate, 1)
|
||||||
|
|||||||
+4
-4
@@ -1,5 +1,5 @@
|
|||||||
# Stage 1: Build stage
|
# Stage 1: Build stage
|
||||||
FROM php:8.3-fpm AS builder
|
FROM php:8.4-fpm AS builder
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
ENV APP_NAME=Investbrain
|
ENV APP_NAME=Investbrain
|
||||||
@@ -39,7 +39,7 @@ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local
|
|||||||
&& rm -rf node_modules
|
&& rm -rf node_modules
|
||||||
|
|
||||||
# Stage 2: Production stage
|
# Stage 2: Production stage
|
||||||
FROM php:8.3-fpm-alpine
|
FROM php:8.4-fpm-alpine
|
||||||
|
|
||||||
# Set the working directory
|
# Set the working directory
|
||||||
WORKDIR /var/app
|
WORKDIR /var/app
|
||||||
@@ -71,8 +71,8 @@ RUN apk add --no-cache \
|
|||||||
RUN rm -rf /var/www/html \
|
RUN rm -rf /var/www/html \
|
||||||
&& ln -s /var/app /var/www/app
|
&& ln -s /var/app /var/www/app
|
||||||
|
|
||||||
# Create required directories for supervisord
|
# Create required directories
|
||||||
RUN mkdir -p /var/log/supervisor /var/run/supervisor
|
RUN mkdir -p /var/log/supervisor /var/run/supervisor /var/run/nginx
|
||||||
|
|
||||||
# Copy over configs
|
# Copy over configs
|
||||||
COPY ./docker/nginx.conf /etc/nginx/http.d/default.conf
|
COPY ./docker/nginx.conf /etc/nginx/http.d/default.conf
|
||||||
|
|||||||
Generated
+5
-5
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "investbrain",
|
"name": "relock-npm-lock-v2-E2dX8W",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@alpinejs/focus": "^3.15.0",
|
"@alpinejs/focus": "^3.15.1",
|
||||||
"@alpinejs/persist": "^3.14.9",
|
"@alpinejs/persist": "^3.14.9",
|
||||||
"@alpinejs/resize": "^3.14.9",
|
"@alpinejs/resize": "^3.14.9",
|
||||||
"alpinejs": "^3.14.9",
|
"alpinejs": "^3.14.9",
|
||||||
@@ -25,9 +25,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@alpinejs/focus": {
|
"node_modules/@alpinejs/focus": {
|
||||||
"version": "3.15.0",
|
"version": "3.15.1",
|
||||||
"resolved": "https://registry.npmjs.org/@alpinejs/focus/-/focus-3.15.0.tgz",
|
"resolved": "https://registry.npmjs.org/@alpinejs/focus/-/focus-3.15.1.tgz",
|
||||||
"integrity": "sha512-Cm9vop09oNFw7T9SEBcfijrTdSN1aBNHK3cN4mB52eKvi9z5pa+xcyN+6S3FmZ44MR/u81JXa6hi5CjX1iy6dA==",
|
"integrity": "sha512-Svu8ILVafdJouRVAV/vAkw7i/5/RNi5USh/C1llOhmhpSlX+F8JI1FuVhlJHLMcNqNIV6fm9yoiUBjB2NLwwUQ==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"focus-trap": "^6.9.4",
|
"focus-trap": "^6.9.4",
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@
|
|||||||
"vite": "^5.4"
|
"vite": "^5.4"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@alpinejs/focus": "^3.15.0",
|
"@alpinejs/focus": "^3.15.1",
|
||||||
"@alpinejs/persist": "^3.14.9",
|
"@alpinejs/persist": "^3.14.9",
|
||||||
"@alpinejs/resize": "^3.14.9",
|
"@alpinejs/resize": "^3.14.9",
|
||||||
"alpinejs": "^3.14.9",
|
"alpinejs": "^3.14.9",
|
||||||
|
|||||||
Reference in New Issue
Block a user