Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8ad441b72e |
@@ -33,24 +33,7 @@ class DailyChangesSheet implements FromCollection, WithHeadings, WithTitle
|
||||
*/
|
||||
public function collection()
|
||||
{
|
||||
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,
|
||||
];
|
||||
});
|
||||
return $this->empty ? collect() : DailyChange::myDailyChanges()->withDailyPerformance()->get();
|
||||
}
|
||||
|
||||
public function title(): string
|
||||
|
||||
@@ -58,7 +58,7 @@ class TransactionsSheet implements FromCollection, WithHeadings, WithTitle
|
||||
'currency' => $transaction->market_data_currency,
|
||||
'split' => $transaction->split,
|
||||
'reinvested_dividend' => $transaction->reinvested_dividend,
|
||||
'date' => date_format($transaction->date, 'Y-m-d'),
|
||||
'date' => $transaction->date,
|
||||
'created_at' => $transaction->created_at,
|
||||
'updated_at' => $transaction->updated_at,
|
||||
];
|
||||
|
||||
@@ -27,7 +27,7 @@ class TransactionResource extends JsonResource
|
||||
'sale_price' => $this->sale_price,
|
||||
'split' => $this->split,
|
||||
'reinvested_dividend' => $this->reinvested_dividend,
|
||||
'date' => date_format($this->date, 'Y-m-d'),
|
||||
'date' => $this->date,
|
||||
'created_at' => $this->created_at,
|
||||
'updated_at' => $this->updated_at,
|
||||
];
|
||||
|
||||
@@ -121,7 +121,7 @@ class DailyChange extends Model
|
||||
->groupBy('portfolio_id', 'date');
|
||||
|
||||
return $query
|
||||
->select(['daily_change.date', 'daily_change.portfolio_id'])
|
||||
->select(['daily_change.portfolio_id', 'daily_change.date'])
|
||||
->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('daily_change.total_market_value * COALESCE(cr.rate, 1)
|
||||
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
# Stage 1: Build stage
|
||||
FROM php:8.4-fpm AS builder
|
||||
FROM php:8.3-fpm AS builder
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV APP_NAME=Investbrain
|
||||
@@ -39,7 +39,7 @@ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local
|
||||
&& rm -rf node_modules
|
||||
|
||||
# Stage 2: Production stage
|
||||
FROM php:8.4-fpm-alpine
|
||||
FROM php:8.5.0RC2-fpm-alpine
|
||||
|
||||
# Set the working directory
|
||||
WORKDIR /var/app
|
||||
@@ -71,8 +71,8 @@ RUN apk add --no-cache \
|
||||
RUN rm -rf /var/www/html \
|
||||
&& ln -s /var/app /var/www/app
|
||||
|
||||
# Create required directories
|
||||
RUN mkdir -p /var/log/supervisor /var/run/supervisor /var/run/nginx
|
||||
# Create required directories for supervisord
|
||||
RUN mkdir -p /var/log/supervisor /var/run/supervisor
|
||||
|
||||
# Copy over configs
|
||||
COPY ./docker/nginx.conf /etc/nginx/http.d/default.conf
|
||||
|
||||
Generated
+5
-5
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "relock-npm-lock-v2-FTom7m",
|
||||
"name": "investbrain",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"dependencies": {
|
||||
"@alpinejs/focus": "^3.15.0",
|
||||
"@alpinejs/persist": "^3.15.1",
|
||||
"@alpinejs/persist": "^3.14.9",
|
||||
"@alpinejs/resize": "^3.14.9",
|
||||
"alpinejs": "^3.14.9",
|
||||
"apexcharts": "^3.51.0"
|
||||
@@ -35,9 +35,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@alpinejs/persist": {
|
||||
"version": "3.15.1",
|
||||
"resolved": "https://registry.npmjs.org/@alpinejs/persist/-/persist-3.15.1.tgz",
|
||||
"integrity": "sha512-EtK4s7I0xhRTJsLaYjhJ4SyQan8+gkGaRYvzFw+ndg7rzrjSHzhgRmQ20GZbnjj+eDg77fPMTvzvngX6yAExbg==",
|
||||
"version": "3.15.0",
|
||||
"resolved": "https://registry.npmjs.org/@alpinejs/persist/-/persist-3.15.0.tgz",
|
||||
"integrity": "sha512-SmW1DWn9FRflfPqZZtpTq+2uXDq/ohbSiKmYg6HXX1UxQnsaSkTT0HT72SQcbqOC3WmIUF28CberBnwiWoqmpw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@alpinejs/resize": {
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@alpinejs/focus": "^3.15.0",
|
||||
"@alpinejs/persist": "^3.15.1",
|
||||
"@alpinejs/persist": "^3.14.9",
|
||||
"@alpinejs/resize": "^3.14.9",
|
||||
"alpinejs": "^3.14.9",
|
||||
"apexcharts": "^3.51.0"
|
||||
|
||||
Reference in New Issue
Block a user