Teacher Training Entitlement - data_model
This document will undoubtedly change and grow as we develop our understanding of the services that this application encapsulates.
1. Introduction
This document provides an overview of the data model for the NPQ application. It details the primary entities, their relationships, and the data flow within the application. This model is for developers and stakeholders to understand how data is structured, stored, and retrieved.
2. Purpose of the Data Model
The data model for storing NPQ data is designed to:
- Facilitate efficient data storage and retrieval.
- Enable the business logic of the application by structuring data relationships.
- Support data integrity, scalability, and performance optimisation.
3. Entity-Relationship Diagram (ERD)
This diagram represents our current understanding of the data models:
3.1 Overview of Key Entities and Relationships
-
Application - Central to the model,
Applicationconnects multiple entities:- It has a one-to-one relationship with
User,LeadProviderandCourse. - It has optional relationships with
Cohort,Schedule,School,PrivateChildcareProvider, andIttProvider. - It has a one-to-many relationship with
ApplicationStates,DeclarationandParticipantIdChange(throughUser).
Applicationcaptures various attributes related to a user's employment, funding eligibility, and application status. - It has a one-to-one relationship with
-
User - Represents individuals applying for courses. Each
Userhas an ID, email, and other identifying details, including a teacher reference number. -
LeadProvider - Provides a source for educational leads or courses. LeadProviders are linked to multiple entities:
-
Applicationto associate a lead provider with specific applications. -
Declarationto associate a lead provider with specific declarations. -
Statementto track declarations and cohorts per provider. -
ApiTokento allow access via API, with security tracking through hashed tokens and last used timestamps.
-
-
DeliveryPartner - Represents the delivery partner for an application. They are linked to:
-
Declaration- when a declaration is made, it is associated with a delivery partner, and optionally a secondary delivery partner. -
LeadProvder- a delivery partner can be associated with multiple lead providers. -
Cohort- a delivery partner can be associated with multiple cohorts.
-
-
Course - Represents educational courses available for application.
- Linked to
Applicationto assign a course to an application. - Connected to
CourseGroupto organise courses by group and associate withSchedule.
- Linked to
-
Schedule - Details the scheduling for different course groups and cohorts, including key dates like the start and application period for declarations.
-
Cohort - Represents a group of participants starting in a given year. It links with:
-
Application,Declaration,ScheduleandStatement, to track cohorts across applications, declarations, schedules and statements.
-
-
Declaration and Statement - These entities track user declarations and statements associated with lead providers:
-
Declarationlinks toApplication,CohortandParticipantOutcome, tracking users' declaration states and types. -
Statementrelates toLeadProviderandCohortto represent payment deadlines, states, and reconciliation amounts.
-
-
Contract and ContractTemplate - Defines the contractual relationships and terms related to statements and courses:
-
ContractlinksStatement,Course, andContractTemplate. -
ContractTemplatecaptures detailed payment and service fee structures.
-
-
ParticipantOutcome - Tracks user outcomes tied to declarations, including the outcome state and completion date.
-
Auxiliary Entities
-
School,PrivateChildcareProvider, andIttProviderallow additional relationships with applications. -
ApiTokenenables secure API access for lead providers. -
ParticipantIdChangekeeps a record of changes in participant IDs forUser. -
ApplicationStatekeeps a record per change in the state of anApplication.
-
4. Data Flow and Key Processes
This data model supports a structured system for NPQ applications, participant declarations, provider statements, and contractual processes. Here's a high-level overview of the data flow and key processes:
4.1. Application Submission Process
-
Data Entry: A user (
User) submits anApplicationfor aCourseoffered by aLeadProvider. -
Entity Interactions: When an
Applicationis created, it references:- The
Userapplying. - The specific
CourseandCohortapplied for. - A specific
Schedulewhen theApplicationis accepted by aLeadProvider(related to timing and cohorts). - Optional entities like
School,PrivateChildcareProvider, andIttProvider, representing different organisational affiliations or employment details.
- The
-
Attributes: The
Applicationincludes data on eligibility, funding, role, approval, and training status. This information is essential for tracking the participant's suitability and funding options.
This application data flows to downstream entities that track the participant's progress and outcomes.
erDiagram
Application }|--|| User : ""
Application }|--|| Schedule : ""
Declaration }|--|| Application : ""
User {
uuid id
string email
string full_name
string teacher_reference_number
datetime updated_at
}
Application {
uuid id
uuid course_id
uuid lead_provider_id
uuid user_id
uuid schedule_id
uuid itt_provider_id
uuid school_id
uuid private_childcare_provider_id
string employer_name
string employment_role
string funding_choice
string headteacher_status
string ineligible_for_funding_reason
string school_urn
string lead_provider_approval_status
string training_status
boolean works_in_school
boolean eligible_for_funding
boolean targeted_delivery_funding_eligibility
string teacher_catchment
string teacher_catchment_iso_country_code
string teacher_catchment_country
boolean lead_mentor
datetime accepted_at
datetime updated_at
}
Declaration {
uuid id
uuid application_id
string state
string declaration_type
date declaration_date
datetime updated_at
}
Schedule {
uuid id
uuid course_group_id
uuid cohort_id
string name
date declaration_starts_on
date schedule_applies_from
date schedule_applies_to
string declaration_type
}
4.2. Course Scheduling and Cohort Management
-
Data Organisation: Courses (
Course) are organised intoCourseGroups, which are further linked to specificSchedules.Scheduleconnects eachCourseGroupwithCohortentities that denote specific time frames, ensuring applications align with course timings. -
Cohort Management: The
Cohortentity represents the year or session in which a group of participants starts. Each cohort can be associated with multiple applications and helps manage different program batches.
This organisation ensures that courses are managed and tracked by cohorts and groups, making it easy to allocate schedules and track cohort-specific declarations and outcomes.
erDiagram
Course }|--|| CourseGroup : ""
Schedule }|--|| CourseGroup : ""
Schedule }|--|| Cohort : ""
Course {
uuid id
uuid course_group_id
string identifier
}
Cohort {
uuid id
integer start_year
}
CourseGroup {
uuid id
string name
}
Schedule {
uuid id
uuid course_group_id
uuid cohort_id
string name
date declaration_starts_on
date schedule_applies_from
date schedule_applies_to
string declaration_type
}
4.3. Declaration and Statement Process
-
Declarations: As users participate in courses, they make progress and fulfil specific requirements represented by
Declarationentities.-
Attributes: Each
Declarationhas a state (e.g., submitted, eligible, payable), type, and declaration date. -
Association:
Declarationis linked toApplication(allowing the system to track a participant's journey through different declarations), andDeliveryPartner. A declaration can optionally have a secondaryDeliveryPartner. -
Outcome Tracking: A
ParticipantOutcomeentity links toDeclaration, capturing the outcome and completion status of the user's declaration.
-
Attributes: Each
-
Statements:
Statements track financial aspects of user declarations for eachLeadProviderandCohort.-
Attributes: Each
Statementhas attributes for financial reconciliation, deadlines, payment states, and provider-specific data. -
Items Tracking:
StatementItems are associated withDeclarations and store the state of each declaration as part of the statement.
-
Attributes: Each
This declaration-statement process captures user progress and facilitates reporting for providers, helping reconcile payments and manage declarations.
erDiagram
ParticipantOutcome }o--|| Declaration : ""
StatementItem }|--|| Statement : ""
StatementItem }|--|| Declaration : ""
DeliveryPartner ||--o{ Declaration : ""
Declaration {
uuid id
uuid application_id
string state
string declaration_type
date declaration_date
uuid delivery_partner_id
uuid secondary_delivery_partner_id
datetime updated_at
}
Statement {
uuid id
enum month
integer year
date deadline_date
uuid cohort_id
uuid lead_provider_id
datetime marked_as_paid_at
decimal reconcile_amount
string state
}
StatementItem {
uuid id
uuid statement_id
uuid declaration_id
string state
}
ParticipantOutcome {
uuid id
string state
date completion_date
uuid declaration_id
datetime created_at
}
DeliveryPartner {
uuid id
string name
}
4.4. Contractual and Financial Tracking
-
Contracts: The
Contractentity defines agreements between the educational system, providers, and courses. It ties intoStatement,Course, andContractTemplate. -
Templates: Each
ContractTemplatespecifies payment terms, including service fees, participant fees, recruitment targets, and payment periods. -
Financial Flow:
ContractTemplateensures that eachContractandStatementaligns with predefined financial terms, facilitating accurate budget and payment management.
This financial tracking process ensures contractual compliance, accurate billing, and budget management across providers and courses.
erDiagram
Contract }|--|| Statement : ""
Contract }|--|| ContractTemplate : ""
Statement {
uuid id
enum month
integer year
date deadline_date
uuid cohort_id
uuid lead_provider_id
datetime marked_as_paid_at
decimal reconcile_amount
string state
}
Contract {
uuid statement_id
uuid course_id
uuid contract_template_id
}
ContractTemplate {
boolean special_course
decimal recruitment_target
decimal per_participant
decimal output_payment_percentage
decimal number_of_payment_periods
decimal service_fee_percentage
decimal service_fee_installments
}
4.5. User and Provider Management
-
User ID Management:
ParticipantIdChangeenables the tracking of changes in user (User) identifiers, essential for maintaining a clear user history. -
API Access:
ApiTokenallowsLeadProviders secure access to the system via hashed tokens, facilitating data access for providers while ensuring security.
These auxiliary processes help maintain user data integrity and allow providers secure access to manage applications and declarations.
erDiagram
ParticipantIdChange }|--|| User : ""
LeadProvider }|--|| ApiToken : ""
User {
uuid id
string email
string full_name
string teacher_reference_number
datetime updated_at
}
LeadProvider {
uuid id
string name
}
ParticipantIdChange {
uuid id
uuid user_id
uuid from_participant_id
uuid to_participant_id
}
ApiToken {
uuid id
uuid lead_provider_id
string hashed_token
datetime last_used_at
}
Key Data Flow Summary:
- Application Creation ➔ Triggers cohort association for user applications.
- Application Acceptance ➔ Triggers schedule association for user applications.
- Declaration Submission ➔ Captures user progress and outcomes, feeding into statements for financial tracking.
- Statement and Contract Processing ➔ Ensures compliance with financial terms for providers, courses, and user declarations.
- Provider and User Management ➔ Supports secure provider access and accurate user tracking across application processes.
Overall Workflow
-
User applies for a course through an
Application, selecting relevant provider. -
Provider accepts an
Application, optionally selecting relevant schedule and funded place status. - Declarations are made based on user progress, feeding into statements and tracking outcomes.
- Statements and Contracts manage finances, ensuring terms are met.
-
Providers access data through
ApiToken, while user identifiers are tracked to ensure data accuracy.
5. Notes
- Details on NPQ Contracts can be found here.