Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -255,4 +255,4 @@ Guid serviceHistoryId
Price = r.Price
}).ToList();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Data;
using System.Text.RegularExpressions;
using FluentValidation;
using MainHub.Api.DTOs;
Expand Down Expand Up @@ -61,12 +60,12 @@ public CreateVehicleDtoValidator()
.When(x => x.BoughtAt.HasValue);

RuleFor(x => x.EngineCapacity)
.NotEmpty()
.WithMessage("Engine capacity is required.")
.GreaterThan(0)
.WithMessage("Engine capacity must be greater than 0.")
.LessThanOrEqualTo(10000)
.WithMessage("Engine capacity must be less than or equal to 10000.");
.NotEmpty().WithMessage("Engine capacity is required.")
.LessThanOrEqualTo(10000).WithMessage("Engine capacity must be less than or equal to 10000.")
.GreaterThan(0).WithMessage("Engine capacity must be greater than 0.")
.When(x => x.FuelType is not FuelType.Electric and not FuelType.Hydrogen)
.Equal(0).WithMessage("Engine capacity must be 0 for Electric/Hydrogen vehicles.")
.When(x => x.FuelType is FuelType.Electric or FuelType.Hydrogen);

RuleFor(x => x.Mileage)
.NotEmpty()
Expand Down
5 changes: 4 additions & 1 deletion apps/AdminWebUi/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { BrowserRouter } from "react-router-dom";
import { AuthProvider } from "./auth/AuthContext";
import { StoProvider } from "./context/StoContext";
import { StoVehicleProvider } from "./context/StoVehicleContext";
import { BookingRequestProvider } from "./context/BookingRequestContext";
import { queryClient } from "./lib/queryClient";
import { AppRouter } from "./routes/AppRouter";
import { persistor, store } from "./store";
Expand All @@ -19,7 +20,9 @@ function App() {
<AuthProvider>
<StoProvider>
<StoVehicleProvider>
<AppRouter />
<BookingRequestProvider>
<AppRouter />
</BookingRequestProvider>
</StoVehicleProvider>
</StoProvider>
</AuthProvider>
Expand Down
233 changes: 233 additions & 0 deletions apps/AdminWebUi/src/components/ActivityLog/ActivityLog.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
.section {
margin: 20px 24px 24px;
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: var(--radius-lg);
background-color: #1a1c1e;
overflow: hidden;
}

.toggle {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
width: 100%;
padding: 16px 20px;
border: none;
background: linear-gradient(
180deg,
rgba(74, 222, 158, 0.04) 0%,
transparent 100%
);
color: inherit;
cursor: pointer;
text-align: left;
}

.toggle:hover {
background-color: rgba(255, 255, 255, 0.02);
}

.toggleMain {
display: flex;
align-items: center;
gap: 10px;
min-width: 0;
}

.toggleTitle {
margin: 0;
font-size: 13px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
color: var(--text-secondary);
}

.countBadge {
padding: 2px 8px;
border-radius: 999px;
font-size: 11px;
font-weight: 600;
color: var(--accent-primary);
background-color: rgba(74, 222, 158, 0.12);
border: 1px solid rgba(74, 222, 158, 0.24);
}

.toggleHint {
margin: 4px 0 0;
font-size: 12px;
color: var(--text-tertiary);
line-height: 1.4;
}

.chevron {
display: flex;
align-items: center;
justify-content: center;
width: 28px;
height: 28px;
flex-shrink: 0;
border-radius: var(--radius-sm);
border: 1px solid rgba(255, 255, 255, 0.08);
color: var(--text-secondary);
transition:
transform 0.3s ease,
color 0.2s ease,
border-color 0.2s ease;
}

.chevronExpanded {
transform: rotate(180deg);
color: var(--accent-primary);
border-color: rgba(74, 222, 158, 0.24);
}

.bodyWrapper {
display: grid;
grid-template-rows: 0fr;
transition: grid-template-rows 0.32s ease;
}

.bodyWrapperExpanded {
grid-template-rows: 1fr;
}

.bodyInner {
overflow: hidden;
min-height: 0;
opacity: 0;
transition: opacity 0.24s ease;
}

.bodyWrapperExpanded .bodyInner {
opacity: 1;
}

.body {
border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.scrollArea {
max-height: 360px;
overflow-y: auto;
padding: 12px 16px 16px;
}

.scrollArea::-webkit-scrollbar {
width: 6px;
}

.scrollArea::-webkit-scrollbar-thumb {
background-color: rgba(255, 255, 255, 0.12);
border-radius: 3px;
}

.list {
display: flex;
flex-direction: column;
gap: 0;
margin: 0;
padding: 0;
list-style: none;
}

.entry {
display: grid;
grid-template-columns: 20px 1fr;
gap: 12px;
padding: 12px 4px;
position: relative;
}

.entry:not(:last-child)::after {
content: "";
position: absolute;
left: 9px;
top: 32px;
bottom: -4px;
width: 2px;
background-color: rgba(255, 255, 255, 0.08);
border-radius: 1px;
}

.marker {
display: flex;
align-items: flex-start;
justify-content: center;
padding-top: 4px;
}

.dot {
width: 10px;
height: 10px;
border-radius: 50%;
flex-shrink: 0;
box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

.entryMain {
min-width: 0;
}

.entryHeader {
display: flex;
flex-wrap: wrap;
align-items: baseline;
justify-content: space-between;
gap: 8px;
margin-bottom: 4px;
}

.entryTitle {
margin: 0;
font-size: 14px;
font-weight: 600;
color: var(--text-primary);
line-height: 1.35;
}

.entryTime {
font-size: 11px;
color: var(--text-tertiary);
white-space: nowrap;
}

.entryMeta {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 6px;
margin-bottom: 4px;
}

.actorName {
font-size: 12px;
color: var(--text-secondary);
}

.actorRole {
padding: 1px 6px;
border-radius: 4px;
font-size: 10px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.3px;
color: var(--text-tertiary);
background-color: rgba(255, 255, 255, 0.05);
border: 1px solid rgba(255, 255, 255, 0.06);
}

.entryDescription {
margin: 0;
font-size: 12px;
color: var(--text-secondary);
line-height: 1.45;
}

.empty {
padding: 20px 16px;
font-size: 13px;
color: var(--text-tertiary);
text-align: center;
}
Loading