Danncode10 / Danncode10/LGU-Solano-Marriage-License-System
Class Structures for FAST API (not final). To be edited if Form Variables is finished
- Dominant language
- No language data
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
docs/Framework/3-SoftwareDesign.md -> 3.2 Low-Level Design (LLD)
Class Structures (Conceptual Examples, e.g., for FastAPI/Python)
* **`models.py` (Pydantic Models):**
* `ApplicantInfo(BaseModel)`: Defines structure for male/female applicant data (name, age, address, parents_info).
* `ApplicationCreate(BaseModel)`: Input model for new applications.
* `ApplicationDB(ApplicationCreate)`: Database model including `id`, `unique_code`, `photo_url`, `status`, timestamps.
* `EmployeeCreate(BaseModel)`, `EmployeeDB(EmployeeCreate)`: Models for employee data.
* `AdminUser(BaseModel)`: Model for admin user data.
* **`services.py` (Business Logic/Service Layer):**
* `AuthService`:
* `login(email, password)`: Authenticates user via Supabase Auth.
* `create_employee(employee_data)`: Registers new employee.
* `delete_employee(employee_id)`: Deletes employee record.
* `ApplicationService`:
* `create_application(applicant_data)`: Stores new application, generates unique code.
* `get_application(unique_code)`: Retrieves application details.
* `update_photo_url(application_id, photo_url)`: Updates application with photo URL.
* `DocumentService`:
* `generate_document(application_data)`: Orchestrates document generation steps.
* **`document_generator.py` (Excel Manipulation Logic):**
* `DocumentGenerator` Class:
* `__init__(master_template_path)`: Loads the master Excel template.
* `prune_sheets(male_age, female_age, male_address, female_address)`: Dynamically removes irrelevant sheets based on business rules.
* `inject_data(application_data)`: Maps and inserts textual data into designated cells.
* `insert_photo(photo_path, sheet_name, anchor_cell)`: Embeds the captured photo into a specific sheet.
* `save_document()`: Returns the modified workbook as a byte stream.
### Database Schema (Supabase PostgreSQL)
* **`applications` Table:**
* `id` (UUID, Primary Key, auto-generated)
* `unique_code` (VARCHAR(10), NOT NULL, UNIQUE)
* `male_name` (VARCHAR(255), NOT NULL)
* `male_age` (INTEGER, NOT NULL)
* `male_address` (VARCHAR(255), NOT NULL)
* `male_parents_info` (TEXT, NOT NULL)
* `female_name` (VARCHAR(255), NOT NULL)
* `female_age` (INTEGER, NOT NULL)
* `female_address` (VARCHAR(255), NOT NULL)
* `female_parents_info` (TEXT, NOT NULL)
* `photo_url` (VARCHAR(500))
* `status` (VARCHAR(50), DEFAULT 'pending')
* `created_at` (TIMESTAMP WITH TIME ZONE, DEFAULT NOW())
* `updated_at` (TIMESTAMP WITH TIME ZONE, DEFAULT NOW())
* **`users` Table (managed by Supabase Auth, additional columns for roles):**
* `id` (UUID, Primary Key, from Supabase Auth)
* `email` (VARCHAR(255), UNIQUE, from Supabase Auth)
* `role` (VARCHAR(50), CHECK (role IN ('admin', 'employee', 'applicant')), DEFAULT 'applicant')
* `created_at`, `updated_at` (from Supabase Auth)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.