update schema table with ApplicationUser; add test page
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
## Entities
|
||||
|
||||
### `ApplicationUser`
|
||||
Extends built-in .NET Core Identity framework `IdentityUser` class.
|
||||
|
||||
### `Plant`
|
||||
Represents an **individual plant**. Contains instance-specific information and references a shared plant species
|
||||
|
||||
| Attribute | Type | Nullable | Description | Example |
|
||||
| - | - | - | - | - |
|
||||
| `id` | `int` | NO | Primary key | 15 |
|
||||
| `user_id` | `int` | NO | FK to [ApplicationUser](#applicationuser) | 0 |
|
||||
| `species_id` | `int` | NO | FK to [PlantSpecies](#plantspecies) | 1 |
|
||||
| `name` | `string` | YES | Given/nickname for the plant | "Big Fatty" |
|
||||
| `date_acquired` | `datetime` | YES | Date acquired | 2025-08-14T14:30:45Z |
|
||||
@@ -32,6 +37,7 @@ Logical grouping of plants (e.g., location, category).
|
||||
| Attribute | Type | Nullable | Description | Example |
|
||||
| - | - | - | - | - |
|
||||
| `id` | `int` | NO | Primary key | 3 |
|
||||
| `user_id` | `int` | NO | FK to [ApplicationUser](#applicationuser) | 0 |
|
||||
| `name` | `string` | NO | Group name | "Location: Plant Cart" |
|
||||
|
||||
---
|
||||
@@ -53,6 +59,7 @@ An **action** is a type of care or maintenance performed on a plant (e.g., water
|
||||
| Attribute | Type | Nullable | Description | Example |
|
||||
| - | - | - | - | - |
|
||||
| `id` | `int` | NO | Primary key | 4 |
|
||||
| `user_id` | `int` | NO | FK to [ApplicationUser](#applicationuser) | 0 |
|
||||
| `name` | `string` | NO | Action name | Water |
|
||||
| `description` | `string` | YES | Action description | "Give the plant some water" |
|
||||
|
||||
@@ -64,6 +71,7 @@ Records **which actions** were performed on **which plants or groups**
|
||||
| Attribute | Type | Nullable | Description | Example |
|
||||
| - | - | - | - | - |
|
||||
| `id` | `int` | NO | Primary key | 22 |
|
||||
| `user_id` | `int` | NO | FK to [ApplicationUser](#applicationuser) | 0 |
|
||||
| `action_id` | `int` | NO | FK to [Action](#action) | 4 |
|
||||
| `plant_id` | `int` | YES | FK to [Plant](#plant) | NULL |
|
||||
| `group_id` | `int` | YES | FK to [Group](#group) | 3 |
|
||||
@@ -102,6 +110,7 @@ Represents a **tool** used to complete an action (e.g., “warm water” for a w
|
||||
| Attribute | Type | Nullable | Description | Example |
|
||||
| - | - | - | - | - |
|
||||
| `id` | `int` | NO | Primary key | 5 |
|
||||
| `user_id` | `int` | NO | FK to [ApplicationUser](#applicationuser) | 0 |
|
||||
| `name` | `string` | NO | Tool name | Warm Water |
|
||||
| `description` | `string` | YES | Tool description | "Like bath water" |
|
||||
|
||||
@@ -147,6 +156,7 @@ Material used as the substrate in which a [Plant](#plant) is grown
|
||||
| Attribute | Type | Nullable | Description | Example |
|
||||
| - | - | - | - | - |
|
||||
| `id` | `int` | NO | Primary key | 8 |
|
||||
| `user_id` | `int` | NO | FK to [ApplicationUser](#applicationuser) | 0 |
|
||||
| `name` | `string` | NO | Given name | "Coco Coir" |
|
||||
| `description` | `string` | YES | Short description | "good aeration and drainage" |
|
||||
| `water_retention` | `int` | YES | Relative rating (1–5) of water retention capacity | 2 |
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.14.36414.22 d17.14
|
||||
VisualStudioVersion = 17.14.36414.22
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "plant-manager", "plant-manager\plant-manager.csproj", "{9623820E-0AE2-4500-80AD-85239C402D9D}"
|
||||
EndProject
|
||||
|
||||
@@ -14,23 +14,15 @@
|
||||
<nav class="nav flex-column">
|
||||
<AuthorizeView>
|
||||
<Authorized>
|
||||
|
||||
<div class="nav-item">
|
||||
<form action="Account/Logout" method="post">
|
||||
<AntiforgeryToken />
|
||||
<input type="hidden" name="ReturnUrl" value="@currentUrl" />
|
||||
<button type="submit" class="nav-link">
|
||||
🚪 Logout
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="nav-item">
|
||||
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
|
||||
🏠 Home
|
||||
</NavLink>
|
||||
</div>
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="#">
|
||||
<NavLink class="nav-link" href="plant-compendium">
|
||||
📖 Plant Compendium
|
||||
</NavLink>
|
||||
</div>
|
||||
@@ -49,6 +41,15 @@
|
||||
🛠️ Maintenance
|
||||
</NavLink>
|
||||
</div>
|
||||
<div class="nav-item">
|
||||
<form action="Account/Logout" method="post">
|
||||
<AntiforgeryToken />
|
||||
<input type="hidden" name="ReturnUrl" value="@currentUrl" />
|
||||
<button type="submit" class="nav-link">
|
||||
🚪 Logout
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</Authorized>
|
||||
<NotAuthorized>
|
||||
<div class="nav-item">
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
@page "/plant-compendium"
|
||||
|
||||
@using Microsoft.AspNetCore.Authorization
|
||||
|
||||
@attribute [Authorize]
|
||||
|
||||
<PageTitle>Auth</PageTitle>
|
||||
|
||||
<h1>Plant Compendium</h1>
|
||||
Reference in New Issue
Block a user