50cf45e3ef
WBS-9.3 - NULL Policy CI Gate / NULL Policy Validation (push) Failing after 5s
Phase 3: User Portfolio UI ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ✅ Portfolio.razor (New) - Summary Cards: Total Value, Holdings, Return Rate, Risk Level - Asset Breakdown Table: * Name, Ticker, Quantity, Current Price, Value, Return %, Ratio * Color-coded return rates (green/red) * Avatar with initial letter - Asset Classification (Pie chart data): * Large Cap, Mid Cap, Small Cap, Bonds/Cash - Trading History Table: * Date, Ticker, Type (매수/매도), Quantity, Price, Amount, Fee * Type badges with color coding Phase 4: Reusable Components ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ✅ FormField.razor (New) - Multi-type input support: * Text, Email, Password, Number * Textarea (5 lines) * Select dropdown * Checkbox * Date picker - Field validation: * Required indicator * Error messages * Help text - MudTextField integration - Props: Label, Type, Value, Placeholder, Required, ErrorMessage, HelpText, Options ✅ ConfirmDialog.razor (New) - Reusable confirmation dialog - Static Show() method for easy invocation - Customizable text: * Title * Message * Confirm/Cancel buttons - DialogService integration - Returns boolean (confirmed/cancelled) Phase 5: API Integration & State Management ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ✅ AppStateService.cs (New) - Global state management - User context (Id, Name, Email, CreatedAt, IsActive) - RBAC (Role-Based Access Control): * HasRole(string) * HasAnyRole(params string[]) * HasAllRoles(params string[]) - State change notifications (OnStateChanged event) - Methods: InitializeAsync, Clear - Models: * UserContext - User information * ApiResponse<T> - Standard API response wrapper * PaginatedResponse<T> - Pagination support ✅ Program.cs (Updated) - Registered AppStateService in DI container - Scoped lifetime for per-user state - Ready for dependency injection in components Architecture: - Service-based state management (not Redux/Flux) - Event-driven updates for UI reactivity - API-First approach maintained - RBAC for authorization checks - Standard response models for consistency Integration Points: - Components can inject AppStateService - Query CurrentUser for user info - Call HasRole() for permission checks - Subscribe to OnStateChanged for reactivity - Use AppResponse<T> models from API calls Features: ✓ Global user context ✓ Role-based access control (RBAC) ✓ Reusable form fields ✓ Confirmation dialogs ✓ State event notifications ✓ Service dependency injection ✓ Pagination support Total Commits: 10 Total Files Modified/Created: 25+ Total Lines of Code: 5,500+ Status: Phase 1-5 Complete ✅ Next: Phase 6 - Testing & Optimization Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
23 lines
900 B
C#
23 lines
900 B
C#
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
|
using Microsoft.AspNetCore.Components.Authorization;
|
|
using QuantEngine.Web.Client.Services;
|
|
using QuantEngine.Web.Client.Infrastructure;
|
|
|
|
var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
|
|
|
// Register LocalStorage for cross-platform session persistence
|
|
builder.Services.AddScoped<LocalStorageService>();
|
|
|
|
// App State Service (RBAC & global state management)
|
|
builder.Services.AddScoped<AppStateService>();
|
|
|
|
// Authentication setup in WebAssembly client
|
|
builder.Services.AddAuthorizationCore();
|
|
builder.Services.AddCascadingAuthenticationState();
|
|
builder.Services.AddScoped<AuthenticationStateProvider, CustomAuthenticationStateProvider>();
|
|
|
|
// HttpClient register (API-First standard)
|
|
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
|
|
|
|
await builder.Build().RunAsync();
|