diff --git a/404.html b/404.html
index e74e212..1723e2d 100644
--- a/404.html
+++ b/404.html
@@ -40,6 +40,10 @@
Authentication
+
Database Schema
diff --git a/account/index.html b/account/index.html
new file mode 100644
index 0000000..f264280
--- /dev/null
+++ b/account/index.html
@@ -0,0 +1,220 @@
+
+
+
+
+
+
+
+ Account Management - Backend Documentation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Backend Documentation
+
+
+
+
+
+
+ Account Management
+
+
+
+
+
+
+
+
+
Account Management
+
Create New Account for User POST
+
API
+
http://127.0.0.1:8000/account_create
+
+
+
+
{
+ "email": "test@example.com",
+ "type": "credit",
+ "account_name": "td_credit",
+ "init_balance(optional)": -200
+}
+
+
+
+Response:
+Successfully created: STATUS_CODE::CREATED
(201)
+Failed to create (e.g. account name already exists): STATUS_CODE::BAD_REQUEST
(400)
+
+
+
+
Get Account Overview for User GET
+
API
+
http://127.0.0.1:8000/account_summary
+
+
+
+
{
+ "email": "test@example.com"
+}
+
+
+
+
{
+ "account1": "888.88CAD",
+ "account2": "666.66CAD"
+}
+
+
+
Get Account Detailed View for User GET
+
API
+
http://127.0.0.1:8000/account_details
+
+
+
+
{
+ "email": "test@example.com",
+ "account_name": "td_credit"
+}
+
+
+
+
[
+ {
+ "1": "TBD"
+ },
+ {
+ "2": "TBD"
+ }
+]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/authentication/index.html b/authentication/index.html
index 18ab6e0..66fa1aa 100644
--- a/authentication/index.html
+++ b/authentication/index.html
@@ -57,6 +57,10 @@
+
+
@@ -81,30 +79,14 @@
Description
Schema
-
- Notes
- Budget Table
+ Category Table
-
- Category Table
-
@@ -138,24 +120,20 @@
Database Schema Documentation
Introduction
-This document outlines the updated database schema for the financial tracker
-application backend, utilizing Rust Rocket for REST API handling, Diesel for database interaction,
-and PostgreSQL as the database. The schema is designed to efficiently store and manage user information
,
-financial accounts
, transactions
, budgets
, and categories
, ensuring data scalability.
+This document outlines the updated database schema for the financial tracker application backend, utilizing Rust Rocket for REST API handling, Diesel for database interaction, and PostgreSQL as the database. The schema is designed to efficiently store and manage user information
, financial accounts
, transactions
, budgets
, and categories
, ensuring data scalability and consistency.
Table of Contents
User Table
Account Table
Transaction Table
-Budget Table
Category Table
Summary of Updates
User Table
Description
-Stores user credentials and personal information. Each user is uniquely identified and can have multiple accounts and budgets associated with them.
+Stores user credentials and personal information. Each user is uniquely identified and can have multiple accounts, transactions, and categories associated with them.
Schema
@@ -175,51 +153,28 @@ Schema
-
-Password Security : Passwords must be stored securely using a hashing algorithm like bcrypt.
-Email Uniqueness : Enforce a unique constraint to prevent duplicate accounts.
-
Account Table
Description
-Represents financial accounts linked to users, such as bank accounts or credit cards. Each account belongs to a user and holds financial transactions.
+Represents financial accounts linked to users. Each account belongs to a user and holds financial transactions.
Schema
@@ -238,58 +193,25 @@ Schema
-
-ACCOUNT_TYPE_ENUM : An enumeration with values 'Credit'
, 'Debit'
, 'Saving'
.
-
-Notes
-
-Foreign Key Constraint : user_id
references User.id
to establish ownership.
-Account Balance Calculation : It's recommended to calculate account balance dynamically from transactions to maintain consistency.
-
Transaction Table
Description
@@ -306,56 +228,41 @@ Schema
-
-Amount Significance : Positive amounts indicate deposits; negative amounts indicate withdrawals.
-Foreign Key Constraints :
-account_id
references Account.account_id
.
-category_id
references Category.category_id
.
-
-
-
-Budget Table
+Category Table
Description
-Defines budget limits and expectations for users, potentially per category and over specific time periods.
+Provides a way to classify transactions into categories, allowing for detailed financial tracking and reporting.
Schema
@@ -368,172 +275,65 @@ Schema
-
-FREQUENCY_ENUM : An enumeration with values 'Daily'
, 'Weekly'
, 'Monthly'
, 'Yearly'
.
-
-Notes
-
-Per-Category Budgets : If category_id
is set, the budget applies to that category; otherwise, it may apply to overall spending.
-Date Fields : start_date
and end_date
define custom budget periods if needed.
-
-
-Category Table
-Description
-Provides a way to classify transactions and budgets into categories, allowing for detailed financial tracking and reporting.
-Schema
-
-
-
-Field Name
-Data Type
-Constraints
-Description
-
-
-
-
-category_id
-SERIAL
-Primary Key
-Unique identifier for each category.
-
-
-user_id
-INTEGER
-Foreign Key (User.id
), Optional
-Owner of the category.
-
-
-name
-VARCHAR(100)
-Not Null
-Category name.
+Budget associated with this category.
-description
+budget_freq
TEXT
Optional
-Additional details about the category.
+Budget frequency (Daily
, Weekly
, etc.).
-Notes
-
-User-Specific Categories : If user_id
is set, the category is user-specific; otherwise, it can be a global category.
-Usage : Categories are linked to transactions and budgets for better organization.
-
Summary of Updates
-
-Primary Keys Added : Introduced id
fields as primary keys in tables where they were missing (Transaction
, Budget
, Category
).
-
-
-Foreign Key Constraints : Clearly defined relationships between tables using foreign keys to enforce referential integrity.
-
-
-Unique Constraints :
-
-Enforced uniqueness on User.email
to prevent duplicate user accounts.
-Added unique constraint on Account.account_number
if applicable.
-
-
-
-Data Types and Fields :
-
-Replaced ambiguous field names with more descriptive ones (e.g., TIME
to created_at
).
-Clarified AMOUNT
in Transaction
to allow both positive and negative values.
-Added description
fields for additional details where necessary.
-
-
-
-Enumerations :
-
-Defined enums for ACCOUNT_TYPE
and FREQUENCY
to standardize allowed values.
-Recommended using PostgreSQL's ENUM
type or lookup tables for better performance and data integrity.
-
-
-
-Timestamps :
-
-Added created_at
and updated_at
fields to track record creation and modification times.
-
-
-
-Password Security :
-
-Emphasized the importance of hashing passwords before storing them in the database.
-
-
-
-Normalization :
-
-Introduced a Category
table to eliminate redundancy and provide better data organization.
-
-
-
-Additional Fields :
-
-Added optional fields like first_name
, last_name
, currency
, start_date
, and end_date
for enhanced functionality.
-
-
+Primary Keys : Added id
fields as primary keys in tables where they were missing.
+Foreign Key Relationships :
+email
links multiple tables to the users
table for referential integrity.
+category_id
links the transactions
table to the categories
table.
+Field Updates :
+Added account_name
to the accounts
table for better account identification.
+Ensured foreign key constraints for better data consistency.
+Enumerations and Constraints :
+Categories and budgets allow classification for better financial tracking.
+Transaction amounts support both positive and negative values.
+Scalability and Performance :
+Schema supports detailed tracking and reporting, optimized for scalability and extensibility.
@@ -556,7 +356,7 @@ Summary of Updates