Skip to content

Commit 9946b4e

Browse files
committed
readme updated
1 parent 7ed382a commit 9946b4e

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

README.md

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The application uses the following database models:
1818
- **Employee**: Represents employees, linked to divisions and items.
1919
- **Item**: Represents inventory items, with attributes and status.
2020
- **EmployeeItem**: An associative table linking employees to items.
21-
- **ItemAttribute**: Represents dynamic attributes for items.
21+
- **EmployeeItemAttribute**: Represents dynamic attributes for items.
2222
- **User**: Represents system users (managers).
2323
- **Log**: For logging actions performed in the system.
2424
- **ItemTransferHistory**: Tracks the history of item transfers between employees.
@@ -63,6 +63,10 @@ Some reusable utility functions lies here including search functions
6363

6464
### Database Schema in detail
6565

66+
Here is the revised database schema in Markdown format:
67+
68+
### Database Schema in detail
69+
6670
#### 1. **Employee Table**
6771
*Now includes division ID as a foreign key and keeps track of each employee's division and details.*
6872

@@ -72,7 +76,7 @@ Some reusable utility functions lies here including search functions
7276
| name | String | Employee name |
7377
| division_id | Integer | Foreign key to `Division` |
7478
| item_count | Integer | Total number of assigned items |
75-
| date_joined | Date | Date employee joined the company |
79+
| date_joined | DateTime | Date employee joined the company |
7680

7781
#### 2. **Division Table**
7882
*Includes a count of employees in each division.*
@@ -81,7 +85,6 @@ Some reusable utility functions lies here including search functions
8185
|------------------|---------|--------------------------------------|
8286
| division_id | Integer | Unique ID for each division |
8387
| name | String | Name of the division |
84-
| employee_count | Integer | Number of employees in this division|
8588

8689
#### 3. **Item Table**
8790
*Now includes additional details for item status and history tracking.*
@@ -90,10 +93,7 @@ Some reusable utility functions lies here including search functions
9093
|-----------------|---------|---------------------------------------|
9194
| item_id | Integer | Unique ID for each item |
9295
| name | String | Item name |
93-
| unique_key | String | Unique identifier (e.g., serial) |
94-
| is_common | Boolean | Whether the item is common or unique |
95-
| status | String | Current status (`active`, `retired`, `lost`, etc.)|
96-
| last_assigned | Date | Date when the item was last assigned |
96+
| last_assigned | DateTime | Date when the item was last assigned |
9797

9898
#### 4. **EmployeeItem Table** (Associative Table for Many-to-Many Relationship)
9999
*Tracks unique or shared items and keeps records of item ownership.*
@@ -103,11 +103,21 @@ Some reusable utility functions lies here including search functions
103103
| id | Integer | Primary key |
104104
| emp_id | String | Foreign key to `Employee` |
105105
| item_id | Integer | Foreign key to `Item` |
106-
| is_unique | Boolean | Indicates if item is unique to this employee |
107-
| date_assigned | Date | Date when item was assigned |
106+
| unique_key | String | Unique identifier (e.g., serial) |
107+
| date_assigned | DateTime | Date when item was assigned |
108108
| notes | Text | Additional notes (e.g., item conditions) |
109109

110-
#### 5. **User Table** (For System Manager)
110+
#### 5. **EmployeeItemAttribute Table**
111+
*Tracks dynamic attributes for employee items.*
112+
113+
| Column | Type | Description |
114+
|-----------------|---------|---------------------------------------|
115+
| emp_attribute_id | Integer | Primary key |
116+
| emp_item_id | Integer | Foreign key to `EmployeeItem` |
117+
| name | String | Attribute name |
118+
| value | String | Attribute value |
119+
120+
#### 6. **User Table** (For System Manager)
111121
*Manager login table.*
112122

113123
| Column | Type | Description |
@@ -117,7 +127,7 @@ Some reusable utility functions lies here including search functions
117127
| password | String | Hashed login password |
118128
| role | String | Role of the user (`manager`) |
119129

120-
#### 6. **Log Table**
130+
#### 7. **Log Table**
121131
*Enhanced to log all user actions, including system changes, searches, and item updates.*
122132

123133
| Column | Type | Description |
@@ -128,7 +138,7 @@ Some reusable utility functions lies here including search functions
128138
| timestamp | DateTime | When the action occurred |
129139
| user_id | Integer | Foreign key to `User` performing the action (nullable for searches) |
130140

131-
#### 7. **ItemTransferHistory Table**
141+
#### 8. **ItemTransferHistory Table**
132142
*Tracks historical transfers of items between employees.*
133143

134144
| Column | Type | Description |
@@ -140,12 +150,6 @@ Some reusable utility functions lies here including search functions
140150
| transfer_date | Date | Date of transfer |
141151
| notes | Text | Optional notes (e.g., reason for transfer)|
142152

143-
---
144-
145-
## To do
146-
147-
- chnage the db model with new attributes values for employee record .
148-
149153
### Screenshots
150154

151155

0 commit comments

Comments
 (0)