Product & System Data Models
Relevant source files
The following files were used as context for generating this wiki page:
The Product and System Data Models define the core structure for managing enterprise hardware and services within the Sunrise Communication platform. These models facilitate the organization of security and telecommunication products—such as CCTV, EPABX, and Biometrics—into a searchable catalog with detailed technical specifications and associated service offerings.
This system bridges the Django-based backend database with the Angular frontend signals-based architecture. It ensures data consistency across bulk imports, catalog filtering, and dynamic SEO generation for lead-generation workflows.
Sources: implementation_plan.md:9-12, sunrise-backend/products/models.py:73-81
Backend Database Schema
The backend architecture uses Django models to enforce a hierarchical taxonomy for products. Data is organized into Categories, Sub-Categories, and Brands to support granular filtering and administrative management.
Entity Relationships
The system uses UUIDs as primary keys for all major entities to ensure unique identification across distributed environments.
The diagram represents the relational structure where products are bound to brands and categories, while technical details are decoupled into a separate specification model.
Sources: sunrise-backend/products/models.py:7-133
Model Definitions
| Model | Description | Key Fields |
|---|---|---|
| Category | High-level classification (e.g., Network Camera). | name, slug, icon_class, gradient_colors |
| SubCategory | Variants within a category (e.g., 4 MP). | category_id, name, slug, display_order |
| Brand | Hardware manufacturers (e.g., CP Plus). | name, logo, display_order |
| Product | The central hardware entity. | model_number, brand_id, services_offered (JSON) |
| ProductSpec | Technical key-value pairs. | product_id, key, value |
Sources: sunrise-backend/products/models.py:7-133
Frontend TypeScript Interfaces
The frontend utilizes TypeScript interfaces that mirror the backend API responses. These models support Angular Signals for reactive catalog filtering and server-side rendering (SSR) optimization.
Core Product Interface
export interface Product {
id: string;
model_number?: string;
slug: string;
name: string;
brand: string;
category: string;
category_slug: string;
specs: ProductSpec[];
services_offered: ServiceType[];
}
Sources: sunrise-angular/src/app/core/models/product.model.ts:10-27
Service Types and Specifications
The system restricts service types to a specific union literal to ensure compile-time safety across the lead generation workflow.
- ServiceType: Defines valid offerings:
Sales,Installation,AMC, orRepair. - ProductSpec: A simple interface for technical rows, maintaining display order for the UI.
Sources: sunrise-angular/src/app/core/models/product.model.ts:1-8, implementation_plan.md:120-125
SEO & Knowledge Graph Mapping
The SeoService maps internal product models to Schema.org structured data. This process transforms hardware attributes into machine-readable JSON-LD @graph nodes for search engine optimization.
Data Flow for Search Agents
This flow illustrates how the internal data model is projected into the document head to facilitate discovery by AI and search agents.
Sources: sunrise-angular/src/app/core/services/seo.service.ts:153-205
Estimation & Logic Models
The RequirementEstimatorComponent uses the data models to calculate hardware recommendations based on user inputs. It translates quantitative values (camera counts, flat counts) into specific NVR and HDD configurations.
Recommendation Logic Table
| Input Param | Logic Condition | Recommended Hardware |
|---|---|---|
cameraCount | <= 8 | 8-Channel 4K H.265+ NVR |
cameraCount | > 32 | 64-Channel Multi-Drive High-Capacity NVR |
storageDays | (cams * 20 * days) / 1000 | Surveillance Grade HDD (calculated in TB) |
flatCount | <= 64 | Matrix ETERNITY Expandable CHS Intercom |
Conclusion
The Product & System Data Models provide a unified structure for hardware cataloging and service estimation. By utilizing Django's relational integrity and TypeScript's type safety, the system ensures that complex technical specifications are accurately communicated to both human users via the Angular UI and machine agents via structured SEO schema.