diff --git a/app/Features/Dashboard/Services/DashboardService.php b/app/Features/Dashboard/Services/DashboardService.php index a932e2b..f92f79e 100644 --- a/app/Features/Dashboard/Services/DashboardService.php +++ b/app/Features/Dashboard/Services/DashboardService.php @@ -20,7 +20,7 @@ class DashboardService $eNow = $electricity->whereBetween('startDate', [$now->copy()->subHour(), $now])->first(); $eCheapest = $electricity->where('totalPriceTaxIncluded', $electricity->min('totalPriceTaxIncluded'))->first(); - $eDurable = $electricity->where('sustainabilityScore', $electricity->min('sustainabilityScore'))->first(); + $eDurable = $electricity->where('sustainabilityScore', $electricity->max('sustainabilityScore'))->first(); $ePriciest = $electricity->where('totalPriceTaxIncluded', $electricity->max('totalPriceTaxIncluded'))->first(); $gas = $this->repository->retrieveGas(); diff --git a/package-lock.json b/package-lock.json index 01f425f..362292b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ "i18next": "^26.3.6", "i18next-vue": "^5.4.0", "laravel-vite-plugin": "^3.1", + "moment": "^2.30.1", "tailwind-merge": "^3.2.0", "tailwindcss": "^4.1.1", "typescript": "^5.2.2", @@ -5040,6 +5041,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/moment": { + "version": "2.30.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", + "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==", + "license": "MIT", + "engines": { + "node": "*" + } + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", diff --git a/package.json b/package.json index d502480..967606a 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "i18next": "^26.3.6", "i18next-vue": "^5.4.0", "laravel-vite-plugin": "^3.1", + "moment": "^2.30.1", "tailwind-merge": "^3.2.0", "tailwindcss": "^4.1.1", "typescript": "^5.2.2", diff --git a/resources/css/app.css b/resources/css/app.css index 9c5a556..c7b7d9e 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -8,4 +8,6 @@ Instrument Sans, ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; + + --color-primary: #4ba66a; } diff --git a/resources/js/features/dashboard/components/Price.vue b/resources/js/features/dashboard/components/Price.vue new file mode 100644 index 0000000..d532951 --- /dev/null +++ b/resources/js/features/dashboard/components/Price.vue @@ -0,0 +1,23 @@ + + + diff --git a/resources/js/features/dashboard/pages/Index.vue b/resources/js/features/dashboard/pages/Index.vue index d9062ab..135df27 100644 --- a/resources/js/features/dashboard/pages/Index.vue +++ b/resources/js/features/dashboard/pages/Index.vue @@ -1,5 +1,8 @@ diff --git a/resources/js/generated/generated.d.ts b/resources/js/generated/generated.d.ts index 7b5b492..423d0ed 100644 --- a/resources/js/generated/generated.d.ts +++ b/resources/js/generated/generated.d.ts @@ -3,11 +3,11 @@ declare namespace App { namespace Dashboard { namespace Data { export type DashboardData = { - electricityHistory: App.Features.Dashboard.Data.ElectricityData[]; + electricity: App.Features.Dashboard.Data.ElectricityData; electricityCheapest: App.Features.Dashboard.Data.ElectricityData | null; electricityDurable: App.Features.Dashboard.Data.ElectricityData | null; electricityPriciest: App.Features.Dashboard.Data.ElectricityData | null; - gasHistory: App.Features.Dashboard.Data.ElectricityData[]; + gas: App.Features.Dashboard.Data.GasData; gasCheapest: App.Features.Dashboard.Data.GasData | null; gasPriciest: App.Features.Dashboard.Data.GasData | null; }; diff --git a/resources/js/generated/typescript-transformer-manifest.json b/resources/js/generated/typescript-transformer-manifest.json index 36f9081..3bb79b1 100644 --- a/resources/js/generated/typescript-transformer-manifest.json +++ b/resources/js/generated/typescript-transformer-manifest.json @@ -1,3 +1,3 @@ { - "generated.d.ts": "63b1a5a3410956e9dfd29ea3c90abc71" + "generated.d.ts": "f593095f6f419a96a4c39c2b93719f9a" } \ No newline at end of file diff --git a/resources/js/layouts/Layout.vue b/resources/js/layouts/Layout.vue index 50db2fb..322a350 100644 --- a/resources/js/layouts/Layout.vue +++ b/resources/js/layouts/Layout.vue @@ -5,8 +5,9 @@ import history from '@/routes/history';